Document and scripts for OpenShift deployment#4679
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a full OpenShift deployment guide (plus helper scripts) to the admin deployment docs, and includes a small compatibility tweak to the Kubernetes job launcher to handle newer Kubernetes Python client token key behavior.
Changes:
- Documented an end-to-end OpenShift workflow (provision → deploy → submit job → monitor) under
docs/user_guide/admin_guide/deployment/openshift/. - Added helper scripts for CRC (OpenShift Local) cluster creation/start, scripted NVFlare provisioning/deploy/job submission, and a Rich-based live pod monitor.
- Updated
K8sJobLauncherto mirror an in-cluster token fromauthorizationtoBearerTokenfor newer Kubernetes Python client behavior.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| nvflare/app_opt/job_launcher/k8s_launcher.py | Adds a small token-key compatibility shim for in-cluster Kubernetes client configuration. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/start_openshift_cluster.sh | Starts CRC, optionally logs in via oc, and prepares/ चयन selects the target project/namespace. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/create_openshift_cluster.sh | Configures CRC settings and runs crc setup, optionally delegating to the start script. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_common.sh | Shared implementation for provision/deploy/submit phases (workspace prep, PVC staging, helm installs, job submit/wait). |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_provision.sh | Phase script to generate startup kits via nvflare provision. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_deploy.sh | Phase script to run nvflare deploy prepare, stage PVCs, and install generated Helm charts. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_submit_job.sh | Phase script to export and submit hello-numpy from an in-cluster admin pod and wait for completion. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_watch.sh | Shell wrapper to run the Rich pod watcher with shared env defaults. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_watch.py | Implements a Rich live pod table driven by oc/kubectl get pods -o json. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/openshift_k8s_e2e.sh | Convenience script to run provision → deploy → submit sequentially. |
| docs/user_guide/admin_guide/deployment/openshift/scripts/Dockerfile | Provides an OpenShift restricted-SCC-compatible NVFlare image build recipe. |
| docs/user_guide/admin_guide/deployment/openshift/README.md | Describes the OpenShift docs/scripts layout and quickstart entry points. |
| docs/user_guide/admin_guide/deployment/openshift/index.rst | New OpenShift deployment guide page (CRC setup, image requirements, scripted and manual workflows). |
| docs/user_guide/admin_guide/deployment/index.rst | Adds the OpenShift guide to the deployment guide TOC. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds OpenShift deployment documentation, helper shell scripts, and a Python watch utility for running NVFlare on OpenShift/Kubernetes. A targeted
Confidence Score: 5/5Safe to merge. The Python code change is a targeted version exclusion with a matching test; the new scripts and documentation do not touch any existing runtime paths. The only runtime code change is excluding kubernetes==36.0.0 in setup.cfg and adding a test for the already-existing in-cluster config branch. All other additions are new deployment scripts and documentation that are opt-in and have no effect on existing functionality. examples/devops/openshift/scripts/k8s_common.sh — the tarfile extraction call and the python-path comparison are worth a second look before these scripts are used in production or CI. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant k8s_e2e.sh
participant k8s_provision.sh
participant k8s_deploy.sh
participant k8s_submit_job.sh
participant OpenShift_K8s
User->>k8s_e2e.sh: "IMAGE=... bash k8s_e2e.sh"
k8s_e2e.sh->>k8s_provision.sh: "CLEAN_WORK_DIR=true"
k8s_provision.sh->>k8s_provision.sh: write_project_file()
k8s_provision.sh->>k8s_provision.sh: nvflare provision
k8s_provision.sh-->>k8s_e2e.sh: prod_00/ ready
k8s_e2e.sh->>k8s_deploy.sh: "CLEAN_WORK_DIR=false"
k8s_deploy.sh->>k8s_deploy.sh: nvflare deploy prepare (each participant)
k8s_deploy.sh->>OpenShift_K8s: create namespace + PVCs
k8s_deploy.sh->>OpenShift_K8s: stage workspace via copy pods
k8s_deploy.sh->>OpenShift_K8s: helm upgrade --install (server + clients)
OpenShift_K8s-->>k8s_deploy.sh: rollout status OK
k8s_e2e.sh->>k8s_submit_job.sh: "CLEAN_WORK_DIR=false"
k8s_submit_job.sh->>k8s_submit_job.sh: export_hello_numpy_job + patch_job_launcher_spec
k8s_submit_job.sh->>OpenShift_K8s: launch admin pod
k8s_submit_job.sh->>OpenShift_K8s: nvflare job submit (in-cluster)
OpenShift_K8s->>OpenShift_K8s: K8sJobLauncher (load_incluster_config) spawns job pods
OpenShift_K8s-->>k8s_submit_job.sh: job FINISHED:COMPLETED
k8s_submit_job.sh-->>k8s_e2e.sh: done
Reviews (17): Last reviewed commit: "Merge branch 'main' into final_oc" | Re-trigger Greptile |
Add document Start to sync Add Red Hat OpenShift Local E2E scripts
chesterxgchen
left a comment
There was a problem hiding this comment.
the scripts adding too many wrappers under script folder.
The user will have to understand each scripts and to learn what it does. Remember users are not interested in just run your scripts and see it worked. They are here to learn what are the basic commands that they can use for their deployment.
By wrapping the nvflare commands under these wrapper scripts creating a new barrier to learn. Many of the wrapper scripts are just conveniences.
Try remove or minimize these wrapper scripts to expose the base insrtuctions for user to use.
Description
Readme and user guide to describe how to deployment nvflare into OpenShift.
The following scripts are included and described in the user guides.
For users without existing OpenShift cluster, the follow two scripts are also included and described in the user guide.
One small update in k8s job launcher to support different token formats.
Types of changes
./runtest.sh.