Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/reframe-hpc/reframe into…
Browse files Browse the repository at this point in the history
… firecrest_scheduler
  • Loading branch information
ekouts committed Nov 16, 2023
2 parents 1495671 + 5986ed5 commit e963330
Show file tree
Hide file tree
Showing 22 changed files with 98 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-flux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
container: ['fluxrm/flux-sched:focal-v0.28.0']
container: ['fluxrm/flux-sched:focal']

container:
image: ${{ matrix.container }}
Expand All @@ -28,7 +28,7 @@ jobs:

- name: Install Reframe
run: |
apt-get update && apt-get install -y python3-venv
apt-get update && apt-get install -y python3-pip curl
/bin/bash ./bootstrap.sh
export PATH=$PWD/bin:$PATH
which reframe
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,16 @@ python3 -m http.server

The documentation is now up on [localhost:8000](http://localhost:8000), where you can navigate with your browser.


## Test library

The framework comes with a library of tests that users can either run them from the command line directly or extend them and fine tune them for their systems. See [here](https://reframe-hpc.readthedocs.io/en/stable/hpctestlib.html) for more details.

The framework comes with an experimental library of tests that users can either run from the command line directly or extend and fine tune them for their systems. See [here](https://reframe-hpc.readthedocs.io/en/stable/hpctestlib.html) for more details.

## Test examples
## Public test repositories

You can find examples of real tests under the ReFrame HPC [community Github page](https://github.com/reframe-hpc).
The most complete suite of tests currently publicly available is that of [CSCS](https://cscs.ch/), which you can also find [here](https://github.com/eth-cscs/cscs-reframe-tests).
You can use those tests as a starting point for implementing your own tests.
The ReFrame HPC [community Github page](https://github.com/reframe-hpc) provides mirror forks of interesting ReFrame test repositories maintained by various sites or projects.
You can use those tests as an additional guidance to implement your own tests.

If you maintain a public test repository and you would like it to be listed in the community page, feel free to open an issue or contact us through [Slack](#slack).

## Contact

Expand Down
3 changes: 2 additions & 1 deletion bin/reframe
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
# SPDX-License-Identifier: BSD-3-Clause

import os
import platform
import sys

prefix = os.path.normpath(
os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
)
external = os.path.join(prefix, 'external')
external = os.path.join(prefix, 'external', platform.machine())
sys.path = [prefix, external] + sys.path


Expand Down
51 changes: 24 additions & 27 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ if [ -t 1 ]; then
NC='\033[0m'
fi

INFO()
{
echo -e "${BLUE}==>${NC}" ${YELLOW}$*${NC}
}


CMD()
{
echo -e "${BLUE}==>${NC}" ${YELLOW}$*${NC} && $*
Expand Down Expand Up @@ -61,7 +67,7 @@ if [ -z $ignore_errors ]; then
fi

shift $((OPTIND - 1))
if [ -z $python ]; then
if [ -z "$python" ]; then
python=python3
fi

Expand All @@ -73,55 +79,46 @@ while [ -n "$1" ]; do
esac
done

pyver=$($python -V | sed -n 's/Python \([0-9]\+\)\.\([0-9]\+\)\..*/\1.\2/p')

# We need to exit with a zero code if the Python version is the correct
# one, so we invert the comparison

if $python -c 'import sys; sys.exit(sys.version_info[:2] >= (3, 6))'; then
echo -e "ReFrame requires Python >= 3.6 (found $($python -V 2>&1))"
exit 1
fi

venvdir=$(mktemp -d)
CMD $python -m venv $venvdir
CMD python3 -m venv --without-pip $venvdir
CMD source $venvdir/bin/activate

_shutdown_venv() {
_destroy_venv() {
deactivate
/bin/rm -rf $venvdir
}

trap _shutdown_venv EXIT
trap _destroy_venv EXIT

# Disable the user installation scheme which is the default for Debian and
# cannot be combined with `--target`
export PIP_USER=0
# Create an arch-specific installation
py_pkg_prefix=external/$(uname -m)

# Check if ensurepip is installed
if $python -m ensurepip --version &> /dev/null; then
# Install pip for Python 3
CMD $python -m ensurepip --root $(pwd)/external/ --default-pip
# Install a fresh pip in the current environment
if $python -c 'import sys; sys.exit(sys.version_info[:2] == (3, 6))'; then
get_pip_url="https://bootstrap.pypa.io/get-pip.py"
else
get_pip_url="https://bootstrap.pypa.io/pip/3.6/get-pip.py"
fi

export PATH=$(pwd)/external/usr/bin:$PATH

# ensurepip installs pip in `external/usr/` whereas the `--root` option installs
# everything under `external/`. That's why we include both in the PYTHONPATH

export PYTHONPATH=$(pwd)/external:$(pwd)/external/usr/lib/python$pyver/site-packages:$PYTHONPATH

CMD $python -m pip install --no-cache-dir -q --upgrade pip --target=external/
INFO "curl -s $get_pip_url | $python"
curl -s $get_pip_url | $python

export PATH=$(pwd)/$py_pkg_prefix/usr/bin:$PATH
export PYTHONPATH=$(pwd)/$py_pkg_prefix:$PYTHONPATH
if [ -n "$PYGELF" ]; then
tmp_requirements=$(mktemp)
sed -e 's/^#+pygelf%//g' requirements.txt > $tmp_requirements
CMD_M +pygelf $python -m pip install --no-cache-dir -q -r $tmp_requirements --target=external/ --upgrade $PIPOPTS && rm $tmp_requirements
CMD_M +pygelf $python -m pip install --no-cache-dir -q -r $tmp_requirements --target=$py_pkg_prefix/ --upgrade $PIPOPTS && rm $tmp_requirements
else
CMD $python -m pip install --no-cache-dir -q -r requirements.txt --target=external/ --upgrade $PIPOPTS
CMD $python -m pip install --no-cache-dir -q -r requirements.txt --target=$py_pkg_prefix/ --upgrade $PIPOPTS
fi

if [ -n "$MAKEDOCS" ]; then
CMD_M +docs $python -m pip install --no-cache-dir -q -r docs/requirements.txt --target=external/ --upgrade $PIPOPTS
CMD_M +docs $python -m pip install --no-cache-dir -q -r docs/requirements.txt --target=$py_pkg_prefix/ --upgrade $PIPOPTS
make -C docs PYTHON=$python
fi
2 changes: 1 addition & 1 deletion ci-scripts/dockerfiles/reframe-lmod.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ghcr.io/reframe-hpc/lmod:8.4.12

# Install ReFrame unit test requirements
RUN apt-get -y update && \
apt-get -y install gcc git make python3 python3-pip python3-venv
apt-get -y install gcc git make python3 python3-pip curl

# ReFrame user
RUN useradd -ms /bin/bash rfmuser
Expand Down
2 changes: 1 addition & 1 deletion ci-scripts/dockerfiles/reframe-lmod77.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM ghcr.io/reframe-hpc/lmod:7.7

# Install ReFrame unit test requirements
RUN apt-get -y update && \
apt-get -y install gcc make python3 python3-pip python3-venv
apt-get -y install gcc make python3 python3-pip curl

# ReFrame user
RUN useradd -ms /bin/bash rfmuser
Expand Down
2 changes: 1 addition & 1 deletion ci-scripts/dockerfiles/reframe-tmod4.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM ghcr.io/reframe-hpc/tmod:4.6.0
# ReFrame requirements
RUN \
apt-get -y update && \
apt-get -y install gcc make git python3 python3-pip python3-venv
apt-get -y install gcc make git python3 python3-pip curl

# ReFrame user
RUN useradd -ms /bin/bash rfmuser
Expand Down
2 changes: 1 addition & 1 deletion ci-scripts/dockerfiles/tutorials.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV _EB_VER=4.4.1

# Install ReFrame unit test requirements
RUN apt-get -y update && \
apt-get -y install gcc git make python3 python3-pip python3-venv curl
apt-get -y install gcc git make python3 python3-pip curl

# ReFrame user
RUN useradd -ms /bin/bash rfmuser
Expand Down
2 changes: 1 addition & 1 deletion docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="https://github.com/reframe-hpc/reframe" target="_blank">ReFrame Github repo</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://github.com/reframe-hpc" target="_blank">ReFrame site tests</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://reframe-slack.herokuapp.com/" target="_blank">ReFrame's Slack workspace</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://join.slack.com/t/reframetalk/shared_invite/zt-1tar8s71w-At0tolJ~~zxT2oG_2Ly9sw" target="_blank">ReFrame's Slack workspace</a></li>
<li class="toctree-l1"><a class="reference internal" href="https://twitter.com/ReFrameHPC" target="_blank">@ReFrameHPC on Twitter</a></li>
</ul>
{% endblock %}
6 changes: 5 additions & 1 deletion docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,7 @@ All logging handlers share the following set of common attributes:
``%(check_prebuild_cmds)s``, The value of the :attr:`~reframe.core.pipeline.RegressionTest.prebuild_cmds` attribute.
``%(check_prefix)s``, The value of the :attr:`~reframe.core.pipeline.RegressionTest.prefix` attribute.
``%(check_prerun_cmds)s``, The value of the :attr:`~reframe.core.pipeline.RegressionTest.prerun_cmds` attribute.
``%(check_result)s``, The result of the test (``pass`` or ``fail``).
``%(check_readonly_files)s``, The value of the :attr:`~reframe.core.pipeline.RegressionTest.readonly_files` attribute.
``%(check_short_name)s``, The value of the :attr:`~reframe.core.pipeline.RegressionTest.short_name` attribute.
``%(check_sourcepath)s``, The value of the :attr:`~reframe.core.pipeline.RegressionTest.sourcepath` attribute.
Expand Down Expand Up @@ -1116,6 +1117,9 @@ All logging handlers share the following set of common attributes:
.. versionchanged:: 3.11.0
Limit the number of attributes that can be logged. User attributes or properties must be explicitly marked as "loggable" in order to be selectable for logging.

.. versionadded:: 4.0
The ``%(check_result)s`` specifier is added.

.. versionadded:: 4.3
The ``%(check_#ALL)s`` special specifier is added.

Expand Down Expand Up @@ -1188,7 +1192,7 @@ The additional properties for the ``file`` handler are the following:

.. py:attribute:: logging.handlers..file..append
.. py:attribute:: logging.handlers_perflog..file..ppend
.. py:attribute:: logging.handlers_perflog..file..append
:required: No
:default: ``false``
Expand Down
4 changes: 4 additions & 0 deletions docs/deferrable_functions_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The key characteristic of these functions is that they store their arguments whe
ReFrame provides an ample set of deferrable utilities and it also allows users to write their own deferrable functions when needed.
Please refer to ":doc:`deferrables`" for a hands-on explanation on how deferrable functions work and how to create custom deferrable functions.

.. contents:: Contents
:local:
:backlinks: entry


Explicit evaluation of deferrable functions
-------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions docs/manpage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ Options controlling ReFrame execution
the :option:`-P` option can only parameterize the leaf test:
it cannot be used to parameterize a fixture of the test.

.. note::

The :option:`-P` option supports only tests that use fixtures.
Tests that use raw dependencies are not supported.

.. versionadded:: 4.3

.. option:: --repeat=N
Expand Down
2 changes: 1 addition & 1 deletion docs/programming_apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Programming APIs
================

.. toctree::
:maxdepth: 3
:maxdepth: 2

regression_test_api
deferrable_functions_reference
Expand Down
6 changes: 5 additions & 1 deletion docs/regression_test_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ This page provides a reference guide of the ReFrame API for writing regression t
Internal data structures and APIs are covered only to the extent that this might be helpful to the final user of the framework.


.. _regression-bases:
.. contents:: Contents
:local:
:backlinks: entry

.. _regression-bases:

-----------------
Test Base Classes
Expand Down
4 changes: 4 additions & 0 deletions docs/utility_functions_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Utility Functions
This is a collection of utility functions and classes that are used by the framework but can also be useful when writing regression tests.
Functions or classes marked as draft should be used with caution, since they might change or be replaced without a deprecation warning.

.. contents:: Contents
:local:
:backlinks: entry


General Utilities
-----------------
Expand Down
2 changes: 1 addition & 1 deletion reframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import sys

VERSION = '4.5.0-dev.0'
VERSION = '4.5.0-dev.1'
INSTALL_PREFIX = os.path.normpath(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
)
Expand Down
4 changes: 0 additions & 4 deletions reframe/core/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,13 +789,9 @@ def __init__(self, logger=None, check=None):
'__rfm_check__': check,
'__rfm_loggable_attrs__': [],
'check_name': 'reframe',
'check_jobid': None,
'check_job_completion_time': None,
'check_job_completion_time_unix': None,
'check_info': 'reframe',
'check_system': None,
'check_partition': None,
'check_environ': None,
'check_perf_var': None,
'check_perf_value': None,
'check_perf_ref': None,
Expand Down
4 changes: 2 additions & 2 deletions reframe/core/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def __init__(self, *args, **kwargs):

@property
def nodelist(self):
# Redefine nodelist so as to generate it from the nodespec
if self._nodelist is None and self._nodespec is not None:
# Generate the nodelist only after the job is finished
if slurm_state_completed(self.state):
completed = osext.run_command(
f'scontrol show hostname {self._nodespec}', log=False
)
Expand Down
1 change: 1 addition & 0 deletions reframe/frontend/autodetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def _emit_script_for_pip(job, env):
commands = [
'python3 -m venv venv.reframe',
'source venv.reframe/bin/activate',
'pip install --upgrade pip',
f'pip install reframe-hpc=={rfm.VERSION}',
'reframe --detect-host-topology=topo.json',
'deactivate'
Expand Down
Loading

0 comments on commit e963330

Please sign in to comment.