Complete guide for deploying the Docling Pipelines project on OpenShift using the automated deployment script.
This guide covers deploying Docling Pipelines on OpenShift by:
oc): Version 4.10 or higher# Check oc CLI installation
oc version
# Login to OpenShift cluster
oc login https://api.your-cluster.com:6443
# Verify login
oc whoami
git clone https://github.com/IBM/docling-pipelines.git
cd docling-pipelines
If the repository is private, export the Git username and personal access token before starting the deployment script. The script uses these values to create the OpenShift secret docpipe-git-auth and attach it to the build source.
export GIT_USERNAME="your-git-username"
export GIT_TOKEN="your-personal-access-token"
# Optional: override the secret name created by the script
export GIT_SECRET_NAME="docpipe-git-auth" # pragma: allowlist secret
Notes:
# Deploy with default settings (project name: docpipe)
./scripts/deploy-openshift.sh
# Or specify custom project name and Git repository
./scripts/deploy-openshift.sh my-docpipe-project https://github.com/IBM/docling-pipelines.git main
# Watch build progress
oc logs -f bc/docpipe-app
# Watch pod status
oc get pods -w
# Check deployment status
oc get deployment docpipe-backend
# Get the route URL
oc get route docpipe-route -o jsonpath='{.spec.host}'
# Test the application
DOCPIPE_URL=$(oc get route docpipe-route -o jsonpath='{.spec.host}')
curl -k https://$DOCPIPE_URL/health
./scripts/deploy-openshift.sh [project-name] [git-repo-url] [git-branch]
Parameters:
project-name (optional): OpenShift project name (default: docpipe)git-repo-url (optional): Git repository URL (default: https://github.com/IBM/docling-pipelines.git)git-branch (optional): Git branch to deploy (default: main)oc CLI is installedGIT_USERNAME and GIT_TOKEN from the environmentdocker/Dockerfile for the image buildDeploymentConfig with 2 replicasIf you prefer manual deployment or need to customize the process:
oc new-project docpipe --display-name="Docling Pipelines" \
--description="Docling Pipelines - Modular document processing framework"
oc new-app python:3.12~https://github.com/IBM/docling-pipelines.git \
--name=docpipe-app \
--strategy=source \
--context-dir=. \
--env PYTHONPATH=/opt/app-root/src/src \
--env PYTHONUNBUFFERED=1
cat <<EOF | oc apply -f -
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: docpipe-image
spec:
lookupPolicy:
local: true
EOF
cat <<EOF | oc apply -f -
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: docpipe-build
spec:
output:
to:
kind: ImageStreamTag
name: docpipe-image:latest
source:
type: Git
git:
uri: https://github.com/IBM/docling-pipelines.git
ref: main
strategy:
type: Source
sourceStrategy:
from:
kind: ImageStreamTag
namespace: openshift
name: python:3.12
EOF
cat <<EOF | oc apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: docpipe-backend
spec:
replicas: 2
selector:
matchLabels:
app: docpipe-app
template:
metadata:
labels:
app: docpipe-app
spec:
containers:
- name: docpipe
image: docpipe-image:latest
ports:
- containerPort: 8000
resources:
requests:
memory: "2Gi"
cpu: "1000m"
limits:
memory: "4Gi"
cpu: "2000m"
EOF
oc expose deployment docpipe-backend --port=8000 --name=docpipe-service
oc create route edge docpipe-route --service=docpipe-service --insecure-policy=Redirect
The deployment configures the following environment variables:
PYTHONPATH=/opt/app-root/src/src: Ensures Python can find docpipe modulesPYTHONUNBUFFERED=1: Enables real-time log outputDefault resource configuration per pod:
| Resource | Request | Limit |
|---|---|---|
| Memory | 2Gi | 4Gi |
| CPU | 1 core | 2 cores |
Liveness Probe:
/healthReadiness Probe:
/health# Scale to 3 replicas
oc scale deployment/docpipe-backend --replicas=3
# Check scaling status
oc get deployment docpipe-backend
# View application logs
oc logs -f deployment/docpipe-backend
# View specific pod logs
oc logs -f <pod-name>
# View build logs
oc logs -f bc/docpipe-app
# Trigger new build from Git
oc start-build docpipe-app
# Follow build logs
oc logs -f bc/docpipe-app
# Check build status
oc get builds
# Update environment variable
oc set env deployment/docpipe-backend NEW_VAR=value
# Update resource limits
oc set resources deployment/docpipe-backend \
--requests=cpu=1500m,memory=3Gi \
--limits=cpu=2500m,memory=5Gi
# Rollout restart
oc rollout restart deployment/docpipe-backend
# Update image
oc set image deployment/docpipe-backend docpipe=docpipe-image:v2.0
# Check rollout status
oc rollout status deployment/docpipe-backend
# View rollout history
oc rollout history deployment/docpipe-backend
# Rollback to previous version
oc rollout undo deployment/docpipe-backend
# List all pods
oc get pods
# Watch pod status
oc get pods -w
# Describe pod for events
oc describe pod <pod-name>
# View resource usage
oc adm top pods
# View node resource usage
oc adm top nodes
# View recent events
oc get events --sort-by='.lastTimestamp'
# Watch events
oc get events -w
# Check build logs
oc logs -f bc/docpipe-app
# Describe build for errors
oc describe build <build-name>
# Check build config
oc describe bc/docpipe-app
# Check pod status
oc get pods
# Describe pod for events
oc describe pod <pod-name>
# Check pod logs
oc logs <pod-name>
# Check previous container logs (if crashed)
oc logs <pod-name> --previous
# Check imagestream
oc get imagestream docpipe-image
# Describe imagestream
oc describe imagestream docpipe-image
# Check image tags
oc get imagestreamtag
# Check route configuration
oc get route docpipe-route
# Describe route
oc describe route docpipe-route
# Check service endpoints
oc get endpoints docpipe-service
# Test from inside cluster
oc run test-pod --image=curlimages/curl -it --rm -- \
curl http://docpipe-service:8000/health
# Check service
oc get svc docpipe-service
# Check endpoints
oc get endpoints docpipe-service
# Test connectivity from debug pod
oc debug deployment/docpipe-backend
# Delete all resources in project
oc delete all -l app=docpipe-app
# Or delete entire project
oc delete project docpipe
# Delete deployment only
oc delete deployment docpipe-backend
# Delete service
oc delete svc docpipe-service
# Delete route
oc delete route docpipe-route
# Delete buildconfig
oc delete bc docpipe-build
# Delete imagestream
oc delete imagestream docpipe-image
If you need to use a custom Dockerfile instead of S2I:
# Create BuildConfig with Docker strategy
cat <<EOF | oc apply -f -
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: docpipe-docker-build
spec:
output:
to:
kind: ImageStreamTag
name: docpipe-image:latest
source:
type: Git
git:
uri: https://github.com/IBM/docling-pipelines.git
strategy:
type: Docker
dockerStrategy:
dockerfilePath: Dockerfile
EOF
Add persistent volume for data storage:
# Create PVC
cat <<EOF | oc apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: docpipe-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
EOF
# Mount in deployment
oc set volume deployment/docpipe-backend \
--add --name=data-volume \
--type=persistentVolumeClaim \
--claim-name=docpipe-data \
--mount-path=/data
# Create ConfigMap
oc create configmap docpipe-config \
--from-file=config.yaml
# Create Secret
oc create secret generic docpipe-secrets \
--from-literal=api-key=your-secret-key
# Mount in deployment
oc set volume deployment/docpipe-backend \
--add --name=config \
--type=configmap \
--configmap-name=docpipe-config \
--mount-path=/config
oc set env deployment/docpipe-backend \
--from=secret/docpipe-secrets
The BuildConfig includes webhook triggers for automated builds:
# Get webhook URL
oc describe bc/docpipe-build | grep -A 1 "Webhook GitHub"
# Configure in GitHub repository settings:
# Settings > Webhooks > Add webhook
# Payload URL: <webhook-url>
# Content type: application/json
# Create Jenkins pipeline
cat <<EOF | oc apply -f -
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: docpipe-pipeline
spec:
strategy:
type: JenkinsPipeline
jenkinsPipelineStrategy:
jenkinsfile: |
pipeline {
agent any
stages {
stage('Build') {
steps {
script {
openshift.withCluster() {
openshift.withProject('docpipe') {
openshift.startBuild('docpipe-build').logs('-f')
}
}
}
}
}
stage('Deploy') {
steps {
script {
openshift.withCluster() {
openshift.withProject('docpipe') {
openshift.selector('deployment', 'docpipe-backend').rollout().latest()
}
}
}
}
}
}
}
EOF
latest tag in productionFor issues or questions:
oc logs <pod-name>oc get events --sort-by='.lastTimestamp'