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

Easystack labels #3620

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
257 changes: 199 additions & 58 deletions easybuild/framework/easystack.py

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,15 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None):
last_log = find_last_log(logfile) or '(none)'
print_msg(last_log, log=_log, prefix=False)

# if easystack is provided with the command, commands with arguments from it will be executed
# check if user is using easystack
if options.easystack:
# TODO add general_options (i.e. robot) to build options
orig_paths, general_options = parse_easystack(options.easystack)
if general_options:
raise EasyBuildError("Specifying general configuration options in easystack file is not supported yet.")
# if user provided labels, we need to pass them to parse_easystack()
if options.labels:
orig_paths, print_only = parse_easystack(options.easystack, options.labels)
else:
orig_paths, print_only = parse_easystack(options.easystack, False)
if print_only is True:
clean_exit(logfile, eb_tmpdir, testing, silent=True)

# check whether packaging is supported when it's being used
if options.package:
Expand Down
6 changes: 4 additions & 2 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,10 @@ def informative_options(self):
'dep-graph': ("Create dependency graph", None, 'store', None, {'metavar': 'depgraph.<ext>'}),
'dump-env-script': ("Dump source script to set up build environment based on toolchain/dependencies",
None, 'store_true', False),
'easystack': ("Path to easystack file in YAML format, specifying details of a software stack",
None, 'store', None, {'metavar': "example.yaml"}),
'labels': ("Easystack feature. Compares labels with those defined in Easystack file.",
'strlist', 'store', None, {'metavar': "LAB1,LAB2"}),
'last-log': ("Print location to EasyBuild log file of last (failed) session", None, 'store_true', False),
'list-easyblocks': ("Show list of available easyblocks",
'choice', 'store_or_None', 'simple', ['simple', 'detailed']),
Expand All @@ -619,8 +623,6 @@ def informative_options(self):
'show-full-config': ("Show current EasyBuild configuration (all settings)", None, 'store_true', False),
'show-system-info': ("Show system information relevant to EasyBuild", None, 'store_true', False),
'terse': ("Terse output (machine-readable)", None, 'store_true', False),
'easystack': ("Path to easystack file in YAML format, specifying details of a software stack",
None, 'store', None),
})

self.log.debug("informative_options: descr %s opts %s" % (descr, opts))
Expand Down
6 changes: 1 addition & 5 deletions test/framework/easystacks/test_easystack_basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ software:
versions:
2.25:
2.26:
foss:
toolchains:
SYSTEM:
versions: [2018a]
toy:
toolchains:
gompi-2018a:
versions:
0.0:
versionsuffix: '-test'
versionsuffix: '-test'
9 changes: 9 additions & 0 deletions test/framework/easystacks/test_easystack_basic_install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
software:
SQLite:
toolchains:
foss-2018a:
versions:
3.8.10.2:
gompi-2018a:
versions:
3.8.10.2:
32 changes: 28 additions & 4 deletions test/framework/easystacks/test_easystack_labels.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
software:
binutils:
HPL:
toolchains:
GCCcore-4.9.3:
CrayCCE-5.1.29:
include-labels: 'craycce'
versions:
3.11:
exclude-labels: arch:aarch64
2.1:
imkl:
toolchains:
iimpi-2016.01:
versions:
11.3.1.150:
exclude-labels: 'no_mpi'
iimpi-2019.08:
versions:
2019.4.243:
exclude-labels: 'no_mpi'
SQLite:
include-labels: sqlite
toolchains:
foss-2018a:
versions:
3.8.10.2:
gompi-2018a:
exclude-labels: 'no_mpi'
versions:
3.8.10.2:
GCC-6.4.0-2.28:
versions:
3.8.10.2:
include-labels: 'sqlitegcc'
16 changes: 16 additions & 0 deletions test/framework/easystacks/test_easystack_print_only.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
robot: True
dry-run: False
force: True
software:
SQLite:
toolchains:
foss-2018a:
versions:
3.8.10.2:
parallel: 12
gompi-2018a:
versions:
3.8.10.2:
parallel: 6
dry-run: False
from-pr: '1234xyz'
16 changes: 13 additions & 3 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -5994,15 +5994,25 @@ def test_easystack_asterisk(self):

self.assertErrorRegex(EasyBuildError, expected_err, parse_easystack, toy_easystack)

# tests whether include and exclude labels are read & interpretted correctly
def test_easystack_labels(self):
"""Test for --easystack <easystack.yaml> when yaml easystack contains exclude-labels / include-labels"""
easybuild.tools.build_log.EXPERIMENTAL = True
topdir = os.path.dirname(os.path.abspath(__file__))
toy_easystack = os.path.join(topdir, 'easystacks', 'test_easystack_labels.yaml')

error_msg = "EasyStack specifications of 'binutils' in .*/test_easystack_labels.yaml contain labels. "
error_msg += "Labels aren't supported yet."
self.assertErrorRegex(EasyBuildError, error_msg, parse_easystack, toy_easystack)
args = ['--easystack', toy_easystack, '--labels', 'sqlite,no_mpi,sqlitegcc', '--debug',
'--experimental', '--dry-run']
stdout, err = self.eb_main(args, do_build=True, return_error=True)
patterns = [
r"[\S\s]*DEBUG EasyStack parsed\. Proceeding to install these Easyconfigs: \n[\S\s]*",
r"[\S\s]*'SQLite-3\.8\.10\.2-foss-2018a\.eb',\n'SQLite-3\.8\.10\.2-GCC-6\.4\.0-2\.28\.eb'[\S\s]*",
r"[\S\s]*Building from easystack:[\S\s]*",
r"[\S\s]*Number of easyconfigs extracted from Easystack: 2[\S\s]*",
]
for pattern in patterns:
regex = re.compile(pattern)
self.assertTrue(regex.match(stdout) is not None)


def suite():
Expand Down
Binary file not shown.