From dfdafe207fd7e128e03c9ad2c7b60043c3be270b Mon Sep 17 00:00:00 2001 From: copilotcoder Date: Tue, 26 May 2026 20:44:53 -0400 Subject: [PATCH] Attempting to fix the CICD again again again. Signed-off-by: copilotcoder --- .gitea/workflows/cicd-base.yml | 45 ++++++++-------------------------- .gitea/workflows/cicd.yml | 16 +++++++----- 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/.gitea/workflows/cicd-base.yml b/.gitea/workflows/cicd-base.yml index 2b00875..2f36b67 100644 --- a/.gitea/workflows/cicd-base.yml +++ b/.gitea/workflows/cicd-base.yml @@ -285,49 +285,24 @@ jobs: echo "${GITEA_REGISTRY_IP} ${GITEA_REGISTRY_HOST}" >> /etc/hosts fi - echo "${PACKAGE_ACCESS_TOKEN}" | docker login "http://${GITEA_REGISTRY}" -u "${REGISTRY_USER}" --password-stdin >/dev/null 2>&1 - - if ! command -v skopeo >/dev/null 2>&1; then - if command -v apt-get >/dev/null 2>&1; then - apt-get update && apt-get install -y skopeo - elif command -v apk >/dev/null 2>&1; then - apk add --no-cache skopeo - fi - fi - - if ! command -v skopeo >/dev/null 2>&1; then - echo "❌ skopeo not available for verification" + if ! echo "${PACKAGE_ACCESS_TOKEN}" | docker login "http://${GITEA_REGISTRY}" -u "${REGISTRY_USER}" --password-stdin; then + echo "❌ Registry login failed during verification" exit 1 fi - for i in 1 2 3 4 5 6 7 8 9 10 11 12; do - echo "Verification attempt ${i}/12 for ${BASE_REF_HASH}..." + for i in 1 2 3 4 5 6; do + echo "Verification attempt ${i}/6 for ${BASE_REF_HASH}..." - if skopeo inspect \ - --creds "${REGISTRY_USER}:${PACKAGE_ACCESS_TOKEN}" \ - --tls-verify=false \ - "docker://${BASE_REF_HASH}" >/tmp/cicd-base-verify.json 2>/tmp/cicd-base-verify.err; then - echo "✓ Registry manifest verified for ${BASE_REF_HASH}" - - if docker pull "${BASE_REF_HASH}" >/dev/null 2>&1; then - echo "✓ Published base image is pullable: ${BASE_REF_HASH}" - exit 0 - fi - - echo "⚠ Manifest is visible but docker pull still failed; retrying." - else - echo "⚠ Verification attempt ${i} failed:" - cat /tmp/cicd-base-verify.err + if docker pull "${BASE_REF_HASH}"; then + echo "✓ Published base image is pullable: ${BASE_REF_HASH}" + exit 0 fi - if [ "${i}" -lt 12 ]; then + if [ "${i}" -lt 6 ]; then + echo "⚠ Pull failed; waiting 20s before retry" sleep 20 fi done - echo "❌ Published base image could not be verified after 12 attempts: ${BASE_REF_HASH}" - if [ -f /tmp/cicd-base-verify.err ]; then - echo "=== Last verification error ===" - cat /tmp/cicd-base-verify.err - fi + echo "❌ Published base image could not be pulled after 6 attempts: ${BASE_REF_HASH}" exit 1 diff --git a/.gitea/workflows/cicd.yml b/.gitea/workflows/cicd.yml index 65f153a..e920c8f 100644 --- a/.gitea/workflows/cicd.yml +++ b/.gitea/workflows/cicd.yml @@ -278,8 +278,11 @@ jobs: echo "Waiting for immutable base image: ${BASE_IMAGE}" - for i in 1 2 3 4 5 6; do - echo "Base availability check ${i}/6..." + max_attempts=40 + sleep_seconds=30 + + for i in $(seq 1 "${max_attempts}"); do + echo "Base availability check ${i}/${max_attempts}..." if timeout 30 docker manifest inspect "${BASE_IMAGE}" >/dev/null 2>&1 && \ timeout 60 docker pull "${BASE_IMAGE}" >/dev/null 2>&1; then @@ -287,14 +290,15 @@ jobs: break fi - if [ "${i}" -eq 6 ]; then + if [ "${i}" -eq "${max_attempts}" ]; then echo "❌ Required immutable base image is not available: ${BASE_IMAGE}" - echo "Publish the base image via the CICD Base Image workflow before rerunning main CI." + echo "Timed out after $((max_attempts * sleep_seconds))s waiting for base image publish." + echo "Ensure CICD Base Image workflow is still running or has completed successfully, then rerun main CI." exit 1 fi - echo "⚠ Base image not available yet; waiting 10s for publish workflow" - sleep 10 + echo "⚠ Base image not available yet; waiting ${sleep_seconds}s for publish workflow" + sleep "${sleep_seconds}" done # Create temporary SSH key file for BuildKit secrets