Files
TheRock/rocm-systems/.github/workflows/hipfile-image-update-nightly.yml
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

131 lines
5.7 KiB
YAML

name: update_nightly_CI_image
run-name: Refresh the latest nightly hipFile CI image
env:
AIS_DOCKER_REGISTRY: ghcr.io/${{ github.repository_owner }}/hipfile
on:
schedule:
# ~10:00 UTC daily. The ROCm nightly publish runs ~02:00 UTC, leaving ~8h of
# buffer. This job is purely an optimization: if it is late/failed/builds
# against an incomplete nightly, per-PR runs fall back to building the nightly
# image on demand.
- cron: "0 2 * * *"
workflow_dispatch:
# Refresh on merge of a Dockerfile/resolver change so the published nightly
# image + floating cache track develop. Without this, the per-PR registry
# skip could serve an image built from an out-of-date Dockerfile.
pull_request_target:
types:
- closed
branches:
- develop
paths:
- projects/hipfile/util/docker/**
- projects/hipfile/util/resolve-rocm-nightly.sh
- .github/workflows/hipfile-image-update-nightly.yml
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
# Resolve runs on the runner (not the docker:28.5 container) because the
# resolver needs curl/bash, which the Alpine-based docker image lacks.
resolve_nightly:
# pull_request_target/closed fires for un-merged PRs too; only act on merges.
# (The downstream build job needs this one, so skipping here skips both.)
if: ${{ github.event_name != 'pull_request_target' || github.event.pull_request.merged == true }}
runs-on: [ubuntu-24.04]
outputs:
nightly_build: ${{ steps.nightly.outputs.nightly_build }}
nightly_rocm_version: ${{ steps.nightly.outputs.nightly_rocm_version }}
steps:
- name: Fetching code repository...
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
sparse-checkout: |
projects/hipfile
.github/workflows
- name: Resolve ROCm nightly metadata
id: nightly
working-directory: projects/hipfile
run: ./util/resolve-rocm-nightly.sh | tee -a "${GITHUB_OUTPUT}"
update_nightly_AIS_CI_image:
needs: resolve_nightly
env:
AIS_CI_IMAGE_NAME: ais_ci_ubuntu
AIS_INPUT_PLATFORM: ubuntu
AIS_NIGHTLY_BUILD: ${{ needs.resolve_nightly.outputs.nightly_build }}
AIS_NIGHTLY_ROCM_VERSION: ${{ needs.resolve_nightly.outputs.nightly_rocm_version }}
runs-on: [ubuntu-24.04]
container: docker:28.5
steps:
- name: Fetching code repository...
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
sparse-checkout: |
projects/hipfile
.github/workflows
- name: Authenticating to GitHub Container Registry.
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set target nightly AIS CI image
id: ci-image
# The image tag carries the resolved build id for reproducibility; the
# cache refs stay floating (no build id) so each day's build reuses the
# previous day's layers.
run: |
AIS_CI_IMAGE="${AIS_DOCKER_REGISTRY}/${AIS_CI_IMAGE_NAME}:latest-rocm-nightly-${AIS_NIGHTLY_BUILD}"
echo "AIS_CI_IMAGE=$(printf '%s' "${AIS_CI_IMAGE}" | tr '[:upper:]' '[:lower:]')" >> "${GITHUB_OUTPUT}"
AIS_CI_IMAGE_NVIDIA="${AIS_CI_IMAGE}-nvidia"
echo "AIS_CI_IMAGE_NVIDIA=$(printf '%s' "${AIS_CI_IMAGE_NVIDIA}" | tr '[:upper:]' '[:lower:]')" >> "${GITHUB_OUTPUT}"
AIS_CI_CACHE="${AIS_DOCKER_REGISTRY}/${AIS_CI_IMAGE_NAME}:latest-rocm-nightly-cache"
echo "AIS_CI_CACHE=$(printf '%s' "${AIS_CI_CACHE}" | tr '[:upper:]' '[:lower:]')" >> "${GITHUB_OUTPUT}"
AIS_CI_CACHE_NVIDIA="${AIS_DOCKER_REGISTRY}/${AIS_CI_IMAGE_NAME}:latest-rocm-nightly-nvidia-cache"
echo "AIS_CI_CACHE_NVIDIA=$(printf '%s' "${AIS_CI_CACHE_NVIDIA}" | tr '[:upper:]' '[:lower:]')" >> "${GITHUB_OUTPUT}"
- name: Setup Docker Builder
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
with:
name: ais-builder
driver: docker-container
cache-binary: false # True uses the GHA Cache Backend
- name: Build & Push latest nightly base image for AIS CI
run: |
docker buildx build \
-f "${GITHUB_WORKSPACE}/projects/hipfile/util/docker/DOCKERFILE.${AIS_CI_IMAGE_NAME}" \
--target base \
--build-arg ROCM_VERSION=${AIS_NIGHTLY_ROCM_VERSION} \
--build-arg ROCM_NIGHTLY_BUILD=${AIS_NIGHTLY_BUILD} \
--cache-to=type=registry,ref="${{ steps.ci-image.outputs.AIS_CI_CACHE }}" \
--cache-from=type=registry,ref="${{ steps.ci-image.outputs.AIS_CI_CACHE }}" \
--push \
-t "${{ steps.ci-image.outputs.AIS_CI_IMAGE }}" \
"${GITHUB_WORKSPACE}/projects/hipfile/util/docker"
- name: Build & Push latest nightly NVIDIA image for AIS CI
run: |
docker buildx build \
-f "${GITHUB_WORKSPACE}/projects/hipfile/util/docker/DOCKERFILE.${AIS_CI_IMAGE_NAME}" \
--target nvidia \
--build-arg ROCM_VERSION=${AIS_NIGHTLY_ROCM_VERSION} \
--build-arg ROCM_NIGHTLY_BUILD=${AIS_NIGHTLY_BUILD} \
--cache-to=type=registry,ref="${{ steps.ci-image.outputs.AIS_CI_CACHE_NVIDIA }}" \
--cache-from=type=registry,ref="${{ steps.ci-image.outputs.AIS_CI_CACHE }}" \
--cache-from=type=registry,ref="${{ steps.ci-image.outputs.AIS_CI_CACHE_NVIDIA }}" \
--push \
-t "${{ steps.ci-image.outputs.AIS_CI_IMAGE_NVIDIA }}" \
"${GITHUB_WORKSPACE}/projects/hipfile/util/docker"