Domino environment variables¶
Domino automatically injects several environment variables whenever it runs your code, as part of the context of your run.
If you’re looking to define your own environment variables, please see Environment variables for secure credential storage.
First, you can use these to programmatically determine if your code is running in Domino or not. This is useful in cases where your code might do something different when running locally vs running on Domino.
Second, these variables can be useful when generating artifacts or outputs – e.g., a report you produce might refer to the run number.
Domino automatically injects the following variables:
DOMINO_USER_API_KEY— Useful if you want to use the Domino API to access another project
DOMINO_API_HOST— same as above
DOMINO_PROJECT_OWNER— user name of the owner of the running project
DOMINO_PROJECT_NAME— name of the running project
DOMINO_RUN_ID— run ID of the current run
DOMINO_RUN_NUMBER— run number of the current run
DOMINO_HARDWARE_TIER_ID- hardware tier the current run is executing on (new in v1.42)
DOMINO_STARTING_USERNAME- username of the user who began the run (new in v1.43)
DOMINO_WORKING_DIR- working directory for the running project
AWS_SHARED_CREDENTIALS_FILE- path to your AWS credential file for connecting to addition AWS resources (e.g. S3, Redshift). Learn more.
DOMINO_TOKEN_FILE- path to a jwt token signed by Domino useful for authenticating with the Domino API or other third party services. Learn more.
Note: These variables are not available in the Model Manager
Here are some examples on retrieving an environment variable within your code: