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.envand as a project-level variable, thespec.envvalue 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.
Attempting to overwrite any protected variable causes an error during experiment execution.
Project and experiment
| Environment Variable Name | Description | Example value | Overwritable |
|---|---|---|---|
| AICHOR_PROJECT_ID | AIchor project ID | e7be88af-7621-4574-aa61-e810679b69d4 | ❌ |
| AICHOR_EXPERIMENT_ID | AIchor experiment ID | e2b53b98-975d-4be7-9f5b-8dfd6b765d32 | ❌ |
| AICHOR_EXPERIMENT_MESSAGE | Message describing the experiment; defaults to the short commit message, or a custom message set at submission | Tune learning rate schedule | ❌ |
| AICHOR_ENGINE_NAME | Current engine name | AIchor | ❌ |
| AICHOR_CLUSTER_NAME | Current cluster name | AIchor | ❌ |
| AICHOR_CLUSTER_ID | Current cluster ID | 31ed1de8-c937-40ea-b5c8-d17eecb12ec1 | ❌ |
Storage and buckets
| Environment Variable Name | Description | Example value | Overwritable |
|---|---|---|---|
| AICHOR_INPUT_PATH | Input bucket path | s3://project-name-e7be88af76214574-inputs/ | ❌ |
| AICHOR_INPUT_BUCKET_NAME | Input bucket name (without the s3:// prefix) | project-name-e7be88af76214574-inputs | ❌ |
| AICHOR_OUTPUT_PATH | Recommended output path (in the output bucket) | s3://project-name-e7be88af76214574-outputs/output/e2b53b98-975d-4be7-9f5b-8dfd6b765d32/ | ❌ |
| AICHOR_OUTPUT_BUCKET_NAME | Output bucket name (without the s3:// prefix) | project-name-e7be88af76214574-outputs | ❌ |
| AICHOR_TENSORBOARD_PATH | Recommended path for TensorBoard records (in the output bucket); set only when TensorBoard is enabled in your manifest | s3://project-name-e7be88af76214574-outputs/output/e2b53b98-975d-4be7-9f5b-8dfd6b765d32/tensorboard/ | ❌ |
| AWS_ENDPOINT_URL | S3 endpoint URL used by AWS SDK clients; usually points to the buckets AIchor created for the project | https://storage.googleapis.com | ✅ |
| AWS_ACCESS_KEY_ID | AWS key for configuring S3 automatically | AKIAIOSFODNN7EXAMPLE | ✅ |
| AWS_SECRET_ACCESS_KEY | AWS secret for configuring S3 automatically | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY | ✅ |
| AWS_REQUEST_CHECKSUM_CALCULATION | Controls when a checksum is calculated for request payloads | when_required | ❌ |
| AWS_RESPONSE_CHECKSUM_VALIDATION | Controls when checksum validation is performed for response payloads | when_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 Name | Description | Example value | Overwritable |
|---|---|---|---|
| VCS_TYPE | VCS repository type | gitlab, github or bitbucket | ❌ |
| VCS_URL | URL of the remote Git repository | https://github.com/instadeep/group/subgroup/repo.git | ❌ |
| VCS_REPOSITORY | Full repository path, including owner, groups, and name | instadeep/group/subgroup/repo | ❌ |
| VCS_REPOSITORY_SLUG | Slugified VCS_REPOSITORY | instadeep-group-subgroup-repo | ❌ |
| VCS_REPOSITORY_OWNER | First segment of the repository URL, usually a username | instadeep | ❌ |
| VCS_REPOSITORY_OWNER_SLUG | Slugified VCS_REPOSITORY_OWNER | instadeep | ❌ |
| VCS_REPOSITORY_GROUPS | Intermediate segments of the repository URL | group/subgroup | ❌ |
| VCS_REPOSITORY_GROUPS_SLUG | Slugified VCS_REPOSITORY_GROUPS | group-subgroup | ❌ |
| VCS_REPOSITORY_NAME | Last segment of the repository URL | repo | ❌ |
| VCS_REPOSITORY_NAME_SLUG | Slugified VCS_REPOSITORY_NAME | repo | ❌ |
| VCS_REF | Git reference of the branch or tag | refs/heads/current-branch-name | ❌ |
| VCS_REF_SLUG | Slugified VCS_REF | refs-heads-current-branch-name | ❌ |
| VCS_REF_NAME | Name of the branch or tag | current-branch-name | ❌ |
| VCS_REF_NAME_SLUG | Slugified VCS_REF_NAME | current-branch-name | ❌ |
| VCS_SHA | Git commit SHA | ffac537e6cbbf934b08745a378932722df287a53 | ❌ |
| VCS_SHA_SHORT | Shortened Git commit SHA | ffac537e | ❌ |
| VCS_AUTHOR_NAME | Git commit author name | Jane Doe | ❌ |
| VCS_AUTHOR_EMAIL | Git commit author email address | j.doe@instadeep.com | ❌ |
| VCS_COMMIT_MESSAGE | Full Git commit message | Tune learning rate schedule Lower the initial value for training stability | ❌ |
| VCS_COMMIT_MESSAGE_SHORT | First line of the Git commit message | Tune learning rate schedule | ❌ |
User and organization
| Environment Variable Name | Description | Example value | Overwritable |
|---|---|---|---|
| AICHOR_USER_NAME | Name of the user who launched the experiment | Jane Doe | ❌ |
| AICHOR_USER_EMAIL | Email address of the user who launched the experiment | j.doe@instadeep.com | ❌ |
| AICHOR_ORGANIZATION_NAME | Current organization name | instadeep | ❌ |
| AICHOR_ORGANIZATION_ID | Current organization ID | org_wa4GMsQSU1ZrZ921 | ❌ |
Compute and runtime
| Environment Variable Name | Description | Example value | Overwritable |
|---|---|---|---|
| CURRENT_POD_IP | IP address of the pod in the cluster | 10.110.20.26 | ❌ |
| CPU_REQUEST | Number of CPUs requested | 12 | ❌ |
| NODE_NAME | Name of the node on which the pod is running | my-nvidia-gb200 | ❌ |