Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ebrains-spack-builds
Manage
Activity
Members
Labels
Plan
Issues
30
Issue boards
Milestones
Wiki
Code
Merge requests
30
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Platform
EBRAINS Software Distribution
ebrains-spack-builds
Merge requests
!457
create new experimental release
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
create new experimental release
master
into
experimental_rel
Overview
0
Commits
10
Pipelines
5
Changes
4
Merged
Eleni Mathioulaki
requested to merge
master
into
experimental_rel
1 year ago
Overview
0
Commits
10
Pipelines
5
Changes
4
Expand
0
0
Merge request reports
Compare
experimental_rel
version 3
71530f9c
1 year ago
version 2
d3523dfa
1 year ago
version 1
56733b55
1 year ago
experimental_rel (base)
and
latest version
latest version
72b28a56
10 commits,
1 year ago
version 3
71530f9c
9 commits,
1 year ago
version 2
d3523dfa
8 commits,
1 year ago
version 1
56733b55
7 commits,
1 year ago
4 files
+
61
−
27
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
packages/wf-brainscales2-demos/package.py
+
33
−
12
Options
@@ -39,20 +39,40 @@ class WfBrainscales2Demos(Package):
def
install
(
self
,
spec
,
prefix
):
install_tree
(
"
.
"
,
join_path
(
prefix
,
"
notebooks
"
))
def
_nbconvert
(
self
,
nb
,
nb_out
):
jupyter
=
Executable
(
"
jupyter
"
)
args
=
[
"
nbconvert
"
,
"
--ExecutePreprocessor.kernel_name=python3
"
,
"
--ExecutePreprocessor.timeout=900
"
,
"
--execute
"
,
"
--to
"
,
"
notebook
"
,
nb
,
"
--output
"
,
nb_out
]
try
:
# execute notebook and save
jupyter
(
*
args
,
output
=
str
.
split
,
error
=
str
.
split
)
except
ProcessError
as
e
:
# if the notebook execution fails, re-run notebook to produce output with error
# in case of a cell timeout, don't re-run
if
"
CellTimeoutError
"
not
in
e
:
jupyter
(
*
(
args
+
[
"
--allow-errors
"
]))
raise
def
_run_notebooks
(
self
,
output_dir
):
mkdirp
(
output_dir
)
#
execute notebook and save
jupyter
=
Executable
(
"
jupyter
"
)
#
try to run all notebooks, then fail if there are errors
exceptions
=
[]
for
fn
in
glob
(
join_path
(
prefix
,
"
notebooks
"
,
"
ts*.ipynb
"
))
+
glob
(
join_path
(
prefix
,
"
notebooks
"
,
"
tp*.ipynb
"
)):
jupyter
(
"
nbconvert
"
,
"
--ExecutePreprocessor.kernel_name=python3
"
,
"
--execute
"
,
"
--allow-errors
"
,
"
--to
"
,
"
notebook
"
,
fn
,
"
--output
"
,
join_path
(
output_dir
,
os
.
path
.
basename
(
fn
)))
try
:
self
.
_nbconvert
(
fn
,
join_path
(
output_dir
,
os
.
path
.
basename
(
fn
)))
except
Exception
as
e
:
exceptions
.
append
(
e
)
if
exceptions
:
raise
Exception
(
"
Errors during notebook execution
"
)
def
_set_collab_things
(
self
):
# enable "EBRAINS lab" mode
@@ -66,7 +86,8 @@ class WfBrainscales2Demos(Package):
def
installcheck
(
self
):
self
.
_set_collab_things
()
# TODO (ECM): Provide a selection of notebooks that perform local-only tests.
#self._run_notebooks(join_path(self.prefix, ".spack_test_results"))
# self._run_notebooks(join_path(self.stage.path, ".install_time_tests"))
# copy_tree(join_path(self.stage.path, ".install_time_tests"), join_path(self.prefix, '.build'))
def
test_notebooks
(
self
):
self
.
_set_collab_things
()