Follow

PATH environment cannot be set for a given run

Overview

Commonly you may need to setup certain additional paths in your environment. However simply using the normal bash syntax to export the $PATH environment variable in your pre setup-script for your compute environment will not work with certain versions of Domino.

For example in the pre-setup script of a given environment you might add the following:

export PATH=$PATH:"/home/ubuntu/pathTest"

Then using a command line from a Jupyter notebook we check the $PATH env variable but it does not yet have our new path:

$ echo $PATH
/usr/local/anaconda/bin:/usr/local/cuda-7.5/bin:/usr/local/anaconda/bin:/usr/local/cuda-7.5/bin:/usr/local/sbin:/usr/local/bin:/usr/
sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/spark-1.6.1-bin-hadoop2.6/bin:/opt/spark-1.6.1-bin-hadoop2.6/bin

 

Solution

Domino environments have a special file (/home/ubuntu/.domino-defaults) that Domino will automatically source when the environment spins up. You can use this file to include initialization like you would normally include in a .bashrc or shell startup script. So that makes it the ideal place to put $PATH additions

A simple example is here:

echo "export PATH=\${PATH}:/home/ubuntu/pathTest" >> /home/ubuntu/.domino-defaults

The environment will need to be saved and the run repeated in order to process the changes.

Further reading

See also: compute environment management.

Was this article helpful?
0 out of 0 found this helpful

Comments