Skip to content

Commit bdf35a6

Browse files
authored
Merge branch 'easybuilders:develop' into resolve-custom-cmds
2 parents fe8f407 + ae40c24 commit bdf35a6

File tree

10 files changed

+243
-109
lines changed

10 files changed

+243
-109
lines changed

.github/workflows/end2end.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,17 @@ jobs:
1818
fail-fast: false
1919
container:
2020
image: ghcr.io/easybuilders/${{ matrix.container }}-amd64
21-
env: {ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true} # Allow using Node16 actions
21+
volumes:
22+
- /node20217:/node20217:rw,rshared
23+
- ${{ matrix.container == 'centos-7.9' && '/node20217:/__e/node20:ro,rshared' || ' ' }}
2224
steps:
25+
- name: install nodejs20glibc2.17
26+
if: ${{ matrix.container == 'centos-7.9' }}
27+
run: |
28+
curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz
29+
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
2330
- name: Check out the repo
24-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
2532

2633
- name: download and unpack easyblocks and easyconfigs repositories
2734
run: |

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
IGNORE_PATTERNS+="|skipping SvnRepository test"
196196
IGNORE_PATTERNS+="|requires Lmod as modules tool"
197197
IGNORE_PATTERNS+="|stty: 'standard input': Inappropriate ioctl for device"
198-
IGNORE_PATTERNS+="|CryptographyDeprecationWarning: Python 3.[56]"
198+
IGNORE_PATTERNS+="|CryptographyDeprecationWarning: Python 3.[567]"
199199
IGNORE_PATTERNS+="|from cryptography.* import "
200200
IGNORE_PATTERNS+="|CryptographyDeprecationWarning: Python 2"
201201
IGNORE_PATTERNS+="|Blowfish"

.github/workflows/unit_tests_python2.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ jobs:
1616
# CentOS 7.9 container that already includes Lmod & co,
1717
# see https://github.com/easybuilders/easybuild-containers
1818
image: ghcr.io/easybuilders/centos-7.9-amd64
19-
env: {ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true} # Allow using Node16 actions
19+
volumes:
20+
- '/node20217:/node20217:rw,rshared'
21+
- '/node20217:/__e/node20:ro,rshared'
2022
steps:
21-
- uses: actions/checkout@v3
23+
- name: install nodejs20glibc2.17
24+
run: |
25+
curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz
26+
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
27+
28+
- uses: actions/checkout@v4
2229

2330
- name: install Python packages
2431
run: |

easybuild/framework/easyblock.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* Maxime Boissonneault (Compute Canada)
4141
* Davide Vanzo (Vanderbilt University)
4242
* Caspar van Leeuwen (SURF)
43+
* Jan Andre Reuter (Juelich Supercomputing Centre)
4344
"""
4445

4546
import copy
@@ -141,10 +142,11 @@ def extra_options(extra=None):
141142
#
142143
# INIT
143144
#
144-
def __init__(self, ec):
145+
def __init__(self, ec, logfile=None):
145146
"""
146147
Initialize the EasyBlock instance.
147148
:param ec: a parsed easyconfig file (EasyConfig instance)
149+
:param logfile: pass logfile from other EasyBlock. If not passed, create logfile (optional)
148150
"""
149151

150152
# keep track of original working directory, so we can go back there
@@ -214,7 +216,8 @@ def __init__(self, ec):
214216

215217
# logging
216218
self.log = None
217-
self.logfile = None
219+
self.logfile = logfile
220+
self.external_logfile = logfile is not None
218221
self.logdebug = build_option('debug')
219222
self.postmsg = '' # allow a post message to be set, which can be shown as last output
220223
self.current_step = None
@@ -303,11 +306,11 @@ def _init_log(self):
303306
if self.log is not None:
304307
return
305308

306-
self.logfile = get_log_filename(self.name, self.version, add_salt=True)
307-
fancylogger.logToFile(self.logfile, max_bytes=0)
309+
if self.logfile is None:
310+
self.logfile = get_log_filename(self.name, self.version, add_salt=True)
311+
fancylogger.logToFile(self.logfile, max_bytes=0)
308312

309313
self.log = fancylogger.getLogger(name=self.__class__.__name__, fname=False)
310-
311314
self.log.info(this_is_easybuild())
312315

313316
this_module = inspect.getmodule(self)
@@ -323,6 +326,9 @@ def close_log(self):
323326
"""
324327
Shutdown the logger.
325328
"""
329+
# only close log if we created a logfile
330+
if self.external_logfile:
331+
return
326332
self.log.info("Closing log for application name %s version %s" % (self.name, self.version))
327333
fancylogger.logToFile(self.logfile, enable=False)
328334

0 commit comments

Comments
 (0)