Creating a Task Environment

Create a task environment to specify the container image, runtime settings, task environment variables, and shared storage mounts that the Batch tasks require.

  • On the Task environments list page, select Create task environment and provide information in each section. If you need help finding the list page, see Listing Task Environments.

    1. Basic information

    • Compartment: Select the compartment in which you want to create the task environment.
    • Name: Enter the task environment name.
    • Description: Provide a brief description of the task environment.

    2. Image configuration

    • Image
      • Image compartment: Select the compartment task environment.
      • Image: Select the Docker image that contains the software suite and all supporting programs to run.
    • Security context
      • User ID: Select the user ID that the container must run as.
      • Group ID: Select the group ID for the primary group under which the container runs.
      • Filesystem group ID: Select the file system group ID that the container adds to its supplemental group.
    • Working directory: Enter the working directory that the application expects. The container runs all commands in the directory by default when it starts (for example, /).

    3. Attachments

    In the NFS volumes section, specify the storage mount details for the batch tasks. NFS volumes provide storage for reading and writing data across jobs. Select Add NFS volume and complete the following fields:

    • Name: Enter a name to identify the fleet mount in the task environment.
    • NFS URI: Private Fully Qualified Domain Name (FQDN) of the NFS server or endpoint that provides the shared storage.
    • Source Path and Directory: The export path on the NFS server where the shared files are located.
    • Destination Path and Directory: The path inside the container where the NFS volume is mounted.

    3. Review and create

    Select Create.

  • Use the oci batch batch-task-environment create command and required parameters to create a batch task environment:
    oci batch batch-task-environment create [OPTIONS]

    For a complete list of flags and variable options for Batch CLI commands, see the Batch CLI.

  • Run the CreateBatchTaskEnvironment operation to create a task environment.