Fix cause of checksum failures in public binary mirror (#32407)

Move the copying of the buildcache to a root job that runs after all the child
pipelines have finished, so that the operation can be coordinated across all
child pipelines to remove the possibility of race conditions during potentially
simlutandous copies. This lets us ensure the .spec.json.sig and .spack files
for any spec in the root mirror always come from the same child pipeline
mirror (though which pipeline is arbitrary).  It also allows us to avoid copying
of duplicates, which we now do.
This commit is contained in:
Scott Wittenburg
2022-09-01 15:29:44 -06:00
committed by GitHub
parent d9313cf561
commit 6239198d65
4 changed files with 119 additions and 49 deletions

View File

@@ -12,7 +12,7 @@ default:
- /^pr[\d]+_.*$/
- /^github\/pr[\d]+_.*$/
variables:
SPACK_BUILDCACHE_DESTINATION: "s3://spack-binaries-prs/${CI_COMMIT_REF_NAME}"
SPACK_BUILDCACHE_DESTINATION: "s3://spack-binaries-prs/${CI_COMMIT_REF_NAME}/${SPACK_CI_STACK_NAME}"
SPACK_PIPELINE_TYPE: "spack_pull_request"
SPACK_PRUNE_UNTOUCHED: "True"
@@ -88,7 +88,7 @@ default:
protected-publish:
stage: publish
extends: [ ".protected-refs" ]
extends: [ ".protected" ]
image: "ghcr.io/spack/python-aws-bash:0.0.1"
tags: ["spack", "public", "medium", "aws", "x86_64"]
variables:
@@ -97,7 +97,9 @@ protected-publish:
script:
- . "./share/spack/setup-env.sh"
- spack --version
- spack buildcache update-index --mirror-url "s3://spack-binaries/${CI_COMMIT_REF_NAME}"
- export COPY_SPECS_DIR=${CI_PROJECT_DIR}/jobs_scratch_dir/specs_to_copy
- spack buildcache sync --manifest-glob "${COPY_SPECS_DIR}/*.json"
- spack buildcache update-index --mirror-url ${SPACK_COPY_BUILDCACHE}
########################################
# TEMPLATE FOR ADDING ANOTHER PIPELINE