Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eic_container
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
containers
eic_container
Commits
23fd01d4
Commit
23fd01d4
authored
3 years ago
by
Sylvester Joosten
Browse files
Options
Downloads
Patches
Plain Diff
Better handling of systems with old singulairty installs
parent
f54b7c1c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!57
Better handling of systems with old singularity installs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
install.sh
+37
-13
37 additions, 13 deletions
install.sh
with
37 additions
and
13 deletions
install.sh
+
37
−
13
View file @
23fd01d4
...
...
@@ -14,19 +14,30 @@ echo "Setting up development environment for eicweb/$CONTAINER:$VERSION"
mkdir
-p
local
/lib
||
exit
1
SINGULARITY
=
## check for a singularity install
## jlab singularity
if
[
-d
"/apps/singularity/3.7.1/bin/"
]
;
then
SINGULARITY
=
"/apps/singularity/3.7.1/bin/singularity"
## cvmfs singularity
elif
[
-f
"/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity"
]
;
then
SINGULARITY
=
"/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity"
## whatever is in the path
elif
[
$(
type
-P
singularity
)
]
;
then
## default singularity if new enough
if
[
$(
type
-P
singularity
)
]
;
then
SINGULARITY
=
$(
which singularity
)
else
echo
"ERROR: no singularity found, please make sure you have singularity in your
\$
PATH"
exit
1
SINGULARITY_VERSION
=
`
$SINGULARITY
--version
`
if
[
${
SINGULARITY_VERSION
:0:1
}
=
2
]
;
then
## too old, look for something else
SINGULARITY
=
fi
fi
if
[
-z
$SINGULARITY
]
;
then
if
[
-d
"/apps/singularity/3.7.1/bin/"
]
;
then
SINGULARITY
=
"/apps/singularity/3.7.1/bin/singularity"
## cvmfs singularity
elif
[
-f
"/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity"
]
;
then
SINGULARITY
=
"/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity"
## whatever is in the path
elif
[
$(
type
-P
singularity
)
]
;
then
SINGULARITY
=
$(
which singularity
)
else
echo
"ERROR: no singularity found, please make sure you have singularity in your
\$
PATH"
exit
1
fi
fi
echo
" - Found singularity at
$SINGULARITY
"
...
...
@@ -39,12 +50,13 @@ if [ ${SINGULARITY_VERSION:0:1} = 2 ]; then
echo
"WARNING: your singularity version
$SINGULARITY_VERSION
is ancient, we strongly recommend using version 3.x"
echo
"We will attempt to use a fall-back SIMG image to be used with this singularity version"
if
[
-f
/gpfs02/eic/athena/jug_xl-3.0-stable.simg
]
;
then
ln
-
d
f
/gpfs02/eic/athena/jug_xl-3.0-stable.simg
local
/lib
ln
-
s
f
/gpfs02/eic/athena/jug_xl-3.0-stable.simg
local
/lib
SIF
=
"
$PWD
/local/lib/jug_xl-3.0-stable.simg"
else
echo
"Attempting last-resort singularity pull for old image"
echo
"This may take a few minutes..."
singularity pull docker://eicweb/
$CONTAINER
:
$VERSION
SIF
=
"
$PWD
/local/lib/jug_xl-3.0-stable.simg"
singularity pull
--name
"
$SIF
"
docker://eicweb/
$CONTAINER
:
$VERSION
fi
## we are in sane territory, yay!
else
...
...
@@ -78,11 +90,23 @@ fi
## create a new top-level eic-shell launcher script
## that sets the ATHENA_PREFIX and then starts singularity
## need different script for old singularity versions
if
[
${
SINGULARITY_VERSION
:0:1
}
!=
2
]
;
then
## newer singularity
cat
<<
EOF
> eic-shell
#!/bin/bash
export ATHENA_PREFIX=
$PWD
/local
$SINGULARITY
run
$SIF
EOF
else
## ancient singularity
cat
<<
EOF
> eic-shell
#!/bin/bash
export ATHENA_PREFIX=
$PWD
/local
$SINGULARITY
exec
$SIF
bash
EOF
fi
chmod
+x eic-shell
echo
" - Created custom eic-shell excecutable"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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