https://dagster.io/ logo
#ask-community
Title
# ask-community
a

Asif Imran

04/26/2023, 8:09 PM
I was under the impression that
DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT
is automagically available in cloud deployment. I am running hybrid (cloud + aws). Noticed that its not being set. At least the following is not working as expected
Copy code
def get_current_env():
    # this is a global variable set by Dagster itself
    is_branch_deployment = os.getenv("DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT") == 1
    assert is_branch_deployment is not None, "DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT not set"
    return "branch" if is_branch_deployment else "prod"
i.e always returning
prod
😬
Is there a way to verify/confirm this?
My branch deployment works just fine
c

chris

04/26/2023, 8:27 PM
It might be available in the deployment but not propogated to the place where your code is actually executing
a

Asif Imran

04/26/2023, 8:30 PM
I see. Is there any recommended solution for propagating these env variables to the agents?
c

chris

04/26/2023, 8:45 PM
The agent should have access - but if you’re using certain executors for example you might need to bring in the env vars to the executing step. What executor is in use here?
a

Asif Imran

04/26/2023, 8:48 PM
Both my agent and executor are based on ECS fargate. When a job shows up, agent launches (+/-) corresponding ECS tasks
facepalm embarrassing. Looks like
DAGSTER_CLOUD_IS_BRANCH_DEPLOYMENT=1
is (not surprisingly) serialized as
'1'
inside the job. Therefore I need to cast it as integer or compare to
== '1'
. Time to call it a day
c

chris

04/26/2023, 9:44 PM
lolol no worries - glad it was something easy , wasn’t looking forward to spelunking through ecs docs to figure out how to send that env var over the wire
thankyou bow 1