Files
TheRock/rocm-systems/projects/rccl/tools/ci/lib/rocm-ref.sh
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

48 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Reference-count the shared ROCm cache. References are acquired by fetch-rocm.sh
# (ROCM_REF_TOKEN) under a per-version lock and dropped here at end of run.
#
# rocm-ref.sh release Drop this run's reference for ROCM_RELEASE. The tree is
# kept warm; fetch-rocm.sh prunes unreferenced nightly/rc
# versions on the next version bump.
#
# Environment:
# RCCL_DEVICE_API_CACHE Cache root (default: /apps/rccl-ci)
# ROCM_RELEASE Concrete version (required; empty => no-op)
# ROCM_REF_TOKEN This run's reference token (e.g. <run_id>-<attempt>)
set -euo pipefail
op="${1:-}"
# "release-gc" is accepted as a legacy alias for "release".
if [[ "${op}" != "release" && "${op}" != "release-gc" ]]; then
echo "usage: $0 release" >&2
exit 2
fi
ref_token="${ROCM_REF_TOKEN:-}"
CACHE_DIR="${RCCL_DEVICE_API_CACHE:-/apps/rccl-ci}"
if [[ -z "${ROCM_RELEASE:-}" ]]; then
echo "==> ROCM_RELEASE is empty; nothing to release"
exit 0
fi
ROCM_PATH="${CACHE_DIR}/rocm/rocm-${ROCM_RELEASE}"
refs_dir="${ROCM_PATH}.refs"
lock_file="${CACHE_DIR}/downloads/.lock-${ROCM_RELEASE}"
mkdir -p "${CACHE_DIR}/downloads"
# Lock the version so we order against fetch-rocm.sh's acquire/prune.
exec {lock_fd}>"${lock_file}"
flock "${lock_fd}"
if [[ -n "${ref_token}" ]]; then
rm -f "${refs_dir}/${ref_token}"
echo "==> Released ROCm reference ${ref_token} (kept ${ROCM_PATH} warm)"
else
echo "==> No ROCM_REF_TOKEN set; nothing to release"
fi
flock -u "${lock_fd}"