AWS Thinkbox Discussion Forums

System env vars

Hi
We have several scripts which install several programs etc which we have deadline schedule for us. Some of these scripts set environment vars, “export myEnvVar=myvar”, which some other scripts look to reference later down the line. I’ve found that if deadline runs other scripts which look for env vars that were set in other jobs, that it can’t seem to find these variables. But if i echo the variables in the linux terminal it is there, i also have a .sh script which prints the env var, running in terminal works, running through deadline doesnt.
Why would deadlineworkers be unable to see these enviroment variables that are on the system? I’ve restarted the docker container but i get the same behaviour. It can only echo env vars which was set whilst the docker image was being built.

Deadline isn’t a great choice to run installers for you, since everything it runs gets put into an environment sandbox that is wiped after the task is completed.By the sound of it that’s what’s happening to you here.

It could be that your jobs have UseJobEnvironmentOnly=True set and aren’t merging the system’s environment into the render sandbox. How are you dumping the environment from within Deadline? There might be some edge case you’re working in that’s not jumping to mind for me.

I’m also not getting system env variables passed on to jobs on linux Coreweave machines. The job is not set to only use Job Env, and the worker is running as a daemon/service as the user. Logs confirm it’s running as the current (only) user, the same as the worker. The variables are visible with printenv, export, echo, etc. They’re set using /etc/environment. “Run Plugin Sandbox in Job’s Environment” is enabled.

I’ll look to have the whole docker container rebuilt from scratch and take more careful notes on the behaviour of the env vars being set. But it’s used the export command in a bash file to set the env var but i believe there was also a test that set it like so.
echo ‘export testvar=“true”’ >> ~/.bashrc

But since i know the env var HAS been set either through deadline with our scripts or through other means, such as manually set via terminal. Our worker doesn’t seem to be picking up the env var that i know is set on the system. Does the worker take note of the env vars that have been set at the point it started running and disregards anything set later on?

The Worker should be pulling in existing environment variables when it creates the sandbox. The issue is that that environment will be a snapshot of the environment at sandbox creation time. So if the environment changes while the sandbox is running it’ll be out of date.

Privacy | Site terms | Cookie preferences