Creating a Batch Context

Create a batch context in Batch.

A batch context provides a logical framework for defining the system environment where jobs are executed. It defines the network resources, fleets configuration, job priorities, logging preferences, and entitlements. Creating a batch context sets up the machine that orchestrates and isolates the batch workloads.

Creating an OCI Batch Context includes configuring and setting up the following components:
  • Network resources: The network section enables you to select a VCN and subnet for the batch context from the same tenancy.
  • Fleets: The Fleets section enables you to select the compute resources for executing the workload. The compute resources are linked to the tasks by specifying task profiles in the fleets.
  • Entitlements: Some submitted jobs might require a license entitlement for rendering software and these entitlements can have limitations on the maximum number of leases required for specific period. For more information, see Entitlement Claims.
  • Job Prioritization: Jobs submitted can be tagged with priority tags and weights. Job priority configuration specifies how jobs are prioritized based on these tags. Priority tags allow adjustment of job scheduling when resources are limited.
  • Logging: Any computational job executed in the system produces logs, and these can be used for debugging purposes. These logs are delivered to the configured log group and custom log specified in the batch context logging section.
Note

Network, fleets, and logging configurations can't be changed after a batch context is created. You can only update basic details such as the batch context name, description, entitlements, and job priority levels after the batch context is created.
  • On the Batch contexts list page, select Create batch context and provide information in each section. If you need help finding the list page, see Listing Batch Contexts.

    1. Basic Information

    • Name: Enter the batch context name.
    • Compartment: Select the compartment in which you want to create the batch context.
    • Description: Provide a short description.

    2. Network

    • Compartment: Select a compartment that contains the VCN and subnet for this batch context.
    • VCN: Select a VCN you created during the initial setup.
    • Subnet: Select a subnet you created during the initial setup.

    3. Fleets

    Under Fleets, select Add Fleet, and then complete the following fields:

    • Name: Enter the fleet name.
    • Maximum concurrent tasks: Enter the maximum number of concurrent tasks for the fleet to perform.
    • Node shape: Select a cluster configuration by selecting the processor type and compute shape. Optionally, you can adjust the values of OCPUs and RAM in gigabytes.

    4. Entitlements

    Under Entitlements, select Add Resource, and then complete the following fields.

    • Resource name: Enter the name of the resource that's required for the submitted task. For example, a submitted task might require a License entitlement for rendering software.
    • Limit: Enter the maximum limit for the entitlement for a specific period.

    5. Job Priority Configuration

    1. Under Job Priority, select Add job priority, and then complete the following fields:
      • Namespace: Select a namespace for organizing priority tags. This acts as a container for the tags.
      • Tag key: Select a tag key, for example, BoostPriorityConfiguration. The tag keys are available through the tag namespaces.
      • Weight %: Provide a job priority value in percentage to enable the operator and manager of resources to dynamically prioritize batch context work. Ensure you provide a Priority value for all values that belong to the selected tag key. For example, if the Value is No, you can enter a Priority value of 0. If the Value is Yes, you can enter a Priority value of 5.
    2. Select Submit.

    6. Logging

    Under Logging Configuration, complete the following fields:

    • Compartment: Select a compartment that contains the log group and custom logs for the batch context.
    • Log group: Select a log group.
    • Log: Select a custom log.

    7. Review

    Review the information to confirm it's correct. To revise any values, expand that step and change the values as needed. When the batch context settings are fully verified, select Create to create the batch context and list it on the Batch contexts list page.

    You can view the status of batch context on the Batch contexts list page. If the process fails, the status changes to Failed. To view and resolve the errors, select the WorkRequest tab.

  • Use the oci batch batch-context createcommand and required parameters to create a batch context:
    oci batch batch-context create [OPTIONS]
    Use the oci batch batch-context-shape-collection list command and required parameters to list the shapes you can specify during batch context creation:
    oci batch batch-context-shape-collection list [OPTIONS]

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

  • Run the operation CreateBatchContext to create a batch context.

    Run the operation ListBatchContextShapes to list the shapes you can specify during batch context creation.