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

test bootstrap script in separate workflow, and limit test configurations a bit #3646

Merged
merged 2 commits into from
Apr 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
120 changes: 120 additions & 0 deletions .github/workflows/bootstrap_script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: test EasyBuild bootstrap script
on: [push, pull_request]
jobs:
setup:
runs-on: ubuntu-latest
outputs:
lmod7: Lmod-7.8.22
lmod8: Lmod-8.4.27
modulesTcl: modules-tcl-1.147
modules3: modules-3.2.10
modules4: modules-4.1.4
steps:
- run: "true"
build:
needs: setup
runs-on: ubuntu-18.04
strategy:
matrix:
python: [2.7, 3.6, 3.7, 3.8, 3.9]
modules_tool:
# use variables defined by 'setup' job above, see also
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
- ${{needs.setup.outputs.lmod7}}
- ${{needs.setup.outputs.lmod8}}
module_syntax: [Lua]
lc_all: [""]
include:
# also test with module tools other than Lmod (only Tcl syntax)
- modules_tool: ${{needs.setup.outputs.modulesTcl}}
module_syntax: Tcl
python: 2.7
- modules_tool: ${{needs.setup.outputs.modulesTcl}}
module_syntax: Tcl
python: 3.6
- modules_tool: ${{needs.setup.outputs.modules3}}
module_syntax: Tcl
python: 2.7
- modules_tool: ${{needs.setup.outputs.modules3}}
module_syntax: Tcl
python: 3.6
- modules_tool: ${{needs.setup.outputs.modules4}}
module_syntax: Tcl
python: 2.7
- modules_tool: ${{needs.setup.outputs.modules4}}
module_syntax: Tcl
python: 3.6
# There may be encoding errors in Python 3 which are hidden when an UTF-8 encoding is set
# Hence run the tests (again) with LC_ALL=C and Python 3.6 (or any < 3.7)
- python: 3.6
modules_tool: ${{needs.setup.outputs.lmod8}}
module_syntax: Lua
lc_all: C
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: set up Python
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python}}
architecture: x64

- name: install OS & Python packages
run: |
# disable apt-get update, we don't really need it,
# and it does more harm than good (it's fairly expensive, and it results in flaky test runs)
# sudo apt-get update
# for modules tool
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
# fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
# needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then
sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so
fi

- name: install modules tool
run: |
# avoid downloading modules tool sources into easybuild-framework dir
cd $HOME
export INSTALL_DEP=$GITHUB_WORKSPACE/easybuild/scripts/install_eb_dep.sh
# install Lmod
source $INSTALL_DEP ${{matrix.modules_tool}} $HOME
# changes in environment are not passed to other steps, so need to create files...
echo $MOD_INIT > mod_init
echo $PATH > path
if [ ! -z $MODULESHOME ]; then echo $MODULESHOME > moduleshome; fi

- name: test bootstrap script
run: |
# (re)initialize environment for modules tool
if [ -f $HOME/moduleshome ]; then export MODULESHOME=$(cat $HOME/moduleshome); fi
source $(cat $HOME/mod_init); type module
# also pick up changes to $PATH set by sourcing $HOME/mod_init
export PATH=$(cat $HOME/path)

# define $EASYBUILD_MODULES_TOOL only for oldest module tools
# (for Lmod and EnvironmentModules 4.x the bootstrap script should correctly auto-detect the modules tool)
if [[ ${{matrix.modules_tool}} =~ ^modules-tcl- ]]; then
export EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl
elif [[ ${{matrix.modules_tool}} =~ ^modules-3 ]]; then
export EASYBUILD_MODULES_TOOL=EnvironmentModulesC
fi

# version and SHA256 checksum are hardcoded below to avoid forgetting to update the version in the script along with contents
EB_BOOTSTRAP_VERSION=$(grep '^EB_BOOTSTRAP_VERSION' easybuild/scripts/bootstrap_eb.py | sed 's/[^0-9.]//g')
EB_BOOTSTRAP_SHA256SUM=$(sha256sum easybuild/scripts/bootstrap_eb.py | cut -f1 -d' ')
EB_BOOTSTRAP_FOUND="$EB_BOOTSTRAP_VERSION $EB_BOOTSTRAP_SHA256SUM"
EB_BOOTSTRAP_EXPECTED="20210106.01 c2d93de0dd91123eb4f51cfc16d1f5efb80f1d238b3d6cd100994086887a1ae0"
test "$EB_BOOTSTRAP_FOUND" = "$EB_BOOTSTRAP_EXPECTED" || (echo "Version check on bootstrap script failed $EB_BOOTSTRAP_FOUND" && exit 1)

# test bootstrap script
export PREFIX=/tmp/$USER/$GITHUB_SHA/eb_bootstrap
python easybuild/scripts/bootstrap_eb.py $PREFIX
# unset $PYTHONPATH to avoid mixing two EasyBuild 'installations' when testing bootstrapped EasyBuild module
unset PYTHONPATH
# simple sanity check on bootstrapped EasyBuild module
module use $PREFIX/modules/all
module load EasyBuild
eb --version
33 changes: 0 additions & 33 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,36 +197,3 @@ jobs:
# '|| true' is needed to avoid that Travis stops the job on non-zero exit of grep (i.e. when there are no matches)
PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true)
test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite\n${PRINTED_MSG}" && exit 1)

- name: test bootstrap script
run: |
# (re)initialize environment for modules tool
if [ -f $HOME/moduleshome ]; then export MODULESHOME=$(cat $HOME/moduleshome); fi
source $(cat $HOME/mod_init); type module
# also pick up changes to $PATH set by sourcing $HOME/mod_init
export PATH=$(cat $HOME/path)

# define $EASYBUILD_MODULES_TOOL only for oldest module tools
# (for Lmod and EnvironmentModules 4.x the bootstrap script should correctly auto-detect the modules tool)
if [[ ${{matrix.modules_tool}} =~ ^modules-tcl- ]]; then
export EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl
elif [[ ${{matrix.modules_tool}} =~ ^modules-3 ]]; then
export EASYBUILD_MODULES_TOOL=EnvironmentModulesC
fi

# version and SHA256 checksum are hardcoded below to avoid forgetting to update the version in the script along with contents
EB_BOOTSTRAP_VERSION=$(grep '^EB_BOOTSTRAP_VERSION' easybuild/scripts/bootstrap_eb.py | sed 's/[^0-9.]//g')
EB_BOOTSTRAP_SHA256SUM=$(sha256sum easybuild/scripts/bootstrap_eb.py | cut -f1 -d' ')
EB_BOOTSTRAP_FOUND="$EB_BOOTSTRAP_VERSION $EB_BOOTSTRAP_SHA256SUM"
EB_BOOTSTRAP_EXPECTED="20210106.01 c2d93de0dd91123eb4f51cfc16d1f5efb80f1d238b3d6cd100994086887a1ae0"
test "$EB_BOOTSTRAP_FOUND" = "$EB_BOOTSTRAP_EXPECTED" || (echo "Version check on bootstrap script failed $EB_BOOTSTRAP_FOUND" && exit 1)

# test bootstrap script
export PREFIX=/tmp/$USER/$GITHUB_SHA/eb_bootstrap
python easybuild/scripts/bootstrap_eb.py $PREFIX
# unset $PYTHONPATH to avoid mixing two EasyBuild 'installations' when testing bootstrapped EasyBuild module
unset PYTHONPATH
# simple sanity check on bootstrapped EasyBuild module
module use $PREFIX/modules/all
module load EasyBuild
eb --version