Skip to content

Commit cf898d5

Browse files
Merge pull request #200 from alwinm/main-container
new build-tests.yml for Docker container
2 parents 7ce2daa + 83360cb commit cf898d5

1 file changed

Lines changed: 92 additions & 165 deletions

File tree

.github/workflows/build_tests.yml

Lines changed: 92 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,92 @@
1-
name: Cholla Compile
2-
3-
on:
4-
pull_request:
5-
# branches: [ CAAR ]
6-
schedule:
7-
- cron: "37 07 * * 1" # run every Monday at 07:37UTC. Crontab computed with crontab.guru
8-
workflow_dispatch:
9-
10-
jobs:
11-
Build:
12-
name: >
13-
Build
14-
API:${{ matrix.gpu-api }}
15-
Make-Type:${{ matrix.make-type }}
16-
Cuda-toolkit:v${{ matrix.cuda-toolkit-version }}
17-
GCC:v${{ matrix.gcc-version }}
18-
ROCm:v${{ matrix.rocm-version }}
19-
# if: ${{ false }} # If uncommented this line will disable this job
20-
21-
# Choose OS/Runner
22-
runs-on: ubuntu-latest
23-
24-
# Matrix for different make types
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
make-type: [hydro, gravity, disk, particles, cosmology, mhd]
29-
gpu-api: [HIP, CUDA]
30-
# NOTE: if more than one parameter is in any of these three variables
31-
# you need to manually exclude it for the GPU API that doesn't use it.
32-
# An example exclude is shown below but commented out. Uncomment and
33-
# tweak it to fit your needs
34-
# CUDA uses the cuda-toolkit-version and gcc-version
35-
# HIP uses the clang-version
36-
cuda-toolkit-version: ['11.2.2']
37-
gcc-version: [9]
38-
rocm-version: ['5.1.0']
39-
mpi: ['openmpi'] #Can use mpich and/or openmpi
40-
# exclude:
41-
# - gpu-api: HIP
42-
# make-type: hydro
43-
44-
# Setup environment variables
45-
env:
46-
CHOLLA_MACHINE: github
47-
CHOLLA_MAKE_TYPE: ${{ matrix.make-type }}
48-
CUDA_ROOT: /usr/local/cuda
49-
HDF5_ROOT: /usr/lib/x86_64-linux-gnu/hdf5/serial
50-
MPI_ROOT: /usr/lib/x86_64-linux-gnu/openmpi
51-
52-
# Run the job itself
53-
steps:
54-
55-
# Install required Tools
56-
- uses: actions/checkout@v2
57-
- name: Setup MPI
58-
uses: mpi4py/setup-mpi@v1
59-
with:
60-
mpi: ${{ matrix.mpi }}
61-
- name: Show MPI version
62-
run: mpirun --version
63-
- name: Install HDF5 Serial
64-
run: sudo apt-get install libhdf5-serial-dev
65-
- name: Show HDF5 config
66-
run: |
67-
h5cc -showconfig
68-
69-
# Install CUDA and dependencies if this is a CUDA build
70-
- uses: Jimver/cuda-toolkit@v0.2.8
71-
if: matrix.gpu-api == 'CUDA'
72-
id: cuda-toolkit
73-
with:
74-
cuda: ${{ matrix.cuda-toolkit-version }}
75-
- name: NVCC version & set CUDA_ROOT
76-
if: matrix.gpu-api == 'CUDA'
77-
run: |
78-
nvcc -V
79-
- name: Set up GCC
80-
if: matrix.gpu-api == 'CUDA'
81-
uses: egor-tensin/setup-gcc@v1
82-
with:
83-
version: ${{ matrix.gcc-version }}
84-
- name: GCC Version
85-
if: matrix.gpu-api == 'CUDA'
86-
run: |
87-
cc --version
88-
c++ --version
89-
90-
# Install HIP and dependencies if this is a HIP build
91-
- name: Setup ROCm
92-
if: matrix.gpu-api == 'HIP'
93-
run: |
94-
# Download and install the installation script
95-
sudo apt-get update
96-
wget https://repo.radeon.com/amdgpu-install/22.20.1/ubuntu/focal/amdgpu-install_22.20.50201-1_all.deb
97-
sudo apt-get install -y ./amdgpu-install_22.20.50201-1_all.deb
98-
99-
# Get names correct by stripping out the last ".0" if it exists
100-
ROCM_VERSION=${{ matrix.rocm-version }}
101-
if [ "${ROCM_VERSION:0-1}" = "0" ]
102-
then
103-
# If the last character is a "0" then trim the last ".0"
104-
ROCM_REPO_VERSION="${ROCM_VERSION:0:3}"
105-
else
106-
ROCM_REPO_VERSION=$ROCM_VERSION
107-
fi
108-
109-
# Add the repo for the version of ROCm that we want
110-
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${ROCM_REPO_VERSION} ubuntu main" | sudo tee /etc/apt/sources.list.d/rocm.list
111-
sudo apt update
112-
- name: Install ROCm
113-
if: matrix.gpu-api == 'HIP'
114-
run: |
115-
# Install ROCm
116-
sudo amdgpu-install -y --usecase=rocm --rocmrelease=${{ matrix.rocm-version }}
117-
- name: Install hipFFT and RocFFT
118-
if: matrix.gpu-api == 'HIP'
119-
run: |
120-
sudo apt install -y hipfft${{ matrix.rocm-version }} rocfft${{ matrix.rocm-version }}
121-
- name: Verify HIP install
122-
if: matrix.gpu-api == 'HIP'
123-
run: |
124-
hipconfig --full
125-
- name: Set Environment Variables and Files
126-
if: matrix.gpu-api == 'HIP'
127-
run: |
128-
echo "HIPCONFIG=$(hipconfig -C)" >> $GITHUB_ENV
129-
echo "ROCM_PATH=$(hipconfig -R)" >> $GITHUB_ENV
130-
echo "gfx90a" | sudo tee --append $(hipconfig -R)/bin/target.lst # trick ROCm into thinking there's a GPU
131-
- name: Echo Environment Variables and Files
132-
if: matrix.gpu-api == 'HIP'
133-
run: |
134-
echo "HIPCONFIG = ${HIPCONFIG}"
135-
echo "ROCM_PATH = ${ROCM_PATH}"
136-
echo "HIPFFT_PATH = ${HIPFFT_PATH}"
137-
138-
echo "The contents of $(hipconfig -R)/bin/target.lst are:"
139-
sudo cat $(hipconfig -R)/bin/target.lst
140-
141-
# Perform Build
142-
- name: Cholla setup
143-
run: |
144-
source builds/run_tests.sh
145-
setupTests -c gcc
146-
echo "CHOLLA_ROOT = ${CHOLLA_ROOT}"
147-
echo "CHOLLA_LAUNCH_COMMAND = ${CHOLLA_LAUNCH_COMMAND}"
148-
149-
echo "CHOLLA_ROOT=${CHOLLA_ROOT}" >> $GITHUB_ENV
150-
echo "CHOLLA_LAUNCH_COMMAND=${CHOLLA_LAUNCH_COMMAND}" >> $GITHUB_ENV
151-
echo "F_OFFLOAD=${F_OFFLOAD} >> $GITHUB_ENV
152-
echo "CHOLLA_ENVSET=${CHOLLA_ENVSET} >> $GITHUB_ENV
153-
- name: Build GoogleTest
154-
run: |
155-
source builds/run_tests.sh
156-
buildGoogleTest
157-
echo "GOOGLETEST_ROOT=${GOOGLETEST_ROOT}" >> $GITHUB_ENV
158-
- name: Build Cholla
159-
run: |
160-
source builds/run_tests.sh
161-
buildCholla
162-
- name: Build Tests
163-
run: |
164-
source builds/run_tests.sh
165-
buildChollaTests
1+
name: Cholla Compile
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
- cron: "37 07 * * 1" # run every Monday at 07:37UTC. Crontab computed with crontab.guru
7+
workflow_dispatch:
8+
9+
jobs:
10+
Build:
11+
name: >
12+
Build
13+
${{ matrix.container.name }}
14+
TYPE=${{ matrix.make-type }}
15+
# if: ${{ false }} # If uncommented this line will disable this job
16+
17+
# Choose OS/Runner
18+
runs-on: ubuntu-latest
19+
container:
20+
image: ${{matrix.container.link}}
21+
defaults:
22+
run:
23+
shell: bash
24+
# Matrix for different make types
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
make-type: [hydro, gravity, disk, particles, cosmology, mhd]
29+
container: [{name: "CUDA", link: "docker://alwinm/cholla:cuda_github"}, {name: "HIP",link: "docker://alwinm/cholla:hip_github"},]
30+
31+
# Setup environment variables
32+
env:
33+
CHOLLA_MACHINE: github
34+
CHOLLA_MAKE_TYPE: ${{ matrix.make-type }}
35+
CUDA_ROOT: /usr/local/cuda
36+
HDF5_ROOT: /usr/lib/x86_64-linux-gnu/hdf5/serial
37+
MPI_ROOT: /usr/lib/x86_64-linux-gnu/openmpi
38+
39+
# Run the job itself
40+
steps:
41+
42+
# Install required Tools
43+
- uses: actions/checkout@v3
44+
45+
# Show versions
46+
- name: Show MPI version
47+
run: mpirun --version
48+
- name: Show HDF5 config
49+
run: |
50+
h5cc -showconfig
51+
- name: Git Safe Directory
52+
run: |
53+
git --version
54+
git config --global --add safe.directory /__w/cholla/cholla
55+
git config --global --add safe.directory '*'
56+
- name: Show CUDA and gcc version
57+
if: matrix.container.name == 'CUDA'
58+
run: |
59+
cc --version
60+
c++ --version
61+
nvcc -V
62+
- name: Show HIP and hipcc version
63+
if: matrix.container.name == 'HIP'
64+
run: |
65+
hipcc --version
66+
hipconfig --full
67+
68+
69+
# Perform Build
70+
- name: Cholla setup
71+
run: |
72+
source builds/run_tests.sh
73+
setupTests -c gcc
74+
echo "CHOLLA_ROOT = ${CHOLLA_ROOT}"
75+
echo "CHOLLA_LAUNCH_COMMAND = ${CHOLLA_LAUNCH_COMMAND}"
76+
echo "CHOLLA_ROOT=${CHOLLA_ROOT}" >> $GITHUB_ENV
77+
echo "CHOLLA_LAUNCH_COMMAND=${CHOLLA_LAUNCH_COMMAND}" >> $GITHUB_ENV
78+
echo "F_OFFLOAD=${F_OFFLOAD} >> $GITHUB_ENV
79+
echo "CHOLLA_ENVSET=${CHOLLA_ENVSET} >> $GITHUB_ENV
80+
- name: Build GoogleTest
81+
run: |
82+
source builds/run_tests.sh
83+
buildGoogleTest
84+
echo "GOOGLETEST_ROOT=${GOOGLETEST_ROOT}" >> $GITHUB_ENV
85+
- name: Build Cholla
86+
run: |
87+
source builds/run_tests.sh
88+
buildCholla OPTIMIZE
89+
- name: Build Tests
90+
run: |
91+
source builds/run_tests.sh
92+
buildChollaTests

0 commit comments

Comments
 (0)