TomasB
06/21/2022, 9:35 PMcontainers:
command:
- /bin/bash
- '-c
args:
- source /etc/priv/credentials/envvars && meltano ui
source /etc/priv/credentials/envvars
- exports the secrets as env variables.
When I check for the values of meltano config meltano config --format=env meltano
I see the meltano default values and not the ones that have been exported during start up (meltano ui
). Is there a way for the meltano process to read from the exported env variables?visch
06/22/2022, 2:01 AMmeltano config meltano list
as it'll tell you where each config var is coming from. It should help you debug thisTomasB
06/22/2022, 12:41 PMui.secret_key [env: MELTANO_UI_SECRET_KEY] current value: 'thisisnotapropersecretkey' (default)
. I think my question is why meltano isn't picking the values from the exported onesvisch
06/22/2022, 12:43 PMexported ones
visch
06/22/2022, 12:44 PMTomasB
06/22/2022, 12:45 PMsource /etc/priv/credentials/envvars
executes export MELTANO_UI_SECRET_KEY="anewsecret"
but it gets executed in entrypoint before meltano ui
visch
06/22/2022, 12:45 PMsource /etc/priv/credentials/envvars
isn't setting the values the way you expect them to be.
Maybe it's source /etc/priv/credentials/envvars && meltano ui
doesn't pass those vars to that command?visch
06/22/2022, 12:46 PMexport MELTANO_UI_SECRET_KEY=TEST && meltano config meltano list
visch
06/22/2022, 12:47 PMTomasB
06/22/2022, 12:48 PMcat /proc/1/environ
I can see the env variables set from source /etc/priv/credentials/envvars
visch
06/22/2022, 12:48 PMmeltano ui
proc as well?TomasB
06/22/2022, 12:49 PMmeltano ui
is the first processvisch
06/22/2022, 12:50 PMbash
kungfu than me.
So for a test could you swap to
containers:
command:
- /bin/bash
- '-c
args:
- source /etc/priv/credentials/envvars && meltano config meltano list
visch
06/22/2022, 12:50 PMvisch
06/22/2022, 12:50 PMmeltano ui
thing or what's happeningTomasB
06/22/2022, 12:51 PMvisch
06/22/2022, 1:00 PMvisch@visch-ubuntu:~/git/meltano-test-6212022$ export MELTANO_UI_SECRET_KEY=TEST && meltano config meltano list
Works
ui.secret_key [env: MELTANO_UI_SECRET_KEY] (default: 'thisisnotapropersecretkey') current value: 'TEST' (from the environment)
visch
06/22/2022, 1:03 PMvisch@visch-ubuntu:~/git/meltano-test-6212022$ cat ./envvar
export MELTANO_UI_SECRET_KEY=TEST
visch@visch-ubuntu:~/git/meltano-test-6212022$ unset MELTANO_UI_SECRET_KEY
visch@visch-ubuntu:~/git/meltano-test-6212022$ echo $MELTANO_UI_SECRET_KEY
visch@visch-ubuntu:~/git/meltano-test-6212022$ source ./envvar && meltano config meltano list
ui.secret_key [env: MELTANO_UI_SECRET_KEY] (default: 'thisisnotapropersecretkey') current value: 'TEST' (from the environment)
Also works π€·TomasB
06/22/2022, 1:30 PMTomasB
06/22/2022, 1:35 PMsource ./envvar && meltano config meltano list
if you don't mind sharing.TomasB
06/22/2022, 1:35 PMvisch
06/22/2022, 1:45 PMwhat are your processes running before you executeNothing interestingif you don't mind sharing.source ./envvar && meltano config meltano list
and did you test it in a docker container?No but it should be the same thing
TomasB
06/22/2022, 1:55 PMsource ./envvar && meltano config meltano list && meltano ui
I see the secrets picked up from ./envvar
but then when I get into the docker container docker exec ...
and I run meltano config meltano list
I see the meltano default values. That's the same behavior I see in k8sTomasB
06/22/2022, 1:56 PM./envvar
visch
06/22/2022, 2:09 PMmeltano.yml
)
database_uri [env: MELTANO_DATABASE_URI] current value: 'sqlite:////project/project/.meltano/meltano.db' (default: 'sqlite:///$MELTANO_PROJECT_ROOT/.meltano/meltano.db')
database_max_retries [env: MELTANO_DATABASE_MAX_RETRIES] current value: 3 (default)
database_retry_timeout [env: MELTANO_DATABASE_RETRY_TIMEOUT] current value: 5 (default)
project_readonly [env: MELTANO_PROJECT_READONLY] current value: False (default)
discovery_url [env: MELTANO_DISCOVERY_URL] current value: 'https://discovery.meltano.com/discovery.yml' (default)
hub_url [env: MELTANO_HUB_URL] current value: 'https://hub.meltano.com' (default)
discovery_url_auth [env: MELTANO_DISCOVERY_URL_AUTH] current value: None (default)
elt.buffer_size [env: MELTANO_ELT_BUFFER_SIZE] current value: 10485760 (default)
cli.log_level [env: MELTANO_CLI_LOG_LEVEL] current value: 'info' (default)
cli.log_config [env: MELTANO_CLI_LOG_CONFIG] current value: 'logging.yaml' (default)
ui.bind_host [env: MELTANO_UI_BIND_HOST] current value: '0.0.0.0' (default)
ui.bind_port [env: MELTANO_UI_BIND_PORT] current value: 5000 (default)
ui.server_name [env: MELTANO_UI_SERVER_NAME] current value: None (default)
ui.session_cookie_domain [env: MELTANO_UI_SESSION_COOKIE_DOMAIN] current value: None (default)
ui.session_cookie_secure [env: MELTANO_UI_SESSION_COOKIE_SECURE] current value: False (default)
ui.secret_key [env: MELTANO_UI_SECRET_KEY] current value: 'thisisnotapropersecretkey' (defaultβ¦TomasB
06/22/2022, 2:33 PM...
service-local:
<<: *service
environment:
<<: *service_env
command: ["/bin/bash", "-c", "source ./envvars && meltano config meltano list && meltano ui"]
expose:
- 5000
ports:
- "5000:5000"
...
The secrets will be the ones from ./envvars
when the container starts
command: ["/bin/bash", "-c", "source ./envvars && meltano config meltano list && meltano ui"]
but then if you get into the container itself docker exec ....
and run meltano config meltano list
you'll see the meltano default env var values. With docker-compose testing I'm trying to mimic the k8s behaviorvisch
06/22/2022, 2:35 PMmeltano config meltano list
and defaults are returned it means that the environment variable is not set for that shell.
So however you're running it doesn't workTomasB
06/22/2022, 2:36 PMvisch
06/22/2022, 2:36 PMmeltano ui
here that's causing this but if in the above meltano config meltano list
https://meltano.slack.com/archives/C01UTUSP34M/p1655908415103819?thread_ts=1655847345.641149&cid=C01UTUSP34M command it still doesnt' get printed then there's probably something with source ./envvars
visch
06/22/2022, 2:37 PMcorrect, but is the meltano process going to use the ones from the start? I guess that's my questionMeltano uses whatever its process has when you run the command.
meltano config meltano list
pulls it at the time it's ranTomasB
06/22/2022, 2:46 PM