# Builds

> The isolated machine that turns your code into artifacts: detection, caching, logs and limits.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://run.docs.sypnia.com/deploys/builds/

For agents: Run builds: fresh Linux machine per build (x86_64/arm64) with Node/pnpm/npm/yarn/bun/Python/Go and Docker; in Cloud on AWS CodeBuild with a per-build role (writes only its artifacts), internet egress for packages, no internal network; build-time vs runtime vars, secrets masked; steps fetch → cache restore (lockfile hash) → frozen install → build → package + cache save; logs streamed and kept; time and size limits (timed_out never touches production).

A build runs your install and build commands on a clean machine and keeps only the artifacts.

## The build machine

- A fresh Linux machine per build (x86_64 or arm64, matching the app's runtime), with Node, pnpm, npm, yarn, bun, Python and Go preinstalled, and Docker for container apps.
- In Sypnia Cloud it runs in AWS CodeBuild with its own role that can write only this build's artifacts. It has internet access to install packages, and no access to Sypnia's internal network or to other customers. [Isolation](https://run.docs.sypnia.com/architecture/isolation) explains the model.
- Build-time variables are the ones marked `build` in [the environment](https://run.docs.sypnia.com/config/environment-and-secrets). Secrets are not available at build time unless you mark them so, and they are masked in logs.

## Steps

1. Fetch the source: the Git commit, or the archive the CLI uploaded (respecting `.gitignore` and `.sypniaignore`).
2. Restore the cache: the package manager's store and the framework's build cache, keyed by the lockfile's hash.
3. Install with the lockfile (`pnpm install --frozen-lockfile` or the equivalent). A missing lockfile is a warning; a lockfile out of date is an error.
4. Run the build command.
5. Package the artifacts for the app's kind, and save the cache.

## Logs

Logs stream to the CLI and the console while the build runs and are kept with the build. Lines that contain the value of a secret are masked as `****`.

## Limits

A build has a time limit and an artifact size limit, published with the plans. A build that passes the time limit is stopped and marked `timed_out`; production is not touched.
