-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: main
Are you sure you want to change the base?
Changes from all commits
2c87eaf
2a606c7
2b208d3
1a434ec
48843d3
99c17c6
e6a3206
044de80
f67e725
8b07089
dc73c23
9a6638f
9d90d37
f87182a
bc2f7a2
2168067
e779a8f
410761f
5c77a66
30e0480
e9efb8b
2881c0d
ee5a863
3286dfa
0247b70
7fe8e93
7b2a55f
b073ed5
bbea903
ad44c50
2c7cc9f
1b00676
03de498
f09cdf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||||||||||||||||||
| 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 | ||||||||||||||||||||||
| RUN curl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o /usr/sbin/kubectl && \ | ||||||||||||||||||||||
|
||||||||||||||||||||||
| RUN curl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o /usr/sbin/kubectl && \ | |
| ARG KUBECTL_VERSION=v1.30.2 | |
| ARG KUBECTL_SHA256=4310270c87a4f80637ef6fa9af9d1f703d8d43b7efd2d7661f7902dc0e05251d | |
| 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 - && \ |
Copilot
AI
Apr 17, 2026
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.
Dockerfile uses the instruction env (lowercase) to set environment variables. Dockerfile instructions are case-insensitive in some tooling, but env is not a valid Dockerfile directive in the standard parser; this will fail builds on common builders. Use ENV for these variables so the image builds reliably.
| 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 | |
| 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 |
| 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"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||
| #!/bin/bash | ||||||
|
|
||||||
| # | ||||||
| # osgvo pilot does not like is CONDOR_HOST is set | ||||||
|
||||||
| # osgvo pilot does not like is CONDOR_HOST is set | |
| # osgvo pilot does not like if CONDOR_HOST is set |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||
|
|
||||||||||||||||||
| # | ||||||||||||||||||
| # osgvo-pilot expects the token as an env variable | ||||||||||||||||||
| # | ||||||||||||||||||
|
|
||||||||||||||||||
| export TOKEN=`cat /etc/condor/tokens.d/prp-wn.token` | ||||||||||||||||||
|
|
||||||||||||||||||
|
Comment on lines
+7
to
+8
|
||||||||||||||||||
| export TOKEN=`cat /etc/condor/tokens.d/prp-wn.token` | |
| 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 | |
| export TOKEN=$(cat "$token_file") |
| 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 singularity is present | ||||||
|
||||||
| # only test for apptainer functionality if singularity is present | |
| # only test for apptainer functionality if apptainer is present |
| 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 | ||
| # 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 |
| 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} -L nautilus.io/OSGInstitutionID | tail -1 | awk '{print $6}'` | ||||||
|
||||||
| OSG_INSTITUTION_ID=`/usr/sbin/kubectl get node ${PHYSICAL_HOSTNAME} -L nautilus.io/OSGInstitutionID | tail -1 | awk '{print $6}'` | |
| OSG_INSTITUTION_ID=`/usr/sbin/kubectl get node ${PHYSICAL_HOSTNAME} -o jsonpath="{.metadata.labels['nautilus\.io/OSGInstitutionID']}"` |
| 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 | ||
|
|
| 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 | ||
|
|
||
|
|
| 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 | ||
|
|
| 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 | ||
|
|
| 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 |
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.
The workflow now includes
osg-htc/...images in the build list, but the push job still uses the same Harbor registry (hub.opensciencegrid.org) and robot credentials for all contexts. Ifcontextis used as the registry repo name, this will attempt to push into anosg-htcnamespace/project that the current robot account may not be authorized for; consider adding per-org registry/credentials routing or excludingosg-htc/*from the push steps until permissions are in place.