Skip to content

Add osg-htc/nrp-provisioner: the HTCondor provisioner for NRP Nautilus - #331

Open
ashtongraves wants to merge 6 commits into
mainfrom
nrp-provisioner
Open

ashtongraves wants to merge 6 commits into
mainfrom
nrp-provisioner

Conversation

@ashtongraves

Copy link
Copy Markdown
Collaborator

What

New image osg-htc/nrp-provisioner: the demand-driven HTCondor provisioner that launches osg-htc/nrp-ospool-ep worker pods on the NRP Nautilus Kubernetes cluster. One provisioner per namespace reads idle jobs from whitelisted schedds, groups them by resource shape, and creates Kubernetes Jobs whose pods join the OSPool (or IGWN) with one static slot each.

It currently runs in four NRP namespaces (osg-opportunistic, osg-icecube, osg-nrao, osg-ligo) from a personal registry project. Building it here puts it next to its worker image, osg-htc/nrp-ospool-ep.

Contents

  • Dockerfile: Rocky 10, OSG 25, HTCondor 25 with the htcondor2 bindings, Python 3.12, kubernetes client pinned at 37.0.1.
  • src/: the provisioner library; provisioner_main.py and the startup scripts.
  • README.md: how it works, configuration, authentication, troubleshooting, building and tests.
  • tests/: unit tests, an image test (tests/image.sh <image>) and a sample config.
  • LICENSES/: the code comes from sfiligoi/prp-osg-pool (MIT) and the prp-htcondor-portal provisioner (BSD-2-Clause), and keeps those copyright headers.

Notes

  • build-config.json is el10 / OSG 25 / release, so CI publishes nrp-provisioner:25-release. The Dockerfile installs OSG 25 on Rocky 10 itself and doesn't use the BASE_* build arguments, so Docker may warn that they're unused.
  • Tested on an amd64 build of this directory: tests/image.sh passes (32 unit tests inside the image; startup with a fake service account reaches the provisioning loop and reads the OSPool collector and a schedd).
  • The deployment configs, operations notes and live checks stay in ashtongraves/nrp-provisioner, whose provisioner/ directory is kept identical to this one (changes land here first).

🤖 Generated with Claude Code

The demand-driven provisioner that launches osg-htc/nrp-ospool-ep worker
pods on the NRP Nautilus Kubernetes cluster for idle OSPool jobs. Moved here
from github.com/ashtongraves/nrp-provisioner, whose provisioner/ directory
is kept identical to this one; deployment configs stay there.

Rocky 10, OSG 25, HTCondor 25 (htcondor2 bindings). Includes its README,
unit tests and an image test (tests/image.sh).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Scheduling, resource accounting, and failure-isolation defects can stall provisioning, repeatedly create workers, or terminate running workloads.

5 open issues
What changed in this PR

Adds osg-htc/nrp-provisioner alongside its worker image, bringing demand-driven HTCondor worker provisioning for NRP Nautilus into this repository.

Changes:

  • Adds the container build, credential setup, and runtime entry points.
  • Implements demand queries, resource grouping, Kubernetes Job creation, trial pods, and back-off.
  • Includes unit and image checks, configuration examples, operational documentation, and upstream licenses.
File Description
osg-htc/​nrp-provisioner/​tests/​test_schedd_query.py Tests schedd filtering, query constraints, and failures.
osg-htc/​nrp-provisioner/​tests/​test_logging.py Tests file logging and stdout mirroring.
osg-htc/​nrp-provisioner/​tests/​test_k8s_submit.py Checks Job submission and resource quantities.
osg-htc/​nrp-provisioner/​tests/​test_htcondor_ads.py Tests ad conversion and resource grouping.
osg-htc/​nrp-provisioner/​tests/​test_backoff.py Tests back-off, trial pods, and loop integration.
osg-htc/​nrp-provisioner/​tests/​sample_osg_provisioner.conf Supplies configuration for tests.
osg-htc/​nrp-provisioner/​tests/​image.sh Checks image dependencies, environment, and startup.
osg-htc/​nrp-provisioner/​src/​provisioner_logging.py Provides buffered file and stdout logging.
osg-htc/​nrp-provisioner/​src/​provisioner_k8s.py Configures, queries, and creates worker Jobs.
osg-htc/​nrp-provisioner/​src/​provisioner_htcondor.py Queries schedds and collector ads using htcondor2.
osg-htc/​nrp-provisioner/​src/​provisioner_config_parser.py Parses configuration values.
osg-htc/​nrp-provisioner/​src/​provisioner_clustering.py Groups demand and workers by resource shape.
osg-htc/​nrp-provisioner/​src/​provisioner_backoff.py Pauses provisioning after repeated unclaimed exits.
osg-htc/​nrp-provisioner/​src/​event_loop.py Coordinates queries, accounting, and provisioning.
osg-htc/​nrp-provisioner/​src/​__init__.py Marks the provisioner library package.
osg-htc/​nrp-provisioner/​setup_k8s_creds.sh Preserves Kubernetes settings for the runtime user.
osg-htc/​nrp-provisioner/​setup_htcondor_creds.sh Copies tokens and configures optional authentication.
osg-htc/​nrp-provisioner/​README.md Documents operation, configuration, troubleshooting, and tests.
osg-htc/​nrp-provisioner/​provisioner_startup.sh Prepares runtime settings and launches the provisioner.
osg-htc/​nrp-provisioner/​provisioner_main.py Initializes clients and runs the provisioning loop.
osg-htc/​nrp-provisioner/​provisioner_info.py Reports demand and worker counts by shape.
osg-htc/​nrp-provisioner/​LICENSES/​MIT-prp-osg-pool.txt Includes the upstream MIT license.
osg-htc/​nrp-provisioner/​LICENSES/​BSD-2-Clause-prp-htcondor-portal.txt Includes the upstream BSD license.
osg-htc/​nrp-provisioner/​Dockerfile Builds the provisioner image and runtime environment.
osg-htc/​nrp-provisioner/​build-config.json Registers the EL10/OSG 25 release build.
osg-htc/​nrp-provisioner/​03_condor_sec.config Configures HTCondor to use OSG certificates.

Review effort: Balanced

Comment thread osg-htc/nrp-provisioner/src/provisioner_k8s.py
Comment thread osg-htc/nrp-provisioner/src/provisioner_k8s.py
Comment thread osg-htc/nrp-provisioner/src/provisioner_k8s.py Outdated
Comment thread osg-htc/nrp-provisioner/provisioner_startup.sh Outdated
Comment thread osg-htc/nrp-provisioner/src/provisioner_k8s.py Outdated
ashtongraves and others added 4 commits October 24, 2026 17:26
…void matching no nodes'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…failures from the worker script'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…k resource limits'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Jobs were grouped by RequestDiskVolumes, RequestGPUTypes and RequestLabels
too, but submit() never puts those on the pods. A job setting one would get
pods every loop that its group never counted, with no cap and no back-off.
Group as if they were unset: trial pods and the back-off then limit the cost
if such a job's pods don't match it. No job in the deployed namespaces sets
them today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pods

Worker Jobs run several pods with backoffLimit 0, so one failed pod fails the
whole Job and the Job controller deletes the others, claimed ones included.
In osg-opportunistic, 17 such failures in an hour, all preemptions, deleted
141 sibling pods. Ignore pods stopped for preemption (DisruptionTarget) in a
podFailurePolicy: the Job controller replaces them instead. Other failures
still fail the Job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ashtongraves added a commit to ashtongraves/nrp-provisioner that referenced this pull request Oct 25, 2026
Same as opensciencegrid/images#331: ignore preemption (DisruptionTarget) in
the worker Jobs' podFailurePolicy, so the Job controller replaces the pod
instead of failing the Job and deleting its other pods.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ashtongraves added a commit to ashtongraves/nrp-provisioner that referenced this pull request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants