|
| 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. |
0 commit comments