Expand description
The build artifact: a zip of the daemon binary, a Dockerfile, and — when the caller
passes ProjectFiles — the project’s dependency files.
What CreateMicrovmImage’s codeArtifact.uri points at (sandbox.py:523
build_artifact). Two entries always, both carrying a measured constraint, plus an
ecosystem-named manifest/lockfile pair when the image bakes an environment layer (#74).
§The execute bit has to be in the zip entry
A build that copies a non-executable binary produces an image whose CMD fails, and
the failure surfaces as a run-hook timeout — which says nothing about permissions,
and sends the reader to look at the daemon’s startup path instead of at the archive.
So the agentd entry sets mode 0o755 explicitly rather than inheriting whatever the
host file had.
§The agent token is never in here (TRAP-5’s other half)
The artifact becomes a shared image snapshot: every MicroVM launched from the image
sees the same bytes. A per-VM secret in there is a per-VM secret shared with every VM.
So the token travels through runHookPayload at launch instead, and this function has
no parameter that could carry one — see crate::control::microvm. The test at the
bottom of this file scans the produced zip’s raw bytes for a token value to prove the
path stays closed, which is a byte scan rather than an API review because the leak
would be a value appearing somewhere, not a parameter being declared.
Structs§
- Base
Image - A base image: the platform ARN, the Dockerfile
FROMthat pairs with it, and whether it declares aWORKDIR. - Project
Files - A project’s dependency files: the lockfile plus the manifest that owns it.
- Wrap
Options - What
wrap_dockerfileneeds besides the task text.
Enums§
- Ecosystem
- An ecosystem whose dependency files may enter the build artifact (#74).
Constants§
- DEFAULT_
PROJECT_ WORKDIR - Where the environment layer lives when the caller named no workdir of their own.
Functions§
- artifact_
content_ hash - The sha256 of the artifact’s inputs, as lowercase hex.
- artifact_
content_ hash_ with_ context artifact_content_hashextended with a build context (IMAGE-6).- build_
artifact - Zips
binarywithdockerfile— and, when given, the project’s dependency files — into the bytescodeArtifact.uriwill point at. - build_
artifact_ with_ context build_artifactplus a build context: the context’s files at their relative paths beside the Dockerfile, which is the build context root, so the Dockerfile’sCOPYlines find them (IMAGE-7).- default_
dockerfile - A Dockerfile that makes the daemon the container
CMD. - dockerfile_
agentd_ port - The port in a Dockerfile’s last
ENV AGENTD_PORT=, orNonewhen it sets none. - dockerfile_
cmd - The value of a Dockerfile’s last
CMD, orNonewhen it sets none. - dockerfile_
entrypoint - The value of a Dockerfile’s last
ENTRYPOINT, orNonewhen it sets none. - dockerfile_
env_ u64 - The seconds in a Dockerfile’s last
ENV AGENTD_SSE_KEEPALIVE_SECS=, orNonewhen it sets none. - dockerfile_
from_ ref - The image ref in a Dockerfile’s first
FROM, orNonewhen it has none. - require_
daemon_ cmd - Rejects a Dockerfile whose image would never run the daemon: no
CMD, or anENTRYPOINTthat swallows it. - require_
keepalive_ under_ idle_ timeout - Rejects a Dockerfile whose
AGENTD_SSE_KEEPALIVE_SECSis not shorter than the client’s stream idle timeout. - require_
matching_ agentd_ port - Rejects a Dockerfile whose
AGENTD_PORTdisagrees with the port the create call sends ashooks.port. - require_
matching_ from - Rejects a Dockerfile whose
FROMis not the selected base image. - require_
project_ install - Rejects a caller Dockerfile that never mentions the lockfile the request carries.
- require_
workdir - Rejects working-directory inheritance when nothing declares one.
- wrap_
dockerfile - A task Dockerfile with the agentd stanza appended: the one call a harness needs to go from the Dockerfile a task brings to one this client can build (#220).
- wrap_
dockerfile_ preserving_ user - Preserve the final Dockerfile USER as the default identity for workload execs.