Batch
AWS Batch — compute environments, job queues, job definitions, scheduling policies, consumable resources, service environments, quota shares, and the job control plane. restJson1 protocol.
AWS Batch (the batch service) runs batch computing workloads: you register a job definition, point a job queue at one or more compute environments, and submit jobs that run as containers.
The wedge: against every other free local emulator AWS Batch is a fake — its compute does no real work. MiniStack's Batch jumps a job straight to SUCCEEDED with no container; Moto runs Docker but leaks; LocalStack gates Batch behind its Ultimate tier. fakecloud already runs ECS tasks as real containers, and Batch is built to run real jobs on that same engine.
fakecloud implements 45 of 45 AWS Batch operations at 100% Smithy conformance.
Supported today
- Compute environments —
CreateComputeEnvironment,DescribeComputeEnvironments,UpdateComputeEnvironment,DeleteComputeEnvironment. CreatedVALID/ENABLED. - Job queues —
CreateJobQueue,DescribeJobQueues,UpdateJobQueue,DeleteJobQueue, withcomputeEnvironmentOrder,priority, and an optionalschedulingPolicyArn. - Job definitions —
RegisterJobDefinition(monotonic per-namerevision),DescribeJobDefinitions(filter by name / ARN /status),DeregisterJobDefinition(marks the revisionINACTIVE). - Scheduling policies —
CreateSchedulingPolicy,DescribeSchedulingPolicies,ListSchedulingPolicies,UpdateSchedulingPolicy,DeleteSchedulingPolicy(fair-share). - Jobs — real container execution —
SubmitJoblaunches the job definition'scontainerProperties(image / command / vcpus / memory / environment, with this submit'scontainerOverridesapplied) as a real container on fakecloud's ECS task engine, and drives the job status off the container's actual lifecycle:SUBMITTED → STARTING → RUNNING → SUCCEEDEDwhen the container exits 0, orFAILED(carrying the realcontainer.exitCode) on a non-zero exit. This is the wedge: every other free emulator fakes Batch compute (MiniStack jumps straight toSUCCEEDEDwith no container). With no container runtime available the job staysSUBMITTEDhonestly — never an auto-success.DescribeJobs/ListJobs(filter by queue / status) report live status + exit code;CancelJob/TerminateJobstop a job. - Array jobs —
SubmitJobwitharrayProperties.size = NspawnsNreal child containers (<jobId>:<index>), each withAWS_BATCH_JOB_ARRAY_INDEXset so it can select its slice of work. The parent's status andarrayProperties.statusSummaryaggregate the children live —SUCCEEDEDonly when every child exits 0. - Job dependencies —
SubmitJobwithdependsOnparks the job atPENDINGand launches it only once every dependency hasSUCCEEDED; if any dependencyFAILED, the dependent job fails with "Dependent job failed". The wait never blocks theSubmitJobcall. - Retry + timeout —
retryStrategy.attemptsre-launches a failed container up to that many times (each prior attempt recorded underattempts[]);timeout.attemptDurationSecondscaps each attempt and fails the job with "Job attempt duration exceeded timeout" if the container overruns. - Consumable resources:
CreateConsumableResource,DescribeConsumableResource,ListConsumableResources(CONSUMABLE_RESOURCE_NAMEfilter with trailing*prefix match),UpdateConsumableResource(SET/ADD/REMOVE,clientTokenreplay applied once),DeleteConsumableResource, andListJobsByConsumableResource(JOB_STATUS/JOB_NAMEfilters). Jobs declare requirements via the job definition'sconsumableResourcePropertiesorSubmitJob'sconsumableResourcePropertiesOverride(unknown resources are rejected). Requirements gate dispatch for real: a job whose quantity doesn't fit waits atRUNNABLEuntil capacity returns.inUseQuantity/availableQuantityare computed from jobs holding the resource; aNON_REPLENISHABLEresource stays consumed once a job has started. - Service environments and service jobs:
CreateServiceEnvironment/DescribeServiceEnvironments/UpdateServiceEnvironment/DeleteServiceEnvironment(SAGEMAKER_TRAINING, must beDISABLEDand detached from every queue before delete). Job queues acceptserviceEnvironmentOrder(and take the environments'jobQueueType).SubmitServiceJobvalidates the queue type and state, the JSONserviceRequestPayload, fair-shareshareIdentifierand quota-sharequotaShareNamerules, andclientTokenreuse;DescribeServiceJob,ListServiceJobs(status plusJOB_NAME/BEFORE_CREATED_AT/AFTER_CREATED_AT/SHARE_IDENTIFIER/QUOTA_SHARE_NAMEfilters),UpdateServiceJob(schedulingPriority) andTerminateServiceJobround-trip. fakecloud's SageMaker has no training executor, so a service job is accepted into the queue and waits atRUNNABLEuntil terminated. It never reports a fabricated training run. - Quota shares:
CreateQuotaShare,DescribeQuotaShare,ListQuotaShares,UpdateQuotaShare,DeleteQuotaShare(must beDISABLED; deleting terminates the share's remaining service jobs). - Queue snapshot:
GetJobQueueSnapshotreports theRUNNABLEfront of the queue in dispatch order, the first job per quota share, and capacity utilization of dispatched jobs (overall, per fair-share identifier, and per quota share). - Tags —
TagResource,UntagResource,ListTagsForResource, on every Batch ARN including consumable resources, service environments, quota shares and service jobs. - CloudFormation —
AWS::Batch::ComputeEnvironment,AWS::Batch::JobQueue, andAWS::Batch::JobDefinitionare provisioned into the Batch control plane when a stack is created (and removed on stack delete). The provisioned resources persist across a restart in persistent mode.
Terraform / CloudFormation can provision a full Batch stack (aws_batch_compute_environment, aws_batch_job_queue, aws_batch_job_definition, aws_batch_scheduling_policy) and an SDK client can submit jobs (single, array, dependency-chained, retried, or timed-out) that run real containers and report their real exit codes. The terraform-provider-aws Batch acceptance suite (TestAccBatchComputeEnvironment_basic, TestAccBatchJobQueue_basic, TestAccBatchJobDefinition_basic) runs against fakecloud.