Add native SCV staging image build

286279cf4a71 · AtlantisPleb · · parent d247a8a3821c

Add native SCV staging image build

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified docs/operations/scv-staging-qualification.md
  • modified docs/scv-planning.md
  • added ops/scv/images/build-opencode-core-cloud.sh
  • added ops/scv/images/cloudbuild-opencode-core.yaml

Diff

4 files changed, +90 -2

docs/operations/scv-staging-qualification.md modified +4 -2

@@ -32,8 +32,10 @@ to Cloud Logging, writes one terminal result, and exits.

32 32
## Build and deploy
33 33
34 34
1. Commit and push the candidate. Record the exact Git SHA.
35
2. Build `ops/scv/images/opencode-core/Dockerfile` for `linux/amd64` with that
36
   SHA as `SCV_SOURCE_REVISION`.
35
2. Run `ops/scv/images/build-opencode-core-cloud.sh` against the clean commit.
36
   The script builds `ops/scv/images/opencode-core/Dockerfile` on native
37
   `linux/amd64` infrastructure with the SHA as
38
   `OPENAGENTS_BUILD_REVISION`.
37 39
3. Push the image to the dedicated immutable Artifact Registry repository and
38 40
   resolve its manifest digest.
39 41
4. Deploy or update the dedicated Cloud Run job by digest. Configure these
docs/scv-planning.md modified +5

@@ -198,6 +198,11 @@ Run `ops/scv/images/build-opencode-core.sh` to build the native architecture as

198 198
digests, Debian snapshot, Hex, Rebar3, Node.js, Bun, and OpenCode. It produces a
199 199
self-contained Elixir release and the OpenCode toolchain in one image.
200 200
201
Use `ops/scv/images/build-opencode-core-cloud.sh` to build a clean committed
202
source tree on native `linux/amd64` Cloud Build infrastructure and publish it to
203
the immutable staging repository. Do not use an emulated cross-build as staging
204
evidence when the language runtime fails under the emulation layer.
205
201 206
On 2026-08-20, the complete ARM64 image ran as UID and GID `10001` through the
202 207
Elixir SCV process role. The SCV selected the `opencode` driver and
203 208
`opencode-core` environment, inspected the source baked into the image, and
ops/scv/images/build-opencode-core-cloud.sh added +39

@@ -0,0 +1,39 @@

1
#!/usr/bin/env bash
2
set -euo pipefail
3
4
repo_root=$(git rev-parse --show-toplevel)
5
source "${repo_root}/ops/scv/images/versions.env"
6
7
project=${SCV_GCP_PROJECT:?Set SCV_GCP_PROJECT to the staging Google Cloud project}
8
region=${SCV_GCP_REGION:-us-central1}
9
git_sha=${SCV_BUILD_REVISION:-$(git -C "${repo_root}" rev-parse HEAD)}
10
source_date_epoch=$(git -C "${repo_root}" show -s --format=%ct "${git_sha}")
11
image=${SCV_IMAGE:-${region}-docker.pkg.dev/${project}/openagents-scv-staging/opencode-core:${git_sha}}
12
13
if [[ -n "$(git -C "${repo_root}" status --porcelain)" ]]; then
14
  echo "The SCV Cloud Build context must match a clean Git commit." >&2
15
  exit 1
16
fi
17
18
substitutions=(
19
  "_IMAGE=${image}"
20
  "_RUNTIME_IMAGE=${SCV_RUNTIME_IMAGE}"
21
  "_ELIXIR_IMAGE=${SCV_ELIXIR_IMAGE}"
22
  "_DEBIAN_SNAPSHOT=${SCV_DEBIAN_SNAPSHOT}"
23
  "_HEX_VERSION=${SCV_HEX_VERSION}"
24
  "_REBAR3_VERSION=${SCV_REBAR3_VERSION}"
25
  "_REBAR3_SHA512=${SCV_REBAR3_SHA512}"
26
  "_NODE_VERSION=${SCV_NODE_VERSION}"
27
  "_BUN_VERSION=${SCV_BUN_VERSION}"
28
  "_OPENCODE_VERSION=${SCV_OPENCODE_VERSION}"
29
  "_BUILD_REVISION=${git_sha}"
30
  "_SOURCE_DATE_EPOCH=${source_date_epoch}"
31
)
32
33
substitution_csv=$(IFS=,; echo "${substitutions[*]}")
34
35
gcloud builds submit "${repo_root}" \
36
  --config="${repo_root}/ops/scv/images/cloudbuild-opencode-core.yaml" \
37
  --project="${project}" \
38
  --region="${region}" \
39
  --substitutions="${substitution_csv}"
ops/scv/images/cloudbuild-opencode-core.yaml added +42

@@ -0,0 +1,42 @@

1
steps:
2
  - name: gcr.io/cloud-builders/docker
3
    args:
4
      - build
5
      - --file
6
      - ops/scv/images/opencode-core/Dockerfile
7
      - --tag
8
      - ${_IMAGE}
9
      - --build-arg
10
      - RUNTIME_IMAGE=${_RUNTIME_IMAGE}
11
      - --build-arg
12
      - ELIXIR_IMAGE=${_ELIXIR_IMAGE}
13
      - --build-arg
14
      - DEBIAN_SNAPSHOT=${_DEBIAN_SNAPSHOT}
15
      - --build-arg
16
      - HEX_VERSION=${_HEX_VERSION}
17
      - --build-arg
18
      - REBAR3_VERSION=${_REBAR3_VERSION}
19
      - --build-arg
20
      - REBAR3_SHA512=${_REBAR3_SHA512}
21
      - --build-arg
22
      - NODE_VERSION=${_NODE_VERSION}
23
      - --build-arg
24
      - BUN_VERSION=${_BUN_VERSION}
25
      - --build-arg
26
      - OPENCODE_VERSION=${_OPENCODE_VERSION}
27
      - --build-arg
28
      - OPENAGENTS_BUILD_REVISION=${_BUILD_REVISION}
29
      - --build-arg
30
      - SOURCE_DATE_EPOCH=${_SOURCE_DATE_EPOCH}
31
      - --label
32
      - com.openagents.scv.image=opencode-core
33
      - --label
34
      - com.openagents.scv.opencode.version=${_OPENCODE_VERSION}
35
      - --label
36
      - org.opencontainers.image.revision=${_BUILD_REVISION}
37
      - .
38
images:
39
  - ${_IMAGE}
40
options:
41
  machineType: E2_HIGHCPU_8
42
timeout: 1800s

This page updates live while a promote is in flight · changelog