Skip to content

Commit 8f97241

Browse files
committed
remove local runner
1 parent 1dce7bb commit 8f97241

File tree

4 files changed

+19
-268
lines changed

4 files changed

+19
-268
lines changed

sandbox-sidecar/README.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ helm install taco-sidecar diggerhq/taco-sidecar
5757
| Variable | Description |
5858
| --- | --- |
5959
| `PORT` | HTTP port for the sidecar (default `9100`). |
60-
| `SANDBOX_RUNNER` | `local` or `e2b`. Defaults to `local`. |
61-
| `E2B_API_KEY` | Required for `SANDBOX_RUNNER=e2b`. |
62-
| `E2B_BAREBONES_TEMPLATE_ID` | Optional fallback template ID for runtime installation (defaults to `rki5dems9wqfm4r03t7g`). |
63-
| `LOCAL_TERRAFORM_BIN` | Optional path to the `terraform` binary (defaults to `terraform` in `$PATH`). |
60+
| `SANDBOX_RUNNER` | Must be `e2b`. |
61+
| `E2B_API_KEY` | Required. Your E2B API key. |
62+
| `E2B_BAREBONES_TEMPLATE_ID` | Required. Fallback template ID for runtime installation. |
6463

6564
### Terraform/OpenTofu Version Selection
6665

@@ -77,20 +76,11 @@ The sidecar automatically selects the best execution environment:
7776

7877
Users specify the version when creating a unit in the UI (defaults to 1.5.5).
7978

80-
### Local Runner
81-
82-
The bundled local runner is intended for development. It unpacks the provided
83-
archive, writes the optional state payload, and shells out to a Terraform binary
84-
installed on the same host. All stdout/stderr is captured and streamed back to
85-
the requester.
86-
8779
### E2B Runner
8880

89-
An opinionated `E2BSandboxRunner` is included as a scaffold. Hook it up to the
90-
official SDK by wiring the `runPlan`/`runApply` helpers with the appropriate E2B API
91-
calls and file upload primitives (see `src/runners/e2bRunner.ts` for the TODOs).
92-
Once implemented, switch `SANDBOX_RUNNER=e2b` and provide `E2B_API_KEY` plus a
93-
template/blueprint identifier.
81+
The sidecar uses E2B sandboxes for secure, isolated Terraform/OpenTofu execution.
82+
Each run creates an ephemeral sandbox, executes the IaC commands, and returns
83+
results. Sandboxes are automatically cleaned up after execution.
9484

9585
## API Surface
9686

@@ -131,9 +121,6 @@ failure, `error` contains the reason string. A `failed` response never includes
131121

132122
- This package intentionally keeps job state in-memory. Use a persistent store
133123
(Redis, Postgres) before running multiple replicas.
134-
- The local runner shell-outs to `terraform`. Sandbox machines therefore need
135-
Terraform installed and accessible in `$PATH`.
136-
- The E2B runner is wired as an interchangeable strategy: extend it or add
137-
additional runners (Kubernetes, Nomad, etc.) as needed without touching
138-
the Go control plane.
124+
- E2B sandboxes are ephemeral and isolated - each run gets a fresh environment.
125+
- Pre-built templates provide instant startup; custom versions install at runtime (~1-2s).
139126

sandbox-sidecar/src/config.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ import dotenv from "dotenv";
22

33
dotenv.config();
44

5-
export type RunnerType = "local" | "e2b";
5+
export type RunnerType = "e2b";
66

77
export interface AppConfig {
88
port: number;
99
runner: RunnerType;
10-
local: {
11-
terraformBinary: string;
12-
};
1310
e2b: {
1411
apiKey?: string;
15-
defaultTemplateId?: string; // Pre-built template with TF 1.5.5
1612
bareBonesTemplateId?: string; // Base template for custom versions
1713
};
1814
}
@@ -29,19 +25,18 @@ const parsePort = (value: string | undefined, fallback: number) => {
2925
};
3026

3127
export function loadConfig(): AppConfig {
32-
const runnerEnv = (process.env.SANDBOX_RUNNER || "local").toLowerCase();
33-
const runner: RunnerType = runnerEnv === "e2b" ? "e2b" : "local";
28+
const runnerEnv = (process.env.SANDBOX_RUNNER || "e2b").toLowerCase();
29+
30+
if (runnerEnv !== "e2b") {
31+
throw new Error("Only E2B runner is supported. Set SANDBOX_RUNNER=e2b");
32+
}
3433

3534
return {
3635
port: parsePort(process.env.PORT, 9100),
37-
runner,
38-
local: {
39-
terraformBinary: process.env.LOCAL_TERRAFORM_BIN || "terraform",
40-
},
36+
runner: "e2b",
4137
e2b: {
4238
apiKey: process.env.E2B_API_KEY,
43-
defaultTemplateId: process.env.E2B_DEFAULT_TEMPLATE_ID, // Pre-built with TF 1.5.5
44-
bareBonesTemplateId: process.env.E2B_BAREBONES_TEMPLATE_ID, // Base for custom versions
39+
bareBonesTemplateId: process.env.E2B_BAREBONES_TEMPLATE_ID,
4540
},
4641
};
4742
}
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { AppConfig } from "../config.js";
22
import { SandboxRunner } from "./types.js";
3-
import { LocalTerraformRunner } from "./localRunner.js";
43
import { E2BSandboxRunner } from "./e2bRunner.js";
54

65
export function createRunner(config: AppConfig): SandboxRunner {
7-
if (config.runner === "e2b") {
8-
return new E2BSandboxRunner(config.e2b);
6+
if (config.runner !== "e2b") {
7+
throw new Error("Only E2B runner is supported. Set SANDBOX_RUNNER=e2b");
98
}
10-
return new LocalTerraformRunner({
11-
terraformBinary: config.local.terraformBinary,
12-
});
9+
return new E2BSandboxRunner(config.e2b);
1310
}
1411

sandbox-sidecar/src/runners/localRunner.ts

Lines changed: 0 additions & 228 deletions
This file was deleted.

0 commit comments

Comments
 (0)