Skip to content

Commit ad3e8e4

Browse files
committed
Add Prow CI scripts and configuration
Add CI scripts for OFCIR SSH-from-Pod pattern: - prow_setup.sh: machine setup (install deps, validate env) - prow_e2e.sh: E2E deployment (connected/disconnected) - prow_infra_verify.sh: infrastructure verification - prow_disconnected_dry_run.sh: mirror config validation - prow_cleanup.sh: periodic infrastructure cleanup Add OWNERS file for Prow review workflow. Add migration and OFCIR setup documentation.
1 parent c34c4d9 commit ad3e8e4

10 files changed

Lines changed: 1039 additions & 0 deletions

Makefile.ci

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ include Makefile
2222
.PHONY: validate validate-shell validate-yaml validate-json-schema validate-ansible \
2323
validate-tags validate-templates validate-mirror validate-makefile validate-plugins \
2424
build-ci-image push-ci-image test-ci-image build-push-ci-image \
25+
build-tarball build-push-tarball \
2526
deploy-cluster-pre-install-validate \
2627
environment provision-landing-zone verify-landing-zone \
2728
install-enclave verify-enclave-installation \
@@ -241,6 +242,16 @@ validate-makefile:
241242
validate-plugins:
242243
@./scripts/verification/validate.sh plugins
243244

245+
# --- Tarball targets ---
246+
247+
# Build distribution tarball (used by ci-operator container test)
248+
build-tarball:
249+
@./scripts/ci/build_tarball.sh build
250+
251+
# Build and push tarball to Quay (postsubmit)
252+
build-push-tarball:
253+
@./scripts/ci/build_tarball.sh build-push
254+
244255
# --- CI Image targets ---
245256

246257
build-ci-image:

OWNERS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
approvers:
2+
- agonzalezrh
3+
- carbonin
4+
- danielerez
5+
- eliorerz
6+
- eurijon
7+
- javipolo
8+
- maorfr
9+
- mlorenzofr
10+
- rporres
11+
reviewers:
12+
- agonzalezrh
13+
- carbonin
14+
- danielerez
15+
- eliorerz
16+
- eurijon
17+
- javipolo
18+
- maorfr
19+
- mlorenzofr
20+
- rporres

docs/OFCIR_SETUP.md

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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

Comments
 (0)