Execution Environments

Preview

Isolated runtimes for code execution, dependency management and long jobs.

An execution environment is a disposable machine: a filesystem, a runtime, a resource ceiling and an egress profile.

Environment classes#

ClassvCPU / memoryMax wall clockTypical use
micro1 / 2 GB5 minSnippets, validation, formatting
standard2 / 8 GB30 minTest suites, build steps, analysis
analysis4 / 32 GB60 minLarge datasets, notebooks
extended8 / 64 GB4 hLong training-free batch jobs
Classes are indicative; workspace plans determine the available ceiling.

Lifecycle#

  1. 1

    Provision

    Created on first code.execute step with the declared runtime and egress profile.

  2. 2

    Prepare

    Dependencies installed under the package-install profile, then egress is narrowed.

  3. 3

    Execute

    Commands run with captured stdout, stderr, exit code and duration.

  4. 4

    Snapshot

    Filesystem snapshotted at checkpoints so a resumed run does not rebuild from scratch.

  5. 5

    Destroy

    Environment torn down at run end; published artifacts survive, the machine does not.

ts
const env = await pimsy.environments.create({
  class: class="tok-str">"standard",
  runtime: class="tok-str">"node@class="tok-num">22",
  egress: class="tok-str">"package-install",
  setup: [class="tok-str">"pnpm install --frozen-lockfile"]
});

const result = await env.exec(class="tok-str">"pnpm test -- --reporter=json");
console.log(result.exitCode, result.durationMs);

Last updated 2026-09-01