You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Addons.md
+27-88Lines changed: 27 additions & 88 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,86 +18,35 @@ The [Prow Operator Test] is a good example of a [Basic operator test]. It verifi
18
18
19
19
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.
20
20
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
-
43
21
## SKUs and Quota
44
22
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).
46
24
47
25
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.
48
26
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.
69
28
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:
71
30
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)
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!
75
36
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
85
38
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).
87
40
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).
89
42
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:
94
44
95
-
environment: "see below"
96
45
```
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
+
```
101
50
102
51
## **Configuring OSDe2e**
103
52
@@ -140,12 +89,14 @@ An example prow job that configures the "prow" operator in the stage environment
@@ -156,6 +107,9 @@ An example prow job that configures the "prow" operator in the stage environment
156
107
- mountPath: /usr/local/osde2e-common
157
108
name: osde2e-common
158
109
readOnly: true
110
+
- mountPath: /usr/local/osde2e-credentials
111
+
name: osde2e-credentials
112
+
readOnly: true
159
113
- mountPath: /usr/local/prow-operator-credentials
160
114
name: prow-operator-credentials
161
115
readOnly: true
@@ -164,24 +118,22 @@ An example prow job that configures the "prow" operator in the stage environment
164
118
- name: osde2e-common
165
119
secret:
166
120
secretName: osde2e-common
121
+
- name: osde2e-credentials
122
+
secret:
123
+
secretName: osde2e-credentials
167
124
- name: prow-operator-credentials
168
125
secret:
169
126
secretName: prow-operator-credentials
170
127
```
171
128
172
129
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.
173
130
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.
175
132
176
133
> *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.
177
134
178
135
You can change the cron scheduling of the job as well.
179
136
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
-
185
137
### Addon Cleanup
186
138
187
139
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
192
144
193
145
`ADDON_RUN_CLEANUP`is true, and `ADDON_CLEANUP_HARNESSES` is set, OSDe2e will only run the `ADDON_CLEANUP_HARNESSES`, passing no arguments.
194
146
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
+
210
149
### Slack Notifications
211
150
212
151
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