Skip to content

Commit 3738fee

Browse files
authored
Merge pull request finos#274 from finos/feat/k8s-legacy-consolidation
feat(k8s-legacy): consolidate legacy k8s plugin under orb k8s-legacy
2 parents 775c468 + 1b5beed commit 3738fee

122 files changed

Lines changed: 4980 additions & 3733 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11

22
# Use bd merge for beads JSONL files
33
.beads/issues.jsonl merge=beads
4+
5+
# Enforce LF line endings for shell scripts
6+
*.sh text eol=lf
7+
8+
# Legacy k8s-legacy/tools/ are shell scripts without .sh extension
9+
# (executed by kubelet via PATH lookup inside pods).
10+
k8s-legacy/tools/* text eol=lf

.github/workflows/dev-pypi.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
branches: [main]
2020
paths:
2121
- 'src/**'
22+
- 'k8s-legacy/**'
2223
- 'pyproject.toml'
2324
- 'requirements*.txt'
2425
- 'uv.lock'
@@ -100,14 +101,16 @@ jobs:
100101
repository-url: https://test.pypi.org/legacy/
101102
verbose: true
102103
skip-existing: true
104+
packages-dir: dist/
103105

104106
- name: Create deployment summary
105107
run: |
106108
{
107-
echo "## Package Published Successfully"
109+
echo "## Packages Published Successfully"
108110
echo ""
109111
echo "**Environment:** Test PyPI"
110-
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.config.outputs.pypi-name }}\`"
112+
echo "**Installation (orb-py):** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.config.outputs.pypi-name }}\`"
113+
echo "**Installation (k8s-legacy extra):** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.config.outputs.pypi-name }}[k8s-legacy]\`"
111114
echo ""
112115
echo "**Version:** $VERSION"
113116
echo "**Commands:**"

.github/workflows/security-code.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ jobs:
128128
# pywin32 PSF-2.0 -> PSF-2.0 (permissive, equivalent to BSD)
129129
# cyclonedx-python-lib no detected license -> Apache-2.0 (METADATA: License: Apache-2.0)
130130
# fastapi no detected license -> MIT (METADATA: License-Expression: MIT)
131-
allow-dependencies-licenses: 'pkg:pypi/werkzeug, pkg:githubactions/trufflesecurity/trufflehog, pkg:pypi/lark, pkg:pypi/mcp, pkg:pypi/rfc3987-syntax, pkg:pypi/wcwidth, pkg:pypi/lxml, pkg:pypi/protobuf, pkg:pypi/pywin32, pkg:pypi/cyclonedx-python-lib, pkg:pypi/fastapi'
131+
# aiohappyeyeballs 0BSD AND BSD-3-Clause AND GPL-1.0-or-later AND PSF-2.0 AND Python-2.0 -> PSF-2.0 (METADATA: License-Expression: PSF-2.0; permissive)
132+
# aiohttp no detected license -> Apache-2.0 (METADATA: License-Expression: Apache-2.0 AND MIT; dual permissive)
133+
# docutils BSD-2-Clause AND BSD-3-Clause AND CC-PDDC AND GPL-1.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND ... -> public-domain + BSD-2-Clause (METADATA: License: public domain, Python, 2-Clause BSD; GPL applies to a few isolated source files in the docutils source tree)
134+
# scramp no detected license -> MIT-0 (METADATA: License-Expression: MIT No Attribution; permissive)
135+
allow-dependencies-licenses: 'pkg:pypi/werkzeug, pkg:githubactions/trufflesecurity/trufflehog, pkg:pypi/lark, pkg:pypi/mcp, pkg:pypi/rfc3987-syntax, pkg:pypi/wcwidth, pkg:pypi/lxml, pkg:pypi/protobuf, pkg:pypi/pywin32, pkg:pypi/cyclonedx-python-lib, pkg:pypi/fastapi, pkg:pypi/aiohappyeyeballs, pkg:pypi/aiohttp, pkg:pypi/docutils, pkg:pypi/scramp'
132136

133137
codeql-analysis:
134138
name: CodeQL Analysis

.github/workflows/validate-workflows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ jobs:
6969
- name: Validate shell scripts with shellcheck
7070
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
7171
with:
72-
ignore_paths: '.venv .git __pycache__ node_modules k8s'
72+
ignore_paths: '.venv .git __pycache__ node_modules'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2121

2222
### Changed
2323

24+
- The legacy Symphony-on-Kubernetes HostFactory plugin is now bundled with `orb-py` as an optional install extra rather than as a separate `open-resource-broker` PyPI package. Install with `pip install "orb-py[k8s-legacy]"` and invoke via `orb k8s-legacy <command>`. See `docs/root/operational/from-open-resource-broker.md` for details. Runtime semantics are unchanged.
2425
- `[monitoring]` extra no longer includes `opentelemetry-instrumentation-boto` (use `[monitoring-aws]`).
2526
- `[all]` extra now includes `[all-providers]` so `pip install orb-py[all]` still pulls everything.
2627
- `[dev]` shim extra now includes `[all-providers]` for full local development.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,27 @@ curl http://localhost:8000/health
373373

374374
</details>
375375

376+
## Symphony HostFactory on Kubernetes (legacy)
377+
378+
The `k8s-legacy` module is a Symphony HostFactory custom provider plugin for Kubernetes, predating the modern multi-cloud ORB architecture. It is now bundled with `orb-py` as an optional install extra rather than as a separate PyPI package.
379+
380+
Install with:
381+
382+
```bash
383+
pip install "orb-py[k8s-legacy]"
384+
```
385+
386+
Confirm the install by listing available templates:
387+
388+
```bash
389+
orb k8s-legacy get-available-templates
390+
```
391+
392+
The plugin is in maintenance mode. A modern Kubernetes provider with native ORB integration is in development; existing deployments remain fully supported.
393+
394+
- **Upgrading from `open-resource-broker`?** See the [migration guide](docs/root/operational/from-open-resource-broker.md).
395+
- **Deploying the Symphony HF plugin?** See the [k8s-legacy deployment guide](k8s-legacy/README.md).
396+
376397
## Project
377398

378399
Architecture, development, and documentation.

docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ nav:
154154
- Operations:
155155
- Backup and Recovery: operational/backup_recovery.md
156156
- Migration: operational/migration.md
157+
- Migrate from open-resource-broker: operational/from-open-resource-broker.md
157158
- Performance: operational/performance.md
158159
- Monitoring: operational/monitoring.md
159160
- Tools: operational/tools.md
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Migrating from `open-resource-broker` to `orb-py[k8s-legacy]`
2+
3+
This guide is for operators who deployed the legacy `open-resource-broker` PyPI package and need to upgrade to the consolidated `orb-py` distribution.
4+
5+
## What changed
6+
7+
The Symphony-on-Kubernetes HostFactory plugin previously published as a standalone `open-resource-broker` package is now bundled with `orb-py` as an optional install extra at the `orb.k8s_legacy` sub-module path. There is a single wheel: `orb-py`. The heavy dependencies (kubernetes, fastapi, uvicorn, sqlalchemy, alembic, pg8000, prometheus-client, watchdog, inotify, and others) are behind the `[k8s-legacy]` extra so that operators running only the modern AWS provider do not pay for them.
8+
9+
The runtime semantics are unchanged: same filesystem workdir layout, same push-based Kubernetes watchers, same event log format, same HostFactory API output.
10+
11+
## Install
12+
13+
| Before | After |
14+
|--------|-------|
15+
| `pip install open-resource-broker` | `pip install "orb-py[k8s-legacy]"` |
16+
17+
The `open-resource-broker` package is no longer published to PyPI. Pin to an older release only as a rollback option (see [Rollback](#rollback)).
18+
19+
## CLI commands
20+
21+
The standalone entry-point binaries (`open-resource-broker`, `open-resource-broker-admin`, `open-resource-broker-utils`, `open-resource-broker-events`) are replaced by subcommand groups under the unified `orb` binary.
22+
23+
### Core HostFactory verbs
24+
25+
| Before | After |
26+
|--------|-------|
27+
| `open-resource-broker request-machines '{...}'` | `orb k8s-legacy request-machines '{...}'` |
28+
| `open-resource-broker get-request-status '{...}'` | `orb k8s-legacy get-request-status '{...}'` |
29+
| `open-resource-broker request-return-machines '{...}'` | `orb k8s-legacy request-return-machines '{...}'` |
30+
| `open-resource-broker get-return-requests '{...}'` | `orb k8s-legacy get-return-requests '{...}'` |
31+
| `open-resource-broker get-available-templates` | `orb k8s-legacy get-available-templates` |
32+
| `open-resource-broker watch pods` | `orb k8s-legacy watch pods` |
33+
| `open-resource-broker watch request-machines` | `orb k8s-legacy watch request-machines` |
34+
| `open-resource-broker watch request-return-machines` | `orb k8s-legacy watch request-return-machines` |
35+
| `open-resource-broker watch events` | `orb k8s-legacy watch events` |
36+
| `open-resource-broker watch nodes` | `orb k8s-legacy watch nodes` |
37+
| `open-resource-broker watch kube-events` | `orb k8s-legacy watch kube-events` |
38+
| `open-resource-broker run-cron` | `orb k8s-legacy run-cron` |
39+
40+
### Admin
41+
42+
| Before | After |
43+
|--------|-------|
44+
| `open-resource-broker-admin <verb>` | `orb k8s-legacy admin <verb>` |
45+
46+
### Utils and events-db
47+
48+
| Before | After |
49+
|--------|-------|
50+
| `open-resource-broker-utils` | `orb k8s-legacy utils` |
51+
| `open-resource-broker-events transform` | `orb k8s-legacy events-db transform` |
52+
53+
The `utils` server takes its configuration via flags (`--host`, `--port`, `--workdir`, `--platform`, `--cluster`, `--region`, `--namespace`, `--bucket`); it is not a subcommand group. Pass flags directly: `orb k8s-legacy utils --host 0.0.0.0 --port 8080`.
54+
55+
## HF shell scripts
56+
57+
The five HostFactory provider scripts at `${HF_CONFDIR}/providers/k8s-hf/scripts/` now call `orb k8s-legacy <verb>` internally instead of `hostfactory <verb>` (or `open-resource-broker <verb>`).
58+
59+
These scripts are repository artefacts, not Python package data, and are not bundled in the `orb-py` wheel. After upgrading, replace your deployed copies with the updated versions from the repository at `k8s-legacy/hostfactory/providers/k8s-hf/scripts/`:
60+
61+
```bash
62+
# From a checkout of finos/open-resource-broker at the release tag:
63+
cp k8s-legacy/hostfactory/providers/k8s-hf/scripts/*.sh "${HF_CONFDIR}/providers/k8s-hf/scripts/"
64+
```
65+
66+
Or fetch the five scripts (`requestMachines.sh`, `getRequestStatus.sh`, `requestReturnMachines.sh`, `getReturnRequests.sh`, `getAvailableTemplates.sh`) individually from the release tarball or the GitHub source tree.
67+
68+
## Operator daemon services
69+
70+
If you have systemd units, supervisord configs, or similar process managers running the watcher daemons, update the `ExecStart` (or equivalent) line for each daemon.
71+
72+
| Daemon | Before | After |
73+
|--------|--------|-------|
74+
| Pod watcher | `/usr/local/bin/open-resource-broker watch pods` | `/usr/local/bin/orb k8s-legacy watch pods` |
75+
| Request watcher | `/usr/local/bin/open-resource-broker watch request-machines` | `/usr/local/bin/orb k8s-legacy watch request-machines` |
76+
| Return watcher | `/usr/local/bin/open-resource-broker watch request-return-machines` | `/usr/local/bin/orb k8s-legacy watch request-return-machines` |
77+
| Cron runner | `/usr/local/bin/open-resource-broker run-cron` | `/usr/local/bin/orb k8s-legacy run-cron` |
78+
79+
Adjust the binary path to match your virtual environment if `orb` is not on the system `PATH`.
80+
81+
After updating the service definition, reload and restart:
82+
83+
```bash
84+
systemctl daemon-reload
85+
systemctl restart hostfactory-watch-pods.service
86+
# repeat for each daemon unit
87+
```
88+
89+
## Python imports
90+
91+
This applies only if you embed the legacy plugin as a library. Operator deployments that invoke the CLI exclusively are unaffected.
92+
93+
| Before | After |
94+
|--------|-------|
95+
| `from open_resource_broker import ...` | `from orb.k8s_legacy import ...` |
96+
| `from open_resource_broker.api import ...` | `from orb.k8s_legacy.api import ...` |
97+
98+
## Runtime semantics
99+
100+
Unchanged. The filesystem workdir layout (`/var/tmp/hostfactory` by default), Kubernetes watcher behaviour, event log format, and HostFactory API output are identical to the legacy standalone package.
101+
102+
## Rollback
103+
104+
To roll back to the standalone package, pin to the last published version:
105+
106+
```bash
107+
pip install "open-resource-broker<1.0"
108+
```
109+
110+
Or revert to a previous `orb-py` release that predates the consolidation. Check the project changelog at the repository root for the exact version boundary.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)