Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
arc
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
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
Aleksandr Konstantinov
arc
Commits
fa39578f
Commit
fa39578f
authored
3 months ago
by
Maiken
Browse files
Options
Downloads
Patches
Plain Diff
Creating Apptainer RTE
parent
dfb48a26
Branches
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
src/services/a-rex/rte/ENV/APPTAINER
+52
-0
52 additions, 0 deletions
src/services/a-rex/rte/ENV/APPTAINER
with
52 additions
and
0 deletions
src/services/a-rex/rte/ENV/APPTAINER
0 → 100644
+
52
−
0
View file @
fa39578f
# description: executes the job inside apptainer container
# param:APPTAINER_IMAGE:string:NULL:apptainer image or tree per VO, key:value comma separated, key default if VO not matched
# param:APPTAINER_OPTIONS:string: :apptainer options
# param:BINARY_PATH:string:/usr/bin/apptainer:apptainer binary location
APPTAINER_OPTIONS="${APPTAINER_OPTIONS:-}"
APPTAINER_IMAGE="${APPTAINER_IMAGE:-}"
BINARY_PATH="${BINARY_PATH:-'/usr/bin/apptainer'}"
BINARY_PATH="${4:-$BINARY_PATH}"
DEFAULT_IMAGE="NULL"
if [ "x$1" = "x0" ]; then
LOCAL_FILE=$(control_path "${joboption_controldir}" "${joboption_gridid}" "local")
# get VO
#vo=`arcproxy -P $joboption_controldir/job.$joboption_gridid.proxy -i vomsVO 2> /dev/null`
vo=`grep voms= $LOCAL_FILE | awk -F / '{print $2}'|sort -u`
values=`echo $APPTAINER_IMAGE | sed -e 's/,/ /g'`
for i in $values
do
voname=`echo $i | awk -F : '{print $1}'`
voimage=`echo $i | awk -F : '{print $2}'`
if [ "xdefault" = "x$voname" ]; then
DEFAULT_IMAGE=$voimage
fi
if [ "x$vo" = "x$voname" ] ; then
IMAGE=$voimage
fi
done
IMAGE="${IMAGE:-$DEFAULT_IMAGE}"
# explicit image, NULL skips container
IMAGE="${2:-$IMAGE}"
# unquote IMAGE
temp="${IMAGE%\"}"
temp="${temp#\"}"
IMAGE=$temp
# Check if apptainer already used/set by another RTE
echo $joboption_args |grep -q apptainer; sused=$?
if [ "x$IMAGE" != "xNULL" ] && [ "x$sused" == "x1" ] ; then
joboption_args="$BINARY_PATH exec $APPTAINER_OPTIONS --home \${RUNTIME_JOB_DIR} $IMAGE $joboption_args"
# account apptainer image usage
export ACCOUNTING_WN_INSTANCE="${IMAGE}"
fi
fi
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