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

Update json schema for buildtest configuration. Change property value for moduletool to 'none' #1699

Merged
merged 6 commits into from
Feb 5, 2024
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
10 changes: 2 additions & 8 deletions buildtest/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,6 @@ def parse_buildspecs(self):
console.print("Total builder objects created:", len(self.builders))

script_builders = []
compiler_builder = []
spack_builder = []
batch_builders = []

Expand All @@ -1155,9 +1154,7 @@ def parse_buildspecs(self):
if not builder.is_local_executor():
batch_builders.append(builder)

self.print_builders(
compiler_builder, spack_builder, script_builders, batch_builders
)
self.print_builders(spack_builder, script_builders, batch_builders)

def build_phase(self):
"""This method will build all tests by invoking class method ``build`` for
Expand Down Expand Up @@ -1525,14 +1522,11 @@ def print_batch_builders(self, builders):

console.print(batch_builders_numnodes_table)

def print_builders(
self, compiler_builder, spack_builder, script_builder, batch_builder
):
def print_builders(self, spack_builder, script_builder, batch_builder):
"""Print detected builders during build phase"""

self.print_builders_by_type(script_builder, builder_type="script")
self.print_builders_by_type(spack_builder, builder_type="spack")
self.print_builders_by_type(compiler_builder, builder_type="compiler")
self.print_batch_builders(batch_builder)


Expand Down
2 changes: 1 addition & 1 deletion buildtest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def validate(self, moduletool=None):
self._executor_check()

if (
self.target_config.get("moduletool") != "N/A"
self.target_config.get("moduletool") != "none"
and self.target_config.get("moduletool") != moduletool
):
raise ConfigurationError(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
system:
generic:
hostnames: ['.*']
moduletool: N/A
moduletool: none
poolsize: 1
buildspecs:
# whether to rebuild cache file automatically when running `buildtest buildspec find`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
system:
generic:
hostnames: ['.*']
#logdir: $BUILDTEST_ROOT/logs
#testdir: $BUILDTEST_ROOT/tests
moduletool: N/A
logdir: $BUILDTEST_ROOT/logs
testdir: $BUILDTEST_ROOT/tests
moduletool: none
poolsize: 1
max_jobs: 1
pager: False
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
system:
generic:
hostnames: ['.*']
moduletool: N/A
moduletool: none
poolsize: 1
buildspecs:
# whether to rebuild cache file automatically when running `buildtest buildspec find`
Expand Down
41 changes: 16 additions & 25 deletions buildtest/schemas/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"enum": [
"environment-modules",
"lmod",
"N/A"
"none"
]
},
"timeout": {
Expand Down Expand Up @@ -120,6 +120,8 @@
"report":
{
"type": "object",
"additionalProperties": false,
"description": "Specify configuration for ``buildtest report`` command",
"properties": {
"terse": { "$ref": "#/definitions/terse" },
"format": { "$ref": "#/definitions/format" },
Expand Down Expand Up @@ -425,7 +427,7 @@
"type": "string"
}
},
"disable": {"type": "boolean", "description": "Disable executor"},
"disable": {"type": "boolean", "description": "Disable an executor"},
"module": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -473,10 +475,7 @@
"additionalProperties": false,
"required": [ "shell" ],
"properties": {
"description": {
"type": "string",
"description": "description field for documenting your executor"
},
"description": { "$ref": "#/definitions/description" },
"shell": {
"type": "string",
"description": "Specify the shell launcher you want to use when running tests locally"
Expand All @@ -491,10 +490,7 @@
"additionalProperties": false,
"description": "An instance object of slurm executor",
"properties": {
"description": {
"type": "string",
"description": "description field for documenting your executor"
},
"description": { "$ref": "#/definitions/description" },
"launcher": {
"type": "string",
"enum": [ "sbatch" ],
Expand Down Expand Up @@ -579,10 +575,7 @@
"additionalProperties": false,
"required": [ "queue" ],
"properties": {
"description": {
"type": "string",
"description": "description field for documenting your executor"
},
"description": { "$ref": "#/definitions/description" },
"launcher": {
"type": "string",
"enum": [ "qsub" ],
Expand Down Expand Up @@ -619,10 +612,7 @@
"additionalProperties": false,
"required": [ "queue" ],
"properties": {
"description": {
"type": "string",
"description": "description field for documenting your executor"
},
"description": { "$ref": "#/definitions/description" },
"launcher": {
"type": "string",
"enum": [ "qsub" ],
Expand Down Expand Up @@ -657,10 +647,7 @@
"type": "object",
"additionalProperties": false,
"properties": {
"description": {
"type": "string",
"description": "description field for documenting your executor"
},
"description": { "$ref": "#/definitions/description" },
"before_script": {
"description": "The ``before_script`` section can be used to specify commands before start of test. The script will be sourced in active shell.",
"#ref": "#/definitions/script"
Expand Down Expand Up @@ -709,7 +696,7 @@
"minItems": 1,
"items": {
"type": "string",
"enum": ["script", "compiler", "spack"]
"enum": ["script", "spack"]
}
},
"tags": {
Expand All @@ -727,8 +714,8 @@
"module-purge": {"type": "boolean"},
"rebuild": {"type": "integer", "minimum": 1, "maximum": 50, "description": "Specify number of tests to rebuild"},
"limit": {"type": "integer", "minimum": 1, "description": "Limit number of tests to build"},
"account": {"type": "string"},
"maxpendtime": {"type": "integer", "minimum": 1, "description": "Specify maximum pending time in seconds"},
"account": {"$ref": "#/definitions/account"},
"maxpendtime": { "$ref": "#/definitions/maxpendtime" },
"pollinterval": {"type": "integer", "minimum": 1, "description": "Specify poll interval in seconds"},
"procs": {"$ref": "definitions.schema.json#/definitions/list_of_positive_integers"},
"nodes": {"$ref": "definitions.schema.json#/definitions/list_of_positive_integers"},
Expand All @@ -742,6 +729,10 @@
"remove-stagedir": {"type": "boolean", "description": "Remove stage directory after test completes"},
"max-jobs": {"type": "integer", "minimum": 1, "description": "Maximum number of jobs that can be run at a given time for a particular executor"}
}
},
"description": {
"type": "string",
"description": "description field for documenting your executor"
}
}
}
4 changes: 2 additions & 2 deletions buildtest/settings/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ system:
hostnames: ['.*']
# system description
description: Generic System
# specify module system to use. Supported module systems are [lmod, environment-modules, N/A]
moduletool: N/A
# specify module system to use. Supported module systems are [lmod, environment-modules, none]
moduletool: none

# specify size of job pool (https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool). This will configure the number of processes that can run in parallel.
# If not specified then buildtest will use all available cores on the system.
Expand Down
2 changes: 2 additions & 0 deletions docs/command_line_tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _command_line_tutorial:

Command Line Tutorial
======================

Expand Down
2 changes: 1 addition & 1 deletion docs/configuring_buildtest/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Configuration properties like ``rebuild``, ``limit``, ``timeout`` are integer an
.. code-block:: yaml
:emphasize-lines: 13-15

profiles:
profiles:
profile-2:
buildspecs:
- /Users/siddiq90/Documents/github/buildtest/tutorials/job_dependency
Expand Down
63 changes: 34 additions & 29 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
| |license| |docs| |codecov| |regressiontest|


buildtest
==========

This documentation was rebuilt on |today| and is intended for version |version|.

If you are working off the latest release please see https://buildtest.readthedocs.io/en/latest/ for documentation.
If you are working off the `devel <https://github.com/buildtesters/buildtest/tree/devel>`_ branch then please refer to
https://buildtest.readthedocs.io/en/devel/
which references the `devel` branch.
https://buildtest.readthedocs.io/en/devel/ for documentation.

buildtest
==========

`buildtest <https://github.com/buildtesters/buildtest>`_ is
a testing framework to help HPC sites write test for their system as part of their
routine acceptance and regression testing. Buildtest provides a YAML interface to write tests
which buildtest can validate and then use to generate shell scripts that run on your HPC system.
The test template (YAML) is called a **buildspec** which can define one or more test instances
and is validated by a `json schema <https://json-schema.org/>`_. Buildtest supports the following batch schedulers:
`IBM Spectrum LSF <https://www.ibm.com/support/knowledgecenter/SSWRJV_10.1.0/lsf_welcome/lsf_welcome.html>`_,
`Slurm <https://slurm.schedmd.com/>`_, `PBS <https://www.openpbs.org/>`_ and
`Cobalt <https://trac.mcs.anl.gov/projects/cobalt>`_.

To learn more about buildtest, see the `What is buildtest? <what_is_buildtest>`_

A spin-off project called `lmodule <https://lmodule.readthedocs.io/en/latest/>`_
is a Python API for `Lmod <https://lmod.readthedocs.io/en/latest/>`_. The buildtest
module features were deprecated and moved to lmodule with the main objective is to
automate module load testing. For more details on lmodule see https://github.com/buildtesters/lmodule.

Getting Started
----------------

If you are interested in trying out buildtest, first :ref:`install buildtest <installing_buildtest>` and
check out the :ref:`quick start guide <quick_start>`. Next, go through the :ref:`Getting Started Guide <getting_started>`
which will walk you through the basic features of buildtest. Once you are ready to write tests, check out the
:ref:`writing buildspecs guide <writing_buildspecs>` which will discuss how to write buildspecs.

If you are first time user of buildtest, we recommend you to go through the :ref:`command line tutorial <command_line_tutorial>`
and :ref:`buildspec tutorial <buildspec_tutorial>`.


.. |docs| image:: https://readthedocs.org/projects/buildtest/badge/?version=devel
:alt: Documentation Status
Expand All @@ -30,7 +58,7 @@ Useful Links

- Source Code: https://github.com/buildtesters/buildtest
- Documentation: http://buildtest.rtfd.io/
- Schema Docs: https://buildtesters.github.io/buildtest/
- Buildtest Home Page: https://buildtesters.github.io/buildtest.io/
- ReadTheDocs: https://readthedocs.org/projects/buildtest/
- CodeCov: https://codecov.io/gh/buildtesters/buildtest
- Slack Channel: http://hpcbuildtest.slack.com
Expand All @@ -39,29 +67,6 @@ Useful Links
- Snyk: https://app.snyk.io/org/buildtesters/
- NERSC Test Repository: https://github.com/buildtesters/buildtest-nersc

Description
------------

`buildtest <https://github.com/buildtesters/buildtest>`_ is
a testing framework to help HPC sites write test for their system as part of their
routine acceptance and regression testing. Buildtest provides a YAML interface to write tests
which buildtest can validate and then use to generate shell scripts that run on your HPC system.
The test template (YAML) is called a **buildspec** which can define one or more test instances
and is validated by a `json schema <https://json-schema.org/>`_. Buildtest supports the following batch schedulers:
`IBM Spectrum LSF <https://www.ibm.com/support/knowledgecenter/SSWRJV_10.1.0/lsf_welcome/lsf_welcome.html>`_,
`Slurm <https://slurm.schedmd.com/>`_, `PBS <https://www.openpbs.org/>`_ and
`Cobalt <https://trac.mcs.anl.gov/projects/cobalt>`_. We publish the schema documentation, json schemas,
and schema examples at https://buildtesters.github.io/buildtest/ which is useful when you are
:ref:`writing buildspecs <writing_buildspecs>`.

To get started with buildtest, please see :ref:`Installing buildtest <installing_buildtest>` and
:ref:`Getting Started Guide <getting_started>`.

A spin-off project called `lmodule <https://lmodule.readthedocs.io/en/latest/>`_
is a Python API for `Lmod <https://lmod.readthedocs.io/en/latest/>`_. The buildtest
module features were deprecated and moved to lmodule with the main objective is to
automate module load testing. For more details on lmodule see https://github.com/buildtesters/lmodule

.. toctree::
:maxdepth: 2
:caption: Background
Expand Down
4 changes: 1 addition & 3 deletions tests/cli/configuration/invalid_executors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ system:
hostnames:
- .*
description: Generic System
moduletool: N/A
moduletool: none
cdash:
url: https://my.cdash.org
project: buildtest
Expand All @@ -21,8 +21,6 @@ system:
count: 25
terse: False
format: "name,id,state,runtime,returncode"
latest: True
oldest: False
executors:
local:
bash:
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_compilers/invalid_moduletool.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
system:
generic:
hostnames: [".*"]
moduletool: N/A
moduletool: none
buildspecs:
rebuild: False
count: 15
Expand Down
11 changes: 11 additions & 0 deletions tutorials/compilation/compiler_exclude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
buildspecs:
compiler_exclude_example:
type: script
executor: generic.local.bash
description: Example excluding a particular compiler
compilers:
name: ['gcc']
exclude: ['gcc_6.5.0']
run: |
$BUILDTEST_CC hello.c -o hello_c
./hello_c
Loading