Skip to content

Commit

Permalink
Merge branch 'feature/spack-stack' of https://github.com/davidhuber-n…
Browse files Browse the repository at this point in the history
…oaa/GSI-Utils into feature/spack-stack
  • Loading branch information
isouopgui-redline committed Nov 29, 2023
2 parents 3cc02d3 + fc13aea commit 225bf95
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 49 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults:
shell: bash -leo pipefail {0}

env:
cache_key: gcc4 # The number (#) following the cache_key "gcc" is to flush Action cache.
cache_key: gcc
CC: gcc-10
FC: gfortran-10
CXX: g++-10
Expand All @@ -24,71 +24,70 @@ env:

# The jobs are split into:
# 1. a dependency build step (setup), and
# 2. a GSI-utils build step (build)
# 2. a GSI-utils build step (gsi-utils)
# The setup is run once and the environment is cached,
# so each build of GSI-utils can reuse the cached dependencies to save time (and compute).
# so each subsequent build of GSI-utils can reuse the cached dependencies to save time (and compute).

jobs:
setup:
runs-on: ubuntu-latest

steps:
- name: checkout # This is for getting spack.yaml
uses: actions/checkout@v3
with:
path: gsi-utils

# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
~/.spack
key: spack-${{ runner.os }}-${{ env.cache_key }}

- name: checkout-gsiutils # This is for getting spack.yaml
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
path: GSI-utils
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}

# Install dependencies using Spack
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsiutils-env GSI-utils/ci/spack.yaml
spack env create gsiutils-env gsi-utils/ci/spack.yaml
spack env activate gsiutils-env
spack compiler find
spack external find
spack add [email protected]
spack concretize
spack install -v --fail-fast
spack install -v --fail-fast --dirty
spack clean --all
build:
gsi-monitor:
needs: setup
runs-on: ubuntu-latest

steps:
- name: checkout-gsiutils
uses: actions/checkout@v2
- name: checkout
uses: actions/checkout@v3
with:
path: GSI-utils
path: gsi-utils

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
~/.spack
key: spack-${{ runner.os }}-${{ env.cache_key }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}

- name: build-gsiutils
- name: build
run: |
source spack/share/spack/setup-env.sh
spack env activate gsiutils-env
export CC=mpicc
export FC=mpif90
cd GSI-utils
cd gsi-utils
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DBUILD_UTIL_ALL=ON ..
make -j2 VERBOSE=1
Expand Down
48 changes: 23 additions & 25 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defaults:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel6 # The number (#) following the cache_key "intel" is to flush Action cache.
cache_key: intel
CC: icc
FC: ifort
CXX: icpc
Expand All @@ -27,15 +27,20 @@ env:

# The jobs are split into:
# 1. a dependency build step (setup), and
# 2. a GSI-utils build step (build)
# 2. a GSI-utils build step (gsi-utils)
# The setup is run once and the environment is cached,
# so each build of GSI-utils can reuse the cached dependencies to save time (and compute).
# so each subsequent build of gsi-utils can reuse the cached dependencies to save time (and compute).

jobs:
setup:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: checkout # This is for getting spack.yaml
uses: actions/checkout@v3
with:
path: gsi-utils

# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
Expand All @@ -45,53 +50,46 @@ jobs:
spack
~/.spack
/opt/intel
key: spack-${{ runner.os }}-${{ env.cache_key }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}

- name: install-intel-compilers
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran-2023.2.1 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: checkout-gsiutils # This is for getting spack.yaml
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
path: GSI-utils

# Install dependencies using Spack
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsiutils-env GSI-utils/ci/spack.yaml
spack env create gsiutils-env gsi-utils/ci/spack.yaml
spack env activate gsiutils-env
sudo mv /usr/local/ /usr/local_mv
spack compiler find
spack external find
spack add intel-oneapi-mpi
spack concretize
spack install --dirty --fail-fast -v
spack clean --all
build:
gsi-utils:
needs: setup
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: checkout-gsiutils
uses: actions/checkout@v2
with:
path: GSI-utils

- name: install-intel
run: |
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: checkout-gsiutils
uses: actions/checkout@v3
with:
path: gsi-utils

- name: cache-env
id: cache-env
uses: actions/cache@v3
Expand All @@ -100,15 +98,15 @@ jobs:
spack
~/.spack
/opt/intel
key: spack-${{ runner.os }}-${{ env.cache_key }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi-utils/ci/spack.yaml') }}

- name: build-gsiutils
- name: build
run: |
source spack/share/spack/setup-env.sh
spack env activate gsiutils-env
export CC=mpiicc
export FC=mpiifort
cd GSI-utils
cd gsi-utils
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DBUILD_UTIL_ALL=ON ..
make -j2 VERBOSE=1
Expand Down
5 changes: 3 additions & 2 deletions ci/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
spack:
packages:
all:
compiler: [intel, gcc]
compiler: [intel, gcc@10:10]
specs:
- [email protected]
- [email protected]
Expand All @@ -18,9 +18,10 @@ spack:
- [email protected]
- [email protected]
- [email protected]
- crtm@2.3.0
- crtm@2.4.0
- [email protected]
- [email protected]
- [email protected]
view: true
concretizer:
unify: true

0 comments on commit 225bf95

Please sign in to comment.