cpuos

Recipe · devbox base

Rust builds and tests sandbox recipe

A Rust sandbox recipe for Cargo builds, tests and native dependencies, with locked versions, bounded build jobs and explicit artifact collection.

When to use this profile

Rust compilation often dominates an agent's action time. Prepare dependencies and distinguish incremental development tests from the clean build that validates a final patch. Cache only trusted build inputs within the task's isolation scope. Proc macros and build scripts execute during compilation, so compilation belongs inside the sandbox boundary too.

Prepare a repeatable environment

  • Preserve Cargo.lock and pin the toolchain with rust-toolchain.toml.
  • Install required native libraries and linkers during image preparation.
  • Fetch crates before disabling network access; document any git-based dependencies.
Command inside a prepared Linux guest
cargo test --locked --jobs 2

Return results the agent can use

  • Cargo test results and compiler diagnostics.
  • The source diff, including intentional lockfile changes.
  • Binary artifacts with the target triple and build profile recorded.

Run locked tests on a small fixture, then add a compile error and confirm diagnostics reach the agent. Measure a clean build before using the recipe for large workspaces.

Resources and boundaries

Start with 4 vCPU and 8 GB of RAM, then measure peak memory and task duration on a representative fixture. These are workload planning values, not a benchmark or a provisioned configuration. Use the sandbox cost calculator to estimate running time and retained snapshots.

  • Parallel compiler processes and linkers can consume more memory than the program itself.
  • Build scripts and proc macros run arbitrary code and can read task credentials.
  • Keep caches scoped so another tenant cannot replace a dependency or build artifact.

Keep model inference separate from this execution profile. A hosted model or gpuOS can decide the next action while the CPU environment runs it. The quickstart describes the account workflow and the proposed runtime contract.

Questions

Is this a separate built-in template?
This is a workload recipe based on the devbox profile. It adds preparation and execution guidance, not a separate built-in image or a new backend runtime.
Can I run the command now?
The command runs in a Linux environment where the listed dependencies and input files are prepared. cpuOS SDK examples describe a proposed contract; confirm runtime access and package versions before integration.
How should I choose CPU and memory?
Use the starting profile to run a representative fixture, measure peak memory and elapsed time, and add room for package installation, worker processes and larger inputs. Enforce a task timeout separately.

Related guides

Plan your rust builds and tests task

Create a workspace and choose a profile. Connect an execution backend before running code.

gpuOS · where models think

Need the model too? Run it on gpuOS

gpuOS serves open models on your own GPUs behind one OpenAI-compatible API. The model reasons on gpuOS, the agent acts in a cpuOS sandbox.