Skip to content

Commit

Permalink
Add new template cylc-dev (and test building in GitHub actions) (#1410)
Browse files Browse the repository at this point in the history
This PR adds a new template cylc-dev to build a special environment for running cylc. Because of the way cylc works, this is best accomplished by creating an environment view and then a cylc wrapper that contains the minimum settings necessary to use cylc from the view's bin directory. See cylc/cylc-flow#6532 for more information. Note that the creation of the cylc wrapper is not part of this PR.

Associated changes:
- To compile cylc-dev on the Ubuntu self-hosted runner, exclude meson from the spack external find call. Spack found a deprecated version [email protected] and despite it being deprecated it tried to use it - with the result that the harfbuzz build failed (needed for cylc-dev). Letting spack build meson (it picks [email protected]) solved the problem.
- Remove the +excel variant from py-pandas, which was something the jedi-tools-env used, but that is no longer needed and that caused build errors (and added several more dependencies).
- Fix a bug in the GitHub actions that would allow the tests to fail silently (replace set +e with set -e).
- To avoid duplicate packages, require py-cython@3 and [email protected]
- With Intel Classic/LLVM, build qt with gcc (has no effect on pre-configured sites, where qt is configured as an external package)
  • Loading branch information
climbfuji authored Jan 10, 2025
1 parent 94d1afb commit 2470fb4
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos-ci-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
set +e
spack mirror add local-binary file:///Users/ec2-user/spack-stack/build-cache/
spack buildcache update-index local-binary || (echo "No valid binary cache found, proceed without" && spack mirror rm local-binary)
set +e
set -e
echo "Packages in spack binary cache:"
spack buildcache list
fi
Expand Down
39 changes: 22 additions & 17 deletions .github/workflows/ubuntu-ci-x86_64-gnu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ jobs:
# Set up spack-stack
source ./setup.sh
declare -a TEMPLATES=("unified-dev" "skylab-dev")
declare -a TEMPLATES=("unified-dev" "skylab-dev" "cylc-dev")
for TEMPLATE in "${TEMPLATES[@]}"; do
if [[ "${TEMPLATE}" == *"unified-dev"* ]]; then
export ENVNAME=ue-gcc-11.4.0-buildcache
elif [[ "${TEMPLATE}" == *"skylab-dev"* ]]; then
export ENVNAME=se-gcc-11.4.0-buildcache
elif [[ "${TEMPLATE}" == *"cylc-dev"* ]]; then
export ENVNAME=ce-gcc-11.4.0-buildcache
fi
echo "Creating environment ${ENVNAME} from template ${TEMPLATE}"
Expand All @@ -68,7 +70,8 @@ jobs:
# Find external packages
spack external find --scope system \
--exclude bison --exclude openssl \
--exclude curl --exclude python
--exclude curl --exclude python \
--exclude meson
spack external find --scope system grep
spack external find --scope system sed
spack external find --scope system perl
Expand Down Expand Up @@ -104,7 +107,7 @@ jobs:
set +e
spack mirror add local-binary file:///home/ubuntu/spack-stack/build-cache/
spack buildcache update-index local-binary || (echo "No valid binary cache found, proceed without" && spack mirror rm local-binary)
set +e
set -e
echo "Packages in spack binary cache:"
spack buildcache list
fi
Expand All @@ -113,20 +116,22 @@ jobs:
# 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-buildcache.base-env
spack buildcache create -u /home/ubuntu/spack-stack/build-cache/ base-env
# jedi-base-env
echo "jedi-base-env ..."
spack install --fail-fast --source --no-check-signature jedi-base-env 2>&1 | tee log.install.gnu-11.4.0-buildcache.jedi-base-env
spack buildcache create -u /home/ubuntu/spack-stack/build-cache/ jedi-base-env
# jedi-ufs-env
echo "jedi-ufs-env ..."
spack install --fail-fast --source --no-check-signature jedi-ufs-env 2>&1 | tee log.install.gnu-11.4.0-buildcache.jedi-ufs-env
spack buildcache create -u /home/ubuntu/spack-stack/build-cache/ jedi-ufs-env
if [[ "${TEMPLATE}" == *"unified-dev"* || "${TEMPLATE}" == *"skylab-dev"* ]]; then
# base-env
echo "base-env ..."
spack install --fail-fast --source --no-check-signature base-env 2>&1 | tee log.install.gnu-11.4.0-buildcache.base-env
spack buildcache create -u /home/ubuntu/spack-stack/build-cache/ base-env
# jedi-base-env
echo "jedi-base-env ..."
spack install --fail-fast --source --no-check-signature jedi-base-env 2>&1 | tee log.install.gnu-11.4.0-buildcache.jedi-base-env
spack buildcache create -u /home/ubuntu/spack-stack/build-cache/ jedi-base-env
# jedi-ufs-env
echo "jedi-ufs-env ..."
spack install --fail-fast --source --no-check-signature jedi-ufs-env 2>&1 | tee log.install.gnu-11.4.0-buildcache.jedi-ufs-env
spack buildcache create -u /home/ubuntu/spack-stack/build-cache/ jedi-ufs-env
fi
# the rest
echo "${TEMPLATE} ..."
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ubuntu-ci-x86_64-intel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
# Find external packages
spack external find --scope system \
--exclude bison --exclude openssl \
--exclude curl --exclude python
--exclude curl --exclude python \
--exclude meson
spack external find --scope system grep
spack external find --scope system sed
spack external find --scope system perl
Expand Down Expand Up @@ -144,7 +145,7 @@ jobs:
set +e
spack mirror add local-binary file:///home/ubuntu/spack-stack/build-cache/
spack buildcache update-index local-binary || (echo "No valid binary cache found, proceed without" && spack mirror rm local-binary)
set +e
set -e
echo "Packages in spack binary cache:"
spack buildcache list
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
spack external find --scope system \
--exclude bison --exclude openssl \
--exclude curl --exclude python \
--exclude gmake
--exclude meson --exclude gmake
spack external find --scope system grep
spack external find --scope system sed
spack external find --scope system perl
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
set +e
spack mirror add local-binary file:///home/ubuntu/spack-stack/build-cache/
spack buildcache update-index local-binary || (echo "No valid binary cache found, proceed without" && spack mirror rm local-binary)
set +e
set -e
echo "Packages in spack binary cache:"
spack buildcache list
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu-ci-x86_64-oneapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
spack external find --scope system \
--exclude bison --exclude openssl \
--exclude curl --exclude python \
--exclude gmake
--exclude meson --exclude gmake
spack external find --scope system grep
spack external find --scope system sed
spack external find --scope system perl
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
set +e
spack mirror add local-binary file:///home/ubuntu/spack-stack/build-cache/
spack buildcache update-index local-binary || (echo "No valid binary cache found, proceed without" && spack mirror rm local-binary)
set +e
set -e
echo "Packages in spack binary cache:"
spack buildcache list
fi
Expand Down
13 changes: 7 additions & 6 deletions configs/common/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,9 @@ packages:
# Avoid full rust dependency: version 43+ requires py-maturin
py-cryptography:
require: '@:42 +rust_bootstrap'
# Introduced in https://github.com/JCSDA/spack-stack/pull/894, pin py-cython
# to avoid duplicate packages being built (cylc dependencies soft-want @3:)
# Pin py-cython to avoid duplicate packages
py-cython:
require: '@0.29.36'
require: '@3'
# As long as we need the "delayed" variant for py-dask,
# we are restricted to version 2021.03.0 (last one that has it)
# and newer than 2021.01.0 because of these issues:
Expand All @@ -233,13 +232,15 @@ packages:
require: '~mpi'
# https://github.com/JCSDA/spack-stack/issues/1276
py-matplotlib:
require: '@3.7.4'
require: '@3.7.4'
# Variant ~mpi not working for latest py-netcdf4
# https://github.com/spack/spack/issues/47652
py-netcdf4:
require: '@1.7.1 +mpi'
py-pandas:
require: '+excel'
# To avoid duplicate packages
py-numpy:
require:
- '@1.26'
# To avoid duplicate packages
py-ruamel-yaml:
require: '@0.17.16'
Expand Down
3 changes: 3 additions & 0 deletions configs/common/packages_intel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ packages:
boost:
require:
- '%gcc'
qt:
require:
- '%gcc'
ecflow:
require:
- '%gcc'
Expand Down
3 changes: 3 additions & 0 deletions configs/common/packages_oneapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ packages:
require: '%gcc'
libbsd:
require: '%gcc'
qt:
require:
- '%gcc'
6 changes: 6 additions & 0 deletions configs/sites/tier1/narwhal/compilers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ compilers::
- compiler:
spec: [email protected]
paths:
# Still need Cray wrappers for most environments
cc: cc
cxx: CC
f77: ftn
fc: ftn
# For cylc-dev, can't use Cray wrappers
#cc: /opt/cray/pe/gcc/10.3.0/snos/bin/gcc
#cxx: /opt/cray/pe/gcc/10.3.0/snos/bin/g++
#f77: /opt/cray/pe/gcc/10.3.0/snos/bin/gfortran
#fc: /opt/cray/pe/gcc/10.3.0/snos/bin/gfortran
flags: {}
operating_system: sles15
modules:
Expand Down
33 changes: 33 additions & 0 deletions configs/templates/cylc-dev/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Template for CYLC (flow, rose, GUI). Supported with GCC only.
# Creates a view that allows users to define (manually for now)
# simple wrappers for cylc that can be aliased as "cylc":
#
##!/bin/bash
##CYLC_INSTALL_DIR=/path/to/env/view/bin
##PATH=${CYLC_INSTALL_DIR}:$PATH
##unset PYTHONPATH
##cylc "$@"
#
spack:
concretizer:
unify: true

view:
cylc:
root: view
select: [^python]
link: run
link_type: symlink
include: []

definitions:
- compilers: ['%gcc']
- packages:
- [email protected]
- [email protected]
- [email protected]

specs:
- matrix:
- [$packages]
- [$compilers]
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class JediToolsEnv(BundlePackage):
# depends_on("aws-parallelcluster", type="run")
depends_on("py-click", type="run")
depends_on("py-openpyxl", type="run")
depends_on("py-pandas +excel", type="run")
depends_on("py-pandas", type="run")
depends_on("py-pygithub", type="run")
depends_on("py-scipy", type="run")
depends_on("py-sphinx", type="run")
Expand Down

0 comments on commit 2470fb4

Please sign in to comment.