|
| 1 | +# OFCIR Setup Guide |
| 2 | + |
| 3 | +## Approach: Reuse `packet-assisted` Infrastructure |
| 4 | + |
| 5 | +Instead of creating a custom OFCIR pool and cluster profile from scratch, enclave |
| 6 | +reuses the existing `packet-assisted` profile and `assisted_medium_el9` machine pool. |
| 7 | +This is the same infrastructure that `assisted-service` uses. |
| 8 | + |
| 9 | +**What this gives us:** |
| 10 | +- Equinix bare-metal machines with EL9, KVM-capable, sufficient RAM |
| 11 | +- SSH access via `packet-ssh-key` (pre-configured in the profile) |
| 12 | +- OFCIR auth token (pre-configured in the profile) |
| 13 | +- Pull secret with all required registries |
| 14 | + |
| 15 | +**What we skip:** |
| 16 | +- No ci-tools PR (no new cluster profile constant) |
| 17 | +- No Vault self-service setup |
| 18 | +- No boskos lease configuration |
| 19 | +- No OFCIR pool/machine registration |
| 20 | +- No DPTP ticket |
| 21 | + |
| 22 | +### Why this works |
| 23 | + |
| 24 | +1. `packet-assisted` has **no owner restrictions** in `cluster-profiles-config.yaml` — any org can use it |
| 25 | +2. `assisted_medium_el9` machines are Equinix hosts with 64GB+ RAM and KVM support |
| 26 | +3. The SSH-from-Pod pattern is identical regardless of which profile provides the credentials |
| 27 | + |
| 28 | +### Trade-off |
| 29 | + |
| 30 | +Enclave jobs share the machine pool with assisted-service. If the pool is busy, jobs |
| 31 | +queue until a machine is available. If this becomes a bottleneck, we can create a |
| 32 | +dedicated pool later (see "Migrating to a Dedicated Pool" below). |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## What's Needed Now |
| 37 | + |
| 38 | +### In `openshift/release` (single PR) |
| 39 | + |
| 40 | +The ci-operator config already uses: |
| 41 | +```yaml |
| 42 | +cluster_profile: packet-assisted |
| 43 | +CLUSTERTYPE: assisted_medium_el9 |
| 44 | +``` |
| 45 | +
|
| 46 | +The step-registry entries (`e2e-setup`, `e2e-teardown`, `e2e-connected`, etc.) |
| 47 | +use `from: dev-scripts` and source `${SHARED_DIR}/packet-conf.sh` — both provided |
| 48 | +by the existing OFCIR infrastructure. |
| 49 | + |
| 50 | +No additional configuration is needed. |
| 51 | + |
| 52 | +### Verification |
| 53 | + |
| 54 | +After the `openshift/release` PR merges: |
| 55 | + |
| 56 | +1. Open a PR on the enclave repo that touches `playbooks/` or `scripts/` |
| 57 | +2. Run `/test infra-verify` to trigger the OFCIR-based job |
| 58 | +3. Check Prow logs to confirm: |
| 59 | + - `ofcir-acquire` gets a machine IP |
| 60 | + - `e2e-setup` SSHs in and clones the repo |
| 61 | + - The test step runs on the machine |
| 62 | + - `ofcir-release` returns the machine |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## Migrating to a Dedicated Pool (Later) |
| 67 | + |
| 68 | +If sharing the assisted pool becomes a bottleneck, create a dedicated `enclave-edge` |
| 69 | +profile. This requires: |
| 70 | + |
| 71 | +### 1. PR to `openshift/ci-tools` (`pkg/api/types.go`) |
| 72 | + |
| 73 | +```go |
| 74 | +// Add constant |
| 75 | +ClusterProfileEnclaveEdge ClusterProfile = "enclave-edge" |
| 76 | +
|
| 77 | +// Add to ClusterProfiles() list |
| 78 | +ClusterProfileEnclaveEdge, |
| 79 | +
|
| 80 | +// Add to LeaseType() |
| 81 | +case ClusterProfileEnclaveEdge: |
| 82 | + return "enclave-edge-quota-slice" |
| 83 | +``` |
| 84 | + |
| 85 | +### 2. PR to `openshift/release` |
| 86 | + |
| 87 | +**`core-services/prow/02_config/_boskos.yaml`** — add lease: |
| 88 | +```yaml |
| 89 | +- type: enclave-edge-quota-slice |
| 90 | + state: free |
| 91 | + min-count: 1 |
| 92 | + max-count: 1 |
| 93 | +``` |
| 94 | + |
| 95 | +**`core-services/ci-secret-bootstrap/_config.yaml`** — seed pull-secret: |
| 96 | +```yaml |
| 97 | +- from: |
| 98 | + pull-secret: |
| 99 | + dockerconfigJSON: |
| 100 | + - auth_field: token_image-puller_app.ci_reg_auth_value.txt |
| 101 | + item: build_farm |
| 102 | + registry_url: registry.ci.openshift.org |
| 103 | + - auth_field: auth |
| 104 | + email_field: email |
| 105 | + item: quay.io-pull-secret |
| 106 | + registry_url: quay.io |
| 107 | + - auth_field: auth |
| 108 | + email_field: email |
| 109 | + item: registry.redhat.io-pull-secret |
| 110 | + registry_url: registry.redhat.io |
| 111 | + to: |
| 112 | + - cluster_groups: |
| 113 | + - non_app_ci |
| 114 | + name: cluster-secrets-enclave-edge |
| 115 | + namespace: ci |
| 116 | +``` |
| 117 | + |
| 118 | +**`ci-operator/step-registry/cluster-profiles/cluster-profiles-config.yaml`** — restrict access: |
| 119 | +```yaml |
| 120 | +- profile: enclave-edge |
| 121 | + owners: |
| 122 | + - org: rh-ecosystem-edge |
| 123 | + repos: |
| 124 | + - enclave |
| 125 | +``` |
| 126 | + |
| 127 | +### 3. Vault self-service (after PR 2 merges) |
| 128 | + |
| 129 | +At **vault.ci.openshift.org**: |
| 130 | +- Create collection at **selfservice.vault.ci.openshift.org** |
| 131 | +- Add secret with keys: `packet-ssh-key`, `ofcir-auth-token` |
| 132 | +- Set metadata: `secretsync/target-namespace: ci`, `secretsync/target-name: cluster-secrets-enclave-edge` |
| 133 | + |
| 134 | +### 4. DPTP request (`#forum-ocp-testplatform`) |
| 135 | + |
| 136 | +Request a new CIPool with type `enclave_edge_el9` and add the CLUSTERTYPE mapping |
| 137 | +to `ofcir-acquire-commands.sh`. |
| 138 | + |
| 139 | +### 5. Update ci-operator config |
| 140 | + |
| 141 | +Change `packet-assisted` -> `enclave-edge` and `assisted_medium_el9` -> `enclave_edge_el9`. |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## References |
| 146 | + |
| 147 | +- [Adding a Cluster Profile](https://docs.ci.openshift.org/docs/how-tos/adding-a-cluster-profile/) |
| 148 | +- [Adding a New Secret to CI](https://docs.ci.openshift.org/docs/how-tos/adding-a-new-secret-to-ci/) |
| 149 | +- [ci-tools PR 4685](https://github.com/openshift/ci-tools/pull/4685) (example profile addition) |
| 150 | +- DPTP team: `#forum-ocp-testplatform` on Slack |
0 commit comments