Skip to content

Commit 9a95747

Browse files
committed
restructure and add info for self-service
Signed-off-by: Matthias Büchse <[email protected]>
1 parent ff37632 commit 9a95747

File tree

1 file changed

+102
-28
lines changed

1 file changed

+102
-28
lines changed

standards/certification/pipeline.md

Lines changed: 102 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# SCS Compliance Check Pipeline Manual
22

3-
## How to add a new test subject in 8 easy steps
3+
The SCS compliance check suite runs automated tests, generates a signed report for the run, and feeds it to
4+
the compliance monitor. Roughly speaking, this process has to be performed daily, for instance, using a
5+
continuous-integration "pipeline".
46

5-
This is a how-to guide for adding your own subject if you so desire. This way will probably be quickest,
6-
but we are of course happy to help.
7+
Providers of public clouds do not need to use their own pipelines; those clouds can be tested via the
8+
official SCS compliance check pipeline.
9+
10+
Alternatively, if using this pipeline is not feasible (for instance, for private clouds) or not desired,
11+
cloud-service providers can run the tests and feed the compliance monitor themselves.
12+
13+
The next subsection shows common requirements for each of these two cases. The two subsections after that
14+
are each dedicated to the specific cases.
15+
16+
## Common requirements for the compliance checks
717

818
### for SCS-compatible IaaS
919

@@ -14,17 +24,39 @@ to be used for purposes other than compliance testing (such as the
1424

1525
1. Create an application credential. It must be possible to create resources such as servers, routers, etc.
1626

17-
In the next steps, we are going to create a pull request that is very similar to real-life example that
18-
[adds the test subject `scaleup-occ2`](https://github.com/SovereignCloudStack/standards/pull/797).
19-
(However, note that this example also adds an optional GitHub workflow, which we won't do here.)
20-
2127
2. Create a new branch in [the standards repository](https://github.com/SovereignCloudStack/standards):
2228

2329
- `git clone [email protected]:SovereignCloudStack/standards.git`
2430
- `cd standards`
2531
- `git checkout -b feat/add_my_cloud`
2632

27-
3. Modify [playbooks/clouds.yaml.j2](https://github.com/SovereignCloudStack/standards/blob/main/playbooks/clouds.yaml.j2).
33+
3. Add your subject to the results table. This is necessary so your subject shows up in the
34+
[compliance monitor web-site](https://compliance.sovereignit.cloud/page/table). Add the following lines
35+
(substituting all-caps parts):
36+
37+
```diff
38+
| [gx-scs](https://github.com/SovereignCloudStack/docs/blob/main/community/cloud-resources/plusserver-gx-scs.md) | Dev environment provided for SCS & GAIA-X context | plusserver GmbH |
39+
{#- #} [{{ results | pick('gx-scs', iaas) | summary }}]({{ detail_url('gx-scs', iaas) }}) {# -#}
40+
| [HM](https://health.gx-scs.sovereignit.cloud:3000/) |
41+
+| [SUBJECT_NAME](YOUR_URL) | DESCRIPTION | COMPANY_NAME |
42+
+{#- #} [{{ results | pick('SUBJECT_NAME', iaas) | summary }}]({{ detail_url('SUBJECT_NAME', iaas) }}) {# -#}
43+
+| [HM](HEALTH_MONITOR_URL) |
44+
```
45+
46+
Ideally, insert the lines at a position that keeps the part of the table below `gx-scs` sorted.
47+
48+
Now you can proceed with the steps from one of the next subsections, depending on whether you want to
49+
check suite run by the SCS pipeline or not.
50+
51+
## How to add a new test subject to the official pipeline
52+
53+
### for SCS-compatible IaaS
54+
55+
We are going to create a pull request that is very similar to real-life example that
56+
[adds the test subject `scaleup-occ2`](https://github.com/SovereignCloudStack/standards/pull/797).
57+
(However, note that this example also adds an optional GitHub workflow, which we won't do here.)
58+
59+
1. Modify [playbooks/clouds.yaml.j2](https://github.com/SovereignCloudStack/standards/blob/main/playbooks/clouds.yaml.j2).
2860
This is necessary so that the tests can access your cloud.
2961
You can use the following template (replace all-caps parts):
3062

@@ -42,7 +74,7 @@ to be used for purposes other than compliance testing (such as the
4274
4375
Note that you need to replace dashes (and other special characters) by underscores in the last two lines.
4476
45-
4. Add your subject to [Tests/config.toml](https://github.com/SovereignCloudStack/standards/blob/main/Tests/config.toml).
77+
2. Add your subject to [Tests/config.toml](https://github.com/SovereignCloudStack/standards/blob/main/Tests/config.toml).
4678
This is necessary so that your cloud will be included in the nightly tests. Add a line like so:
4779
4880
```diff
@@ -55,9 +87,9 @@ to be used for purposes other than compliance testing (such as the
5587
+ "SUBJECT_NAME",
5688
```
5789

58-
Ideally insert your subject so that the list (after `gx-scs`) remains sorted.
90+
Ideally, insert your subject so that the list (after `gx-scs`) remains sorted.
5991

60-
5. Add your subject to [compliance-monitor/bootstrap.yaml](https://github.com/SovereignCloudStack/standards/blob/main/compliance-monitor/bootstrap.yaml).
92+
3. Add your subject to [compliance-monitor/bootstrap.yaml](https://github.com/SovereignCloudStack/standards/blob/main/compliance-monitor/bootstrap.yaml).
6193
This is necessary to that the reports will be accepted as genuine. Add a section like so:
6294

6395
```diff
@@ -71,22 +103,7 @@ to be used for purposes other than compliance testing (such as the
71103

72104
Again, insert your subject so that the list (after `gx-scs`) remains sorted.
73105

74-
6. Add your subject to the results table. This is necessary so your subject shows up in the
75-
[compliance monitor web-site](https://compliance.sovereignit.cloud/page/table). Add the folling lines
76-
(again substituting all-caps parts):
77-
78-
```diff
79-
| [gx-scs](https://github.com/SovereignCloudStack/docs/blob/main/community/cloud-resources/plusserver-gx-scs.md) | Dev environment provided for SCS & GAIA-X context | plusserver GmbH |
80-
{#- #} [{{ results | pick('gx-scs', iaas) | summary }}]({{ detail_url('gx-scs', iaas) }}) {# -#}
81-
| [HM](https://health.gx-scs.sovereignit.cloud:3000/) |
82-
+| [SUBJECT_NAME](YOUR_URL) | DESCRIPTION | COMPANY_NAME |
83-
+{#- #} [{{ results | pick('SUBJECT_NAME', iaas) | summary }}]({{ detail_url('SUBJECT_NAME', iaas) }}) {# -#}
84-
+| [HM](HEALTH_MONITOR_URL) |
85-
```
86-
87-
Again, insert the lines at a position that keeps the table sorted (below `gx-scs`).
88-
89-
7. Finally, add secrets to [.zuul.d/secure.yaml](https://github.com/SovereignCloudStack/standards/blob/main/.zuul.d/secure.yaml).
106+
4. Finally, add secrets to [.zuul.d/secure.yaml](https://github.com/SovereignCloudStack/standards/blob/main/.zuul.d/secure.yaml).
90107
This is necessary so the tests can access your cloud.
91108

92109
This step is the most involved, and you can always have us do it for you; in that case, please send us
@@ -136,7 +153,64 @@ to be used for purposes other than compliance testing (such as the
136153

137154
Note that you have to use the same keys as in Step 3 (that is, with special characters replaced).
138155

139-
8. Commit your changes and open a pull request:
156+
5. Commit your changes and open a pull request:
157+
158+
```shell
159+
git commit -asm "Add SUBJECT_NAME"
160+
git push # the output of this command will show you the URL for creating the pull request
161+
```
162+
163+
## How to feed the compliance monitor yourself
164+
165+
Note: you may have to adapt these instructions to your infrastructure. For instance, the secrets
166+
we create here are stored locally. If you want to include the check suite into your own
167+
continuous-integration pipeline, you may want to use some dedicated credential store and mechanism for
168+
injecting secrets. You may want to take inspiration from our own Zuul setup by looking at
169+
[.zuul.d](https://github.com/SovereignCloudStack/standards/tree/main/.zuul.d) and
170+
[playbooks](https://github.com/SovereignCloudStack/standards/tree/main/playbooks).
171+
172+
1. Install requirements.
173+
174+
```shell
175+
virtualenv .venv
176+
. .venv/bin/activate
177+
pip install -r requirements.txt
178+
pip install passlib argon2_cffi # these are only needed for step 2
179+
```
180+
181+
2. Run our support script (substitute `$SUBJECT_NAME` appropriately):
182+
183+
```shell
184+
Tests/add_subject.py $SUBJECT_NAME
185+
```
186+
187+
Follow the instructions.
188+
At the end, it will tell you to amend the file `compliance-monitor/boostrap.py`. Do so.
189+
190+
3. Make sure you have `$SUBJECT_NAME` in your `.config/openstack/clouds.yaml` like so:
191+
192+
```yaml
193+
SUBJECT_NAME:
194+
region_name: REGION
195+
interface: "public"
196+
identity_api_version: 3
197+
auth_type: "v3applicationcredential"
198+
auth:
199+
auth_url: AUTH_URL
200+
application_credential_id: "APPLICATION_CREDENTIAL_ID"
201+
application_credential_secret: "APPLICATION_CREDENTIAL_SECRET"
202+
```
203+
204+
4. Perform a test run of the check suite like so:
205+
206+
```shell
207+
python3 Tests/scs-test-runner.py --config Tests/config.toml run --scope scs-compatible-iaas --subject $SUBJECT_NAME
208+
```
209+
210+
If the report can't be submitted at the very end, this is to be expected, because the keyfile is not yet
211+
known to the compliance monitor. To change this, we proceed to the next step.
212+
213+
5. Commit your changes and open a pull request:
140214

141215
```shell
142216
git commit -asm "Add SUBJECT_NAME"

0 commit comments

Comments
 (0)