Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dedal
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
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
dedal
Commits
c708d57a
Commit
c708d57a
authored
1 month ago
by
Adrian Ciu
Browse files
Options
Downloads
Patches
Plain Diff
esd-spack-installation: fixed passing access token to tests; added log file for spack install step
parent
9abbf5f4
No related branches found
Branches containing commit
No related tags found
2 merge requests
!7
Dedal Release
,
!5
Methods for caching; CLI
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
esd/spack_manager/SpackManager.py
+19
-6
19 additions, 6 deletions
esd/spack_manager/SpackManager.py
esd/spack_manager/wrapper/spack_wrapper.py
+1
-1
1 addition, 1 deletion
esd/spack_manager/wrapper/spack_wrapper.py
with
21 additions
and
7 deletions
.gitlab-ci.yml
+
1
−
0
View file @
c708d57a
...
...
@@ -39,5 +39,6 @@ testing-pytest:
paths
:
-
test-results.xml
-
.esd.log
-
.generate_cache.log
expire_in
:
1 week
This diff is collapsed.
Click to expand it.
esd/spack_manager/SpackManager.py
+
19
−
6
View file @
c708d57a
...
...
@@ -2,12 +2,13 @@ import os
import
re
from
abc
import
ABC
,
abstractmethod
from
pathlib
import
Path
from
tabnanny
import
check
from
esd.error_handling.exceptions
import
BashCommandException
,
NoSpackEnvironmentException
,
\
SpackInstallPackagesException
from
esd.logger.logger_builder
import
get_logger
from
esd.model.SpackModel
import
SpackModel
from
esd.spack_manager.wrapper.spack_wrapper
import
no
_spack_env
from
esd.spack_manager.wrapper.spack_wrapper
import
check
_spack_env
from
esd.utils.utils
import
run_command
,
git_clone_repo
...
...
@@ -53,7 +54,6 @@ class SpackManager(ABC):
pass
def
create_fetch_spack_environment
(
self
):
if
self
.
env
.
git_path
:
git_clone_repo
(
self
.
env
.
env_name
,
self
.
env
.
path
/
self
.
env
.
env_name
,
self
.
env
.
git_path
,
logger
=
self
.
logger
)
else
:
...
...
@@ -127,7 +127,7 @@ class SpackManager(ABC):
return
False
return
True
@
no
_spack_env
@
check
_spack_env
def
add_spack_repo
(
self
,
repo_path
:
Path
,
repo_name
:
str
):
"""
Add the Spack repository if it does not exist.
"""
run_command
(
"
bash
"
,
"
-c
"
,
...
...
@@ -137,7 +137,7 @@ class SpackManager(ABC):
exception_msg
=
f
"
Failed to add
{
repo_name
}
to spack environment
{
self
.
env
.
env_name
}
"
,
exception
=
BashCommandException
)
@
no
_spack_env
@
check
_spack_env
def
get_compiler_version
(
self
):
result
=
run_command
(
"
bash
"
,
"
-c
"
,
f
'
source
{
self
.
spack_setup_script
}
&& spack env activate -p
{
self
.
env_path
}
&& spack compiler list
'
,
...
...
@@ -167,8 +167,21 @@ class SpackManager(ABC):
return
spack_version
.
stdout
.
strip
().
split
()[
0
]
return
None
def
install_spack
(
self
,
spack_version
=
"
v0.21.1
"
,
spack_repo
=
'
https://github.com/spack/spack
'
):
@check_spack_env
def
install_packages
(
self
,
jobs
:
int
,
signed
=
True
,
fresh
=
False
):
signed
=
''
if
signed
else
'
--no-check-signature
'
fresh
=
'
--fresh
'
if
fresh
else
''
with
open
(
str
(
Path
(
os
.
getcwd
()).
resolve
()
/
"
.generate_cache.log
"
),
"
w
"
)
as
log_file
:
run_command
(
"
bash
"
,
"
-c
"
,
f
'
source
{
self
.
spack_setup_script
}
&& spack install --env
{
self
.
env
.
env_name
}
-v
{
signed
}
--j
{
jobs
}
{
fresh
}
'
,
stdout
=
log_file
,
capture_output
=
True
,
text
=
True
,
check
=
True
,
logger
=
self
.
logger
,
debug_msg
=
f
"
Installing spack packages for
{
self
.
env
.
env_name
}
"
,
exception_msg
=
f
"
Error installing spack packages for
{
self
.
env
.
env_name
}
"
,
exception
=
SpackInstallPackagesException
)
def
install_spack
(
self
,
spack_version
=
"
v0.22.0
"
,
spack_repo
=
'
https://github.com/spack/spack
'
):
try
:
user
=
os
.
getlogin
()
except
OSError
:
...
...
This diff is collapsed.
Click to expand it.
esd/spack_manager/wrapper/spack_wrapper.py
+
1
−
1
View file @
c708d57a
...
...
@@ -3,7 +3,7 @@ import functools
from
esd.error_handling.exceptions
import
NoSpackEnvironmentException
def
no
_spack_env
(
method
):
def
check
_spack_env
(
method
):
@functools.wraps
(
method
)
def
wrapper
(
self
,
*
args
,
**
kwargs
):
if
self
.
spack_env_exists
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment