Skip to content

Commit

Permalink
- Ensure CI tests fail when a subtask fails
Browse files Browse the repository at this point in the history
- Clean up stderr redirect
- Attempt to fix openmp / openblas pinning
- Since conda build is in base environment, override package
  build and staging location to be in the current environment
- Remove --use-local (which points to base) and instead use
  explicit channel location in current env
  • Loading branch information
tskisner committed Feb 13, 2024
1 parent c4b9e9d commit cdbf1c2
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 107 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,34 +43,34 @@ jobs:
- name: Check Conda Config
run: |
source ~/conda/etc/profile.d/conda.sh
conda activate base
conda info
conda list
conda config --show-sources
source ~/conda/etc/profile.d/conda.sh &&
conda activate base &&
conda info &&
conda list &&
conda config --show-sources &&
conda config --show
- name: Install
run: |
source ~/conda/etc/profile.d/conda.sh
conda activate base
pyver=${{ matrix.python }}
sed -i -e "s/python=3\.10/python=${pyver}/" ./config/default/packages_conda.txt
cat ./config/default/packages_conda.txt
source ~/conda/etc/profile.d/conda.sh &&
conda activate base &&
pyver=${{ matrix.python }} &&
sed -i -e "s/python=3\.*/python=${pyver}/" ./config/default/packages_conda.txt &&
cat ./config/default/packages_conda.txt &&
./soconda.sh -e soconda -v CI
- name: Run Tests
run: |
source ~/conda/etc/profile.d/conda.sh
conda activate "soconda_CI"
export OMP_NUM_THREADS=2
export MPI_DISABLE=1
export CI=1
python3 -c 'import scipy; import toast'
python3 -c 'import toast.tests; toast.tests.run()'
git clone --depth=1 --single-branch --branch=master https://github.com/simonsobs/sotodlib.git
pushd sotodlib
python3 -m unittest
popd
unset MPI_DISABLE
source ~/conda/etc/profile.d/conda.sh &&
conda activate "soconda_CI" &&
export OMP_NUM_THREADS=2 &&
export MPI_DISABLE=1 &&
export CI=1 &&
python3 -c 'import scipy; import toast; print(toast.__version__)' &&
python3 -c 'import toast.tests; toast.tests.run()' &&
git clone --depth=1 --single-branch --branch=master https://github.com/simonsobs/sotodlib.git &&
pushd sotodlib &&
python3 -m unittest &&
popd &&
unset MPI_DISABLE &&
unset OMP_NUM_THREADS
28 changes: 14 additions & 14 deletions deploy/install_nersc_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ fi
# always created.

# Update the persistent git checkout and find the most recent tag
pushd "${git_dir}" 2>&1 >/dev/null
pushd "${git_dir}" >/dev/null 2>&1
git checkout main
git fetch --tags
git rebase origin/main
git remote prune origin
latest=$(git describe --tags $(git rev-list --tags --max-count=1))
popd 2>&1 >/dev/null
popd >/dev/null 2>&1

# See if we already have this tag installed
found=no
Expand Down Expand Up @@ -74,7 +74,7 @@ today=$(date +%Y%m%d)
log_file="${log_dir}/check_tags_${host}_${now}"

# Create the log file
echo "Starting at ${now}" 2>&1 > "${log_file}"
echo "Starting at ${now}" > "${log_file}"

# Get the module file version that will be installed
mod_ver="${today}_${latest}"
Expand All @@ -83,26 +83,26 @@ send_log=no
annoy="${git_dir}/.already_annoyed"
remain=$(get_common_free_gb)
if (( remain < typical )); then
echo "Only ${remain} GB are available in /global/common/software/sobs" 2>&1 >> "${log_file}"
echo "Installing latest tag requires approximately ${typical} GB" 2>&1 >> "${log_file}"
echo "SKIPPING until disk space is cleared." 2>&1 >> "${log_file}"
echo "Only ${remain} GB are available in /global/common/software/sobs" >> "${log_file}"
echo "Installing latest tag requires approximately ${typical} GB" >> "${log_file}"
echo "SKIPPING until disk space is cleared." >> "${log_file}"
if [ ! -e "${annoy}" ]; then
send_log=yes
touch "${annoy}"
fi
else
send_log=yes
rm -f "${git_dir}/.already_annoyed"
echo "Latest tag '${latest}' not found, installing..." 2>&1 >> "${log_file}"
echo "Note: ${remain} GB are available in /global/common/software/sobs" 2>&1 >> "${log_file}"
echo "Installing latest tag requires approximately ${typical} GB" 2>&1 >> "${log_file}"
echo "Latest tag '${latest}' not found, installing..." >> "${log_file}"
echo "Note: ${remain} GB are available in /global/common/software/sobs" >> "${log_file}"
echo "Installing latest tag requires approximately ${typical} GB" >> "${log_file}"
install_log=$(eval "${git_dir}/deploy/install_${host}.sh" "${latest}")
if [ -f "${install_log}" ]; then
# There were no errors, and the log file was returned
cat "${install_log}" 2>&1 >> "${log_file}"
cat "${install_log}" >> "${log_file}"
else
# The script must have printed out some errors
echo "${install_log}" 2>&1 >> "${log_file}"
echo "${install_log}" >> "${log_file}"
fi
fi

Expand All @@ -114,7 +114,7 @@ if [ -e "${mod_latest}" ]; then
rm -f "${mod_dir}/stable.lua" \
&& ln -s "${mod_latest}" "${mod_dir}/stable.lua"
else
echo "ERROR: module file ${mod_latest} was not created- leaving stable symlink" 2>&1 >> "${log_file}"
echo "ERROR: module file ${mod_latest} was not created- leaving stable symlink" >> "${log_file}"
fi

echo "Finished installing tag '${latest}' on host ${NERSC_HOST} at $(date +%Y%m%d-%H%M%S)" >> "${log_file}"
Expand All @@ -124,14 +124,14 @@ if [ "${send_log}" = "yes" ]; then
slack_web_hook=${SLACKBOT_SOCONDA}

if [ "x${slack_web_hook}" = "x" ]; then
echo "Environment variable SLACKBOT_SOCONDA not set- skipping notifications" 2>&1 >> "${log_file}"
echo "Environment variable SLACKBOT_SOCONDA not set- skipping notifications" >> "${log_file}"
else
# Create the JSON payload.
slackjson="${log_file}_slack.json"
headtail=12
echo -e "{\"text\":\"soconda install tag (log at \`${log_file}\`):\n\`\`\`$(head -n ${headtail} ${log_file} | sed -e "s|'|\\\'|g")\`\`\`\n(Snip)\n\`\`\`$(tail -n ${headtail} ${log_file} | sed -e "s|'|\\\'|g")\`\`\`\"}" > "${slackjson}"
# Post it.
slackerror=$(curl -X POST -H 'Content-type: application/json' --data "$(cat ${slackjson})" ${slack_web_hook})
echo "Slack API post ${slackerror}" 2>&1 >> "${log_file}"
echo "Slack API post ${slackerror}" >> "${log_file}"
fi
fi
22 changes: 11 additions & 11 deletions deploy/install_perlmutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,34 @@ if [ -d "${clone_dir}" ]; then
rm -rf "${clone_dir}"
fi

git clone --depth=1 --single-branch --branch=${version} https://github.com/simonsobs/soconda.git "${clone_dir}" 2>&1 >> "${logfile}"
git clone --depth=1 --single-branch --branch=${version} https://github.com/simonsobs/soconda.git "${clone_dir}" >> "${logfile}" 2>&1

# Activate the base environment and keep it up to date.
source "${base_dir}/etc/profile.d/conda.sh"
conda activate base 2>&1 >> "${logfile}"
conda update --yes -n base conda conda-build 2>&1 >> "${logfile}"
conda update --yes --all -n base 2>&1 >> "${logfile}"
conda activate base >> "${logfile}" 2>&1
conda update --yes -n base conda conda-build >> "${logfile}" 2>&1
conda update --yes --all -n base >> "${logfile}" 2>&1

# Build things from the temp directory

pushd "${clone_dir}" 2>&1 >/dev/null
pushd "${clone_dir}" >/dev/null 2>&1
mkdir -p "build"
pushd "build" 2>&1 >/dev/null
pushd "build" >/dev/null 2>&1

export MPICC="cc"

eval "${clone_dir}/soconda.sh" \
-c "perlmutter" \
-e "${env_name}" \
-v "${env_version}" \
-m "${module_dir}" 2>&1 >> "${logfile}"
-m "${module_dir}" >> "${logfile}" 2>&1

popd 2>&1 >/dev/null
popd 2>&1 >/dev/null
popd >/dev/null 2>&1
popd >/dev/null 2>&1

# Update permissions
chmod -R g-w,g+rX "${env_name}_${env_version}" 2>&1 >> "${logfile}"
chmod -R g-w,g+rX "${module_dir}/soconda" 2>&1 >> "${logfile}"
chmod -R g-w,g+rX "${env_name}_${env_version}" >> "${logfile}" 2>&1
chmod -R g-w,g+rX "${module_dir}/soconda" >> "${logfile}" 2>&1

# Return name of log file
echo "${logfile}"
15 changes: 8 additions & 7 deletions pkgs/libactpol/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ build:
requirements:
build:
- {{ compiler('c') }}
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
host:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- automake
- autoconf
Expand All @@ -42,11 +42,12 @@ requirements:
# https://github.com/conda-forge/perl-feedstock/issues/56
- libxcrypt1 # [linux]
run:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- {{ pin_compatible('openblas') }}
- {{ pin_compatible('liblapack') }}
- {{ pin_compatible('libactpol_deps') }}
- {{ pin_compatible('cfitsio') }}
- {{ pin_compatible('wcslib') }}
Expand Down
15 changes: 8 additions & 7 deletions pkgs/libactpol_deps/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ requirements:
build:
- {{ compiler('c') }}
- {{ compiler('fortran') }}
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
host:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- automake
- autoconf
Expand All @@ -35,11 +35,12 @@ requirements:
- make
- zziplib
run:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- {{ pin_compatible('openblas') }}
- {{ pin_compatible('liblapack') }}
- {{ pin_compatible('zziplib') }}

test:
Expand Down
20 changes: 11 additions & 9 deletions pkgs/moby2/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,37 @@ build:
requirements:
build:
- {{ compiler('c') }}
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
host:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- python
- fftw
- gsl
- libactpol
- future
- numpy=1.26.*
- scipy
# Although not a dependency, we put numba here to force
# building with a numba-compatible numpy version
- numba
run:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- python
- {{ pin_compatible('openblas') }}
- {{ pin_compatible('liblapack') }}
- {{ pin_compatible('scipy') }}
- {{ pin_compatible('numpy') }}
- {{ pin_compatible('fftw') }}
- {{ pin_compatible('gsl') }}
- {{ pin_compatible('libactpol') }}
- {{ pin_compatible('numpy') }}
- future
- scipy
- matplotlib
- astropy
- ephem
Expand Down
17 changes: 9 additions & 8 deletions pkgs/pixell/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ requirements:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('fortran') }}
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
host:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- automake
- autoconf
Expand All @@ -46,14 +46,15 @@ requirements:
# https://github.com/conda-forge/perl-feedstock/issues/56
- libxcrypt1 # [linux]
run:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- libopenblas * openmp_*
- libblas * *openblas
- liblapack * *openblas
- python
- {{ pin_compatible('openblas') }}
- {{ pin_compatible('liblapack') }}
- {{ pin_compatible('scipy') }}
- {{ pin_compatible('numpy') }}
- scipy
- astropy
- healpy
- matplotlib
Expand Down
16 changes: 14 additions & 2 deletions pkgs/qpoint/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,32 @@ build:
requirements:
build:
- {{ compiler('c') }}
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
host:
- llvm-openmp # [osx or linux]
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- liblapack * *openblas
- python
- setuptools
- numpy=1.26.*
- scipy
# Although not a dependency, we put numba here to force
# building with a numba-compatible numpy version
- numba
# Adding astropy as a host dependency will download the current
# IERS data and store it in the package
- astropy
run:
- llvm-openmp
- _openmp_mutex * *_llvm
- openblas * openmp_*
- liblapack * *openblas
- python
- {{ pin_compatible('openblas') }}
- {{ pin_compatible('liblapack') }}
- {{ pin_compatible('scipy') }}
- {{ pin_compatible('numpy') }}

test:
Expand Down
Loading

0 comments on commit cdbf1c2

Please sign in to comment.