Isotropix Forums

centralise .env file within software install folder

General Discussion about Isotropix and CG related topics

centralise .env file within software install folder

Unread postby Union » Wed Oct 23, 2019 11:22 am

I have a question is there anyway to centralise the clarisse.env file to be placed in the install location of clarisse?. I have installed Clarisse centrally to our software server so that anyone in the company can launch clarisse. They simply just type clarisse in a terminal as the central .bashrc file has an alias to where clarisse is installed.

At present we would need to roll out clarisse.env to everyone's home account would be great if we had one file centrally that would be referenced when clarisse launches.

If I do not add the PYTHONPATH AND PYTHONHOME to the env file then clarisse launches as it uses our central one however upon launching clarisse I still get an error message stating it does not know where PYTHONPATH and PYTHONHOME is and I should add the location to clarisse.env file.

Thanks
Union
 
Posts: 1
Joined: Wed Oct 23, 2019 11:19 am

Re: centralise .env file within software install folder

Unread postby anemoff » Wed Oct 23, 2019 2:47 pm

Hi,

Out of curiosity and for future reference:
- What Linux distro are you using?
- Did you need to update the Python variables because the default values did not work?

Using a shared clarisse.env file is not natively possible: Clarisse and CNode will always look for the clarisse.env file located in the current user's home dir. However, you can modify each user's environment variables to override the variables from the clarisse.env file.

As you have already customized the .bashrc file to add a "clarisse" alias for your users, you can customize it further to add/update the PYTHONPATH and PYTHONHOME variables with the correct paths. However, this will modify those variables for all terminals.

bash code

export PYTHONHOME=your/pythonhome
export PYTHONPATH=your/pythonpath


If you only want to modify those variables for Clarisse, you could create a function instead of an alias in the .bashrc file:

bash code

clarisse() {
# customize env vars before calling Clarisse
export PYTHONHOME=your/pythonhome
export PYTHONPATH=your/pythonpath

# call Clarisse as a background process with `&` and forward the input args using `$@`
/path/to/clarisse $@ &

# optional: disown the Clarisse background task to allow ending the current terminal session without killing Clarisse
disown

# unset env vars so that the owning terminal session isn't polluted with the custom paths
unset PYTHONHOME
unset PYTHONPATH
}


Let us know if this works for you or if you need more help.

Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 245
Joined: Wed Jan 13, 2016 10:10 am


Return to General Discussion