Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ebrains-spack-builds
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Klaus Noelp
ebrains-spack-builds
Commits
4c7f04e2
Commit
4c7f04e2
authored
1 year ago
by
Eleni Mathioulaki
Browse files
Options
Downloads
Patches
Plain Diff
adapt installation script to use in CI
parent
6eaaf2c0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
install_spack_env.sh
+20
-11
20 additions, 11 deletions
install_spack_env.sh
with
20 additions
and
11 deletions
install_spack_env.sh
+
20
−
11
View file @
4c7f04e2
#!/bin/bash
# ===========================================================================================================
# ===========================================================================================================
====================
# title : install_spack_env.sh
# usage : ./install_spack_env.sh $INSTALLATION_ROOT $SPACK_VERSION $EBRAINS_REPO $EBRAINS_SPACK_ENV
# usage : ./install_spack_env.sh $INSTALLATION_ROOT $SPACK_VERSION $EBRAINS_REPO $EBRAINS_SPACK_ENV
$UPSTREAM_INSTANCE
# description : installs or updates the spack environment defined in the EBRAINS spack repo
# (if the specified spack instance doesn't exist, it also creates it)
# ===========================================================================================================
# ===========================================================================================================
====================
INSTALLATION_ROOT
=
$1
# where to set up the installation
SPACK_VERSION
=
$2
# which spack version to use
EBRAINS_REPO
=
$3
# location of ebrains-spack-builds repository
EBRAINS_SPACK_ENV
=
$4
# name of EBRAINS Spack environment to be created/updated
UPSTREAM_INSTANCE
=
$5
# path to Spack instance to use as upstream (optional)
# specify location of .spack dir (by default in ~)
# this is where cache and configuration settings are stored
...
...
@@ -29,26 +30,34 @@ then
sed
-i
"s/self.file_like,
\"
w
\"
/self.file_like,
\"
a
\"
/g"
$INSTALLATION_ROOT
/spack/lib/spack/llnl/util/tty/log.py
fi
if
[[
$UPSTREAM_INSTANCE
]]
then
cat
<<
EOF
>
$INSTALLATION_ROOT
/spack/etc/spack/defaults/upstreams.yaml
upstreams:
upstream-spack-instance:
install_tree:
$UPSTREAM_INSTANCE
/spack/opt/spack
EOF
fi
# activate Spack
source
$INSTALLATION_ROOT
/spack/share/spack/setup-env.sh
# add repo if it does not exist
if
[[
!
$(
spack repo list |
grep
$EBRAINS_REPO
)
]]
then
spack repo add
$EBRAINS_REPO
fi
# install platform compiler (extract version from packages.yaml)
if
[
$SYSTEMNAME
==
ebrainslab
]
then
EBRAINS_SPACK_COMPILER
=
$(
grep
'compiler'
$EBRAINS_REPO
/site-config/
$SYSTEMNAME
/packages.yaml |
awk
-F
'[][]'
'{ print $2 }'
)
spack compiler find
spack compiler list |
grep
-q
$EBRAINS_SPACK_COMPILER
||
spack
install
$EBRAINS_SPACK_COMPILER
spack load
$EBRAINS_SPACK_COMPILER
spack load
$EBRAINS_SPACK_COMPILER
||
(
spack
install
$EBRAINS_SPACK_COMPILER
;
spack load
$EBRAINS_SPACK_COMPILER
)
fi
spack compiler find
# add repo if it does not exist
if
[[
!
$(
spack repo list |
grep
$EBRAINS_REPO
)
]]
then
spack repo add
$EBRAINS_REPO
fi
# create environment if it does not exist
if
[
!
-d
"
$SPACK_ROOT
/var/spack/environments/
$EBRAINS_SPACK_ENV
"
]
then
...
...
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