Job Environment Variables

When you create a job or a job run, you can provide custom environment variables and command line arguments.

Constraints
  • Custom environment variables—The total character count across the key and value pairs for all custom environment variables. Can't exceed 20,000 characters.
  • Command line arguments—Input for the command line arguments field can't exceed 4,000 characters.

With a job run, the following service provided environment variables are automatically made available:

Service Provided Environment Variables

Name

Description

TENANCY_OCID

OCID of the tenancy the job belongs to.

PROJECT_OCID

OCID of the project the job is associated with.

PROJECT_COMPARTMENT_OCID

OCID of the compartment of the project the job is associated with.

JOB_OCID

OCID of the job is associated with.

JOB_COMPARTMENT_OCID

OCID of the compartment of the job is associated with.

JOB_ARTIFACT_FILE_NAME

The file name of the job artifact that was uploaded.

JOB_RUN_OCID

OCID of the job run.

JOB_RUN_COMPARTMENT_OCID

OCID of the compartment of the job run.

In addition to the service job run environment variables, you can also use these environment variables:

Optional Environment Variables

Name

Description

CONDA_ENV_TYPE

Conda environment type. Either service or published.

CONDA_ENV_SLUG

Service conda environment slug. For example, database_p37_cpu_v2 for the Oracle Database on Python 3.7 (version 2.0) conda environment.

CONDA_ENV_REGION

Published conda environment region.

CONDA_ENV_OBJECT_NAME

Published conda environment object name.

CONDA_ENV_NAMESPACE

Published conda environment Object Storage namespace.

CONDA_ENV_BUCKET

Published conda environment Object Storage bucket.

JOB_RUN_ENTRYPOINT

Required for zip or tar files. Specifies the entry point file in the job artifact to be run.

Bring Your Own Container Variables
Important

These variables are only for version 1 of Bring Your Own Container. See Creating a Job for the latest information on how to configure Bring Your Own Container using Environment Configurations.
You set the following environment variables for a bring your own container job when creating it:
Key Value Type Value Example Description

CONTAINER_CUSTOM_IMAGE

String (Required)

iad.ocir.io/ociodscdev/jobrun

The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. For example:

<region>.ocir.io/<registry>/<image>:<tag>

Important: Bring your own container jobs don't support cross-region container image pulling. For example, when running a bring your own container job in an IAD (Ashburn) region, you can't pull container images from the OCIR (Oracle Cloud Container Registry) in the PHX (Phoenix) region.

CONTAINER_ENTRYPOINT

String[]

`"ls", "-l"`

The container image run ENTRYPOINT as a list of strings.

Accept the CMD as extra arguments.

CONTAINER_CMD

String[]

`"-a", "-h"`

`"ls", "-l", "-a", "-h"`

The container run CMD as a list of strings.

Use CMD as arguments to the ENTRYPOINT or the only command to run in the absence of an ENTRYPOINT.