FAQ115: How to set environment variables on Athera

Follow

SUMMARY

This article explains how to set environment variables for Athera sessions to control how applications will behave.

 

MORE INFORMATION

Environment variables inside Athera are set using the Athera Init scripting process.

Athera Init uses an init.sh file within a .athera folder. This file holds shell script commands to set environment variables, execute Python scripts or automate other similar tasks.

For example, to modify which directory is used by Nuke to store temporary files, determined by the value of the NUKE_TEMP_DIR environment variable, add the following command to /home/<username>/.athera/init.sh:

export NUKE_TEMP_DIR=/home/<username>/my_nuke_temp

A .athera folder containing an init.sh file can be located on either one or multiple of the nested roots of your current Context. For example, it can be placed inside the org, project or team folders, or in external storage connected to the org, project or team Context. It can also be sourced from a connected Dropbox or Google Drive for each individual user.

Directories checked are:

/home/<username>/

/data/org/<org-name>/

/data/project/<project-name>/

/data/team/<team-name>

If any external storage is attached to the Context, for example a GCS or S3 bucket, or the user has connected a personal Dropbox or Google Drive, the following directories are checked as well:

/data/dropbox/

/data/gdrive/

/data/gcs/<bucket_name>

/data/s3/<bucket_name>


NOTE:
It is possible to attach external (GCS or S3) storage buckets to each of the Org, Project and Team levels of the Context. In this case all the external storage locations visible to the current Context will be checked for a .athera folder.

For more details, please see the Athera documentation on Controlling the Session Environment.


These directories are checked in the following order:

  1. User mounts (Mounts private to the individual user: home folder and Dropbox/Google Drive)

  2. Context mounts (Group mounts, starting at the child group and stepping up to the parent org (what is called the 'Context Hierarchy' in Athera))

  3. External mounts (GCS or S3 buckets in the order listed in the Group Detail pages)

To check which environment variables have been set and what their current value is within a session, please execute the following code in a Python console within the application: 

import os
for param in os.environ.keys():    
    print "%20s %s" % (param, os.environ[param])
Was this article helpful?
0 out of 0 found this helpful

Comments