This repository contains an InterLink HTCondor sidecar plugin - a container manager that interfaces with InterLink instances to deploy Kubernetes pod containers on HTCondor batch systems using Singularity/Apptainer.
- Full Kubernetes Pod Support: Handles containers, volumes, secrets, configMaps, and resource requests
- Dual Execution Modes: Singularity containers and host-based script execution
- InterLink API v0.5.0+ Compatible: Modern API with proper error handling and status codes
- Comprehensive Logging: Aggregated stdout, stderr, and HTCondor job logs
- Real-time Status: Live job status with actual timestamps from HTCondor
- Robust Error Handling: Detailed error responses and validation
- Python 3.6+
- HTCondor installation with command-line tools
- Access to HTCondor scheduler and collector
- Grid proxy certificate (for GSI authentication)
-
Clone the repository:
git clone https://github.com/interlink-hq/interlink-htcondor-plugin.git cd interlink-htcondor-plugin
-
Install dependencies:
pip install flask pyyaml
-
Configure the plugin: Edit SidecarConfig.yaml to set:
DataRootFolder
: Directory for job files (default:.knoc/
)CommandPrefix
: Optional command prefix for job executionExportPodData
: Enable volume and secret mounting
-
Create required directories:
mkdir -p .knoc out err log
python3 handles.py \
--condor-config /path/to/condor_config \
--schedd-host scheduler.example.com \
--collector-host collector.example.com \
--auth-method GSI \
--proxy /tmp/x509up_u$(id -u) \
--port 8000
The server will start on http://0.0.0.0:8000/
with REST API endpoints:
POST /create
- Submit new pods as HTCondor jobsPOST /delete
- Cancel and remove jobsGET /status
- Query job status and container statesGET /getLogs
- Retrieve job output and logs
For GSI authentication, ensure certificates are in /etc/grid-security/certificates
and a valid proxy exists at the specified --proxy
path.
If Virtual Kubelet and Interlink instances are running and properly configured, you can then test deploying:
kubectl apply -f ./tests/test_configmap.yaml
kubectl apply -f ./tests/test_secret.yaml
kubectl apply -f ./tests/busyecho_k8s.yaml
A special behaviour is triggered if the image is in the form host
.
The plugin will submit the script which is passed as argument:
kubectl apply -f ./tests/production_deployment_LNL.yaml
This repository is to be used as a repository template for creating a new interTwin repository, and is aiming at being a clean basis promoting currently accepted good practices.
It includes:
- License information
- Copyright and author information
- Code of conduct and contribution guidelines
- Templates for PR and issues
- Code owners file for automatic assignment of PR reviewers
- GitHub actions workflows for linting and checking links
Content is based on:
All changes should go through Pull Requests.
- Only squash should be enforced in the repository settings.
- Update commit message for the squashed commits as needed.
To be configured on the repository settings.
- Require pull request reviews before merging
- Dismiss stale pull request approvals when new commits are pushed
- Require review from Code Owners
- Require status checks to pass before merging
- GitHub actions if available
- Other checks as available and relevant
- Require branches to be up to date before merging
- Include administrators