From ce7f9ec66a3cfb7a9961ee025ab11312411955fd Mon Sep 17 00:00:00 2001 From: Daniel Kmak <4950658+e00dan@users.noreply.github.com> Date: Sun, 8 Nov 2026 22:26:09 +0100 Subject: [PATCH 1/3] fix(cas): make the lab compose CAS start again The CAS in devel/compose.labs.yml crashes on startup because of two regressions: - CAS_PUBLIC_KEY_PATH points at cas.pem, which is the private key. Since #3225 (v1.105.0) the key is parsed at startup, so the CAS panics with "failed to parse public key: x509: malformed tbs certificate". - #3365 (v1.110.0) made staging_dir required, but the scratch image has no directory that user 1001 can write to, so the CAS panics before it reaches the key. Point the key path at cas.pub. Ship an empty /tmp-staging-fs owned by 1001 in the image, which is the path the Helm chart already mounts its emptyDir on, and back it with a named volume in the lab compose. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com> --- app/artifact-cas/Dockerfile.goreleaser | 3 +++ devel/compose.labs.yml | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/artifact-cas/Dockerfile.goreleaser b/app/artifact-cas/Dockerfile.goreleaser index 53cc72f49..bbeadbbc4 100644 --- a/app/artifact-cas/Dockerfile.goreleaser +++ b/app/artifact-cas/Dockerfile.goreleaser @@ -6,10 +6,13 @@ FROM golang:1.27.3@sha256:957861185dbf29d93668ace41e011d091c6e779953d47f0316ef2c RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \ && rm -rf /var/lib/apt/lists/* +RUN mkdir /tmp-staging-fs + FROM scratch COPY ./artifact-cas / COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=builder --chown=1001:1001 /tmp-staging-fs /tmp-staging-fs USER 1001 diff --git a/devel/compose.labs.yml b/devel/compose.labs.yml index ba1dd14f7..1c6675d2e 100644 --- a/devel/compose.labs.yml +++ b/devel/compose.labs.yml @@ -48,9 +48,11 @@ services: - ../app/artifact-cas/configs:/data/conf # development keys - ../devel/devkeys:/devkeys + - cas-staging:/tmp-staging-fs environment: CAS_VAULT_ADDRESS: http://vault:8200 - CAS_PUBLIC_KEY_PATH: /devkeys/cas.pem + CAS_PUBLIC_KEY_PATH: /devkeys/cas.pub + CAS_STAGING_DIR: /tmp-staging-fs ports: - 9001:9001 - 8001:8001 @@ -76,3 +78,6 @@ services: RUSTFS_CONSOLE_ENABLE: "true" profiles: - optional + +volumes: + cas-staging: From 69609937165eae090c9e04f70bf61265209fa2b9 Mon Sep 17 00:00:00 2001 From: Daniel Kmak <4950658+e00dan@users.noreply.github.com> Date: Sun, 8 Nov 2026 22:54:34 +0100 Subject: [PATCH 2/3] fix(controlplane): route the lab control plane to the CAS service With a non-inline CAS backend, attestation push against the lab stack fails with an internal error. The control plane uploads the attestation bundle to the CAS at cas_server.grpc.addr, which config.devel.yaml sets to 0.0.0.0:9001. Inside the control-plane container that is the container itself, so the dial times out. The value has no env placeholder, so compose could not override it. Add a CAS_SERVER_ADDR placeholder that defaults to the current value, so running the control plane on the host is unchanged, and set CP_CAS_SERVER_ADDR to cas:8001 in the lab compose. Like the Helm chart, this targets the CAS shared endpoint rather than the deprecated gRPC-only listener. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com> --- app/controlplane/configs/config.devel.yaml | 2 +- devel/compose.labs.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controlplane/configs/config.devel.yaml b/app/controlplane/configs/config.devel.yaml index aaf1ecf25..e09682ab8 100644 --- a/app/controlplane/configs/config.devel.yaml +++ b/app/controlplane/configs/config.devel.yaml @@ -51,7 +51,7 @@ plugins_dir: "./plugins/bin" # Local CAS server for development cas_server: grpc: - addr: 0.0.0.0:9001 + addr: ${CAS_SERVER_ADDR:0.0.0.0:9001} insecure: true download_url: http://0.0.0.0:8001/download default_entry_max_size: 300MB diff --git a/devel/compose.labs.yml b/devel/compose.labs.yml index 1c6675d2e..997dd7778 100644 --- a/devel/compose.labs.yml +++ b/devel/compose.labs.yml @@ -23,6 +23,7 @@ services: CP_FILE_CA_CERT_PATH: /devkeys/ca.pub CP_FILE_CA_KEY_PATH: /devkeys/ca.pem CP_CAS_KEY_PATH: /devkeys/cas.pem + CP_CAS_SERVER_ADDR: cas:8001 CP_DEV_USER: john@chainloop.local volumes: # main configuration From 7fd8ed3226c4e250de456d01201493d4386566c3 Mon Sep 17 00:00:00 2001 From: Daniel Kmak <4950658+e00dan@users.noreply.github.com> Date: Mon, 9 Nov 2026 13:54:24 +0100 Subject: [PATCH 3/3] fix(devel): use a tmpfs for the lab CAS staging dir Keep the production image unchanged, as requested in review. Revert the Dockerfile change and mount a tmpfs owned by 1001 at /tmp-staging-fs in the lab compose, replacing the named volume. This works with the released artifact-cas:latest image, so the lab stack works as soon as this lands rather than after the next release. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com> --- app/artifact-cas/Dockerfile.goreleaser | 3 --- devel/compose.labs.yml | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/artifact-cas/Dockerfile.goreleaser b/app/artifact-cas/Dockerfile.goreleaser index bbeadbbc4..53cc72f49 100644 --- a/app/artifact-cas/Dockerfile.goreleaser +++ b/app/artifact-cas/Dockerfile.goreleaser @@ -6,13 +6,10 @@ FROM golang:1.27.3@sha256:957861185dbf29d93668ace41e011d091c6e779953d47f0316ef2c RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \ && rm -rf /var/lib/apt/lists/* -RUN mkdir /tmp-staging-fs - FROM scratch COPY ./artifact-cas / COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder --chown=1001:1001 /tmp-staging-fs /tmp-staging-fs USER 1001 diff --git a/devel/compose.labs.yml b/devel/compose.labs.yml index 997dd7778..40f628162 100644 --- a/devel/compose.labs.yml +++ b/devel/compose.labs.yml @@ -49,7 +49,8 @@ services: - ../app/artifact-cas/configs:/data/conf # development keys - ../devel/devkeys:/devkeys - - cas-staging:/tmp-staging-fs + tmpfs: + - /tmp-staging-fs:uid=1001,gid=1001 environment: CAS_VAULT_ADDRESS: http://vault:8200 CAS_PUBLIC_KEY_PATH: /devkeys/cas.pub @@ -79,6 +80,3 @@ services: RUSTFS_CONSOLE_ENABLE: "true" profiles: - optional - -volumes: - cas-staging: