Skip to main content

Environment Variables

AIchor makes a set of predefined environment variables available inside every experiment. Custom variables can also be defined in two ways: at the project level, applying to every experiment in a project, and at the experiment level, scoped to a single experiment through its manifest.

Project-level Environment variables

Project-level variables are defined from the AIchor UI and apply across all experiments in the project. From the AIchor project page, open the Variables tab and select Create new variable.

Two kinds of project-level variable can be created:

  • Runtime variables — made available to the experiment's containers while it runs.
  • Build-time variables — made available during the image build step.

A variable can also be marked as sensitive. The values of sensitive variables are not displayed in the UI after creation, which makes them suited to secrets such as API keys and access tokens. Build-time sensitive variables are the recommended way to pass secrets to an image build — see Docker Build Secrets.

Experiment-level Environment variables

Experiment-level variables are defined directly in the experiment manifest under spec.env. They are scoped to a single experiment, which makes them suited to values that change between runs, such as hyperparameters, without altering the shared project configuration.

Each entry is injected into the experiment as a plain key/value environment variable:

spec:
operator: pytorch
command: python train.py
env:
LEARNING_RATE: "0.001"
BATCH_SIZE: "32"
NUM_EPOCHS: "100"

The following rules apply:

  • Values are injected literally, exactly as written in the manifest.
  • When the same key is defined both under spec.env and as a project-level variable, the spec.env value takes precedence.
  • The protected names listed below cannot be set through spec.env. Attempting to do so causes a validation error when the experiment is submitted.

Predefined Environment variables

The tables below list the environment variables that AIchor makes available inside every experiment, grouped by category, along with example values.

warning

Attempting to overwrite any protected variable causes an error during experiment execution.

Project and experiment

Environment Variable NameDescriptionExample valueOverwritable
AICHOR_PROJECT_IDAIchor project IDe7be88af-7621-4574-aa61-e810679b69d4
AICHOR_EXPERIMENT_IDAIchor experiment IDe2b53b98-975d-4be7-9f5b-8dfd6b765d32
AICHOR_EXPERIMENT_MESSAGEMessage describing the experiment; defaults to the short commit message, or a custom message set at submissionTune learning rate schedule
AICHOR_ENGINE_NAMECurrent engine nameAIchor
AICHOR_CLUSTER_NAMECurrent cluster nameAIchor
AICHOR_CLUSTER_IDCurrent cluster ID31ed1de8-c937-40ea-b5c8-d17eecb12ec1

Storage and buckets

Environment Variable NameDescriptionExample valueOverwritable
AICHOR_INPUT_PATHInput bucket paths3://project-name-e7be88af76214574-inputs/
AICHOR_INPUT_BUCKET_NAMEInput bucket name (without the s3:// prefix)project-name-e7be88af76214574-inputs
AICHOR_OUTPUT_PATHRecommended output path (in the output bucket)s3://project-name-e7be88af76214574-outputs/output/e2b53b98-975d-4be7-9f5b-8dfd6b765d32/
AICHOR_OUTPUT_BUCKET_NAMEOutput bucket name (without the s3:// prefix)project-name-e7be88af76214574-outputs
AICHOR_TENSORBOARD_PATHRecommended path for TensorBoard records (in the output bucket); set only when TensorBoard is enabled in your manifests3://project-name-e7be88af76214574-outputs/output/e2b53b98-975d-4be7-9f5b-8dfd6b765d32/tensorboard/
AWS_ENDPOINT_URLS3 endpoint URL used by AWS SDK clients; usually points to the buckets AIchor created for the projecthttps://storage.googleapis.com
AWS_ACCESS_KEY_IDAWS key for configuring S3 automaticallyAKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEYAWS secret for configuring S3 automaticallywJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_REQUEST_CHECKSUM_CALCULATIONControls when a checksum is calculated for request payloadswhen_required
AWS_RESPONSE_CHECKSUM_VALIDATIONControls when checksum validation is performed for response payloadswhen_required

Version control (Git)

A "slug" is a string that contains no special characters other than hyphens (-). Slugs are safe to use in URLs, Docker image names, and tags.

Environment Variable NameDescriptionExample valueOverwritable
VCS_TYPEVCS repository typegitlab, github or bitbucket
VCS_URLURL of the remote Git repositoryhttps://github.com/instadeep/group/subgroup/repo.git
VCS_REPOSITORYFull repository path, including owner, groups, and nameinstadeep/group/subgroup/repo
VCS_REPOSITORY_SLUGSlugified VCS_REPOSITORYinstadeep-group-subgroup-repo
VCS_REPOSITORY_OWNERFirst segment of the repository URL, usually a usernameinstadeep
VCS_REPOSITORY_OWNER_SLUGSlugified VCS_REPOSITORY_OWNERinstadeep
VCS_REPOSITORY_GROUPSIntermediate segments of the repository URLgroup/subgroup
VCS_REPOSITORY_GROUPS_SLUGSlugified VCS_REPOSITORY_GROUPSgroup-subgroup
VCS_REPOSITORY_NAMELast segment of the repository URLrepo
VCS_REPOSITORY_NAME_SLUGSlugified VCS_REPOSITORY_NAMErepo
VCS_REFGit reference of the branch or tagrefs/heads/current-branch-name
VCS_REF_SLUGSlugified VCS_REFrefs-heads-current-branch-name
VCS_REF_NAMEName of the branch or tagcurrent-branch-name
VCS_REF_NAME_SLUGSlugified VCS_REF_NAMEcurrent-branch-name
VCS_SHAGit commit SHAffac537e6cbbf934b08745a378932722df287a53
VCS_SHA_SHORTShortened Git commit SHAffac537e
VCS_AUTHOR_NAMEGit commit author nameJane Doe
VCS_AUTHOR_EMAILGit commit author email addressj.doe@instadeep.com
VCS_COMMIT_MESSAGEFull Git commit messageTune learning rate schedule

Lower the initial value for training stability
VCS_COMMIT_MESSAGE_SHORTFirst line of the Git commit messageTune learning rate schedule

User and organization

Environment Variable NameDescriptionExample valueOverwritable
AICHOR_USER_NAMEName of the user who launched the experimentJane Doe
AICHOR_USER_EMAILEmail address of the user who launched the experimentj.doe@instadeep.com
AICHOR_ORGANIZATION_NAMECurrent organization nameinstadeep
AICHOR_ORGANIZATION_IDCurrent organization IDorg_wa4GMsQSU1ZrZ921

Compute and runtime

Environment Variable NameDescriptionExample valueOverwritable
CURRENT_POD_IPIP address of the pod in the cluster10.110.20.26
CPU_REQUESTNumber of CPUs requested12
NODE_NAMEName of the node on which the pod is runningmy-nvidia-gb200