{"id":50111422,"url":"https://github.com/npow/localbatch","last_synced_at":"2026-05-23T12:32:40.129Z","repository":{"id":341744235,"uuid":"1171310197","full_name":"npow/localbatch","owner":"npow","description":"Test AWS Batch workloads locally without an AWS account","archived":false,"fork":false,"pushed_at":"2026-03-06T15:35:17.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-06T19:15:33.233Z","etag":null,"topics":["aws-batch","batch-processing","docker","fastapi","integration-testing","local-development","metaflow","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-03T04:54:05.000Z","updated_at":"2026-03-06T15:35:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/npow/localbatch","commit_stats":null,"previous_names":["npow/corral","npow/localbatch"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/npow/localbatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npow%2Flocalbatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npow%2Flocalbatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npow%2Flocalbatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npow%2Flocalbatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npow","download_url":"https://codeload.github.com/npow/localbatch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npow%2Flocalbatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33396575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-batch","batch-processing","docker","fastapi","integration-testing","local-development","metaflow","python"],"created_at":"2026-05-23T12:32:38.472Z","updated_at":"2026-05-23T12:32:40.123Z","avatar_url":"https://github.com/npow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# localbatch\n\n[![CI](https://github.com/npow/localbatch/actions/workflows/ci.yml/badge.svg)](https://github.com/npow/localbatch/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/localbatch)](https://pypi.org/project/localbatch/)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/) [![Docs](https://img.shields.io/badge/docs-mintlify-18a34a?style=flat-square)](https://mintlify.com/npow/localbatch)\n\nThe free AWS Batch emulator that actually runs your containers.\n\n## The problem\n\nTesting AWS Batch jobs means pushing code, waiting on queues, and paying for EC2 — just to find out your container crashes on startup. LocalStack's Batch support is paid. Moto validates API calls but never executes your container. There is no free emulator that runs real workloads.\n\n## Quick start\n\n```bash\npip install localbatch\nlocalbatch --port 8000\n```\n\nPoint any Batch client at it — no AWS account, no credentials:\n\n```bash\nexport AWS_ENDPOINT_URL_BATCH=http://localhost:8000\nexport AWS_DEFAULT_REGION=us-east-1\nexport AWS_ACCESS_KEY_ID=test\nexport AWS_SECRET_ACCESS_KEY=test\n\naws batch describe-job-queues\naws batch register-job-definition --job-definition-name hello \\\n    --type container \\\n    --container-properties '{\"image\":\"alpine\",\"command\":[\"echo\",\"hello\"],\"resourceRequirements\":[{\"type\":\"VCPU\",\"value\":\"1\"},{\"type\":\"MEMORY\",\"value\":\"256\"}]}'\naws batch submit-job --job-name test --job-queue localbatch-default --job-definition hello\n```\n\n## Install\n\n```bash\npip install localbatch          # from PyPI\npip install -e ~/code/localbatch  # from source\n```\n\n## Usage\n\n### boto3\n\n```python\nimport boto3\n\nbatch = boto3.client(\n    \"batch\",\n    endpoint_url=\"http://localhost:8000\",\n    region_name=\"us-east-1\",\n    aws_access_key_id=\"test\",\n    aws_secret_access_key=\"test\",\n)\n\nbatch.register_job_definition(\n    jobDefinitionName=\"my-job\",\n    type=\"container\",\n    containerProperties={\n        \"image\": \"alpine:latest\",\n        \"command\": [\"echo\", \"hello\"],\n        \"resourceRequirements\": [\n            {\"type\": \"VCPU\", \"value\": \"1\"},\n            {\"type\": \"MEMORY\", \"value\": \"256\"},\n        ],\n    },\n)\n\nresp = batch.submit_job(\n    jobName=\"my-run\",\n    jobQueue=\"localbatch-default\",\n    jobDefinition=\"my-job\",\n)\nprint(resp[\"jobId\"])\n```\n\n### Inject environment variables into every container\n\nForward credentials or service URLs into all containers without baking them into your job definition:\n\n```bash\nlocalbatch \\\n  --inject-env AWS_ACCESS_KEY_ID=minioadmin \\\n  --inject-env AWS_SECRET_ACCESS_KEY=minioadmin \\\n  --inject-env AWS_ENDPOINT_URL_S3=http://host.docker.internal:9000\n```\n\n### Metaflow\n\n```bash\nexport METAFLOW_BATCH_JOB_QUEUE=localbatch-default\nexport METAFLOW_BATCH_CLIENT_PARAMS='{\"endpoint_url\":\"http://localhost:8000\"}'\n\npython my_flow.py run\n```\n\n## How it works\n\nlocalbatch starts a FastAPI server that implements the complete [AWS Batch REST API](https://docs.aws.amazon.com/batch/latest/APIReference/API_Operations.html) (all 25 operations). When a job is submitted, localbatch runs the container with the Docker SDK. Job status transitions (`SUBMITTED → PENDING → RUNNABLE → STARTING → RUNNING → SUCCEEDED/FAILED`) reflect the real container exit code.\n\nA fake ECS Container Metadata endpoint is injected via `ECS_CONTAINER_METADATA_URI_V4` so that tooling that reads CloudWatch log stream names works without changes.\n\n## Configuration\n\n| Flag | Env var | Default | Description |\n|------|---------|---------|-------------|\n| `--host` | — | `127.0.0.1` | Bind address |\n| `--port` | — | `8000` | Listen port |\n| `--queue` | `LOCALBATCH_QUEUE` | `localbatch-default` | Default job queue name |\n| `--docker-host` | `LOCALBATCH_DOCKER_HOST` | `host.docker.internal` | Hostname containers use to reach the host |\n| `--inject-env KEY=VAL` | — | — | Env var forwarded into every container (repeatable) |\n| `--log-level` | — | `info` | uvicorn log level |\n\n## Development\n\n```bash\ngit clone https://github.com/npow/localbatch\npip install -e localbatch pytest\npytest  # import smoke tests\n```\n\n## License\n\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpow%2Flocalbatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpow%2Flocalbatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpow%2Flocalbatch/lists"}