-
Notifications
You must be signed in to change notification settings - Fork 22
OSPOOL-158: Add NRP OSPool EP image builds #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
matyasselmeci
merged 40 commits into
opensciencegrid:main
from
brianhlin:OSPOOL-158.nrp-ospool-ep
Sep 3, 2026
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
8edff67
Copy files from prp-osgvo-pilot/image
sfiligoi dcced00
Integrate wn/image/image-config.d/02_additional_requirements.sh with …
sfiligoi 69be689
Add scripts/21_advertise_k8s_provisioner.sh
sfiligoi 74ce469
Add FORCE_K8SNAMESPACE_MATCHING
sfiligoi 79b005d
Add scripts/19_set_resources.sh
sfiligoi 58e6e0d
Fix typo
sfiligoi e49e9c6
Add scripts/01_token.sh
sfiligoi c2847c1
Fix script location
sfiligoi d3cfaa4
Fix typo in 22_set_requirements.sh
sfiligoi 8bfba7f
Add scripts/01_no_condor_host.sh
sfiligoi d5465d0
Add scripts/check_master.sh
sfiligoi 9ab0361
Fix typo
sfiligoi 1cbab6a
Add 02_validate_singularity.sh
sfiligoi b9bef53
Fix return code
sfiligoi f7b25ac
Wrap apptainer, too
sfiligoi 85d06f4
Test also --nv in singularity
sfiligoi 62f5713
Test also --nv in apptainer
sfiligoi 9f289cf
Change entrypoint location as per upstream
sfiligoi 4f9f5ea
Switch from osgvo-docker-pilot:3.6-release to osgvo-docker-pilot:23-r…
sfiligoi d2071f5
Move from opensciencegrid/osgvo-docker-pilot:23-release to openscienc…
sfiligoi 04939ff
Fix typo
sfiligoi 6e7a473
Fix python vs python3
sfiligoi 94df75b
Add IS_GLIDEIN classad
sfiligoi 45c0f74
Add kubectl in the image
sfiligoi 4b0322c
Add 11_set_OSGInstitutionID.sh init script that sets OSG_INSTITUTION_ID
sfiligoi 7813bea
Add OpenCL support
sfiligoi 667ce34
Update base image to hub.opensciencegrid.org/osg-htc/ospool-ep:24-rel…
sfiligoi 51dd25b
Replace exact matching with approximate matching
sfiligoi f79a877
Fix typo
sfiligoi e11aaf9
Make disk range larger
sfiligoi 7311aae
OSPOOL-158: add OSG 25 NRP ospool-ep builds
brianhlin 891b07f
Apply suggestion from @Copilot
matyasselmeci e99e315
Typo fix from @Copilot
matyasselmeci 30bdd54
Typo fix from @Copilot
matyasselmeci ddfdfa8
Fix syntax error noticed by @Copilot
matyasselmeci 38ac2b4
Apply suggestion from @Copilot
matyasselmeci 005bbd2
Pin kubectl download (from @Copilot)
matyasselmeci 68e3fe1
Apply batched suggestions from code review
matyasselmeci 0767c2c
Apply suggestion from @Copilot
matyasselmeci de8c513
Avoid accidentally printing out the token
matyasselmeci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| ARG BASE_OSG_SERIES=25 | ||
| ARG BASE_YUM_REPO=release | ||
|
|
||
| FROM hub.osg-htc.org/osg-htc/ospool-ep:${BASE_OSG_SERIES}-${BASE_YUM_REPO} | ||
|
|
||
| # Previous args have gone out of scope | ||
| ARG BASE_OSG_SERIES=25 | ||
| ARG BASE_YUM_REPO=release | ||
|
|
||
| # Enable OpenCL | ||
| # As suggested by https://github.com/WIPACrepo/pyglidein/blob/master/Dockerfile | ||
| RUN mkdir -p /etc/OpenCL/vendors && \ | ||
| echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd | ||
|
|
||
| # Some helper OpenCL tools | ||
| RUN yum install -y clinfo && \ | ||
| yum clean all | ||
|
|
||
| # Fix python vs python3 | ||
| RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 | ||
|
|
||
| # Add kubectl, to be able to interact with the k8s cluster | ||
| ARG KUBECTL_VERSION=v1.30.2 | ||
| ARG KUBECTL_SHA256=c6e9c45ce3f82c90663e3c30db3b27c167e8b19d83ed4048b61c1013f6a7c66e | ||
| RUN curl -fL "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" -o /usr/sbin/kubectl && \ | ||
| echo "${KUBECTL_SHA256} /usr/sbin/kubectl" | sha256sum -c - && \ | ||
| chmod u+x /usr/sbin/kubectl | ||
|
|
||
| # Tweaked singularity for container environments | ||
| # Remove default singularity from path, too | ||
| COPY scripts/singularity_npid.sh /usr/bin/singularity_npid.sh | ||
| RUN mv /usr/bin/singularity /usr/bin/singularity.org && \ | ||
| chmod a+x /usr/bin/singularity_npid.sh && \ | ||
| ln -s /usr/bin/singularity_npid.sh /usr/bin/singularity | ||
|
|
||
| COPY scripts/apptainer_npid.sh /usr/bin/apptainer_npid.sh | ||
| RUN mv /usr/bin/apptainer /usr/bin/apptainer.org && \ | ||
| chmod a+x /usr/bin/apptainer_npid.sh && \ | ||
| ln -s /usr/bin/apptainer_npid.sh /usr/bin/apptainer | ||
|
|
||
| # We want to be able to add system-level changes | ||
| # and run without explicit privilege drop | ||
| RUN mv /usr/local/sbin/entrypoint.sh /usr/local/sbin/entrypoint.osg.sh | ||
| COPY scripts/entrypoint.sh /usr/local/sbin/entrypoint.sh | ||
| RUN chmod a+rx /usr/local/sbin/entrypoint.sh | ||
|
|
||
| COPY scripts/check_master.sh /bin/check_master.sh | ||
| RUN chmod a+rx /bin/check_master.sh | ||
|
|
||
| # system level scripts | ||
| COPY scripts/01_token.sh /etc/entrypoint/image-config.d/01_token.sh | ||
| COPY scripts/01_no_condor_host.sh /etc/entrypoint/image-config.d/01_no_condor_host.sh | ||
| COPY scripts/11_set_OSGInstitutionID.sh /etc/entrypoint/image-config.d/11_set_OSGInstitutionID.sh | ||
|
|
||
| # pilot level scripts | ||
| COPY scripts/02_validate_singularity.sh /etc/osg/image-init.d/02_validate_singularity.sh | ||
| COPY scripts/02_validate_apptainer.sh /etc/osg/image-init.d/02_validate_apptainer.sh | ||
| COPY scripts/19_set_resources.sh /etc/osg/image-init.d/19_set_resources.sh | ||
| COPY scripts/20_advertise_glidein.sh /etc/osg/image-init.d/20_advertise_glidein.sh | ||
| COPY scripts/20_advertise_k8s_domain.sh /etc/osg/image-init.d/20_advertise_k8s_domain.sh | ||
| COPY scripts/21_advertise_k8s_provisioner.sh /etc/osg/image-init.d/21_advertise_k8s_provisioner.sh | ||
| COPY scripts/22_set_requirements.sh /etc/osg/image-init.d/22_set_requirements.sh | ||
|
|
||
| # keep default low, as we expect to be running in opportunistic mode | ||
| ENV ACCEPT_JOBS_FOR_HOURS=24 | ||
|
|
||
| # keep default idle time low, as we may over-provision certain kinds of resources | ||
| # but others may be waiting | ||
| ENV ACCEPT_IDLE_MINUTES=20 | ||
|
|
||
| # | ||
| # In addition to osgvo-docker-pilot envs, | ||
| # it accepts also the following env variables | ||
| # NUM_CPUS MEMORY DISK NUM_GPUS | ||
| # PHYSICAL_HOSTNAME | ||
| # K8S_NAMESPACE K8S_DOMAIN | ||
| # K8S_PROVISIONER_NAME K8S_PROVISIONER_TYPE | ||
| # FORCE_K8SNAMESPACE_MATCHING ADDITIONAL_REQUIREMENTS | ||
| # | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "standard_build": true, | ||
| "repo_build": false, | ||
| "base_os": ["el9"], | ||
| "osg_series": ["24", "25"], | ||
| "base_repo": ["release"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
|
|
||
| # | ||
| # osgvo pilot does not like it if CONDOR_HOST is set | ||
| # | ||
|
|
||
| export CONDOR_HOST= | ||
| unset CONDOR_HOST | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| # | ||
| # osgvo-pilot expects the token as an env variable | ||
| # | ||
|
|
||
| token_file=/etc/condor/tokens.d/prp-wn.token | ||
| if [ ! -r "$token_file" ]; then | ||
| echo "ERROR: required token file '$token_file' is missing or unreadable" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| read TOKEN < "$token_file" | ||
| export TOKEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/bash | ||
|
|
||
| # check if we need to test nvidia | ||
| nvf= | ||
| ls -l /dev/nvidia* | ||
| if [ $? -eq 0 ]; then | ||
| nvf=--nv | ||
| fi | ||
|
|
||
| # else do nothing, let Condor figure it out | ||
|
|
||
| if [ -f "/usr/bin/apptainer" ]; then | ||
| # only test for apptainer functionality if apptainer is present | ||
| # may not be in all pods | ||
|
|
||
| /usr/bin/apptainer exec $nvf --contain --ipc --pid --bind /cvmfs /cvmfs/singularity.opensciencegrid.org/opensciencegrid/osgvo-el7:latest /usr/bin/dc -e "3 5 + p" | ||
| rc=$? | ||
|
|
||
| if [ $rc -ne 0 ]; then | ||
| echo "Apptainer test execution failed!" | ||
| sleep 30 | ||
| exit 1 | ||
| fi | ||
|
|
||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/bash | ||
|
|
||
| # check if we need to test nvidia | ||
| nvf= | ||
| ls -l /dev/nvidia* | ||
| if [ $? -eq 0 ]; then | ||
| nvf=--nv | ||
| fi | ||
|
|
||
| # else do nothing, let Condor figure it out | ||
|
|
||
| if [ -f "/usr/bin/singularity" ]; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why this check: the Dockerfile explicitly creates /usr/bin/singularity, so this is always true. |
||
| # only test for singularity functionality if singularity is present | ||
| # may not be in all pods | ||
|
|
||
| /usr/bin/singularity exec $nvf --contain --ipc --pid --bind /cvmfs /cvmfs/singularity.opensciencegrid.org/opensciencegrid/osgvo-el8:latest /usr/bin/dc -e "3 5 + p" | ||
| rc=$? | ||
|
|
||
| if [ $rc -ne 0 ]; then | ||
| echo "Singularity test execution failed!" | ||
| sleep 30 | ||
| exit 1 | ||
| fi | ||
|
|
||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # | ||
| # Fetch OSGInstitutionID from k8s and set it as an env variable | ||
| # unless it is already set | ||
| # | ||
| if [ "x${OSG_INSTITUTION_ID}" == "x" ]; then | ||
| OSG_INSTITUTION_ID=`/usr/sbin/kubectl get node ${PHYSICAL_HOSTNAME} -o jsonpath="{.metadata.labels['nautilus\.io/OSGInstitutionID']}"` | ||
| if [ "x${OSG_INSTITUTION_ID}" != "x" ]; then | ||
| export OSG_INSTITUTION_ID | ||
| fi | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/bin/bash | ||
|
|
||
|
|
||
| # | ||
| # Advertise the k8s namespace and physical hostname | ||
| # | ||
|
|
||
| # | ||
| # NUM_CPUS and MEMORY are also handled by the osgvo-pilot | ||
| # but we re-set it here | ||
| # | ||
|
|
||
| full_num_cpus="${NUM_CPUS:-1}" | ||
| full_memory="${MEMORY:-1024}" | ||
| full_disk="${DISK:-100000}" | ||
| full_num_gpus="${NUM_GPUS:-0}" | ||
|
|
||
| echo "NUM_CPUS = ${full_num_cpus}" >> "${PILOT_CONFIG_FILE}" | ||
| echo "MEMORY = ${full_memory}" >> "${PILOT_CONFIG_FILE}" | ||
| echo "DISK = ${full_disk}" >> "${PILOT_CONFIG_FILE}" | ||
|
|
||
| # single slot using all the requested resources | ||
| echo "NUM_SLOTS_TYPE_1 = 1" >> "${PILOT_CONFIG_FILE}" | ||
| echo "SLOT_TYPE_1_PARTITIONABLE = FALSE" >> "${PILOT_CONFIG_FILE}" | ||
|
|
||
| if [ "x${full_num_gpus}" != "x0" ]; then | ||
| # we cannot really set the number of GPUs, just enable auto-detect | ||
| echo "use feature : GPUs" >> "${PILOT_CONFIG_FILE}" | ||
| echo "SLOT_TYPE_1 = cpu=${full_num_cpus},mem=${full_memory},disk=auto,swap=auto,gpus=${full_num_gpus}" \ | ||
| >> "${PILOT_CONFIG_FILE}" | ||
| else | ||
| echo "SLOT_TYPE_1 = cpu=${full_num_cpus},mem=${full_memory},disk=auto,swap=auto" \ | ||
| >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
|
|
||
|
|
||
| # | ||
| # Advertise that this is a glidein | ||
| # | ||
|
|
||
| if [ "x${ADVERTISE_IS_GLIDEIN}" != "xN" ]; then | ||
| echo "IS_GLIDEIN = true" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) IS_GLIDEIN' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/bash | ||
|
|
||
|
|
||
| # | ||
| # Advertise the k8s namespace and physical hostname | ||
| # | ||
|
|
||
| echo "# K8S params" >> "${PILOT_CONFIG_FILE}" | ||
|
|
||
| if [ "x${HOSTNAME}" != "x" ]; then | ||
| echo "K8SPodName=\"${HOSTNAME}\"" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) K8SPodName' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
||
| if [ "x${K8S_DOMAIN}" != "x" ]; then | ||
| echo "K8SDomain=\"${K8S_DOMAIN}\"" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) K8SDomain' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
||
| if [ "x${K8S_NAMESPACE}" != "x" ]; then | ||
| echo "K8SNamespace=\"${K8S_NAMESPACE}\"" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) K8SNamespace' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
||
| if [ "x${PHYSICAL_HOSTNAME}" != "x" ]; then | ||
| echo "K8SPhysicalHostName=\"${PHYSICAL_HOSTNAME}\"" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) K8SPhysicalHostName' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
17 changes: 17 additions & 0 deletions
17
osg-htc/nrp-ospool-ep/scripts/21_advertise_k8s_provisioner.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash | ||
|
|
||
|
|
||
| # | ||
| # Advertise the k8s provisioner | ||
| # | ||
|
|
||
| if [ "x${K8S_PROVISIONER_TYPE}" != "x" ]; then | ||
| echo "K8SProvisionerType=\"${K8S_PROVISIONER_TYPE}\"" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) K8SProvisionerType' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
||
| if [ "x${K8S_PROVISIONER_NAME}" != "x" ]; then | ||
| echo "K8SProvisionerName=\"${K8S_PROVISIONER_NAME}\"" >> "${PILOT_CONFIG_FILE}" | ||
| echo 'STARTD_EXPRS = $(STARTD_EXPRS) K8SProvisionerName' >> "${PILOT_CONFIG_FILE}" | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/bin/bash | ||
|
|
||
| cat >> "${PILOT_CONFIG_FILE}" << EOF | ||
| # | ||
| # Force matching on K8SNamespace | ||
| # unless FORCE_K8SNAMESPACE_MATCHING=="no" | ||
| # | ||
|
|
||
| FORCE_K8SNAMESPACE_MATCHING = "${FORCE_K8SNAMESPACE_MATCHING:-no}" | ||
| STARTD_EXPRS = \$(STARTD_EXPRS) FORCE_K8SNAMESPACE_MATCHING | ||
|
|
||
| MATCHING_START = ( (FORCE_K8SNAMESPACE_MATCHING=?="no") || regexp(TARGET.RequestK8SNamespace,K8SNamespace) ) | ||
|
|
||
| # | ||
| # Force matching on provisioned resources | ||
| # | ||
|
|
||
| PROVISIONING_START = ifthenelse(TARGET.RequestCPUs=!=undefined, CPUs=?=TARGET.RequestCPUs, CPUs=?=1) | ||
|
|
||
| # Pretend small memory and disk requests are the equivalent of not set | ||
| # Note: 4096 is special in the provisioner | ||
| PROVISIONING_START = \$(PROVISIONING_START) && \\ | ||
| ifthenelse(TARGET.RequestMemory=!=undefined, \\ | ||
| ifthenelse(TARGET.RequestMemory<4096, \\ | ||
| Memory=?=4096, \\ | ||
| ((Memory>=TARGET.RequestMemory) && ((TARGET.RequestMemory+1536)>Memory))), \\ | ||
| Memory=?=4096) | ||
|
|
||
| # Note: 8000000 is special in the provisioner | ||
| PROVISIONING_START = \$(PROVISIONING_START) && \\ | ||
| ifthenelse(TARGET.RequestDisk=!=undefined, \\ | ||
| ifthenelse(TARGET.RequestDisk<8000000, \\ | ||
| Disk=?=8000000, \\ | ||
| ((Disk>=TARGET.RequestDisk) && ((TARGET.RequestDisk+4500000)>Disk))), \\ | ||
| Disk=?=8000000) | ||
|
|
||
| # GPUs will not be defined if there are no GPUs | ||
| PROVISIONING_START = \$(PROVISIONING_START) && \\ | ||
| ifthenelse(TARGET.RequestGPUs=!=undefined, \\ | ||
| ifthenelse(GPUs=!=undefined, GPUs=?=TARGET.RequestGPUs, TARGET.RequestGPUs=?=0), \\ | ||
| (GPUs=?=undefined) || (GPUs=?=0)) | ||
|
|
||
| START = ( \$(START) ) && ( \$(PROVISIONING_START) ) && ( \$(MATCHING_START) ) | ||
|
|
||
| EOF | ||
|
|
||
|
|
||
| if [ "x${ADDITIONAL_REQUIREMENTS}" != "x" ]; then | ||
| echo "# Additional requirements added at runtime " >> "${PILOT_CONFIG_FILE}" | ||
| echo "MATCHING_START = ( \$(MATCHING_START) ) && ( ${ADDITIONAL_REQUIREMENTS} )" >> "${PILOT_CONFIG_FILE}" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/bin/bash | ||
|
|
||
| # simple apptainer wrapper that doesn't allow the -p or --pid option | ||
| # also rewrite -C to remove the -p option | ||
| # Disclaimer: Based on | ||
| # https://wiki-dev.bash-hackers.org/scripting/posparams | ||
| # | ||
|
|
||
| options=() # the buffer array for the parameters | ||
| eoo=0 # end of options reached | ||
|
|
||
| while [[ $1 ]] | ||
| do | ||
| if ! ((eoo)); then | ||
| case "$1" in | ||
| --pid) | ||
| # pretend was not passed | ||
| shift | ||
| ;; | ||
| -p) | ||
| # pretend was not passed | ||
| shift | ||
| ;; | ||
| --containall) | ||
| options+=("--contain") | ||
| options+=("--cleanenv") | ||
| options+=("--ipc") | ||
| # but not --pid | ||
| shift | ||
| ;; | ||
| -C) | ||
| options+=("-c") | ||
| options+=("-e") | ||
| options+=("-i") | ||
| # but not -p | ||
| shift | ||
| ;; | ||
| --) | ||
| eoo=1 | ||
| options+=("$1") | ||
| shift | ||
| ;; | ||
| *) | ||
| options+=("$1") | ||
| shift | ||
| ;; | ||
| esac | ||
| else | ||
| options+=("$1") | ||
| shift | ||
| fi | ||
| done | ||
|
|
||
| exec /cvmfs/oasis.opensciencegrid.org/mis/apptainer/bin/apptainer "${options[@]}" | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this check: the Dockerfile explicitly creates /usr/bin/apptainer, so this is always true.