Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Ubuntu CI runner from old AWS c6i ParallelCluster to c6a single-node instance #1085

Merged
merged 32 commits into from
Apr 26, 2024
Merged
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
625336d
workflow yaml w intel
ashley314 Apr 19, 2024
d2dab2b
first attempt for gcc
ashley314 Apr 19, 2024
c90dc47
Rename ubuntu-ci-c6a-x86_64.yaml to ubuntu-ci-x86_64-gnu.yaml, ubuntu…
climbfuji Apr 22, 2024
9d6c6ae
Bug fixes - env names were too long
climbfuji Apr 22, 2024
ab19ed9
Merge branch 'develop' of https://github.com/jcsda/spack-stack into f…
climbfuji Apr 22, 2024
3af5875
Use correct Intel compiler with external ecflow
climbfuji Apr 22, 2024
c965477
More updates in ubuntu-ci-x86_64-intel.yaml and ubuntu-ci-x86_64-gnu.…
climbfuji Apr 22, 2024
550afb2
More bug fixes in ubuntu-ci-x86_64-gnu.yaml and ubuntu-ci-x86_64-inte…
climbfuji Apr 22, 2024
f6ec08e
Merge branch 'develop' of https://github.com/jcsda/spack-stack into f…
climbfuji Apr 22, 2024
aa5b64c
Update .gitmodules and submodule pointer for spack for code review an…
climbfuji Apr 23, 2024
dbf0800
Update compiler and MPI config in .github/workflows/ubuntu-ci-x86_64-…
climbfuji Apr 23, 2024
ab61ad3
Temporarily rename .github/workflows/ubuntu-ci-x86_64-intel.yaml to .…
climbfuji Apr 23, 2024
f5aa519
Update submodule pointer for spack
climbfuji Apr 23, 2024
641950f
Split build process into creating buildcache and installing from cache
climbfuji Apr 23, 2024
38eca26
Use tag v1.3.0 for CMakeModules submodule (same as currently used hash)
climbfuji Apr 23, 2024
0598fcb
Fix stupid bug in .github/workflows/ubuntu-ci-x86_64-gnu.yaml
climbfuji Apr 23, 2024
e954782
Fix another bug in .github/workflows/ubuntu-ci-x86_64-gnu.yaml
climbfuji Apr 23, 2024
72f9f58
More build-cache related updated for .github/workflows/ubuntu-ci-x86_…
climbfuji Apr 23, 2024
79903a8
Fix yet another bug in .github/workflows/ubuntu-ci-x86_64-gnu.yaml an…
climbfuji Apr 23, 2024
e577a84
Initialize environment modules in last step in .github/workflows/ubun…
climbfuji Apr 23, 2024
657888d
Rebuild binary cache for ubuntu-ci-x86_64-gnu every seven days
climbfuji Apr 23, 2024
0307c78
Enable ubuntu-ci-x86_64-intel.yaml and update from ubuntu-ci-x86_64-g…
climbfuji Apr 24, 2024
c3395d8
Revert .gitmodules and update submodule pointer for spack
climbfuji Apr 24, 2024
0fff795
Switch ubuntu-ci-containers-x86_64 to run on c6a instance
climbfuji Apr 24, 2024
99282c5
For testing, run container builds for PRs (need to remove before merg…
climbfuji Apr 24, 2024
c3a44ea
Re-enable macos-ci-aarch64 CI runs
climbfuji Apr 24, 2024
1e3bec0
Update submodule pointer for spack
climbfuji Apr 24, 2024
7ce0aed
Update submodule pointer for spack
climbfuji Apr 24, 2024
90f65d0
Update submodule pointer for spack
climbfuji Apr 24, 2024
eae2841
Run ubuntu-ci-containers-x86_64 workflow only on schedule and via wor…
climbfuji Apr 25, 2024
98da400
No need to find qt
climbfuji Apr 25, 2024
564ff56
Merge branch 'develop' of https://github.com/jcsda/spack-stack into f…
climbfuji Apr 26, 2024
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
210 changes: 210 additions & 0 deletions .github/workflows/ubuntu-ci-c6a-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
name: ubuntu-ci-c6a-x86_64-build
ashley314 marked this conversation as resolved.
Show resolved Hide resolved
on:
pull_request:
paths-ignore:
- 'doc/**'
- '**.md'
- '.github/ISSUE_TEMPLATE/*'
- '.gitignore'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
ubuntu-ci-c6a-x86_64-build:
runs-on: [ubuntu-ci-c6a-x86_64]

steps:
- name: cleanup
run: |
pwd
ls -lart
rm -fr *

- name: checkout
uses: actions/checkout@v3
with:
submodules: true

- name: create-env
run: |
source ./setup.sh

# DH* 20230302 - to avoid using padded_length for build caches,
# always build in the same environment so that the length of the
# path doesn't change - see also other 'DH* 20230302' changes below
#export ENVNAME=${{ inputs.template || 'unified-dev' }}.ubuntu-ci-x86_64
export ENVNAME=ci-env.ubuntu-ci-c6a-x86_64
# *DH
export ENVDIR=$PWD/envs/${ENVNAME}
spack stack create env --site linux.default --template ${{ inputs.template || 'unified-dev' }} --name ${ENVNAME}
spack env activate ${ENVDIR}
spack add ${{ inputs.specs || '' }}
export SPACK_SYSTEM_CONFIG_PATH="${ENVDIR}/site"

# Find external packages
spack external find --scope system \
--exclude bison --exclude openssl \
--exclude curl --exclude python
spack external find --scope system sed
spack external find --scope system perl
spack external find --scope system wget
PATH="/usr/local/opt/qt5/bin:$PATH" \
spack external find --scope system qt
spack external find --scope system texlive
spack external find --scope system mysql

# For GNU
# TODO - anything needed?
ashley314 marked this conversation as resolved.
Show resolved Hide resolved

# For Intel
# Need to find external Intel MPI and annotate with the
# correct compiler, no way to do that with spack commands.
# echo "" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " intel-oneapi-mpi:" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " buildable: false" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " externals:" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " - spec: [email protected]%[email protected]" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " prefix: /opt/intel" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " modules:" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " - libfabric-aws/1.16.0~amzn4.0" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml
# echo " - intelmpi" >> ${SPACK_SYSTEM_CONFIG_PATH}/packages.yaml

# For GNU
ashley314 marked this conversation as resolved.
Show resolved Hide resolved
echo "" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo "compilers:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo "- compiler:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " spec: gcc@=11.4.0" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " paths:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " cc: /usr/bin/gcc" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " cxx: /usr/bin/g++" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " f77: /usr/bin/gfortran" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " fc: /usr/bin/gfortran" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " flags: {}" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " operating_system: ubuntu22.04" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " target: x86_64" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " modules: []" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " environment: {}" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
echo " extra_rpaths: []" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml

# For Intel
# echo "" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo "compilers:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo "- compiler:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " spec: [email protected]" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " paths:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " cc: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icc" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " cxx: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icpc" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " f77: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/ifort" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " fc: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/ifort" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " flags: {}" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " operating_system: ubuntu20.04" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " target: x86_64" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " modules: []" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " environment:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " prepend_path:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " LD_LIBRARY_PATH: '/opt/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin'" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " set:" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " I_MPI_PMI_LIBRARY: '/opt/slurm/lib/libpmi.so'" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml
# echo " extra_rpaths: []" >> ${SPACK_SYSTEM_CONFIG_PATH}/compilers.yaml

export -n SPACK_SYSTEM_CONFIG_PATH

# DH* 20230302 - Don't use yet, too many problems
## For buildcaches
#spack config add config:install_tree:padded_length:true
# *DH

# Set compiler and MPI - for Intel
# spack config add "packages:all:providers:mpi:[[email protected]]"
# spack config add "packages:all:compiler:[[email protected]]"
# sed -i "s/\['\%aocc', '\%apple-clang', '\%gcc', '\%intel'\]/\['\%intel'\]/g" $ENVDIR/spack.yaml

# Set compiler and MPI - for GNU
spack config add "packages:all:providers:mpi:[[email protected]]"
spack config add "packages:all:compiler:[[email protected]]"
sed -i "s/\['\%aocc', '\%apple-clang', '\%gcc', '\%intel'\]/\['\%gcc'\]/g" $ENVDIR/spack.yaml

# Add additional variants for MET packages, different from config/common/packages.yaml
spack config add "packages:met:variants:+python +grib2 +graphics +lidar2nc +modis"

# Concretize and check for duplicates
spack concretize 2>&1 | tee log.concretize.gnu-11.4.0
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -d log.concretize.gnu-11.4.0 -i fms -i crtm -i esmf -i mapl

# Add and update source cache
spack mirror add local-source file:///home/ubuntu/spack-stack/source-cache/
spack mirror create -a -d /home/ubuntu/spack-stack/source-cache/

# Add binary cache and reindex it
spack mirror add local-binary file:///home/ubuntu/spack-stack/build-cache/
spack buildcache update-index local-binary
echo "Packages in combined spack build caches:"
spack buildcache list

# Break installation up in pieces and create build caches in between
# This allows us to "spin up" builds that altogether take longer than
# six hours, and/or fail later in the build process.

# base-env
echo "base-env ..."
spack install --fail-fast --source --no-check-signature base-env 2>&1 | tee log.install.gnu-11.4.0.base-env
spack buildcache create -a -u /home/ubuntu/spack-stack/build-cache/ base-env

# the rest
echo "${{ inputs.template || 'unified-dev' }} ..."
spack install --fail-fast --source --no-check-signature 2>&1 | tee [email protected].${{ inputs.template || 'unified-dev' }}
spack buildcache create -a -u /home/ubuntu/spack-stack/build-cache/

# Next steps: synchronize source and build cache to a central/combined mirror?
echo "Next steps ..."
${SPACK_STACK_DIR}/util/ldd_check.py $SPACK_ENV 2>&1 | tee log.ldd_check
spack clean -a
spack module tcl refresh -y
spack stack setup-meta-modules
spack env deactivate

# Test environment chaining
echo "Test environment chaining"
spack stack create env --name chaintest --template empty --site linux.default --upstream $(realpath envs/ci-env.ubuntu-ci-c6a-x86_64/install)
# Retain config from upstream so we don't have to rebuild:
cp -r $PWD/envs/ci-env.ubuntu-ci-c6a-x86_64/{site,common} $PWD/envs/chaintest/.
spack env activate ${PWD}/envs/chaintest
spack add [email protected]%gcc
ashley314 marked this conversation as resolved.
Show resolved Hide resolved
spack concretize | tee envs/chaintest/log.concretize
unwanted_duplicates=$(( cat envs/chaintest/log.concretize | grep -E '^ - ' | grep -Fv '[email protected]' || true ) | wc -l)
if [ ${unwanted_duplicates} -gt 0 ]; then echo "Environment chaining test failed"; exit 1; fi
spack env deactivate

- name: test-env
run: |
source /etc/profile.d/z00_lmod.sh
module use /usr/share/modules/modulefiles
module use /opt/intel/mpi/2021.6.0/modulefiles
ashley314 marked this conversation as resolved.
Show resolved Hide resolved
module use /home/ubuntu/jedi/modulefiles
ashley314 marked this conversation as resolved.
Show resolved Hide resolved

# DH* 20230302 - to avoid using padded_length for build caches,
# always build in the same environment so that the length of the
# path doesn't change - see also other 'DH* 20230302' changes below
#export ENVNAME=${{ inputs.template || 'unified-dev' }}.ubuntu-ci-x86_64
export ENVNAME=ci-env.ubuntu-ci-c6a-x86_64
# *DH
export ENVDIR=$PWD/envs/${ENVNAME}
ls -l ${ENVDIR}/install/modulefiles/Core

module use ${ENVDIR}/install/modulefiles/Core
module load stack-gcc/11.4.0
module load stack-openmpi/5.0.1
module load stack-python/3.10.13
module available

module load jedi-ufs-env/1.0.0
module load ewok-env/1.0.0
module load soca-env/1.0.0
module list
Loading