Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
chore: mirror singular built image to other registries
Kyle Mendell3603a57bc9b7
diff --git a/.depot/actions/publish-images/action.yml b/.depot/actions/publish-images/action.ymlindex ffb8a9c94..27cff6b9a 100644--- a/.depot/actions/publish-images/action.yml+++ b/.depot/actions/publish-images/action.yml@@ -1,5 +1,5 @@-name: Publish next registry images-description: Build and sign manager and agent images for one registry+name: Publish registry images+description: Copy and sign canonical manager and agent imagesinputs:registry:description: Destination registry@@ -10,26 +10,38 @@ inputs:password:description: Registry passwordrequired: true+ manager-digest:+ description: Canonical manager image index digest+ required: true+ agent-digest:+ description: Canonical agent image index digest+ required: true+ version:+ description: Image version without a leading v+ required: true+ channel:+ description: next or release+ required: trueruns:using: compositesteps:- - name: Setup Vite+- uses: voidzero-dev/setup-vp@3754dd7dbdb32bd8f6d28b6043de13ad3a75f21f # v1.21.1+ - name: Setup ORAS+ uses: oras-project/setup-oras@005458ad77f1c8facd38a094e4af2e69e5607ff4 # v2.0.2with:- node-version: 26- cache: true- run-install: true+ version: 1.3.1- - name: Setup Go- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0- with:- go-version-file: backend/go.mod- cache-dependency-path: backend/go.sum+ - name: Ensure envsubst is installed+ shell: bash+ run: |+ if ! command -v envsubst >/dev/null; then+ sudo apt-get update+ sudo apt-get install -y gettext-base+ fi- - name: Set up Depot CLI- uses: depot/setup-action@91bc8495a33ebfc504ffc89e5674379ccf23c29c # v1.7.2+ - name: Install Cosign+ uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2with:- configure-docker: true+ cosign-release: v3.0.6- name: Login to destination registryuses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0@@ -40,28 +52,12 @@ runs:env:AWS_REGION: us-east-1- - name: Validate destination registry+ - name: Copy and sign registry imagesshell: bash- run: |- case '${{ inputs.registry }}' in- ghcr.io|docker.io|quay.io|public.ecr.aws) ;;- *) echo 'Unsupported image registry' >&2; exit 1 ;;- esac-- - name: Capture frontend build versions- id: frontend-versions- shell: bash- run: |- echo "node_version=$(node --version)" >> "$GITHUB_OUTPUT"- echo "sveltekit_version=$(vp -C frontend node -p 'require("@sveltejs/kit/package.json").version')" >> "$GITHUB_OUTPUT"-- - name: Run GoReleaser- uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3- with:- distribution: goreleaser-pro- version: '~> 2'- args: release --clean --nightly --skip=announce,validate,archive,nfpm,notarize,homebrewenv:IMAGE_REGISTRY: ${{ inputs.registry }}- NODE_VERSION: ${{ steps.frontend-versions.outputs.node_version }}- SVELTEKIT_VERSION: ${{ steps.frontend-versions.outputs.sveltekit_version }}+ MANAGER_DIGEST: ${{ inputs.manager-digest }}+ AGENT_DIGEST: ${{ inputs.agent-digest }}+ IMAGE_VERSION: ${{ inputs.version }}+ IMAGE_CHANNEL: ${{ inputs.channel }}+ run: bash "${{ github.workspace }}/scripts/ci/publish-images.sh"diff --git a/.depot/workflows/build-next-images.yml b/.depot/workflows/build-next-images.ymlindex 79371b751..71d1db51a 100644--- a/.depot/workflows/build-next-images.yml+++ b/.depot/workflows/build-next-images.yml@@ -8,7 +8,7 @@ on:concurrency:group: build-next-images- cancel-in-progress: true+ cancel-in-progress: falsepermissions:contents: read@@ -34,6 +34,10 @@ jobs:build-next-images:needs: next-version+ outputs:+ manager-digest: ${{ steps.digests.outputs.manager }}+ agent-digest: ${{ steps.digests.outputs.agent }}+ version: ${{ needs.next-version.outputs.version }}runs-on:size: 32x128image: g7r5wqb57k.registry.depot.dev/ci:latest@@ -73,12 +77,34 @@ jobs:repositories: arcanepermission-contents: read+ - name: Set up Depot CLI+ uses: depot/setup-action@91bc8495a33ebfc504ffc89e5674379ccf23c29c # v1.7.2+ with:+ configure-docker: true++ - name: Login to GHCR+ uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0+ with:+ registry: ghcr.io+ username: ${{ vars.GHCR_USERNAME }}+ password: ${{ secrets.ARCANE_BOT_TOKEN }}++ - name: Install Cosign+ uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2+ with:+ cosign-release: v3.0.6++ - name: Setup ORAS+ uses: oras-project/setup-oras@005458ad77f1c8facd38a094e4af2e69e5607ff4 # v2.0.2+ with:+ version: 1.3.1+- name: Run GoReleaseruses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3with:distribution: goreleaser-proversion: '~> 2'- args: release --clean --nightly --skip=announce,validate,homebrew,docker+ args: release --clean --nightly --skip=announce,validate,homebrewenv:GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}@@ -105,11 +131,25 @@ jobs:NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}+ - name: Resolve canonical image digests+ id: digests+ env:+ IMAGE_VERSION: ${{ needs.next-version.outputs.version }}+ run: |+ for image in manager agent; do+ digest=$(oras resolve "ghcr.io/getarcaneapp/$image:v$IMAGE_VERSION")+ if [[ ! "$digest" =~ ^sha256:[0-9a-f]{64}$ ]]; then+ echo "::error::Invalid canonical digest for $image: $digest"+ exit 1+ fi+ echo "$image=$digest" >> "$GITHUB_OUTPUT"+ done+publish-images:name: Publish ${{ matrix.registry }}- needs: next-version+ needs: build-next-imagesruns-on:- size: 32x128+ size: 4x16image: g7r5wqb57k.registry.depot.dev/ci:lateststrategy:fail-fast: false@@ -140,13 +180,10 @@ jobs:registry: ${{ matrix.registry }}username: ${{ matrix.registry == 'ghcr.io' && vars.GHCR_USERNAME || secrets[matrix.username-secret] }}password: ${{ secrets[matrix.password-secret] }}+ manager-digest: ${{ needs.build-next-images.outputs.manager-digest }}+ agent-digest: ${{ needs.build-next-images.outputs.agent-digest }}+ version: ${{ needs.build-next-images.outputs.version }}+ channel: nextenv:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}- GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}- BUILD_NEXT: 'true'- SKIP_RELEASE: 'true'- SKIP_CHANGELOG: 'true'- NEXT_IMAGE_VERSION: ${{ needs.next-version.outputs.version }}- GORELEASER_PREVIOUS_TAG: ${{ needs.next-version.outputs.previous-tag }}diff --git a/.depot/workflows/prune-ecr-public-next-images.yml b/.depot/workflows/prune-ecr-public-next-images.ymlindex 03133715d..ba79f7f67 100644--- a/.depot/workflows/prune-ecr-public-next-images.yml+++ b/.depot/workflows/prune-ecr-public-next-images.yml@@ -6,10 +6,11 @@ on:workflow_dispatch:concurrency:- group: prune-ecr-public-next-images+ group: build-next-imagescancel-in-progress: false-permissions: {}+permissions:+ contents: readjobs:prune:@@ -30,25 +31,13 @@ jobs:username: ${{ secrets.ECR_PUBLIC_ACCESS_KEY_ID }}password: ${{ secrets.ECR_PUBLIC_SECRET_ACCESS_KEY }}+ - name: Checkout code+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1++ - name: Setup ORAS+ uses: oras-project/setup-oras@005458ad77f1c8facd38a094e4af2e69e5607ff4 # v2.0.2+ with:+ version: 1.3.1+- name: Delete stale next images- run: |- # Release and next tags stay, along with the manifests they reference and cosign referrers that point at them.- # ECR Public has no lifecycle policies, so this keeps overwritten next images from eating the free tier.- cutoff=$(date -u -d '1 hour ago' +%FT%T)- for repo in manager agent; do- image="public.ecr.aws/getarcaneapp/$repo"- aws ecr-public describe-images --repository-name "$repo" --output json > "$RUNNER_TEMP/images.json"- jq -r '.imageDetails[] | select(.imageTags) | .imageDigest' "$RUNNER_TEMP/images.json" > "$RUNNER_TEMP/tagged.txt"- while read -r digest; do- docker buildx imagetools inspect "$image@$digest" --raw | jq -r '.manifests[]?.digest'- done < "$RUNNER_TEMP/tagged.txt" | cat - "$RUNNER_TEMP/tagged.txt" | sort -u > "$RUNNER_TEMP/keep.txt"- : > "$RUNNER_TEMP/delete.txt"- while read -r digest; do- subject=$(docker buildx imagetools inspect "$image@$digest" --raw | jq -r '.subject.digest // empty')- if [[ -z "$subject" ]] || ! grep -qxF "$subject" "$RUNNER_TEMP/keep.txt"; then- echo "$digest" >> "$RUNNER_TEMP/delete.txt"- fi- done < <(jq -r --arg cutoff "$cutoff" '.imageDetails[] | select((.imageTags | not) and .imagePushedAt < $cutoff) | .imageDigest' "$RUNNER_TEMP/images.json" | sort -u | comm -23 - "$RUNNER_TEMP/keep.txt")- sed 's/^/imageDigest=/' "$RUNNER_TEMP/delete.txt" | xargs -r -n 100 aws ecr-public batch-delete-image --repository-name "$repo" --image-ids > /dev/null- echo "$repo: deleted $(wc -l < "$RUNNER_TEMP/delete.txt" | tr -d ' ') stale manifests" >> "$GITHUB_STEP_SUMMARY"- done+ run: bash scripts/ci/prune-ecr-images.shdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 5fddc8f7b..7dd6e9e61 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -128,6 +128,10 @@ jobs:build:name: Build and attestneeds: prepare+ outputs:+ manager-digest: ${{ steps.digests.outputs.manager }}+ agent-digest: ${{ steps.digests.outputs.agent }}+ version: ${{ needs.prepare.outputs.version }}if: needs.prepare.outputs.tag != ''runs-on: depot-ubuntu-24.04-16permissions:@@ -139,10 +143,8 @@ jobs:env:RELEASE_TAG: ${{ needs.prepare.outputs.tag }}- MANAGER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/arcane- MANAGER_IMAGE_ALIAS: ghcr.io/${{ github.repository_owner }}/manager- AGENT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/arcane-headless- AGENT_IMAGE_ALIAS: ghcr.io/${{ github.repository_owner }}/agent+ MANAGER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/manager+ AGENT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/agentsteps:- name: Checkout@@ -166,24 +168,12 @@ jobs:with:configure-docker: true- - name: Login to container registries+ - name: Login to GHCRuses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0with:- registry-auth: |- - registry: ghcr.io- username: ${{ github.repository_owner }}- password: ${{ secrets.GITHUB_TOKEN }}- - registry: quay.io- username: ${{ secrets.QUAY_USERNAME }}- password: ${{ secrets.QUAY_TOKEN }}- - registry: docker.io- username: ${{ secrets.DOCKER_USER }}- password: ${{ secrets.DOCKER_PAT }}- - registry: public.ecr.aws- username: ${{ secrets.ECR_PUBLIC_ACCESS_KEY_ID }}- password: ${{ secrets.ECR_PUBLIC_SECRET_ACCESS_KEY }}- env:- AWS_REGION: us-east-1+ registry: ghcr.io+ username: ${{ github.repository_owner }}+ password: ${{ secrets.GITHUB_TOKEN }}- name: Install Frontend Dependenciesrun: just deps install frontend@@ -205,6 +195,13 @@ jobs:- name: Install cosignuses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2+ with:+ cosign-release: v3.0.6++ - name: Setup ORAS+ uses: oras-project/setup-oras@005458ad77f1c8facd38a094e4af2e69e5607ff4 # v2.0.2+ with:+ version: 1.3.1- name: Capture frontend build versionsid: frontend-versions@@ -242,7 +239,7 @@ jobs:with:distribution: goreleaser-proversion: "~> v2"- args: release --clean --skip=validate+ args: release --clean --skip=validate,announceenv:GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}@@ -262,11 +259,19 @@ jobs:OPENAI_BASE_URL: https://openrouter.ai/api/v1OPENAI_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}- - name: Resolve image digests+ - name: Resolve canonical image digestsid: digests+ env:+ IMAGE_VERSION: ${{ needs.prepare.outputs.version }}run: |- echo "manager=$(docker buildx imagetools inspect "${MANAGER_IMAGE_NAME}:${RELEASE_TAG}" --format '{{ .Manifest.Digest }}')" >> "$GITHUB_OUTPUT"- echo "agent=$(docker buildx imagetools inspect "${AGENT_IMAGE_NAME}:${RELEASE_TAG}" --format '{{ .Manifest.Digest }}')" >> "$GITHUB_OUTPUT"+ for image in manager agent; do+ digest=$(oras resolve "ghcr.io/getarcaneapp/$image:v$IMAGE_VERSION")+ if [[ ! "$digest" =~ ^sha256:[0-9a-f]{64}$ ]]; then+ echo "::error::Invalid canonical digest for $image: $digest"+ exit 1+ fi+ echo "$image=$digest" >> "$GITHUB_OUTPUT"+ done- name: Container image attestation (manager)uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2@@ -275,30 +280,92 @@ jobs:subject-digest: ${{ steps.digests.outputs.manager }}push-to-registry: true- - name: Container image attestation (manager alias)+ - name: Container image attestation (agent)uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2with:- subject-name: ${{ env.MANAGER_IMAGE_ALIAS }}- subject-digest: ${{ steps.digests.outputs.manager }}+ subject-name: ${{ env.AGENT_IMAGE_NAME }}+ subject-digest: ${{ steps.digests.outputs.agent }}push-to-registry: true- - name: Container image attestation (agent)+ publish-images:+ name: Publish ${{ matrix.registry }}+ needs: [prepare, build]+ runs-on: depot-ubuntu-latest+ permissions:+ contents: read+ packages: write+ strategy:+ fail-fast: false+ matrix:+ include:+ - registry: ghcr.io+ username-secret: GHCR_USERNAME+ password-secret: GITHUB_TOKEN+ - registry: docker.io+ username-secret: DOCKER_USER+ password-secret: DOCKER_PAT+ - registry: quay.io+ username-secret: QUAY_USERNAME+ password-secret: QUAY_TOKEN+ - registry: public.ecr.aws+ username-secret: ECR_PUBLIC_ACCESS_KEY_ID+ password-secret: ECR_PUBLIC_SECRET_ACCESS_KEY++ steps:+ - name: Checkout code+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ with:+ ref: ${{ needs.prepare.outputs.commit }}++ - name: Publish registry images+ uses: ./.depot/actions/publish-images+ with:+ registry: ${{ matrix.registry }}+ username: ${{ matrix.registry == 'ghcr.io' && github.repository_owner || secrets[matrix.username-secret] }}+ password: ${{ secrets[matrix.password-secret] }}+ manager-digest: ${{ needs.build.outputs.manager-digest }}+ agent-digest: ${{ needs.build.outputs.agent-digest }}+ version: ${{ needs.build.outputs.version }}+ channel: release+ env:+ COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}+ COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}++ attest-aliases:+ name: Attest GHCR aliases+ needs: [prepare, build, publish-images]+ runs-on: depot-ubuntu-latest+ permissions:+ contents: read+ packages: write+ attestations: write+ artifact-metadata: write+ id-token: write+ steps:+ - name: Login to GHCR+ uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0+ with:+ registry: ghcr.io+ username: ${{ github.repository_owner }}+ password: ${{ secrets.GITHUB_TOKEN }}++ - name: Container image attestation (manager alias)uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2with:- subject-name: ${{ env.AGENT_IMAGE_NAME }}- subject-digest: ${{ steps.digests.outputs.agent }}+ subject-name: ghcr.io/getarcaneapp/arcane+ subject-digest: ${{ needs.build.outputs.manager-digest }}push-to-registry: true- name: Container image attestation (agent alias)uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2with:- subject-name: ${{ env.AGENT_IMAGE_ALIAS }}- subject-digest: ${{ steps.digests.outputs.agent }}+ subject-name: ghcr.io/getarcaneapp/arcane-headless+ subject-digest: ${{ needs.build.outputs.agent-digest }}push-to-registry: truepublish:name: Publish release- needs: [prepare, build]+ needs: [prepare, build, publish-images, attest-aliases]runs-on: depot-ubuntu-lateststeps:diff --git a/.goreleaser.yaml b/.goreleaser.yamlindex 3829ad47f..ea3615628 100644--- a/.goreleaser.yaml+++ b/.goreleaser.yaml@@ -93,7 +93,6 @@ builds:mod_timestamp: '{{ .CommitTimestamp }}'- id: arcane-cli- skip: '{{ if index .Env "IMAGE_REGISTRY" }}true{{ end }}'main: .dir: clibinary: arcane-cli@@ -160,7 +159,6 @@ notarize:signs:- id: cosign-checksums- if: '{{ not (index .Env "IMAGE_REGISTRY") }}'cmd: cosignartifacts: checksumsignature: '${artifact}.sigstore.json'@@ -175,19 +173,19 @@ signs:checksum:extra_files:- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_linux_amd64_v1/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_linux_amd64_v1/arcane-cli'name_template: arcane-cli_linux_amd64- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_linux_arm64_v8.0/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_linux_arm64_v8.0/arcane-cli'name_template: arcane-cli_linux_arm64- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_linux_386_sse2/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_linux_386_sse2/arcane-cli'name_template: arcane-cli_linux_386- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_linux_arm_7/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_linux_arm_7/arcane-cli'name_template: arcane-cli_linux_armv7- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_linux_riscv64_rva20u64/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_linux_riscv64_rva20u64/arcane-cli'name_template: arcane-cli_linux_riscv64- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_darwin_amd64_v1/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_darwin_amd64_v1/arcane-cli'name_template: arcane-cli_darwin_amd64- - glob: '{{ if not (index .Env "IMAGE_REGISTRY") }}dist/arcane-cli_darwin_arm64_v8.0/arcane-cli{{ end }}'+ - glob: 'dist/arcane-cli_darwin_arm64_v8.0/arcane-cli'name_template: arcane-cli_darwin_arm64nightly:@@ -273,22 +271,16 @@ homebrew_casks:name: homebrew-tapcommit_msg_template: 'chore(brew): update {{ .ProjectName }} to {{ .Tag }}'-# IMAGE_REGISTRY selects one destination in the independent CI image jobs.dockers_v2:- id: arcane-imageids:- arcanedockerfile: docker/Dockerfile-staticimages:- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "ghcr.io") }}ghcr.io/getarcaneapp/arcane{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "ghcr.io") }}ghcr.io/getarcaneapp/manager{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "docker.io") }}getarcaneapp/manager{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "quay.io") }}quay.io/getarcaneapp/manager{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "public.ecr.aws") }}public.ecr.aws/getarcaneapp/manager{{ end }}'+ - ghcr.io/getarcaneapp/managertags:- '{{ if index .Env "BUILD_NEXT" }}next{{ end }}'- # ECR Public next builds publish only the moving next tag so nothing accumulates there- - '{{ if not (and (index .Env "BUILD_NEXT") (eq (index .Env "IMAGE_REGISTRY") "public.ecr.aws")) }}v{{ .Version }}{{ end }}'+ - 'v{{ .Version }}'- '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}.{{ .Minor }}{{ end }}'- '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}{{ end }}'- '{{ if not (index .Env "BUILD_NEXT") }}latest{{ end }}'@@ -308,22 +300,17 @@ dockers_v2:'org.opencontainers.image.title': 'Arcane''org.opencontainers.image.description': 'Modern Docker Management, Made for Everyone''com.getarcaneapp.arcane': 'true'- sbom: true+ sbom: '{{ if eq (index .Env "BUILD_NEXT") "true" }}false{{ else }}true{{ end }}'- id: arcane-agent-imageids:- arcane-agentdockerfile: docker/Dockerfile-agent-staticimages:- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "ghcr.io") }}ghcr.io/getarcaneapp/arcane-headless{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "ghcr.io") }}ghcr.io/getarcaneapp/agent{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "docker.io") }}getarcaneapp/agent{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "quay.io") }}quay.io/getarcaneapp/agent{{ end }}'- - '{{ if or (not (index .Env "IMAGE_REGISTRY")) (eq (index .Env "IMAGE_REGISTRY") "public.ecr.aws") }}public.ecr.aws/getarcaneapp/agent{{ end }}'+ - ghcr.io/getarcaneapp/agenttags:- '{{ if index .Env "BUILD_NEXT" }}next{{ end }}'- # ECR Public next builds publish only the moving next tag so nothing accumulates there- - '{{ if not (and (index .Env "BUILD_NEXT") (eq (index .Env "IMAGE_REGISTRY") "public.ecr.aws")) }}v{{ .Version }}{{ end }}'+ - 'v{{ .Version }}'- '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}.{{ .Minor }}{{ end }}'- '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}{{ end }}'- '{{ if not (index .Env "BUILD_NEXT") }}latest{{ end }}'@@ -343,7 +330,7 @@ dockers_v2:'org.opencontainers.image.title': 'Arcane Agent''org.opencontainers.image.description': 'Arcanes Remote Agent''com.getarcaneapp.arcane.agent': 'true'- sbom: true+ sbom: '{{ if eq (index .Env "BUILD_NEXT") "true" }}false{{ else }}true{{ end }}'docker_signs:- id: cosign-images@@ -386,7 +373,7 @@ blobs:- glob: dist/arcane_*_checksums.txt.sigstore.jsonname_template: arcane-cli_checksums.txt.sigstore.jsoninclude_meta: false- disable: '{{ if or (index .Env "IMAGE_REGISTRY") (not (index .Env "BUILD_NEXT")) }}true{{ end }}'+ disable: '{{ if not (index .Env "BUILD_NEXT") }}true{{ end }}'- provider: s3endpoint: '{{ index .Env "R2_ENDPOINT" }}'@@ -401,7 +388,7 @@ blobs:- glob: dist/arcane_*_checksums.txt.sigstore.jsonname_template: arcane_checksums.txt.sigstore.jsoninclude_meta: false- disable: '{{ if or (index .Env "IMAGE_REGISTRY") (not (index .Env "BUILD_NEXT")) }}true{{ end }}'+ disable: '{{ if not (index .Env "BUILD_NEXT") }}true{{ end }}'changelog:disable: '{{ if isEnvSet "SKIP_CHANGELOG" }}true{{ else if isEnvSet "OPENAI_API_KEY" }}false{{ else }}true{{ end }}'@@ -420,7 +407,7 @@ changelog:- '^revert'ai:use: openai- model: openai/gpt-5.6-luna-pro+ model: openai/gpt-6-luna-proprompt: |Rewrite these release notes for Arcane, a Docker management app.Start with a short intro highlighting the most notable changes, wrappeddiff --git a/Justfile b/Justfileindex 2e0f58002..3b64d5211 100644--- a/Justfile+++ b/Justfile@@ -1021,7 +1021,7 @@ next-image-version mode="":NEXT_BASE="${MAJOR}.${MINOR}.$((PATCH + 1))"fi- GHCR_IMAGE="${GHCR_IMAGE:-getarcaneapp/arcane}"+ GHCR_IMAGE="${GHCR_IMAGE:-getarcaneapp/manager}"if [ -n "${GHCR_TAGS+x}" ]; thenTAGS="$GHCR_TAGS"elsediff --git a/README.md b/README.mdindex bc32a21e8..deafc9e15 100644--- a/README.md+++ b/README.md@@ -1,5 +1,5 @@> [!IMPORTANT]-> Feature requests have moved to [Discussions](https://github.com/getarcaneapp/arcane/discussions/categories/feature-requests). Open new requests and upvote existing ones there; issues are only used for Bug reports now to help maintain priority on those issues.+> Feature requests have moved to [Discussions](https://github.com/getarcaneapp/arcane/discussions/categories/feature-requests). Open new requests and upvote existing ones there; issues are only used for Bug reports now to help maintain priority on those issues.<div align="center">diff --git a/backend/pkg/scheduler/scheduler.go b/backend/pkg/scheduler/scheduler.goindex 5c4638772..57436a632 100644--- a/backend/pkg/scheduler/scheduler.go+++ b/backend/pkg/scheduler/scheduler.go@@ -375,7 +375,11 @@ func (js *jobSchedulerInternal) upsertJobInternal(ctx context.Context, state *scif previousSchedule == "" && shouldSchedule {slog.InfoContext(ctx, "Starting Job", "name", jobName, "schedule", schedule)} else if previousSchedule != schedule || hadPreviousEntry != shouldSchedule {- slog.InfoContext(ctx, "Job rescheduled", "name", jobName, "previousSchedule", previousSchedule, "newSchedule", schedule, "nextRun", nextRun)+ var nextRunValue any+ if nextRun != nil {+ nextRunValue = *nextRun+ }+ slog.InfoContext(ctx, "Job rescheduled", "name", jobName, "previousSchedule", previousSchedule, "newSchedule", schedule, "nextRun", nextRunValue)}slog.DebugContext(ctx, "Job scheduled", "name", jobName, "scheduled", shouldSchedule, "contextCanceled", ctx.Err() != nil)return nildiff --git a/scripts/ci/prune-ecr-images.sh b/scripts/ci/prune-ecr-images.shnew file mode 100644index 000000000..a12b41b89--- /dev/null+++ b/scripts/ci/prune-ecr-images.sh@@ -0,0 +1,66 @@+#!/usr/bin/env bash+set -euo pipefail++workspace=$(mktemp -d)+trap 'rm -r "$workspace"' EXIT+cutoff=$(date -u -d '1 hour ago' +%s)+for repo in manager agent; do+ directory="$workspace/$repo"+ mkdir -p "$directory/manifests"+ image="public.ecr.aws/getarcaneapp/$repo"+ aws ecr-public describe-images --repository-name "$repo" --output json >"$directory/images.json"+ jq -r '.imageDetails[].imageDigest' "$directory/images.json" >"$directory/digests"+ jq -r '.imageDetails[] | select(.imageTags | length > 0) | .imageDigest' "$directory/images.json" | sort -u >"$directory/roots"++ # Read every subject link before deciding what is safe to delete.+ while read -r digest; do+ oras manifest fetch "$image@$digest" >"$directory/manifest.json"+ jq -e '.schemaVersion == 2' "$directory/manifest.json" >/dev/null+ jq --arg digest "$digest" '. + {digest: $digest}' "$directory/manifest.json" >"$directory/manifests/$digest.json"+ done <"$directory/digests"+ jq -s '[.[] | {digest, subject: .subject.digest}]' "$directory/manifests/"*.json >"$directory/subjects.json"++ cp "$directory/roots" "$directory/pending"+ : >"$directory/keep"+ while [[ -s "$directory/pending" ]]; do+ digest=$(head -n 1 "$directory/pending")+ tail -n +2 "$directory/pending" >"$directory/remaining"+ mv "$directory/remaining" "$directory/pending"+ if grep -qxF "$digest" "$directory/keep"; then+ continue+ fi+ jq -r '.manifests[]?.digest' "$directory/manifests/$digest.json" >>"$directory/pending"+ jq -r --arg subject "$digest" '.[] | select(.subject == $subject) | .digest' "$directory/subjects.json" >>"$directory/pending"+ echo "$digest" >>"$directory/keep"+ done+ sort -u "$directory/keep" -o "$directory/keep"+ jq -r --argjson cutoff "$cutoff" '+ .imageDetails[] | select((.imageTags | length) == 0) |+ (.imagePushedAt | if type == "number" then . else sub("\\.[0-9]+"; "") | sub("\\+00:00$"; "Z") | fromdateiso8601 end) as $pushed |+ select($pushed < $cutoff) | .imageDigest+ ' "$directory/images.json" | sort -u >"$directory/candidates"+ comm -23 "$directory/candidates" "$directory/keep" >"$directory/delete"+done++# Abort if either repository changed its tagged roots during traversal.+for repo in manager agent; do+ directory="$workspace/$repo"+ aws ecr-public describe-images --repository-name "$repo" --output json >"$directory/current.json"+ jq -r '.imageDetails[] | select(.imageTags | length > 0) | .imageDigest' "$directory/current.json" | sort -u >"$directory/current-roots"+ cmp "$directory/roots" "$directory/current-roots"+done+for repo in manager agent; do+ directory="$workspace/$repo"+ deleted=$(wc -l <"$directory/delete" | tr -d ' ')+ while [[ -s "$directory/delete" ]]; do+ args=()+ while read -r digest; do+ args+=("imageDigest=$digest")+ done < <(head -n 100 "$directory/delete")+ aws ecr-public batch-delete-image --repository-name "$repo" --image-ids "${args[@]}" --output json >"$directory/result.json"+ jq -e '(.failures // [] | length) == 0' "$directory/result.json" >/dev/null+ tail -n +101 "$directory/delete" >"$directory/remaining"+ mv "$directory/remaining" "$directory/delete"+ done+ echo "$repo: deleted $deleted stale manifests" >>"$GITHUB_STEP_SUMMARY"+donediff --git a/scripts/ci/publish-images.sh b/scripts/ci/publish-images.shnew file mode 100644index 000000000..210fb7d1f--- /dev/null+++ b/scripts/ci/publish-images.sh@@ -0,0 +1,95 @@+#!/usr/bin/env bash+set -euo pipefail++case "$IMAGE_REGISTRY" in+ ghcr.io | docker.io | quay.io | public.ecr.aws) ;;+ *)+ echo 'Unsupported registry' >&2+ exit 1+ ;;+esac+for digest in "$MANAGER_DIGEST" "$AGENT_DIGEST"; do+ if [[ ! "$digest" =~ ^sha256:[0-9a-f]{64}$ ]]; then+ echo "Invalid canonical digest: $digest" >&2+ exit 1+ fi+done++case "$IMAGE_CHANNEL" in+ next)+ [[ "$IMAGE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-next\.[0-9]+$ ]]+ moving_tag=next+ tags=("v$IMAGE_VERSION" next)+ if [[ "$IMAGE_REGISTRY" == public.ecr.aws ]]; then+ tags=(next)+ fi+ ;;+ release)+ [[ "$IMAGE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]+ IFS=. read -r major minor _ <<<"$IMAGE_VERSION"+ moving_tag=latest+ tags=("v$IMAGE_VERSION" "v$major.$minor" "v$major" latest)+ ;;+ *)+ echo 'Unsupported release channel' >&2+ exit 1+ ;;+esac++# An old retry must not move the destination tags backward.+for role in manager agent; do+ if [[ "$role" == manager ]]; then+ expected=$MANAGER_DIGEST+ else+ expected=$AGENT_DIGEST+ fi+ actual=$(oras resolve "ghcr.io/getarcaneapp/$role:$moving_tag")+ if [[ "$actual" != "$expected" ]]; then+ echo "Obsolete publishing run for $role: expected=$expected actual=$actual" >&2+ exit 1+ fi+done++copy_log=$(mktemp)+trap 'rm "$copy_log"' EXIT+for role in manager agent; do+ if [[ "$role" == manager ]]; then+ digest=$MANAGER_DIGEST+ alias=arcane+ else+ digest=$AGENT_DIGEST+ alias=arcane-headless+ fi+ source_image="ghcr.io/getarcaneapp/$role@$digest"+ destination="$IMAGE_REGISTRY/getarcaneapp/$role"+ if [[ "$IMAGE_REGISTRY" == ghcr.io ]]; then+ destination="$IMAGE_REGISTRY/getarcaneapp/$alias"+ fi++ copied=false+ for delay in 0 5 15 30; do+ if [[ "$delay" != 0 ]]; then+ sleep "$delay"+ fi+ if oras cp --recursive "$source_image" "$destination:${tags[0]}" >"$copy_log" 2>&1; then+ cat "$copy_log"+ copied=true+ break+ fi+ cat "$copy_log" >&2+ if grep -Eqi '401|403|unauthorized|denied' "$copy_log" \+ || ! grep -Eqi '429|500|502|503|504|timeout|timed out|connection|temporary|temporarily|unexpected EOF' "$copy_log"; then+ break+ fi+ done+ if [[ "$copied" != true ]]; then+ echo "Copy failed: $source_image to $destination:${tags[0]}" >&2+ exit 1+ fi++ if [[ "${#tags[@]}" -gt 1 ]]; then+ oras tag "$destination@$digest" "${tags[@]:1}"+ fi+ cosign sign --key env://COSIGN_PRIVATE_KEY --yes "$destination@$digest"+ printf '%s tags=%s digest=%s copied and signed\n' "$destination" "${tags[*]}" "$digest" | tee -a "$GITHUB_STEP_SUMMARY"+done