From 0e7bae375a88decb1192b9b3a4348116ca587021 Mon Sep 17 00:00:00 2001 From: rafael Date: Fri, 28 May 2021 10:14:27 +0200 Subject: [PATCH 01/18] add bzip2 tutorial file --- tutorials/advanced/easybuild/eb_test.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tutorials/advanced/easybuild/eb_test.py diff --git a/tutorials/advanced/easybuild/eb_test.py b/tutorials/advanced/easybuild/eb_test.py new file mode 100644 index 0000000000..c9fa43f8bb --- /dev/null +++ b/tutorials/advanced/easybuild/eb_test.py @@ -0,0 +1,23 @@ +import reframe as rfm +import reframe.utility.sanity as sn + + +class EasybuildMixin(rfm.RegressionTest): + @rfm.run_before('run') + def prepare_run(self): + self.modules = self.build_system.generated_modules + + +@rfm.simple_test +class BZip2Check(EasybuildMixin): + def __init__(self): + self.descr = 'This demonstrates the EasyBuild build system.' + self.valid_systems = ['daint:gpu'] + self.valid_prog_environs = ['builtin'] + self.modules = ['EasyBuild-custom'] + self.build_system = 'EasyBuild' + self.build_system.easyconfigs = ['bzip2-1.0.6.eb'] + self.build_system.options = ['-f'] + self.sanity_patterns = sn.assert_found(r'Version 1.0.6', self.stderr) + self.executable = 'bzip2' + self.executable_opts = ['--help'] From 3748f96277b51cb919fe3bf82adda912be56bbdc Mon Sep 17 00:00:00 2001 From: sarafael Date: Fri, 28 May 2021 14:59:13 +0200 Subject: [PATCH 02/18] add doc --- docs/tutorial_easybuild.rst | 83 +++++++++++++++++++ docs/tutorials.rst | 1 + .../easybuild/eb_test.py | 8 +- 3 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 docs/tutorial_easybuild.rst rename tutorials/{advanced => build_systems}/easybuild/eb_test.py (78%) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_easybuild.rst new file mode 100644 index 0000000000..e86f6a2f75 --- /dev/null +++ b/docs/tutorial_easybuild.rst @@ -0,0 +1,83 @@ +============================================ +Tutorial 2: Using the EasyBuild build system +============================================ + +In this tutorial we will present how to build and install software in a ReFrame test given an EasyBuild easyconfig file. +The example uses the configuration file presented in :doc:`tutorial_basics`, which you can find in ``tutorials/config/settings.py``. +We also assume that the reader is already familiar with the concepts presented in the basic tutorial and has a working knowledge of EasyBuild. +Finally, to avoid specifying the tutorial configuration file each time you run the test, make sure to export it here: + +.. code:: bash + + export RFM_CONFIG_FILE=$(pwd)/tutorials/config/mysettings.py + + + +Basic test using EasyBuild +---------------------------- + +Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the easyconfig `bzip2-1.0.6.eb `__ and checks that the installed version is correct. +The following code block shows the check highlighting the lines specific to this tutorial: + + +.. literalinclude:: ../tutorials/build_systems/easybuild/eb_test.py + :emphasize-lines: 5-8,19-21 + +The test looks pretty standard except for the highlighted blocks. +Let's have a look first to the block in the ``BZip2Check`` class. + +The first thing is to specify that the EasyBuild build system will be used. +This is done by setting :attr:`~reframe.core.pipeline.RegressionTest.build_system` to ``'EasyBuild'``. +Then, the software to be installed is passed as a list to :attr:`~reframe.core.buildsystems.EasyBuild.easyconfigs`. +Here only one easyconfig is given, but more than one can be passed. +Finally, through :attr:`~reframe.core.buildsystems.EasyBuild.options`, command line options can be passed to the ``eb`` executable. +In this test we pass ``-f`` to make sure that ``bzip2`` will be built even if the module already exists externally. + +For this test, ReFrame generates the following command to build and install the easyconfig: + +.. code-block:: console + + eb bzip2-1.0.6.eb -f + +All the files generated by this command i.e. the sources, temporary files, installed software and the corresponding modules, are located in the folder ``easybuild`` in the stage directory. + +Now we know all related to building and installing the code so we can move to the part dealing with running it. +To run the code, the generated modules need to be loaded in order to make the software available. +The modules can be accessed through :attr:`~reframe.core.buildsystems.Easybuild.generated_modules`, however, they are available only after EasyBuild is done wit the installation. +This means that :attr:`~reframe.core.pipeline.RegressionTest.modules` can be set only after the build phase finishes. +For that, we can set :attr:`~reframe.core.pipeline.RegressionTest.modules` in a class method wrapped by the :py:func:`~reframe.core.decorators.run_before` decorator, specifying the ``run`` phase. +In this test this is done with the function ``prepare_run()`` in the mixin class ``EasybuildMixin`` that serves as a parent class for the regression test. +Writing this as a mixin class is a convenient way of creating a block of code that can be easily reused for other tests. +This test will run then the following commands: + +.. code-block:: console + + module load bzip/1.06 + bzip2 --help + +Since all EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage``, they are going to be wiped out after the test passes. +:attr:`~reframe.core.pipeline.RegressionTest.keep_files` can be used to avoid that: + +.. code-block:: python + + self.keep_files = ['easybuild'] + + + +Packaging the installation +-------------------------- + +The EasyBuild build system offers a way of packaging the installation by using EasyBuild's packaging support. +To use this feature, `the FPM package manager `__ must be available. +By setting the dictionary :attr:`~reframe.core.buildsystems.Easybuild.package_opts` in the test, ReFrame will pass ``--package-{key}={val}`` to the EasyBuild invocation. +For instance, the following can be set to package the installations as an rpm file: + +.. code-block:: python + + self.keep_files = ['easybuild/packages'] + self.build_system.package_opts = { + 'type': 'rpm', + } + +The packages are generated by EasyBuild in the stage directory. +To keep them after the test passes, :attr:`~reframe.core.pipeline.RegressionTest.keep_files` needs to be set. diff --git a/docs/tutorials.rst b/docs/tutorials.rst index 174bae3c2f..a07bc57f37 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -9,6 +9,7 @@ ReFrame Tutorials tutorial_advanced tutorial_deps tutorial_tips_tricks + tutorial_easybuild Online Tutorials diff --git a/tutorials/advanced/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py similarity index 78% rename from tutorials/advanced/easybuild/eb_test.py rename to tutorials/build_systems/easybuild/eb_test.py index c9fa43f8bb..c08bf9160d 100644 --- a/tutorials/advanced/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -13,11 +13,13 @@ class BZip2Check(EasybuildMixin): def __init__(self): self.descr = 'This demonstrates the EasyBuild build system.' self.valid_systems = ['daint:gpu'] - self.valid_prog_environs = ['builtin'] - self.modules = ['EasyBuild-custom'] + self.valid_prog_environs = ['gnu'] + self.modules = ['daint-gpu', + 'EasyBuild-custom'] self.build_system = 'EasyBuild' self.build_system.easyconfigs = ['bzip2-1.0.6.eb'] self.build_system.options = ['-f'] - self.sanity_patterns = sn.assert_found(r'Version 1.0.6', self.stderr) + self.sanity_patterns = sn.assert_found(r'Version 1.0.6', + self.stderr) self.executable = 'bzip2' self.executable_opts = ['--help'] From 62ed71d5f93a2907d0611586537975c91c46ff6e Mon Sep 17 00:00:00 2001 From: rsarm Date: Mon, 7 Jun 2021 10:27:34 +0200 Subject: [PATCH 03/18] Apply suggestions from code review Co-authored-by: Theofilos Manitaras --- docs/tutorial_easybuild.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_easybuild.rst index e86f6a2f75..3ecc17c318 100644 --- a/docs/tutorial_easybuild.rst +++ b/docs/tutorial_easybuild.rst @@ -17,7 +17,7 @@ Basic test using EasyBuild ---------------------------- Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the easyconfig `bzip2-1.0.6.eb `__ and checks that the installed version is correct. -The following code block shows the check highlighting the lines specific to this tutorial: +The following code block shows the check, highlighting the lines specific to this tutorial: .. literalinclude:: ../tutorials/build_systems/easybuild/eb_test.py @@ -41,22 +41,22 @@ For this test, ReFrame generates the following command to build and install the All the files generated by this command i.e. the sources, temporary files, installed software and the corresponding modules, are located in the folder ``easybuild`` in the stage directory. -Now we know all related to building and installing the code so we can move to the part dealing with running it. +Now that we know everything related to building and installing the code, we can move to the part dealing with running it. To run the code, the generated modules need to be loaded in order to make the software available. -The modules can be accessed through :attr:`~reframe.core.buildsystems.Easybuild.generated_modules`, however, they are available only after EasyBuild is done wit the installation. +The modules can be accessed through :attr:`~reframe.core.buildsystems.Easybuild.generated_modules`, however, they are available only after EasyBuild completes the installation. This means that :attr:`~reframe.core.pipeline.RegressionTest.modules` can be set only after the build phase finishes. For that, we can set :attr:`~reframe.core.pipeline.RegressionTest.modules` in a class method wrapped by the :py:func:`~reframe.core.decorators.run_before` decorator, specifying the ``run`` phase. -In this test this is done with the function ``prepare_run()`` in the mixin class ``EasybuildMixin`` that serves as a parent class for the regression test. +In this test this is done by the function ``prepare_run()`` of the mixin class ``EasybuildMixin`` which is a parent class of the regression test. Writing this as a mixin class is a convenient way of creating a block of code that can be easily reused for other tests. -This test will run then the following commands: +This test will then run the following commands: .. code-block:: console module load bzip/1.06 bzip2 --help -Since all EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage``, they are going to be wiped out after the test passes. -:attr:`~reframe.core.pipeline.RegressionTest.keep_files` can be used to avoid that: +Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. +The :attr:`~reframe.core.pipeline.RegressionTest.keep_files` attribute can be used to avoid that: .. code-block:: python @@ -67,7 +67,7 @@ Since all EasyBuild files are in the stage directory, unless ReFrame was run wit Packaging the installation -------------------------- -The EasyBuild build system offers a way of packaging the installation by using EasyBuild's packaging support. +The EasyBuild build system offers a way of packaging the installation via EasyBuild's packaging support. To use this feature, `the FPM package manager `__ must be available. By setting the dictionary :attr:`~reframe.core.buildsystems.Easybuild.package_opts` in the test, ReFrame will pass ``--package-{key}={val}`` to the EasyBuild invocation. For instance, the following can be set to package the installations as an rpm file: @@ -80,4 +80,4 @@ For instance, the following can be set to package the installations as an rpm fi } The packages are generated by EasyBuild in the stage directory. -To keep them after the test passes, :attr:`~reframe.core.pipeline.RegressionTest.keep_files` needs to be set. +To retain them after the test succeeds, :attr:`~reframe.core.pipeline.RegressionTest.keep_files` needs to be set. From f69b267b30dc2619aacf95976fd239d39c529490 Mon Sep 17 00:00:00 2001 From: rafael Date: Mon, 28 Jun 2021 22:17:39 +0200 Subject: [PATCH 04/18] fix comments --- docs/tutorial_easybuild.rst | 8 ++--- tutorials/build_systems/easybuild/eb_test.py | 31 ++++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_easybuild.rst index 3ecc17c318..2239e04498 100644 --- a/docs/tutorial_easybuild.rst +++ b/docs/tutorial_easybuild.rst @@ -1,5 +1,5 @@ ============================================ -Tutorial 2: Using the EasyBuild build system +Tutorial 5: Using the EasyBuild build system ============================================ In this tutorial we will present how to build and install software in a ReFrame test given an EasyBuild easyconfig file. @@ -45,9 +45,7 @@ Now that we know everything related to building and installing the code, we can To run the code, the generated modules need to be loaded in order to make the software available. The modules can be accessed through :attr:`~reframe.core.buildsystems.Easybuild.generated_modules`, however, they are available only after EasyBuild completes the installation. This means that :attr:`~reframe.core.pipeline.RegressionTest.modules` can be set only after the build phase finishes. -For that, we can set :attr:`~reframe.core.pipeline.RegressionTest.modules` in a class method wrapped by the :py:func:`~reframe.core.decorators.run_before` decorator, specifying the ``run`` phase. -In this test this is done by the function ``prepare_run()`` of the mixin class ``EasybuildMixin`` which is a parent class of the regression test. -Writing this as a mixin class is a convenient way of creating a block of code that can be easily reused for other tests. +For that, we can set :attr:`~reframe.core.pipeline.RegressionTest.modules` in a class method wrapped by the :py:func:`~reframe.core.RegressionTest.run_before` built-in, specifying the ``run`` phase. This test will then run the following commands: .. code-block:: console @@ -56,7 +54,7 @@ This test will then run the following commands: bzip2 --help Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. -The :attr:`~reframe.core.pipeline.RegressionTest.keep_files` attribute can be used to avoid that: +The :attr:`~reframe.core.pipeline.RegressionTest.keep_files` can be use to copy the files generated by EasyBuild to the output directory once the test has successfully finished: .. code-block:: python diff --git a/tutorials/build_systems/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py index c08bf9160d..e61de9c6a1 100644 --- a/tutorials/build_systems/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -2,24 +2,25 @@ import reframe.utility.sanity as sn -class EasybuildMixin(rfm.RegressionTest): - @rfm.run_before('run') - def prepare_run(self): - self.modules = self.build_system.generated_modules - - @rfm.simple_test -class BZip2Check(EasybuildMixin): - def __init__(self): - self.descr = 'This demonstrates the EasyBuild build system.' - self.valid_systems = ['daint:gpu'] - self.valid_prog_environs = ['gnu'] - self.modules = ['daint-gpu', - 'EasyBuild-custom'] +class BZip2Check(rfm.RegressionTest): + descr = 'This demonstrates the EasyBuild build system.' + valid_systems = ['daint:gpu'] + valid_prog_environs = ['gnu'] + executable = 'bzip2' + executable_opts = ['--help'] + + @run_before('compile') + def set_makefile(self): self.build_system = 'EasyBuild' self.build_system.easyconfigs = ['bzip2-1.0.6.eb'] self.build_system.options = ['-f'] + + @run_before('sanity') + def set_sanity(self): self.sanity_patterns = sn.assert_found(r'Version 1.0.6', self.stderr) - self.executable = 'bzip2' - self.executable_opts = ['--help'] + + @run_before('run') + def prepare_run(self): + self.modules = self.build_system.generated_modules From dfa094c4dcc67a3d45d98a6dd251d67009d0a6ec Mon Sep 17 00:00:00 2001 From: sarafael Date: Mon, 28 Jun 2021 22:29:56 +0200 Subject: [PATCH 05/18] fix comments --- docs/tutorial_easybuild.rst | 4 ++-- tutorials/build_systems/easybuild/eb_test.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_easybuild.rst index 2239e04498..e02ccc37b1 100644 --- a/docs/tutorial_easybuild.rst +++ b/docs/tutorial_easybuild.rst @@ -21,7 +21,7 @@ The following code block shows the check, highlighting the lines specific to thi .. literalinclude:: ../tutorials/build_systems/easybuild/eb_test.py - :emphasize-lines: 5-8,19-21 + :emphasize-lines: 15-17,21 The test looks pretty standard except for the highlighted blocks. Let's have a look first to the block in the ``BZip2Check`` class. @@ -54,7 +54,7 @@ This test will then run the following commands: bzip2 --help Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. -The :attr:`~reframe.core.pipeline.RegressionTest.keep_files` can be use to copy the files generated by EasyBuild to the output directory once the test has successfully finished: +The attribute :attr:`~reframe.core.pipeline.RegressionTest.keep_files` can be use to copy the files generated by EasyBuild to the output directory once the test has successfully finished: .. code-block:: python diff --git a/tutorials/build_systems/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py index e61de9c6a1..75b4c59a3f 100644 --- a/tutorials/build_systems/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -16,11 +16,11 @@ def set_makefile(self): self.build_system.easyconfigs = ['bzip2-1.0.6.eb'] self.build_system.options = ['-f'] + @run_before('run') + def prepare_run(self): + self.modules = self.build_system.generated_modules + @run_before('sanity') def set_sanity(self): self.sanity_patterns = sn.assert_found(r'Version 1.0.6', self.stderr) - - @run_before('run') - def prepare_run(self): - self.modules = self.build_system.generated_modules From 1dc76adecc5a1605c312a0984085e4ee1500f4dc Mon Sep 17 00:00:00 2001 From: sarafael Date: Fri, 2 Jul 2021 15:21:45 +0200 Subject: [PATCH 06/18] fix comment --- docs/tutorial_easybuild.rst | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_easybuild.rst index e02ccc37b1..0be92655e5 100644 --- a/docs/tutorial_easybuild.rst +++ b/docs/tutorial_easybuild.rst @@ -1,8 +1,8 @@ -============================================ -Tutorial 5: Using the EasyBuild build system -============================================ +==================================================== +Tutorial 5: Using package managers as a build system +==================================================== -In this tutorial we will present how to build and install software in a ReFrame test given an EasyBuild easyconfig file. +In this tutorial we will present how to use package managers as a build system for a ReFrame test. The example uses the configuration file presented in :doc:`tutorial_basics`, which you can find in ``tutorials/config/settings.py``. We also assume that the reader is already familiar with the concepts presented in the basic tutorial and has a working knowledge of EasyBuild. Finally, to avoid specifying the tutorial configuration file each time you run the test, make sure to export it here: @@ -16,6 +16,8 @@ Finally, to avoid specifying the tutorial configuration file each time you run t Basic test using EasyBuild ---------------------------- +First we are going to see how to build and install software in a ReFrame test given an EasyBuild easyconfig file. +EasyBuild is expected to be available in order to run the examples of this tutorial. Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the easyconfig `bzip2-1.0.6.eb `__ and checks that the installed version is correct. The following code block shows the check, highlighting the lines specific to this tutorial: @@ -39,7 +41,16 @@ For this test, ReFrame generates the following command to build and install the eb bzip2-1.0.6.eb -f -All the files generated by this command i.e. the sources, temporary files, installed software and the corresponding modules, are located in the folder ``easybuild`` in the stage directory. +To keep all the files generated by this command i.e. the sources, temporary files, installed software and the corresponding modules, in the folder stage directory, ReFrame sets the relevant EasyBuild's environment variables as follows: + +.. code-block:: console + + export EASYBUILD_BUILDPATH=/build + export EASYBUILD_INSTALLPATH= + export EASYBUILD_PREFIX= + export EASYBUILD_SOURCEPATH= + +Here ```` is set to the directory ``easybuild`` within the stage directory. Now that we know everything related to building and installing the code, we can move to the part dealing with running it. To run the code, the generated modules need to be loaded in order to make the software available. @@ -50,7 +61,7 @@ This test will then run the following commands: .. code-block:: console - module load bzip/1.06 + module load bzip/1.0.6 bzip2 --help Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. From 89d90c5f599730cac7475e344258809a60ab6391 Mon Sep 17 00:00:00 2001 From: sarafael Date: Thu, 8 Jul 2021 08:43:01 +0200 Subject: [PATCH 07/18] fix comments --- tutorials/build_systems/easybuild/eb_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/build_systems/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py index 75b4c59a3f..c9ab90529f 100644 --- a/tutorials/build_systems/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -5,13 +5,13 @@ @rfm.simple_test class BZip2Check(rfm.RegressionTest): descr = 'This demonstrates the EasyBuild build system.' - valid_systems = ['daint:gpu'] - valid_prog_environs = ['gnu'] + valid_systems = ['*'] + valid_prog_environs = ['builtin'] executable = 'bzip2' executable_opts = ['--help'] @run_before('compile') - def set_makefile(self): + def setup_build_system(self): self.build_system = 'EasyBuild' self.build_system.easyconfigs = ['bzip2-1.0.6.eb'] self.build_system.options = ['-f'] From cd1aa77332741bbe636fa792127ab25afeb1f103 Mon Sep 17 00:00:00 2001 From: sarafael Date: Thu, 8 Jul 2021 14:28:22 +0200 Subject: [PATCH 08/18] remove keep_files --- docs/tutorial_easybuild.rst | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_easybuild.rst index 0be92655e5..7158632f52 100644 --- a/docs/tutorial_easybuild.rst +++ b/docs/tutorial_easybuild.rst @@ -64,13 +64,7 @@ This test will then run the following commands: module load bzip/1.0.6 bzip2 --help -Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. -The attribute :attr:`~reframe.core.pipeline.RegressionTest.keep_files` can be use to copy the files generated by EasyBuild to the output directory once the test has successfully finished: - -.. code-block:: python - - self.keep_files = ['easybuild'] - +Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. That option can be used together with ``--dont-restage`` to avoid rebuilding when runing the test multiple times. Packaging the installation From 7f9f2e0120849b560ad40e50468ceedbc8e8d8a7 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 7 Jul 2021 13:41:44 +0200 Subject: [PATCH 09/18] Fine tune EB as a build system docs --- ...uild.rst => tutorial_build_automation.rst} | 45 ++++++++++--------- docs/tutorials.rst | 2 +- reframe/core/buildsystems.py | 2 +- 3 files changed, 26 insertions(+), 23 deletions(-) rename docs/{tutorial_easybuild.rst => tutorial_build_automation.rst} (70%) diff --git a/docs/tutorial_easybuild.rst b/docs/tutorial_build_automation.rst similarity index 70% rename from docs/tutorial_easybuild.rst rename to docs/tutorial_build_automation.rst index 7158632f52..c4829597d5 100644 --- a/docs/tutorial_easybuild.rst +++ b/docs/tutorial_build_automation.rst @@ -1,10 +1,10 @@ -==================================================== -Tutorial 5: Using package managers as a build system -==================================================== +========================================================== +Tutorial 5: Using Build Automation Tools As a Build System +========================================================== -In this tutorial we will present how to use package managers as a build system for a ReFrame test. +In this tutorial we will present how to use `Easybuild `__ and `Spack `__ as a build system for a ReFrame test. The example uses the configuration file presented in :doc:`tutorial_basics`, which you can find in ``tutorials/config/settings.py``. -We also assume that the reader is already familiar with the concepts presented in the basic tutorial and has a working knowledge of EasyBuild. +We also assume that the reader is already familiar with the concepts presented in the basic tutorial and has a working knowledge of EasyBuild and Spack. Finally, to avoid specifying the tutorial configuration file each time you run the test, make sure to export it here: .. code:: bash @@ -13,20 +13,17 @@ Finally, to avoid specifying the tutorial configuration file each time you run t -Basic test using EasyBuild ----------------------------- +Using EasyBuild to Build the Test Code +-------------------------------------- -First we are going to see how to build and install software in a ReFrame test given an EasyBuild easyconfig file. -EasyBuild is expected to be available in order to run the examples of this tutorial. Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the easyconfig `bzip2-1.0.6.eb `__ and checks that the installed version is correct. The following code block shows the check, highlighting the lines specific to this tutorial: - .. literalinclude:: ../tutorials/build_systems/easybuild/eb_test.py :emphasize-lines: 15-17,21 The test looks pretty standard except for the highlighted blocks. -Let's have a look first to the block in the ``BZip2Check`` class. +Let's have a look first to the block in the :class:`BZip2Check` class. The first thing is to specify that the EasyBuild build system will be used. This is done by setting :attr:`~reframe.core.pipeline.RegressionTest.build_system` to ``'EasyBuild'``. @@ -39,18 +36,24 @@ For this test, ReFrame generates the following command to build and install the .. code-block:: console + export EASYBUILD_BUILDPATH={stagedir}/easybuild/build + export EASYBUILD_INSTALLPATH={stagedir}/easybuild + export EASYBUILD_PREFIX={stagedir}/easybuild + export EASYBUILD_SOURCEPATH={stagedir}/easybuild eb bzip2-1.0.6.eb -f -To keep all the files generated by this command i.e. the sources, temporary files, installed software and the corresponding modules, in the folder stage directory, ReFrame sets the relevant EasyBuild's environment variables as follows: +ReFrame will keep all the files generated by EasyBuild (sources, temporary files, installed software and the corresponding modules) under the test's stage directory. +For this reason it sets the relevant EasyBuild environment variables. -.. code-block:: console +.. tip:: + + Users may set the EasyBuild prefix to a different location by setting the :attr:`~reframe.core.buildsystems.EasyBuild.prefix` attribute of the build system. + This allows you to have the built software installed upon successful completion of the build phase, but if the test fails in a later stage (sanity, performance), the installed software will not be cleaned up automatically. - export EASYBUILD_BUILDPATH=/build - export EASYBUILD_INSTALLPATH= - export EASYBUILD_PREFIX= - export EASYBUILD_SOURCEPATH= +.. note:: + + ReFrame assumes that the ``eb`` executable is available on the system where the compilation is run (typically the local host where ReFrame is executed). -Here ```` is set to the directory ``easybuild`` within the stage directory. Now that we know everything related to building and installing the code, we can move to the part dealing with running it. To run the code, the generated modules need to be loaded in order to make the software available. @@ -66,7 +69,7 @@ This test will then run the following commands: Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. That option can be used together with ``--dont-restage`` to avoid rebuilding when runing the test multiple times. - +-------------------------- Packaging the installation -------------------------- @@ -79,8 +82,8 @@ For instance, the following can be set to package the installations as an rpm fi self.keep_files = ['easybuild/packages'] self.build_system.package_opts = { - 'type': 'rpm', - } + 'type': 'rpm', + } The packages are generated by EasyBuild in the stage directory. To retain them after the test succeeds, :attr:`~reframe.core.pipeline.RegressionTest.keep_files` needs to be set. diff --git a/docs/tutorials.rst b/docs/tutorials.rst index a07bc57f37..c188e1e2af 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -9,7 +9,7 @@ ReFrame Tutorials tutorial_advanced tutorial_deps tutorial_tips_tricks - tutorial_easybuild + tutorial_build_automation Online Tutorials diff --git a/reframe/core/buildsystems.py b/reframe/core/buildsystems.py index 88ab054111..f49cf5cdb7 100644 --- a/reframe/core/buildsystems.py +++ b/reframe/core/buildsystems.py @@ -699,7 +699,7 @@ class EasyBuild(BuildSystem): ReFrame will use EasyBuild to build and install the code in the test's stage directory by default. ReFrame uses environment variables to - configure EasyBuild for running, so Users can pass additional options to + configure EasyBuild for running, so users can pass additional options to the ``eb`` command and modify the default behaviour. .. versionadded:: 3.5.0 From 65286c4b5d771eeea4f6cc78d1a772734c4b17e9 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 8 Jul 2021 14:37:03 +0200 Subject: [PATCH 10/18] WIP: Add tutorial example for Spack as build system --- tutorials/build_systems/easybuild/eb_test.py | 11 +++++----- tutorials/build_systems/spack/spack_test.py | 21 ++++++++++++++++++++ tutorials/build_systems/spack/src/spack.yaml | 9 +++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 tutorials/build_systems/spack/spack_test.py create mode 100644 tutorials/build_systems/spack/src/spack.yaml diff --git a/tutorials/build_systems/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py index c9ab90529f..4ba1a5c978 100644 --- a/tutorials/build_systems/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -3,8 +3,8 @@ @rfm.simple_test -class BZip2Check(rfm.RegressionTest): - descr = 'This demonstrates the EasyBuild build system.' +class BZip2EBCheck(rfm.RegressionTest): + descr = 'Demo test using EasyBuild to build the test code' valid_systems = ['*'] valid_prog_environs = ['builtin'] executable = 'bzip2' @@ -20,7 +20,6 @@ def setup_build_system(self): def prepare_run(self): self.modules = self.build_system.generated_modules - @run_before('sanity') - def set_sanity(self): - self.sanity_patterns = sn.assert_found(r'Version 1.0.6', - self.stderr) + @sanity_function + def assert_version(self): + return sn.assert_found(r'Version 1.0.6', self.stderr) diff --git a/tutorials/build_systems/spack/spack_test.py b/tutorials/build_systems/spack/spack_test.py new file mode 100644 index 0000000000..b172e6a71f --- /dev/null +++ b/tutorials/build_systems/spack/spack_test.py @@ -0,0 +1,21 @@ +import reframe as rfm +import reframe.utility.sanity as sn + + +@rfm.simple_test +class BZip2SpackCheck(rfm.RegressionTest): + descr = 'Demo test using Spack to build the test code' + valid_systems = ['daint:gpu'] + valid_prog_environs = ['builtin'] + executable = 'bzip2' + executable_opts = ['--help'] + + @run_before('compile') + def setup_build_system(self): + self.build_system = 'Spack' + self.build_system.environment = '.' + self.build_system.specs = ['bzip2@1.0.6'] + + @sanity_function + def assert_version(self): + return sn.assert_found(r'Version 1.0.6', self.stderr) diff --git a/tutorials/build_systems/spack/src/spack.yaml b/tutorials/build_systems/spack/src/spack.yaml new file mode 100644 index 0000000000..e9446ca493 --- /dev/null +++ b/tutorials/build_systems/spack/src/spack.yaml @@ -0,0 +1,9 @@ +spack: + specs: + - bzip2 + concretization: together + config: + install_tree: spack/opt/spack + module_roots: + tcl: spack/share/spack/modules + lmod: spack/share/spack/lmod From e767087f555b020c8d82b17db72f24702be1f040 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 8 Jul 2021 18:31:58 +0200 Subject: [PATCH 11/18] Add tutorial about using Spack as a build system --- docs/tutorial_build_automation.rst | 87 ++++++++++++++++++- reframe/core/buildsystems.py | 3 +- tutorials/build_systems/easybuild/eb_test.py | 5 ++ tutorials/build_systems/spack/spack_test.py | 10 ++- .../spack/src/{ => myenv}/spack.yaml | 2 +- 5 files changed, 101 insertions(+), 6 deletions(-) rename tutorials/build_systems/spack/src/{ => myenv}/spack.yaml (90%) diff --git a/docs/tutorial_build_automation.rst b/docs/tutorial_build_automation.rst index c4829597d5..0fc8c056ea 100644 --- a/docs/tutorial_build_automation.rst +++ b/docs/tutorial_build_automation.rst @@ -67,7 +67,6 @@ This test will then run the following commands: module load bzip/1.0.6 bzip2 --help -Since all the EasyBuild files are in the stage directory, unless ReFrame was run with ``--keep-stage-files``, they are going to be wiped out if the test is successful. That option can be used together with ``--dont-restage`` to avoid rebuilding when runing the test multiple times. -------------------------- Packaging the installation @@ -87,3 +86,89 @@ For instance, the following can be set to package the installations as an rpm fi The packages are generated by EasyBuild in the stage directory. To retain them after the test succeeds, :attr:`~reframe.core.pipeline.RegressionTest.keep_files` needs to be set. + + + +Using Spack to Build the Test Code +---------------------------------- + + +This example is the equivalent to the previous one, except that it uses Spack to build ``bzip2``. +Here is the test's code: + +.. literalinclude:: ../tutorials/build_systems/spack/spack_test.py + :lines: 6- + :emphasize-lines: 13-16 + + +When :attr:`~reframe.core.pipeline.RegressionTest.build_system` is set to ``'Spack'``, ReFrame will leverage Spack environments in order to build the test code. +For this reason, currently user must specify an environment. +ReFrame treats Spack environments as *test resources* so it expects them under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``. +Here is the directory structure for the test in this particular example that we show here: + + + +.. code:: console + + tutorials/build_systems/spack/ + ├── spack_test.py + └── src + └── myenv + └── spack.yaml + + +We could have placed ``spack.yaml`` directly under the ``src/`` directory, in which case we would need to specify ``'.'`` as an environment. + +As with every other test, ReFrame will copy the test's resources to its stage directory before building it. +ReFrame will then activate the environment and install the associated specs as in this case. +Optionally, we can add more specs to the environment by setting the :attr:`~reframe.core.buildsystems.Spack.specs` attribute of the build system. +Here is what ReFrame generates as a build script in this example: + +.. code:: bash + + . $SPACK_ROOT/share/spack/setup-env.sh + spack env activate -V -d myenv + spack install + +Any additional specs specified inside the ReFrame test will be added using the ``spack add`` command. +As you might have noticed ReFrame expects that Spack is already installed on the system. +The packages specified in the environment and the tests will be installed in the test's stage directory, where the environment is copied before building. +Here is the the stage directory structure: + +.. code:: console + + stage/generic/default/builtin/BZip2SpackCheck/ + ├── myenv + │   ├── spack + │   │   ├── opt + │   │   │   └── spack + │   │   │   ├── bin + │   │   │   └── darwin-catalina-skylake + │   │   └── share + │   │   └── spack + │   │   └── modules + │   ├── spack.lock + │   └── spack.yaml + ├── rfm_BZip2SpackCheck_build.err + ├── rfm_BZip2SpackCheck_build.out + ├── rfm_BZip2SpackCheck_build.sh + ├── rfm_BZip2SpackCheck_job.err + ├── rfm_BZip2SpackCheck_job.out + └── rfm_BZip2SpackCheck_job.sh + + +Finally, here is the generated run script that ReFrame uses to run the test, once its build has succeeded: + +.. code-block:: bash + + #!/bin/bash + . $SPACK_ROOT/share/spack/setup-env.sh + spack env activate -V -d myenv + bzip2 --help + +From this point on, sanity and performance checking are exactly identical to any other ReFrame test. + +.. tip:: + + While developing a test using Spack or EasyBuild as a build system, it's good to run ReFrame with :option:`--keep-stage-files` and :option:`--dont-restage` options. + These options will not remove the test stage files upon successful completion of the test but, more importantly, ReFrame will not wipe out the stage directory every time you retry the test, which is quite useful for avoiding rebuilding the dependencies of the packages built by the test. diff --git a/reframe/core/buildsystems.py b/reframe/core/buildsystems.py index e6db4c21a2..d1fa3102ca 100644 --- a/reframe/core/buildsystems.py +++ b/reframe/core/buildsystems.py @@ -832,7 +832,8 @@ class Spack(BuildSystem): #: :default: :class:`None` environment = fields.TypedField(typ.Str[r'\S+'], _UndefinedType) - #: The list of specs to build and install within the given environment. + #: A list of additional specs to build and install within the given + #: environment. #: #: ReFrame will add the specs to the active environment by emititing the #: following command: diff --git a/tutorials/build_systems/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py index 4ba1a5c978..d79e7d055c 100644 --- a/tutorials/build_systems/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -1,3 +1,8 @@ +# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) +# ReFrame Project Developers. See the top-level LICENSE file for details. +# +# SPDX-License-Identifier: BSD-3-Clause + import reframe as rfm import reframe.utility.sanity as sn diff --git a/tutorials/build_systems/spack/spack_test.py b/tutorials/build_systems/spack/spack_test.py index b172e6a71f..ba59761955 100644 --- a/tutorials/build_systems/spack/spack_test.py +++ b/tutorials/build_systems/spack/spack_test.py @@ -1,3 +1,8 @@ +# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) +# ReFrame Project Developers. See the top-level LICENSE file for details. +# +# SPDX-License-Identifier: BSD-3-Clause + import reframe as rfm import reframe.utility.sanity as sn @@ -5,7 +10,7 @@ @rfm.simple_test class BZip2SpackCheck(rfm.RegressionTest): descr = 'Demo test using Spack to build the test code' - valid_systems = ['daint:gpu'] + valid_systems = ['*'] valid_prog_environs = ['builtin'] executable = 'bzip2' executable_opts = ['--help'] @@ -13,8 +18,7 @@ class BZip2SpackCheck(rfm.RegressionTest): @run_before('compile') def setup_build_system(self): self.build_system = 'Spack' - self.build_system.environment = '.' - self.build_system.specs = ['bzip2@1.0.6'] + self.build_system.environment = 'myenv' @sanity_function def assert_version(self): diff --git a/tutorials/build_systems/spack/src/spack.yaml b/tutorials/build_systems/spack/src/myenv/spack.yaml similarity index 90% rename from tutorials/build_systems/spack/src/spack.yaml rename to tutorials/build_systems/spack/src/myenv/spack.yaml index e9446ca493..61273fdde6 100644 --- a/tutorials/build_systems/spack/src/spack.yaml +++ b/tutorials/build_systems/spack/src/myenv/spack.yaml @@ -1,6 +1,6 @@ spack: specs: - - bzip2 + - bzip2@1.0.6 concretization: together config: install_tree: spack/opt/spack From 80ac17f247c3b693c41a229154d0460d02e54527 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 8 Jul 2021 21:51:36 +0200 Subject: [PATCH 12/18] Fix and enhance tutorial --- docs/tutorial_build_automation.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/tutorial_build_automation.rst b/docs/tutorial_build_automation.rst index 0fc8c056ea..a50348160e 100644 --- a/docs/tutorial_build_automation.rst +++ b/docs/tutorial_build_automation.rst @@ -20,7 +20,7 @@ Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the eas The following code block shows the check, highlighting the lines specific to this tutorial: .. literalinclude:: ../tutorials/build_systems/easybuild/eb_test.py - :emphasize-lines: 15-17,21 + :emphasize-lines: 20-22,26 The test looks pretty standard except for the highlighted blocks. Let's have a look first to the block in the :class:`BZip2Check` class. @@ -118,6 +118,10 @@ Here is the directory structure for the test in this particular example that we We could have placed ``spack.yaml`` directly under the ``src/`` directory, in which case we would need to specify ``'.'`` as an environment. +For reference, here are the contents of ``spack.yaml``: + +.. literalinclude:: ../tutorials/build_systems/spack/src/myenv/spack.yaml + As with every other test, ReFrame will copy the test's resources to its stage directory before building it. ReFrame will then activate the environment and install the associated specs as in this case. From 43d07f093c1998c997f2da0bcb42b29fcf100233 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 8 Jul 2021 22:04:13 +0200 Subject: [PATCH 13/18] Address PR comments --- docs/tutorial_build_automation.rst | 11 +++++------ tutorials/build_systems/easybuild/eb_test.py | 2 +- tutorials/build_systems/spack/spack_test.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/tutorial_build_automation.rst b/docs/tutorial_build_automation.rst index a50348160e..f4400ed3ef 100644 --- a/docs/tutorial_build_automation.rst +++ b/docs/tutorial_build_automation.rst @@ -20,7 +20,8 @@ Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the eas The following code block shows the check, highlighting the lines specific to this tutorial: .. literalinclude:: ../tutorials/build_systems/easybuild/eb_test.py - :emphasize-lines: 20-22,26 + :lines: 6- + :emphasize-lines: 12,14-17,19-21 The test looks pretty standard except for the highlighted blocks. Let's have a look first to the block in the :class:`BZip2Check` class. @@ -98,7 +99,7 @@ Here is the test's code: .. literalinclude:: ../tutorials/build_systems/spack/spack_test.py :lines: 6- - :emphasize-lines: 13-16 + :emphasize-lines: 12,14-16 When :attr:`~reframe.core.pipeline.RegressionTest.build_system` is set to ``'Spack'``, ReFrame will leverage Spack environments in order to build the test code. @@ -106,8 +107,6 @@ For this reason, currently user must specify an environment. ReFrame treats Spack environments as *test resources* so it expects them under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``. Here is the directory structure for the test in this particular example that we show here: - - .. code:: console tutorials/build_systems/spack/ @@ -174,5 +173,5 @@ From this point on, sanity and performance checking are exactly identical to any .. tip:: - While developing a test using Spack or EasyBuild as a build system, it's good to run ReFrame with :option:`--keep-stage-files` and :option:`--dont-restage` options. - These options will not remove the test stage files upon successful completion of the test but, more importantly, ReFrame will not wipe out the stage directory every time you retry the test, which is quite useful for avoiding rebuilding the dependencies of the packages built by the test. + While developing a test using Spack or EasyBuild as a build system, it can be useful to run ReFrame with the :option:`--keep-stage-files` and :option:`--dont-restage` options to prevent ReFrame from removing the test's stage directory upon successful completion of the test. + For this particular type of test, these options will avoid having to rebuild the required package dependencies every time the test is retried. diff --git a/tutorials/build_systems/easybuild/eb_test.py b/tutorials/build_systems/easybuild/eb_test.py index d79e7d055c..17d6bb2ae8 100644 --- a/tutorials/build_systems/easybuild/eb_test.py +++ b/tutorials/build_systems/easybuild/eb_test.py @@ -14,10 +14,10 @@ class BZip2EBCheck(rfm.RegressionTest): valid_prog_environs = ['builtin'] executable = 'bzip2' executable_opts = ['--help'] + build_system = 'EasyBuild' @run_before('compile') def setup_build_system(self): - self.build_system = 'EasyBuild' self.build_system.easyconfigs = ['bzip2-1.0.6.eb'] self.build_system.options = ['-f'] diff --git a/tutorials/build_systems/spack/spack_test.py b/tutorials/build_systems/spack/spack_test.py index ba59761955..9c7fe91a22 100644 --- a/tutorials/build_systems/spack/spack_test.py +++ b/tutorials/build_systems/spack/spack_test.py @@ -14,10 +14,10 @@ class BZip2SpackCheck(rfm.RegressionTest): valid_prog_environs = ['builtin'] executable = 'bzip2' executable_opts = ['--help'] + build_system = 'Spack' @run_before('compile') def setup_build_system(self): - self.build_system = 'Spack' self.build_system.environment = 'myenv' @sanity_function From 359365e4a19444281df6f8ec9e8fb1ca6c1cced6 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 8 Jul 2021 23:32:16 +0200 Subject: [PATCH 14/18] Add version annotations --- docs/tutorial_build_automation.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/tutorial_build_automation.rst b/docs/tutorial_build_automation.rst index f4400ed3ef..a08ef543af 100644 --- a/docs/tutorial_build_automation.rst +++ b/docs/tutorial_build_automation.rst @@ -16,6 +16,9 @@ Finally, to avoid specifying the tutorial configuration file each time you run t Using EasyBuild to Build the Test Code -------------------------------------- +.. versionadded:: 3.5.0 + + Let's consider a simple ReFrame test that installs ``bzip2-1.0.6`` given the easyconfig `bzip2-1.0.6.eb `__ and checks that the installed version is correct. The following code block shows the check, highlighting the lines specific to this tutorial: @@ -94,6 +97,9 @@ Using Spack to Build the Test Code ---------------------------------- +.. versionadded:: 3.6.1 + + This example is the equivalent to the previous one, except that it uses Spack to build ``bzip2``. Here is the test's code: From 2831c862d13bffdc5daf22b518784c19328f685a Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 9 Jul 2021 16:43:38 +0200 Subject: [PATCH 15/18] Address PR comments --- docs/tutorial_build_automation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial_build_automation.rst b/docs/tutorial_build_automation.rst index a08ef543af..6f6d206ad1 100644 --- a/docs/tutorial_build_automation.rst +++ b/docs/tutorial_build_automation.rst @@ -110,7 +110,7 @@ Here is the test's code: When :attr:`~reframe.core.pipeline.RegressionTest.build_system` is set to ``'Spack'``, ReFrame will leverage Spack environments in order to build the test code. For this reason, currently user must specify an environment. -ReFrame treats Spack environments as *test resources* so it expects them under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``. +ReFrame treats Spack environments as *test resources* so it expects to find them under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``. Here is the directory structure for the test in this particular example that we show here: .. code:: console @@ -142,7 +142,7 @@ Here is what ReFrame generates as a build script in this example: Any additional specs specified inside the ReFrame test will be added using the ``spack add`` command. As you might have noticed ReFrame expects that Spack is already installed on the system. The packages specified in the environment and the tests will be installed in the test's stage directory, where the environment is copied before building. -Here is the the stage directory structure: +Here is the stage directory structure: .. code:: console From 863dc0b44a0401e5d66a0df31f850575535d16e9 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 9 Jul 2021 16:47:45 +0200 Subject: [PATCH 16/18] Exclude Spack and EB tutorial checks from the CI --- ci-scripts/ci-runner.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/ci-runner.bash b/ci-scripts/ci-runner.bash index 0e866df630..28d829c82e 100644 --- a/ci-scripts/ci-runner.bash +++ b/ci-scripts/ci-runner.bash @@ -42,7 +42,7 @@ checked_exec() run_tutorial_checks() { cmd="./bin/reframe -C tutorials/config/settings.py -J account=jenscscs \ ---save-log-files --flex-alloc-nodes=2 -r -x HelloThreadedExtendedTest $@" +--save-log-files --flex-alloc-nodes=2 -r -x 'HelloThreadedExtendedTest|BZip2.*Check' $@" echo "[INFO] Running tutorial checks with \`$cmd'" checked_exec $cmd } From 6e4de3653229df5b9ae5bc4640cc61fb74f4c5da Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Sat, 10 Jul 2021 00:51:49 +0200 Subject: [PATCH 17/18] Fix CI runner script for the tutorials ... and remove stale prints from the frontend. --- ci-scripts/ci-runner.bash | 4 ++-- reframe/frontend/cli.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ci-scripts/ci-runner.bash b/ci-scripts/ci-runner.bash index 28d829c82e..00c94b9595 100644 --- a/ci-scripts/ci-runner.bash +++ b/ci-scripts/ci-runner.bash @@ -41,8 +41,8 @@ checked_exec() run_tutorial_checks() { - cmd="./bin/reframe -C tutorials/config/settings.py -J account=jenscscs \ ---save-log-files --flex-alloc-nodes=2 -r -x 'HelloThreadedExtendedTest|BZip2.*Check' $@" + cmd="./bin/reframe -vv -C tutorials/config/settings.py -J account=jenscscs \ +--save-log-files --flex-alloc-nodes=2 -r -x HelloThreadedExtendedTest|BZip2.*Check $@" echo "[INFO] Running tutorial checks with \`$cmd'" checked_exec $cmd } diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 07df20a1df..cf5348be06 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -817,8 +817,6 @@ def _case_failed(t): printer.debug(dependencies.format_deps(testgraph)) if options.restore_session is not None: testgraph, restored_cases = report.restore_dangling(testgraph) - print(dependencies.format_deps(testgraph)) - print(restored_cases) testcases = dependencies.toposort( testgraph, From 8fa57443864e983552875c14ae5606a4778a267f Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 12 Jul 2021 15:54:36 +0200 Subject: [PATCH 18/18] Address PR comments --- docs/tutorial_build_automation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial_build_automation.rst b/docs/tutorial_build_automation.rst index 6f6d206ad1..85284ffd69 100644 --- a/docs/tutorial_build_automation.rst +++ b/docs/tutorial_build_automation.rst @@ -109,7 +109,7 @@ Here is the test's code: When :attr:`~reframe.core.pipeline.RegressionTest.build_system` is set to ``'Spack'``, ReFrame will leverage Spack environments in order to build the test code. -For this reason, currently user must specify an environment. +For this reason, currently, users must specify an environment. ReFrame treats Spack environments as *test resources* so it expects to find them under the test's :attr:`~reframe.core.pipeline.RegressionTest.sourcesdir`, which defaults to ``'src'``. Here is the directory structure for the test in this particular example that we show here: