Skip to content

Commit

Permalink
updates azure workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed May 3, 2023
1 parent 6054f6b commit a423452
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 26 deletions.
71 changes: 55 additions & 16 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ jobs:
displayName: 'Run checks'
- job: compilation_default
displayName: 'Compilation Default GCC 9'
# ubuntu-latest: ubuntu-22.04 w/ GCC 11
displayName: 'Compilation Default GCC'
steps:
- template: .azure-pipelines/install-template.yml
parameters:
Expand All @@ -95,14 +96,14 @@ jobs:
CUDA: false
BUILD: true

- job: compilation_default_gcc7
displayName: 'Compilation Default GCC 7'
- job: compilation_default_gcc9
displayName: 'Compilation Default GCC 9'
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
variables:
CC: gcc-7
CXX: g++-7
FC: gfortran-7
CC: gcc-9
CXX: g++-9
FC: gfortran-9
steps:
- template: .azure-pipelines/install-template.yml
parameters:
Expand Down Expand Up @@ -131,27 +132,33 @@ jobs:
CUDA: false
BUILD: true

- job: compilation_CUDA10
displayName: 'Compilation CUDA 10'
- job: compilation_CUDA11_gcc9
displayName: 'Compilation CUDA 11 GCC 9'
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
variables:
CC: gcc-7
CXX: g++-7
FC: gfortran-7
CC: gcc-9
CXX: g++-9
FC: gfortran-9
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: true
CUDA_V: '10.2'
CUDA_V: '11.4'
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --with-cuda=cuda10'
CUDA: true
BUILD: true

- job: compilation_CUDA11
displayName: 'Compilation CUDA 11'
- job: compilation_CUDA11_gcc10
displayName: 'Compilation CUDA 11 GCC 10'
pool:
vmImage: 'ubuntu-20.04'
variables:
CC: gcc-10
CXX: g++-10
FC: gfortran-10
steps:
- template: .azure-pipelines/install-template.yml
parameters:
Expand All @@ -163,6 +170,38 @@ jobs:
CUDA: true
BUILD: true

- job: compilation_CUDA12
displayName: 'Compilation CUDA 12 GCC 10'
pool:
vmImage: 'ubuntu-20.04'
variables:
CC: gcc-10
CXX: g++-10
FC: gfortran-10
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: true
CUDA_V: '12.1'
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --with-cuda=cuda11'
CUDA: true
BUILD: true

- job: compilation_CUDA12_latest
displayName: 'Compilation CUDA 12 latest'
steps:
- template: .azure-pipelines/install-template.yml
parameters:
CUDA: true
CUDA_V: '12.1'
- template: .azure-pipelines/configure-template.yml
parameters:
TESTFLAGS: '--with-mpi --with-cuda=cuda12'
CUDA: true
BUILD: true

- job: test_example_1
displayName: 'Test example 1 - simple_topography_and_also_a_simple_fluid_layer'
dependsOn: compilation_default
Expand Down
63 changes: 53 additions & 10 deletions .azure-pipelines/install-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# software setup on VM nodes
# ubuntu-18.04:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md
# ubuntu-20.04 "ubuntu-latest":
# ubuntu-20.04:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# ubuntu-22.04 "ubuntu-latest":
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
#
parameters:
- name: CUDA
Expand All @@ -20,10 +22,27 @@ steps:
# fortran/openMPI compiler
echo "CC: ${CC} CXX: ${CXX} FC: ${FC}"
# updates repository
echo; echo `uname -a`; lsb_release -a; echo
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 78BD65473CB3BD13
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 762E3157
if [ "${FC}" == "gfortran-10" ]; then
if [ "${FC}" == "gfortran-9" ]; then
echo "gfortran: gfortran-9 update"
# updating gfortran version
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y --reinstall gcc-9 g++-9 gfortran-9
# updates alternatives
echo
update-alternatives --query gfortran
echo
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-9 100
echo
update-alternatives --query gfortran
echo
elif [ "${FC}" == "gfortran-10" ]; then
echo "gfortran: gfortran-10 update"
# updating gfortran version
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
Expand Down Expand Up @@ -62,6 +81,8 @@ steps:
echo
echo "numpy version : "
python -c "import numpy; print(numpy.__version__)"
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
echo
# version infos
Expand Down Expand Up @@ -92,9 +113,14 @@ steps:
## distribution xenial: from ubuntu 16.04
#UBUNTU_VERSION=ubuntu1604
## distribution bionic: from ubuntu 18.04
UBUNTU_VERSION=ubuntu1804
#UBUNTU_VERSION=ubuntu1804
## distribution focal: from ubuntu 20.04
#UBUNTU_VERSION=ubuntu2004
## distribution jammy: from ubuntu 22.04
#UBUNTU_VERSION=ubuntu2204
# default
UBUNTU_VERSION=ubuntu2004
# CUDA_VERSION - specifies CUDA toolkit version
echo "CUDA version: $CUDA_V"
Expand All @@ -108,10 +134,20 @@ steps:
elif [ "$CUDA_V" == "10.2" ]; then
## bionic
CUDA_VERSION=10.2.89-1
elif [ "$CUDA_V" == "11.4" ]; then
## focal
CUDA_VERSION=11.4.0-1
elif [ "$CUDA_V" == "12.1" ]; then
## focal
CUDA_VERSION=12.1.1-1
else
# note: on azure VM nodes with ubuntu-latest, default gcc version is 9.3;
# note: - on azure VM nodes with ubuntu 18.04, default gcc version is 9.3;
# needs at least CUDA version 10.x
# - on azure VM nodes with ubuntu 20.04, default gcc version is 10.3;
# needs at least CUDA version 11.x
CUDA_VERSION=11.4.0-1
# - on azure VM nodes with ubuntu-latest (22.04), default gcc version is 11.3;
# needs at least CUDA version 11.7
CUDA_VERSION=12.1.1-1
fi
echo
Expand Down Expand Up @@ -149,7 +185,12 @@ steps:
echo
# gets repo
if [ "${CUDA_VERSION}" == "11.4.0-1" ]; then
if [ "${CUDA_VERSION}" == "10.2.89-1" ]; then
# gets packages
INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA_VERSION}_${CUDA_ARCH}.deb
wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/${CUDA_OS}/${INSTALLER}
sudo dpkg -i ${INSTALLER}
elif [ "${CUDA_VERSION}" == "11.4.0-1" ]; then
# new CUDA version 11.4 has no cuda-repo-** file, following instructions from website,
# see: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=18.04&target_type=deb_network
wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/${CUDA_OS}/cuda-${UBUNTU_VERSION}.pin
Expand All @@ -158,10 +199,12 @@ steps:
# adds repo
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/${CUDA_OS}/ /"
else
# gets packages
INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA_VERSION}_${CUDA_ARCH}.deb
wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/${CUDA_OS}/${INSTALLER}
sudo dpkg -i ${INSTALLER}
# new versions
wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/${CUDA_OS}/cuda-${UBUNTU_VERSION}.pin
sudo mv cuda-${UBUNTU_VERSION}.pin /etc/apt/preferences.d/cuda-repository-pin-600
echo
# adds repo
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/${CUDA_OS}/ /"
fi
#echo
Expand Down

0 comments on commit a423452

Please sign in to comment.