-
Notifications
You must be signed in to change notification settings - Fork 6
116 lines (116 loc) · 3.9 KB
/
Copy pathbuild-ais-nvidia.yml
File metadata and controls
116 lines (116 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: build_ais_nvidia
run-name: Build AIS for Nvidia platforms
env:
AIS_INPUT_CI_IMAGE: ${{ inputs.ci_image }}
AIS_INPUT_PLATFORM: ${{ inputs.platform }}
AIS_INPUT_ROCM_VERSION: ${{ inputs.rocm_version }}
AIS_MOUNT_PATH: /mnt/ais/ext4
on:
workflow_call:
inputs:
ci_image:
required: true
type: string
platform:
required: true
type: string
rocm_version:
description: "Target ROCm MAJOR.MINOR.PATCH Version."
required: true
type: string
permissions:
contents: read
packages: read
jobs:
compile_on_NVIDIA:
env:
AIS_INPUT_CXX_COMPILER: ${{ matrix.supported_compilers }}
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}"
echo "AIS_SAFE_COMPILER_NAME=$(echo ${AIS_INPUT_CXX_COMPILER} | sed 's|[\+]|plus|g')" >> "${GITHUB_ENV}"
- name: Set AIS CI container name
run: |
echo "AIS_CONTAINER_NAME=${AIS_PR_NUMBER}_${GITHUB_JOB}_${AIS_INPUT_PLATFORM}_${AIS_INPUT_ROCM_VERSION}_${AIS_SAFE_COMPILER_NAME}" >> "${GITHUB_ENV}"
- name: Fetching code repository...
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
path: hipFile
- name: Authenticating to GitHub Container Registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 #v4.0.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 "${AIS_MOUNT_PATH}:/mnt/ais-fs" \
--name "${AIS_CONTAINER_NAME}" \
"${AIS_INPUT_CI_IMAGE}"
- 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 \
-e "_AIS_INPUT_CXX_COMPILER=${AIS_INPUT_CXX_COMPILER}" \
-t \
-w /ais/hipFile/build \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
cmake \
-DCMAKE_CXX_COMPILER="${_AIS_INPUT_CXX_COMPILER}" \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_HIP_PLATFORM=nvidia \
..
'
- 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: ${AIS_INPUT_PLATFORM}