Sponsors
Sponsor Products
Setting Environment Variables on OSX - Best Practices
posted by Jean-Francois Panisset  on May 18, 2018, 6:20 p.m. (4 months, 28 days ago)
1 Responses     0 Plus One's     0 Comments  
Assuming you are talking about environment variables that control various aspects of your pipeline, I would personally shy away from setting environment variables at the "system" level for the following reasons:

- It's weird and ever changing on macOS (as per your post)
- It's even weirder on Windows, where GPOs, the registry and roaming profiles interact in weird and wonderful ways so that the set of environment variables you end up with and what they are set to is at best a stochastic process (and I'm not convinced that quantum probabilities aren't also involved). I just spent hours trying to figure out how my profile was ending up with some environment variables we thought we had eradicated years ago.
- You need a process to keep all your machines updated, and make sure they all have the right values (see comments about Windows).
- By definition you can only have a single set of variables for all users and all projects on a system.

For those reasons (and others) many studios use some kind of layered bootstraping setup where users login with as vanilla an environment as possible, and you then "start the pipeline" which creates a context with the right set of environment variables with multiple levels of possible override (show, shot, discipline...), either through running a script which creates a terminal shell with the right environment, running a GUI, or both. Python and something like GitBash / Cygwin on Windows (native bash on Linux / macOS) makes it portable and feasible to support all 3 environments.

Sorry, I realize that doesn't answer your immediate question at all...

JF



On Fri, May 18, 2018 at 10:25 AM, Mike Moss <content@studiosysadmins.com> wrote:

Hello,

Im curious what people are doing and what people consider best practices for setting env variables on OSX. Specifically, we are a mixedenvironment of PC's and OSX. The PC's we just go through GPO - nuff said.

In OSX, up until now we have been using a local login script (.command) file that sets env variables using the launchctl setenvcommand. We would like to change this to something a little more elegant that does not use the user's login items feature.

All our machines are OSX 10.12 and it seems launchd.conf is not supported in anything higher than 10.10 - that option is no go.

We also would prefer this to be module. When we were first looking at the idea of the .bash_profile, we wanted that to source two .sh scripts, one for our development team and another for IT. Each dept can make changes as necessary without disturbing the other. However, ive had isses with this set up due to the .bash_profile running everytime Terminal is launched - which is by design of the bash_profile.

So, what are some other ways? Im curious to hear what others have set up.

Thanks,

Mike


To unsubscribe from the list send a blank e-mail to mailto:studiosysadmins-discuss-request@studiosysadmins.com?subject=unsubscribe


Thread Tags:
  discuss-at-studiosysadmins 

Response from Anonymous @ May 18, 2018, 7:20 p.m.
I thought everyone in VFX used either:*https://github.com/nerdvegas/rez*https://github.com/PeregrineLabs/Ecosystem* or their own homebrew package/env manager solution

On 18 May 2018 at 23:19, Jean-Francois Panisset <panisset@gmail.com> wrote:
Assuming you are talking about environment variables that control various aspects of your pipeline, I would personally shy away from setting environment variables at the "system" level for the following reasons:

- It's weird and ever changing on macOS (as per your post)
- It's even weirder on Windows, where GPOs, the registry and roaming profiles interact in weird and wonderful ways so that the set of environment variables you end up with and what they are set to is at best a stochastic process (and I'm not convinced that quantum probabilities aren't also involved). I just spent hours trying to figure out how my profile was ending up with some environment variables we thought we had eradicated years ago.
- You need a process to keep all your machines updated, and make sure they all have the right values (see comments about Windows).
- By definition you can only have a single set of variables for all users and all projects on a system.

For those reasons (and others) many studios use some kind of layered bootstraping setup where users login with as vanilla an environment as possible, and you then "start the pipeline" which creates a context with the right set of environment variables with multiple levels of possible override (show, shot, discipline...), either through running a script which creates a terminal shell with the right environment, running a GUI, or both. Python and something like GitBash / Cygwin on Windows (native bash on Linux / macOS) makes it portable and feasible to support all 3 environments.

Sorry, I realize that doesn't answer your immediate question at all...

JF



On Fri, May 18, 2018 at 10:25 AM, Mike Moss <content@studiosysadmins.com> wrote:

Hello,

Im curious what people are doing and what people consider best practices for setting env variables on OSX. Specifically, we are a mixedenvironment of PC's and OSX. The PC's we just go through GPO - nuff said.

In OSX, up until now we have been using a local login script (.command) file that sets env variables using the launchctl setenvcommand. We would like to change this to something a little more elegant that does not use the user's login items feature.

All our machines are OSX 10.12 and it seems launchd.conf is not supported in anything higher than 10.10 - that option is no go.

We also would prefer this to be module. When we were first looking at the idea of the .bash_profile, we wanted that to source two .sh scripts, one for our development team and another for IT. Each dept can make changes as necessary without disturbing the other. However, ive had isses with this set up due to the .bash_profile running everytime Terminal is launched - which is by design of the bash_profile.

So, what are some other ways? Im curious to hear what others have set up.

Thanks,

Mike


To unsubscribe from the list send a blank e-mail to mailto:studiosysadmins-discuss-request@studiosysadmins.com?subject=unsubscribe


To unsubscribe from the list send a blank e-mail to mailto:studiosysadmins-discuss-request@studiosysadmins.com?subject=unsubscribe


0 Plus One's     0 Comments