Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions .github/workflows/planeo-private-pull-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Copyright 2026 The Agent Substrate Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# FORK-ONLY (planeodev/google-substrate) — NOT part of the upstream contribution.
#
# Proves Secret-based private image pulls for actors end to end on a real registry: kind + Agent Substrate (gVisor)
# installed exactly as upstream's e2e does, then atelet re-applied with
# manifests/ate-install/components/image-credential-secret (via manifests/ate-install/kind-image-credential-secret),
# then internal/e2e/suites/imagepullsecret pulls the probe from a PRIVATE GHCR package of this fork.
#
# Credentials: only this job's GITHUB_TOKEN (packages: write to push the private copy, read for the pull) — it is
# ephemeral, masked in logs, and lives only in the throwaway kind cluster's Secret. No stored secret.
# The package ghcr.io/planeodev/google-substrate/e2e-private-probe MUST be private: the suite fails if an
# anonymous read succeeds (set it private once in the org's package settings if GitHub created it public).
name: planeo-private-pull-e2e

on:
push:
branches: ['planeo/**', 'feature/**']
workflow_dispatch:

permissions:
contents: read
packages: write

concurrency:
group: planeo-private-pull-e2e-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-private-pull:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
E2E_ATENET_DATAPLANE: envoy
# Same as upstream's e2e job: the installer requires an egress credential provider (the bundled k8s.io one).
ATE_CREDENTIAL_PROVIDER: '{"name":"k8s.io"}'
ARTIFACTS: ${{ github.workspace }}/_artifacts
E2E_PRIVATE_REPOSITORY: ghcr.io/${{ github.repository }}/e2e-private-probe
steps:
- name: Checkout
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- name: Setup Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: 'go.mod'
cache: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
with:
driver-opts: network=host
buildkitd-config-inline: |
[registry."localhost:5001"]
http = true
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Create cluster
run: hack/create-kind-cluster.sh
- name: Install Agent Substrate
run: hack/install-ate-kind.sh --deploy-ate-system
- name: "Phase 1 — denied: stock atelet (no credentials) must NOT pull the private image"
env:
E2E_PRIVATE_PULL_EXPECT: denied
E2E_PRIVATE_REGISTRY_USERNAME: ${{ github.actor }}
E2E_PRIVATE_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
E2E_JUNIT_FILE: ${{ github.workspace }}/_artifacts/e2e-imagepullsecret-denied.xml
run: hack/run-e2e-kind.sh ./internal/e2e/suites/imagepullsecret -v -args --no-color --preview=""
- name: Registry Secret for atelet (before atelet restarts, so the volume is populated at start)
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
kubectl -n ate-system create secret docker-registry atelet-registry-auth \
--docker-server=ghcr.io --docker-username="${REGISTRY_USER}" --docker-password="${REGISTRY_TOKEN}" \
--dry-run=client -o yaml | kubectl apply -f - >/dev/null
echo "Secret ate-system/atelet-registry-auth created (value not printed)"
- name: Re-apply atelet with the image-credential-secret component
env:
KO_DOCKER_REPO: localhost:5001
run: |
kubectl kustomize --load-restrictor LoadRestrictionsNone manifests/ate-install/kind-image-credential-secret \
> "${RUNNER_TEMP}/atelet.yaml"
KO_CONFIG_PATH="${PWD}" hack/run-tool.sh ko resolve -f "${RUNNER_TEMP}/atelet.yaml" | kubectl apply -f -
kubectl -n ate-system rollout status daemonset/atelet --timeout=10m
kubectl -n ate-system get pods -l app=atelet -o wide
- name: "Phase 2 — allowed: atelet with the component + Secret must pull the private image"
env:
E2E_PRIVATE_PULL_EXPECT: allowed
E2E_PRIVATE_REGISTRY_USERNAME: ${{ github.actor }}
E2E_PRIVATE_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
E2E_JUNIT_FILE: ${{ github.workspace }}/_artifacts/e2e-imagepullsecret-allowed.xml
run: hack/run-e2e-kind.sh ./internal/e2e/suites/imagepullsecret -v -args --no-color --preview=""
- name: Evidence — atelet's pulls of the private image (credential provider → registry → layers)
if: always()
run: |
mkdir -p "${ARTIFACTS}"
for p in $(kubectl -n ate-system get pods -l app=atelet -o name); do
kubectl -n ate-system logs "$p" -c atelet --timestamps > "${ARTIFACTS}/$(basename "$p").log" 2>&1 || true
kubectl -n ate-system logs "$p" -c atelet --timestamps --previous > "${ARTIFACTS}/$(basename "$p")-previous.log" 2>/dev/null || true
done
echo "::group::atelet lines about the private repository (${E2E_PRIVATE_REPOSITORY})"
cat "${ARTIFACTS}"/atelet-*.log | grep -E "e2e-private-probe|credential|provider|unauthori|denied" | head -200
echo "::endgroup::"
- name: Upload evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: planeo-private-pull-evidence
path: _artifacts/
retention-days: 30
- name: Diagnostics
if: always()
run: |
{
echo "### planeo-private-pull-e2e"
echo
echo '```'
kubectl -n ate-system get pods -o wide 2>&1 | head -40
echo '```'
echo '#### atelet log (credential provider + pulls)'
echo '```'
kubectl -n ate-system logs daemonset/atelet -c atelet --tail=400 2>&1 \
| grep -iE 'credential|provider|pull|auth|ghcr|e2e-private' | tail -60
echo '```'
} >> "${GITHUB_STEP_SUMMARY}"
67 changes: 67 additions & 0 deletions .github/workflows/planeo-publish-credential-plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2026 The Agent Substrate Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# FORK-ONLY (planeodev/google-substrate) — NOT part of the upstream contribution.
#
# Publishes cmd/dockerconfig-credential-provider exactly as upstream builds images (ko, distroless, linux/amd64 +
# linux/arm64) to ghcr.io/planeodev/google-substrate/dockerconfig-credential-provider:<branch>-<sha7>, and writes the
# digest to the run summary — the digest planeo-infra pins for atelet's init container until upstream publishes the
# image with its release (it is registered in images.Components, which ate-setup publish iterates).
# The image holds no secret; it is public with this public fork.
name: planeo-publish-credential-plugin

on:
push:
branches: ['feature/**']
paths:
- cmd/dockerconfig-credential-provider/**
- .github/workflows/planeo-publish-credential-plugin.yaml
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- name: Setup Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: 'go.mod'
cache: false
- name: Unit tests
run: go test ./cmd/dockerconfig-credential-provider/
- name: Build and push with ko
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
tag="$(printf '%s' "${GITHUB_REF_NAME}" | tr '/' '-')-${GITHUB_SHA::7}"
printf '%s' "${REGISTRY_TOKEN}" | KO_CONFIG_PATH="${PWD}" hack/run-tool.sh ko login ghcr.io --username "${REGISTRY_USER}" --password-stdin
ref="$(KO_CONFIG_PATH="${PWD}" hack/run-tool.sh ko build --bare=false --base-import-paths \
--platform=linux/amd64,linux/arm64 --tags "${tag}" ./cmd/dockerconfig-credential-provider)"
echo "ref=${ref}"
{
echo "### dockerconfig-credential-provider"
echo
echo "- digest-pinned: \`${ref}\`"
echo "- tag: \`${KO_DOCKER_REPO}/dockerconfig-credential-provider:${tag}\`"
} >> "${GITHUB_STEP_SUMMARY}"
1 change: 1 addition & 0 deletions cmd/ate-setup/internal/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var Components = []string{
"cmd/benchmarking/isolate/fake-atelet",
"cmd/benchmarking/isolate/fake-workersync",
"cmd/credential-provider/kubernetes-secrets",
"cmd/dockerconfig-credential-provider",
"cmd/objectstore-plugin",
"cmd/podcertcontroller",
"demos/counter",
Expand Down
Loading
Loading