Skip to content

Commit 2897aa2

Browse files
Merge pull request openshift#763 from whereswaldon/SDCICD-625
docs: update to ccs-only addon testing
2 parents c56f8d4 + 6164cfd commit 2897aa2

File tree

1 file changed

+27
-88
lines changed

1 file changed

+27
-88
lines changed

docs/Addons.md

Lines changed: 27 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -18,86 +18,35 @@ The [Prow Operator Test] is a good example of a [Basic operator test]. It verifi
1818

1919
We have three test environments: integration (int), staging (stage), and production (prod). Your job will probably want to be configured for all of them once you have gained confidence in your test harness. Each environment requires a separate prow job configuration. The next section covers prow configuration in detail.
2020

21-
### **Getting an OCM refresh token for your tests**
22-
23-
You will need to request an OCM refresh token in order to run your tests. The easiest way to do this is to visit [https://cloud.redhat.com/openshift/token] and copy the OFFLINE_REFRESH_TOKEN. If you do not have an account or quota, please see [Managing Organization Quota]
24-
25-
Your account will need the following permissions:
26-
27-
* Credentials API access
28-
29-
### **Configuring your job to use your OCM refresh token**
30-
31-
In order to run addon tests in osde2e, you will need to create a secret in Origin CI with your OCM refresh token. Please follow [these instructions] to both create a secret and a secret mapping into the ci namespace. Note: The secret object must contain a key named `ocm-refresh-token` that contains the Offline Refresh Token from above.
32-
33-
Example secret:
34-
```
35-
apiVersion: v1
36-
kind: Secret
37-
metadata:
38-
name: my-addon-credentials
39-
data:
40-
ocm-refresh-token: <token-goes-here>
41-
```
42-
4321
## SKUs and Quota
4422

45-
In order to provision OSD and install your addon, your OCM token will need to have a quota of OSD clusters and installations of your addon available. In order to allocate quota for your addon, it must be assigned a SKU. You can request a SKU [by following these instructions](https://gitlab.cee.redhat.com/service/managed-tenants/-/tree/master).
23+
In order to provision OSD and install your addon, our OCM token will need to have a quota of OSD clusters and installations of your addon available. In order to allocate quota for your addon, it must be assigned a SKU. You can request a SKU [by following these instructions](https://gitlab.cee.redhat.com/service/managed-tenants/-/tree/master).
4624

4725
Once you have a SKU, you'll need to also allocate quota to test within [`app-interface`](https://gitlab.cee.redhat.com/service/app-interface/#manage-openshift-resourcequotas-via-app-interface-openshiftquota-1yml). Quota is allocated independently in each of `int`, `stage`, and `prod` (different instances of OCM), so you'll need to allocate quota three times.
4826

49-
[Here](https://gitlab.cee.redhat.com/service/ocm-resources/-/blob/master/data/uhc-production/orgs/13215750.yaml#L13) is an example of SD-CICD's quota for production. The `rh_org_id` (which is also the file name) can be determined by logging into OCM via the `ocm` CLI with your OCM token and running `ocm whoami`.
50-
51-
An example production quota for an addon would look like:
52-
```
53-
---
54-
$schema: /org-1.yaml
55-
56-
name: "Your Org Name"
57-
58-
rh_org_id: <your-org-id>
59-
60-
SKUs:
61-
# e2e testing for OSD (non CCS)
62-
# m5.xlarge singleAZ 4 compute
63-
MCT3326: 2
64-
65-
<your-addon-sku>: 2
66-
67-
environment: "uhc-production"
68-
```
27+
[Here](https://gitlab.cee.redhat.com/service/ocm-resources/-/blob/master/data/uhc-production/orgs/13215750.yaml#L13) is an example of SD-CICD's quota for production.
6928

70-
For `int` and `stage`, the file will need to go into a different folder and use a different value for the `environment` key.
29+
You need to open an MR to update the `SDCICD` org's quota so that it can provision your addon (as well as bumping the number of CCS clusters by 2 or so). You'll need to modify the following three files:
7130

72-
> *NOTE*: The SKU `MCT3326` is the SKU that `osde2e` uses to provision OpenShift clusters by default. If you do not request quota of this SKU, your jobs will all fail to provision clusters.
31+
- [Our production quota](https://gitlab.cee.redhat.com/service/ocm-resources/-/blob/master/data/uhc-production/orgs/13215750.yaml)
32+
- [Our stage quota](https://gitlab.cee.redhat.com/service/ocm-resources/-/blob/master/data/uhc-stage/orgs/13215750.yaml)
33+
- [Our integration quota](https://gitlab.cee.redhat.com/service/ocm-resources/-/blob/master/data/uhc-integration/orgs/13215750.yaml)
7334

74-
If you want to test on CCS clusters instead, you need to use the SKU `MW00530` and follow the instructions in [CCS Cluster Testing](ccs-cluster-testing).
35+
Please bump the quota for SKU `MW00530` by 2 so that we can provision additional CCS clusters for you!
7536

76-
## OCM Permissions
77-
78-
The OCM user/organization that runs your tests will need some specific permissions within OCM in order to launch your test clusters.
79-
80-
These permissions are configured via [`ocm-resources`](https://gitlab.cee.redhat.com/service/ocm-resources), and will look like this:
81-
82-
```yaml
83-
---
84-
$schema: /user-1.yaml
37+
### Providing Secrets to Your Build
8538

86-
user_id: "your-ocm-user"
39+
If you are not a part of the public GitHub Organization `OpenShift`, join it by following [these instructions](https://source.redhat.com/groups/public/atomicopenshift/atomicopenshift_wiki/setting_up_your_accounts_openshift).
8740

88-
kerberos_id: "N/A"
41+
Follow the documentation [here](https://docs.ci.openshift.org/docs/how-tos/adding-a-new-secret-to-ci/) to create secrets and configure them to be mirrored into the `ci` namespace [like ours](https://github.com/openshift/release/blob/master/core-services/secret-mirroring/_mapping.yaml#L62).
8942

90-
roles:
91-
- SDCICD:
92-
scope: Organization
93-
organization_id: "your-organization-id"
43+
You'll need to provide some additional details about your AWS account in a secret. In particular, you'll need to provide these values in your credentials secret:
9444

95-
environment: "see below"
9645
```
97-
98-
You can determine your `user_id` and `organization_id` by running `ocm whoami` with the OCM token you acquired in previous steps.
99-
100-
You will need to create three copies of this file, specifying the environments `uhc-{state,integration,production}`, and those files will need to be MR-ed into the folders `ocm-resources/data/uhc-{stage,integration,production}/users/your-ocm-user.yaml`.
46+
ocm-aws-account
47+
ocm-aws-access-key
48+
ocm-aws-secret-access-key
49+
```
10150

10251
## **Configuring OSDe2e**
10352

@@ -140,12 +89,14 @@ An example prow job that configures the "prow" operator in the stage environment
14089
env:
14190
- name: ADDON_IDS
14291
value: prow-operator
92+
- name: OCM_CCS
93+
value: "true"
14394
- name: ADDON_TEST_HARNESSES
14495
value: quay.io/miwilson/prow-operator-test-harness
14596
- name: CONFIGS
14697
value: aws,stage,addon-suite
14798
- name: SECRET_LOCATIONS
148-
value: /usr/local/osde2e-common,/usr/local/prow-operator-credentials
99+
value: /usr/local/osde2e-common,/usr/local/osde2e-credentials,/usr/local/prow-operator-credentials
149100
image: quay.io/app-sre/osde2e
150101
imagePullPolicy: Always
151102
name: ""
@@ -156,6 +107,9 @@ An example prow job that configures the "prow" operator in the stage environment
156107
- mountPath: /usr/local/osde2e-common
157108
name: osde2e-common
158109
readOnly: true
110+
- mountPath: /usr/local/osde2e-credentials
111+
name: osde2e-credentials
112+
readOnly: true
159113
- mountPath: /usr/local/prow-operator-credentials
160114
name: prow-operator-credentials
161115
readOnly: true
@@ -164,24 +118,22 @@ An example prow job that configures the "prow" operator in the stage environment
164118
- name: osde2e-common
165119
secret:
166120
secretName: osde2e-common
121+
- name: osde2e-credentials
122+
secret:
123+
secretName: osde2e-credentials
167124
- name: prow-operator-credentials
168125
secret:
169126
secretName: prow-operator-credentials
170127
```
171128
172129
To adapt this to your job, you would redefine the `ADDON_IDS` and `ADDON_TEST_HARNESSES`, as well as potentially adding some of the other variables discussed above.
173130

174-
You will *also* need to provide your own secrets by swapping the `prow-operator-credentials` above with your job's secrets.
131+
You will *also* need to provide your own secrets by swapping the `prow-operator-credentials` above with your job's secrets. Note that we load osde2e's credentials, followed by the ones you supply. This allows your credentials to override any duplicate credentials supplied in our config.
175132

176133
> *NOTE*: If you want your job to run in a different environment, such as `int` or `prod`, you need to both change its name to include the proper environment *and* redefine the `CONFIGS` environment variable by replacing `stage` with the name of the appropriate environment.
177134

178135
You can change the cron scheduling of the job as well.
179136

180-
181-
### Providing Secrets to Your Build
182-
183-
If you need to add additional secrets to the job, follow the documentation [here](https://docs.ci.openshift.org/docs/how-tos/adding-a-new-secret-to-ci/) to create them and configure them to be mirrored into the `ci` namespace [like ours](https://github.com/openshift/release/blob/master/core-services/secret-mirroring/_mapping.yaml#L62).
184-
185137
### Addon Cleanup
186138

187139
If your addon test creates or affects anything outside of the OSD cluster lifecycle, a separate cleanup action is required. If `ADDON_RUN_CLEANUP` is set to `true`, OSDe2e will run your test harness container a **second time** passing the argument `cleanup` to the container (as the first command line argument).
@@ -192,21 +144,8 @@ There may be a case where a separate cleanup container/harness is required. That
192144

193145
`ADDON_RUN_CLEANUP` is true, and `ADDON_CLEANUP_HARNESSES` is set, OSDe2e will only run the `ADDON_CLEANUP_HARNESSES`, passing no arguments.
194146

195-
### CCS Cluster Testing
196-
197-
If you want to test a CCS (bring your own AWS account) cluster, you'll need to provide some additional details about your AWS account in a secret. In particular, you'll need to provide these values in your credentials secret:
198-
199-
```
200-
ocm-aws-account
201-
ocm-aws-access-key
202-
ocm-aws-secret-access-key
203-
ocm-token
204-
```
205-
206-
You will also need to set `OCM_CCS="true"` in the normal environment configuration.
207-
208-
> *NOTE*: If you perform CCS testing, your OSD clusters will automatically back themselves up to S3 in your AWS account. You can find these backups by running `aws s3 ls --profile osd`. You should probably clean them up as part of the cleanup phase of your build.
209-
147+
> *NOTE*: Your OSD clusters will automatically back themselves up to S3 in your AWS account. You can find these backups by running `aws s3 ls --profile osd`. You should probably clean them up as part of the cleanup phase of your build.
148+
210149
### Slack Notifications
211150

212151
If you want to be notified of the results of your builds in slack, you can take advantage of [this feature](https://docs.ci.openshift.org/docs/how-tos/notification/). [Here](https://github.com/openshift/release/pull/16674/files#diff-d214756a87b37f0ad838abce8ddfa8993c7cd6a7614fc15384f5f3e4307f079aR1983) is an example PR of someone configuring slack alerts for an Addon.

0 commit comments

Comments
 (0)