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.
Motivation
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.
Variables
Domino automatically injects the following variables:
DOMINO_USER_API_KEY
— Useful if you want to use the Domino API to access another projectDOMINO_API_HOST
— same as aboveDOMINO_PROJECT_OWNER
— username of the owner of the running projectDOMINO_PROJECT_NAME
— name of the running projectDOMINO_RUN_ID
— run ID of the current runDOMINO_RUN_NUMBER
— run number of the current runDOMINO_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 projectAWS_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
Usage¶
Here are some examples on retrieving an environment variable within your code:
R
Sys.getenv("DOMINO_RUN_ID")
Python
import os
os.environ['DOMINO_RUN_ID']