AWS Batch

Submit a new AWS Batch job

Changed on

Creates and submits a new job to AWS Batch with the provided configuration

post/api/containers/batch/job

Request

  • The document declares no server URL.
  • Auth
    socaAuth (a scheme the document does not define) and socaToken (a scheme the document does not define)

Headers

X-EDH-USERstring required

SOCA username for authentication

X-EDH-TOKENstring required

SOCA authentication token

Request body application/x-www-form-urlencoded

job_namestring required

Name for the job

job_definitionstring required

ARN of the job definition

job_queuestring required

ARN of the job queue

job_dependenciesstring

Comma-separated list of job IDs this job depends on

array_sizestring

Array size for array jobs (2-10000)

overrideCommandsstring json

JSON array of command to override the container. First element is typically the executable, followed by arguments.

envVarsstring json

JSON array of environment variable objects

scheduling_prioritystring

Scheduling priority (0-9999) for prioritizing jobs in a queue

job_attemptsstring

Number of times to retry the job (1-10)

execution_timeoutstring

Execution timeout in seconds after which the job is terminated

vcpusstring

Number of vCPUs reserved for the container (e.g., 0.25, 1, 2)

memorystring

Hard limit of memory in GB to present to the container

consumableResourcesstring json

JSON array of custom consumable resource objects (max 5 total including VCPU and MEMORY)

Example request

{
  "job_name": "my-batch-job",
  "job_definition": "arn:aws:batch:us-east-1:123456789012:job-definition/my-def:1",
  "job_queue": "arn:aws:batch:us-east-1:123456789012:job-queue/my-queue",
  "job_dependencies": "job-id-1,job-id-2",
  "array_size": "10",
  "overrideCommands": "[\"python\", \"train.py\", \"--epochs\", \"10\"]",
  "envVars": "[{\"name\": \"MY_ENV\", \"value\": \"Hello\"}]",
  "scheduling_priority": "100",
  "job_attempts": "3",
  "execution_timeout": "3600",
  "vcpus": "1",
  "memory": "2",
  "consumableResources": "[{\"type\": \"GPU\", \"value\": \"1\"}, {\"type\": \"FPGA\", \"value\": \"2\"}]"
}

Response

Job submitted successfully

successboolean required
messagestring required

Example response

{
  "success": true,
  "message": "Job my-batch-job submitted successfully. Job ID: a1b2c3d4"
}

Changes