# parlel/batch

A zero-dependency, in-process fake of **AWS Batch**. Batch uses the AWS
REST-JSON protocol with fixed POST paths under `/v1`, so the real
`@aws-sdk/client-batch` works against it unchanged.

| | |
|---|---|
| **Port** | `4705` |
| **Protocol** | AWS REST-JSON (e.g. `POST /v1/submitjob`, `POST /v1/describejobs`) |
| **Health** | `GET /_parlel/health` |
| **Reset** | `POST /_parlel/reset` |

## Default connection

```
AWS_ENDPOINT_URL=http://127.0.0.1:4705
AWS_ACCESS_KEY_ID=parlel
AWS_SECRET_ACCESS_KEY=parlel
AWS_REGION=us-east-1
```

Any SigV4 credentials are accepted (auth is not verified).

## Supported operations

| Operation | Route |
|---|---|
| `CreateJobQueue` | `POST /v1/createjobqueue` |
| `DescribeJobQueues` | `POST /v1/describejobqueues` |
| `RegisterJobDefinition` | `POST /v1/registerjobdefinition` |
| `DescribeJobDefinitions` | `POST /v1/describejobdefinitions` |
| `SubmitJob` | `POST /v1/submitjob` |
| `DescribeJobs` | `POST /v1/describejobs` |
| `ListJobs` | `POST /v1/listjobs` |
| `CancelJob` | `POST /v1/canceljob` |

## SDK usage example

```js
import { BatchClient, CreateJobQueueCommand, SubmitJobCommand, DescribeJobsCommand } from "@aws-sdk/client-batch";

const batch = new BatchClient({
  endpoint: "http://127.0.0.1:4705",
  region: "us-east-1",
  credentials: { accessKeyId: "parlel", secretAccessKey: "parlel" },
});

await batch.send(new CreateJobQueueCommand({ jobQueueName: "jq", priority: 1, computeEnvironmentOrder: [] }));
const s = await batch.send(new SubmitJobCommand({ jobName: "myjob", jobQueue: "jq", jobDefinition: "echo:1" }));
const d = await batch.send(new DescribeJobsCommand({ jobs: [s.jobId] }));
console.log(d.jobs[0].status); // "SUCCEEDED"
```

## Access via MCP / preview URL

When running inside a Daytona sandbox, this HTTP service is exposed at an
automatically-provisioned preview URL. Point the SDK `endpoint` at that URL and
add the `x-daytona-preview-token` header on requests.

## Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ fully supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

| Area | Limitation |
|---|---|
| Execution | Jobs immediately succeed (`SUCCEEDED`, exit code 0); no container runtime or scheduling. |
| Compute environments | `CreateComputeEnvironment` is not implemented; queues reference them opaquely. |
| Dependencies | `dependsOn` is stored but not enforced (no DAG sequencing). |
| Array / multi-node jobs | Array jobs and multi-node parallel jobs are not modeled. |
| Auth | SigV4 is accepted but never validated. |
| Persistence | In-memory; lost on restart/reset. |
