Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 41 additions & 21 deletions .github/workflows/ais-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,56 @@ jobs:
run: |
echo "changed_dockerfile=$(./util/files-changed.sh origin/${{ github.base_ref }} HEAD 'util/docker/DOCKERFILE.*')" >> ${GITHUB_OUTPUT}
build_AIS_CI_image:
if: ${{ needs.AIS_CI_Pre-check.outputs.changed_dockerfile == '1' }}
needs: AIS_CI_Pre-check
permissions:
contents: read
packages: write
uses: ./.github/workflows/build-ais-ci-image.yml
with:
dockerfile_changed: ${{ needs.AIS_CI_Pre-check.outputs.changed_dockerfile == '1' }}
platform: ${{ inputs.platform }}
build_and_test:
# Run after build_AIS_CI_image but only if build_AIS_CI_image passed or was skipped.
# success() implicitly added if no other status check present.
if: >-
${{
!cancelled() &&
(
needs.build_AIS_CI_image.result == 'skipped' ||
(
needs['AIS_CI_Pre-check'].outputs.changed_dockerfile == '1' &&
needs.build_AIS_CI_image.result == 'success'
)
)
}}
# cancelled() needed. Otherwise success() implicitly added and fails if build_AIS_CI_image skipped.
if: ${{ !cancelled() && needs.build_AIS_CI_image.outputs.ci_image_build_satisfied == 'true' }}
needs: [AIS_CI_Pre-check, build_AIS_CI_image]
uses: ./.github/workflows/build-ais.yml
with:
# If Dockerfile changed, use the new CI image. Otherwise, use 'latest'.
ci_image: >-
${{
needs.AIS_CI_Pre-check.outputs.changed_dockerfile == '1' &&
needs.build_AIS_CI_image.outputs.ci_image ||
format('ghcr.io/rocm/hipfile/ais_ci_{0}:latest', inputs.platform)
}}
ci_image: ${{ needs.build_AIS_CI_image.outputs.ci_image }}
cxx_compiler: amdclang++
platform: ${{ inputs.platform }}
upload_artifacts: true
build_and_test_other_compilers:
# Try building on other compilers, but keep as separate job.
# Removes issues regarding matrix job overwriting outputs and
# does not propagate failures.
if: ${{ !cancelled() && needs.build_AIS_CI_image.outputs.ci_image_build_satisfied == 'true' }}
needs: [AIS_CI_Pre-check, build_AIS_CI_image]
strategy:
fail-fast: false
matrix:
cxx_compiler:
- clang++
- g++
uses: ./.github/workflows/build-ais.yml
with:
ci_image: ${{ needs.build_AIS_CI_image.outputs.ci_image }}
cxx_compiler: ${{ matrix.cxx_compiler }}
platform: ${{ inputs.platform }}
AIS_system_tests:
# cancelled() needed. Otherwise success() implicitly added and fails if the chained
# dependency build_AIS_CI_image is skipped.
if: ${{ !cancelled() && needs.build_and_test.result == 'success'}}
needs: [build_and_test]
uses: ./.github/workflows/test-ais-system.yml
with:
ais_hipfile_pkg_dev_filename: ${{ needs.build_and_test.outputs.ais_hipfile_pkg_dev_filename }}
ais_hipfile_pkg_filename: ${{ needs.build_and_test.outputs.ais_hipfile_pkg_filename }}
ci_image: ${{ needs.build_and_test.outputs.ci_image }}
platform: ${{ inputs.platform }}
build_and_test_Nvidia:
if: ${{ !cancelled() && needs.build_AIS_CI_image.outputs.ci_image_build_satisfied == 'true' }}
needs: [AIS_CI_Pre-check, build_AIS_CI_image]
uses: ./.github/workflows/build-ais-nvidia.yml
with:
ci_image: ${{ needs.build_AIS_CI_image.outputs.ci_image }}
platform: ${{ inputs.platform }}
37 changes: 35 additions & 2 deletions .github/workflows/build-ais-ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,51 @@ env:
on:
workflow_call:
inputs:
dockerfile_changed:
# While this seems like a smell to not make this check in this workflow,
# it allows us to skip the job entirely. This yields the benefit of
# letting downstream jobs start sooner and keeping the job result as
# 'skipped' if a new CI image is not needed.
description: Hint for if this workflow actually needs to run.
required: true
type: boolean
platform:
required: true
type: string
outputs:
ci_image:
description: The full name & tag of the newly built image.
value: ${{ jobs.build_AIS_image.outputs.new_ci_image}}
description: |
The full name & tag of the CI image to use.
If a new CI image is produced, returns the new CI image name & tag.
Otherwise, returns the current CI image name & tag.
value: >-
${{
jobs.build_AIS_image.result == 'skipped' && format('ghcr.io/rocm/hipfile/ais_ci_{0}:latest', inputs.platform) ||
jobs.build_AIS_image.result == 'success' && jobs.build_AIS_image.outputs.new_ci_image ||
null
}}
ci_image_build_satisfied:
description: |
Indicates if the CI image is in an acceptable state.
Set to 'true' if the CI image is unchanged, or if a new CI image was
built successfully. Otherwise 'false'.
value: >-
${{
(
!inputs.dockerfile_changed &&
jobs.build_AIS_image.result == 'skipped'
) ||
(
inputs.dockerfile_changed &&
jobs.build_AIS_image.result == 'success'
)
}}
permissions:
contents: read
packages: write
jobs:
build_AIS_image:
if: ${{ inputs.dockerfile_changed }}
env:
AIS_CI_IMAGE_NAME: ais_ci_${{ inputs.platform }}
runs-on: [ubuntu-24.04]
Expand Down
107 changes: 107 additions & 0 deletions .github/workflows/build-ais-nvidia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: build_ais_nvidia
run-name: Build AIS for Nvidia platforms
env:
AIS_MOUNT_PATH: /mnt/ais/ext4
on:
workflow_call:
inputs:
ci_image:
required: true
type: string
platform:
required: true
type: string
permissions:
contents: read
packages: read
jobs:
compile_on_NVIDIA:
runs-on: [ubuntu-24.04]
strategy:
fail-fast: false
matrix:
supported_compilers:
- g++
- clang++
steps:
- name: Set early AIS CI environment variables
run: |
echo "AIS_PR_NUMBER=$(echo ${{ github.ref }} | sed 's|[^0-9]||g')" >> "${GITHUB_ENV}"
Comment thread Fixed
echo "AIS_SAFE_COMPILER_NAME=$(echo ${{ matrix.supported_compilers }} | sed 's|[\+]|plus|g')" >> "${GITHUB_ENV}"
Comment thread Fixed
- name: Set AIS CI container name
run: |
echo "AIS_CONTAINER_NAME=${AIS_PR_NUMBER}_${{ github.job }}_${{ inputs.platform }}_${AIS_SAFE_COMPILER_NAME}" >> "${GITHUB_ENV}"
Comment thread Fixed
Comment thread Fixed
- name: Fetching code repository...
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
with:
path: hipFile
- name: Authenticating to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Detach the container and run separate commands to it.
# Thus we can make separate explicit steps in the Github CI
# as if we were able to parameterize the container image in the first place.
- name: Starting Docker Container
run: |
docker run \
-dt \
--rm \
--pull always \
-v ${GITHUB_WORKSPACE}:/mnt/ais:ro \
-v ${{ env.AIS_MOUNT_PATH }}:/mnt/ais-fs \
Comment thread Fixed
--name ${AIS_CONTAINER_NAME} \
${{ inputs.ci_image }}
Comment thread Fixed
- name: Make copy of the code repository and create build directories
run: |
docker exec \
-t \
${AIS_CONTAINER_NAME} \
/bin/bash -c '
cp -R /mnt/ais /ais
mkdir /ais/hipFile/build
'
- name: Generate build files for hipFile targeting the NVIDIA platform (${{ matrix.supported_compilers }})
run: |
docker exec \
-t \
-w /ais/hipFile/build \
${AIS_CONTAINER_NAME} \
/bin/bash -c '
cmake \
-DCMAKE_CXX_COMPILER=${{ matrix.supported_compilers }} \
Comment thread Fixed
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_HIP_PLATFORM=nvidia \
-DAIS_BUILD_DOCS=ON \
..
'
- name: Build hipFile for the NVIDIA platform (${{ matrix.supported_compilers }})
run: |
docker exec \
-t \
-w /ais/hipFile/build \
${AIS_CONTAINER_NAME} \
/bin/bash -c '
cmake --build . --parallel
'
- name: Clean CMake build directories
run: |
docker exec \
-t \
-w /ais/hipFile \
${AIS_CONTAINER_NAME} \
/bin/bash -c '
rm -rf build/*
'
- name: Cleanup & Stop the Docker container
if: ${{ always() }}
run: |
docker stop ${AIS_CONTAINER_NAME}
### Disable until NVIDIA runners come back
# Run_hipFile_NVIDIA:
# uses: ./.github/workflows/hipfile-nvidia.yml
# needs: build_AIS_image
# with:
# platform: ${{inputs.platform}}
Loading