fix: LOGFLARE_NODE_HOST startup script usage, remove OVERRIDE_MAGIC_COOKIE #1913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR simplifies the handling of LOGFLARE_NODE_HOST as well as RELEASE_COOKIE.
LOGFLARE_NODE_HOST
Previously, this was set under run.sh when
LIBCLUSTER_TOPOLOGY=postgres
. There are a few issues with this: the GCP specific networking logic is not of concern to the libcluster topology setting. The user should set the env var either at system level or in the env var file.Furthermore, the
.env.sh.eex
template has another shell script that configures env vars for the release. We do not use this for setting the release env vars because migrations need to be run with env vars set before the release is run.Hence, this has moved to the gcp instance template startup script for our platform specific logic.
RELEASE_COOKIE
The removal of
OVERRIDE_MAGIC_COOKIE
and the use of/tmp/.magic_cookie
simplifies the magic cookie handling, and ensures that it will adhere to the default release behaviour where thereleases/COOKIE
file is used. As theRELEASE_COOKIE
env var has priority on node startup for runtime configuration, it allows us to override it via the instance template, which is a much cleaner way to do so.As the cookie is always generated at release compile time, it will be baked into the docker image.
https://hexdocs.pm/mix/1.14/Mix.Tasks.Release.html