Skip to content

Batch

CloudMock emulates AWS Batch, supporting compute environments, job queues, job definitions, and job submission/management.

OperationStatusNotes
CreateComputeEnvironmentSupportedCreates a compute environment
DescribeComputeEnvironmentsSupportedLists compute environments
DeleteComputeEnvironmentSupportedDeletes a compute environment
CreateJobQueueSupportedCreates a job queue
DescribeJobQueuesSupportedLists job queues
DeleteJobQueueSupportedDeletes a job queue
RegisterJobDefinitionSupportedRegisters a job definition
DescribeJobDefinitionsSupportedLists job definitions
DeregisterJobDefinitionSupportedDeregisters a job definition
SubmitJobSupportedSubmits a job for execution
DescribeJobsSupportedReturns job details
ListJobsSupportedLists jobs in a queue
CancelJobSupportedCancels a pending job
TerminateJobSupportedTerminates a running job
import { BatchClient, SubmitJobCommand } from '@aws-sdk/client-batch';
const client = new BatchClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { jobId } = await client.send(new SubmitJobCommand({
jobName: 'my-job',
jobQueue: 'my-queue',
jobDefinition: 'my-job-def',
}));
console.log(jobId);
import boto3
client = boto3.client('batch',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
response = client.submit_job(
jobName='my-job',
jobQueue='my-queue',
jobDefinition='my-job-def')
print(response['jobId'])
cloudmock.yml
services:
batch:
enabled: true
  • Jobs are not actually executed on compute resources
  • Job status transitions are simulated
  • Compute environments do not provision real infrastructure