Skip to content

Commit e1d5cfc

Browse files
authored
Factor out requirements for iaas/kaas (#918)
* move cleanup.py to iaas dir, where it belongs Signed-off-by: Matthias Büchse <[email protected]> * move iaas/kaas-specific requirements to respective subfolder Signed-off-by: Matthias Büchse <[email protected]> * adapt pytest workflow to changed requirements handling Signed-off-by: Matthias Büchse <[email protected]> * upgrade all requirements files to avoid conflicting pinnings Signed-off-by: Matthias Büchse <[email protected]> * upgrade once more Signed-off-by: Matthias Büchse <[email protected]> * Bugfix: add constraints to layers to prevent conflicts thx @martinmo for help! Signed-off-by: Matthias Büchse <[email protected]> * update README.txt Signed-off-by: Matthias Büchse <[email protected]> * minor adjustment of Dockerfile Signed-off-by: Matthias Büchse <[email protected]> --------- Signed-off-by: Matthias Büchse <[email protected]>
1 parent d99c13e commit e1d5cfc

16 files changed

+283
-151
lines changed

.github/workflows/scs-compliance-check-with-application-credential.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
EOF
3535
- name: "Clean up any lingering resources from previous run"
3636
if: ${{ inputs.layer == 'iaas' && inputs.version == 'v4' }}
37-
run: "cd /scs-compliance && ./cleanup.py -c ${{ inputs.cloud }} --prefix _scs- --ipaddr 10.1.0. --debug"
37+
run: "cd /scs-compliance && ./iaas/cleanup.py -c ${{ inputs.cloud }} --prefix _scs- --ipaddr 10.1.0. --debug"
3838
- name: "Run scs-compliance-check"
3939
run: "cd /scs-compliance && ./scs-compliance-check.py scs-compatible-${{ inputs.layer }}.yaml --version ${{ inputs.version }} -o result.yaml -s ${{ inputs.cloud }} -a os_cloud=${{ inputs.cloud }}"
4040
- name: "Upload results"

.github/workflows/scs-compliance-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
EOF
3535
- name: "Clean up any lingering resources from previous run"
3636
if: ${{ inputs.layer == 'iaas' && inputs.version == 'v4' }}
37-
run: "cd /scs-compliance && ./cleanup.py -c ${{ inputs.cloud }} --prefix _scs- --ipaddr 10.1.0. --debug"
37+
run: "cd /scs-compliance && ./iaas/cleanup.py -c ${{ inputs.cloud }} --prefix _scs- --ipaddr 10.1.0. --debug"
3838
- name: "Run scs-compliance-check"
3939
run: "cd /scs-compliance && ./scs-compliance-check.py scs-compatible-${{ inputs.layer }}.yaml --version ${{ inputs.version }} -o result.yaml -s ${{ inputs.cloud }} -a os_cloud=${{ inputs.cloud }}"
4040
- name: "Upload results"

.github/workflows/test-python.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ name: Run Python unit and regression tests
77
- '**.py'
88
- .github/workflows/test-python.yml
99
- Tests/requirements.txt
10+
- Tests/iaas/requirements.txt
11+
- Tests/kaas/requirements.txt
1012
- Tests/test-requirements.txt
1113

1214
jobs:
@@ -20,9 +22,11 @@ jobs:
2022
cache: 'pip'
2123
cache-dependency-path: |
2224
Tests/requirements.txt
25+
Tests/iaas/requirements.txt
26+
Tests/kaas/requirements.txt
2327
Tests/test-requirements.txt
2428
- run: pip3 install --upgrade pip setuptools
25-
- run: pip3 install -r requirements.txt -r test-requirements.txt
29+
- run: pip3 install -r requirements.txt -r iaas/requirements.txt -r kaas/requirements.txt -r test-requirements.txt
2630
working-directory: ./Tests
2731
- run: pytest --cov
2832
working-directory: ./Tests

Tests/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ FROM python:3.10
55
WORKDIR /scs-compliance
66

77
COPY requirements.txt requirements.txt
8-
RUN pip3 install -r requirements.txt
8+
COPY iaas/requirements.txt iaas-requirements.txt
9+
COPY kaas/requirements.txt kaas-requirements.txt
10+
RUN pip3 install -r requirements.txt -r iaas-requirements.txt -r kaas-requirements.txt
911

1012
COPY . .
1113

Tests/README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ You can also request a YAML report using the option `-o OUTPUT.yaml`
2121

2222
### IaaS checks
2323

24+
Install IaaS-specific requirements:
25+
26+
```shell
27+
pip install -r iaas/requirements.txt
28+
```
29+
2430
With a cloud environment configured in your `~/.config/openstack/clouds.yaml`
2531
and `secure.yaml`, then run
2632

@@ -33,6 +39,12 @@ specified in `clouds.yaml`.
3339

3440
### KaaS checks
3541

42+
Install KaaS-specific requirements:
43+
44+
```shell
45+
pip install -r kaas/requirements.txt
46+
```
47+
3648
Given a kubeconfig file `path/to/kubeconfig.yaml`, run
3749

3850
```shell
@@ -133,13 +145,13 @@ We run the tests on a regular basis in our GitHub workflows.
133145

134146
### Maintaining the Python dependencies
135147

136-
We list our main Python dependencies in `requirements.in`. Additionally, we list
137-
[unit tests](#unit-and-regression-tests) dependencies in `test-requirements.in`.
138-
The `*.in` files are fed to `pip-compile` to produce corresponding `*.txt` files
139-
that contain an exact, version-pinned listing of *all* dependencies, including
140-
transitive ones.
148+
We use **pip-compile** to pin and upgrade our dependencies in a controlled manner.
149+
150+
With `pip-compile`, you list your dependencies with as few version constraints as
151+
possible in a dedicated file, and then you have pip-compile generate the conventional
152+
`requirements.txt` with fully pinned dependencies.
141153

142-
`pip-compile` can be installed via `pip install pip-tools`.
154+
The tool `pip-compile` can be installed via `pip install pip-tools`.
143155
It needs to be run in two cases:
144156

145157
1. You modified an `*.in` file: run `pip-compile <INFILE>`. For example:
@@ -155,6 +167,15 @@ It needs to be run in two cases:
155167
pip-compile --upgrade requirements.in
156168
```
157169

170+
We use a **layered approach** to allow for selective installation:
171+
172+
- the most basic layer is `requirements.in`,
173+
- above that we have `iaas/requirements.in` and `kaas/requirements.in`, and
174+
- at the very top we have `test-requirements.in`.
175+
176+
Whenever you change or recompile one of these layers,
177+
*all layers above that layer have to be recompiled as well*.
178+
158179
Note: The Python version used for running `pip-compile` should be consistent. The currently
159180
used version is documented in the header of the `requirements.txt`. It should match the
160181
version used in the Docker image (see [Dockerfile](Dockerfile)) and in our GitHub
File renamed without changes.

Tests/iaas/requirements.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-c ../requirements.txt
2+
boto3
3+
openstacksdk

Tests/iaas/requirements.txt

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
boto3==1.38.20
8+
# via -r requirements.in
9+
botocore==1.38.20
10+
# via
11+
# boto3
12+
# s3transfer
13+
certifi==2025.4.26
14+
# via
15+
# -c ../requirements.txt
16+
# requests
17+
cffi==1.17.1
18+
# via
19+
# -c ../requirements.txt
20+
# cryptography
21+
charset-normalizer==3.4.2
22+
# via
23+
# -c ../requirements.txt
24+
# requests
25+
cryptography==44.0.3
26+
# via
27+
# -c ../requirements.txt
28+
# openstacksdk
29+
decorator==5.2.1
30+
# via
31+
# dogpile-cache
32+
# openstacksdk
33+
dogpile-cache==1.4.0
34+
# via openstacksdk
35+
idna==3.10
36+
# via
37+
# -c ../requirements.txt
38+
# requests
39+
iso8601==2.1.0
40+
# via
41+
# keystoneauth1
42+
# openstacksdk
43+
jmespath==1.0.1
44+
# via
45+
# boto3
46+
# botocore
47+
# openstacksdk
48+
jsonpatch==1.33
49+
# via openstacksdk
50+
jsonpointer==3.0.0
51+
# via jsonpatch
52+
keystoneauth1==5.11.0
53+
# via openstacksdk
54+
openstacksdk==4.5.0
55+
# via -r requirements.in
56+
os-service-types==1.7.0
57+
# via
58+
# keystoneauth1
59+
# openstacksdk
60+
pbr==6.1.1
61+
# via
62+
# keystoneauth1
63+
# openstacksdk
64+
# os-service-types
65+
# stevedore
66+
platformdirs==4.3.8
67+
# via openstacksdk
68+
psutil==7.0.0
69+
# via openstacksdk
70+
pycparser==2.22
71+
# via
72+
# -c ../requirements.txt
73+
# cffi
74+
python-dateutil==2.9.0.post0
75+
# via
76+
# -c ../requirements.txt
77+
# botocore
78+
pyyaml==6.0.2
79+
# via
80+
# -c ../requirements.txt
81+
# openstacksdk
82+
requests==2.32.3
83+
# via
84+
# -c ../requirements.txt
85+
# keystoneauth1
86+
requestsexceptions==1.4.0
87+
# via openstacksdk
88+
s3transfer==0.12.0
89+
# via boto3
90+
six==1.17.0
91+
# via
92+
# -c ../requirements.txt
93+
# python-dateutil
94+
stevedore==5.4.1
95+
# via
96+
# dogpile-cache
97+
# keystoneauth1
98+
typing-extensions==4.13.2
99+
# via
100+
# -c ../requirements.txt
101+
# keystoneauth1
102+
# openstacksdk
103+
urllib3==2.4.0
104+
# via
105+
# -c ../requirements.txt
106+
# botocore
107+
# requests
108+
109+
# The following packages are considered to be unsafe in a requirements file:
110+
# setuptools

Tests/kaas/requirements.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
-c ../requirements.txt
12
pytest-kind
23
kubernetes
4+
kubernetes_asyncio
35
jinja2
46
junitparser

Tests/kaas/requirements.txt

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,119 @@
44
#
55
# pip-compile requirements.in
66
#
7-
cachetools==5.5.0
7+
aiohappyeyeballs==2.6.1
8+
# via
9+
# -c ../requirements.txt
10+
# aiohttp
11+
aiohttp==3.11.18
12+
# via
13+
# -c ../requirements.txt
14+
# kubernetes-asyncio
15+
aiosignal==1.3.2
16+
# via
17+
# -c ../requirements.txt
18+
# aiohttp
19+
attrs==25.3.0
20+
# via
21+
# -c ../requirements.txt
22+
# aiohttp
23+
cachetools==5.5.2
824
# via google-auth
9-
certifi==2024.8.30
25+
certifi==2025.4.26
1026
# via
27+
# -c ../requirements.txt
1128
# kubernetes
29+
# kubernetes-asyncio
1230
# requests
13-
charset-normalizer==3.3.2
14-
# via requests
15-
google-auth==2.34.0
31+
charset-normalizer==3.4.2
32+
# via
33+
# -c ../requirements.txt
34+
# requests
35+
durationpy==0.10
36+
# via kubernetes
37+
frozenlist==1.6.0
38+
# via
39+
# -c ../requirements.txt
40+
# aiohttp
41+
# aiosignal
42+
google-auth==2.40.1
1643
# via kubernetes
17-
idna==3.8
18-
# via requests
44+
idna==3.10
45+
# via
46+
# -c ../requirements.txt
47+
# requests
48+
# yarl
1949
jinja2==3.1.6
2050
# via -r requirements.in
2151
junitparser==3.2.0
2252
# via -r requirements.in
23-
kubernetes==30.1.0
53+
kubernetes==32.0.1
54+
# via -r requirements.in
55+
kubernetes-asyncio==32.3.2
2456
# via -r requirements.in
2557
markupsafe==3.0.2
2658
# via jinja2
59+
multidict==6.4.4
60+
# via
61+
# -c ../requirements.txt
62+
# aiohttp
63+
# yarl
2764
oauthlib==3.2.2
2865
# via
2966
# kubernetes
3067
# requests-oauthlib
31-
pyasn1==0.6.0
68+
propcache==0.3.1
69+
# via
70+
# -c ../requirements.txt
71+
# aiohttp
72+
# yarl
73+
pyasn1==0.6.1
3274
# via
3375
# pyasn1-modules
3476
# rsa
35-
pyasn1-modules==0.4.0
77+
pyasn1-modules==0.4.2
3678
# via google-auth
3779
pykube-ng==23.6.0
3880
# via pytest-kind
3981
pytest-kind==22.11.1
4082
# via -r requirements.in
4183
python-dateutil==2.9.0.post0
42-
# via kubernetes
84+
# via
85+
# -c ../requirements.txt
86+
# kubernetes
87+
# kubernetes-asyncio
4388
pyyaml==6.0.2
4489
# via
90+
# -c ../requirements.txt
4591
# kubernetes
92+
# kubernetes-asyncio
4693
# pykube-ng
4794
requests==2.32.3
4895
# via
96+
# -c ../requirements.txt
4997
# kubernetes
5098
# pykube-ng
5199
# requests-oauthlib
52100
requests-oauthlib==2.0.0
53101
# via kubernetes
54-
rsa==4.9
102+
rsa==4.9.1
55103
# via google-auth
56-
six==1.16.0
104+
six==1.17.0
57105
# via
106+
# -c ../requirements.txt
58107
# kubernetes
108+
# kubernetes-asyncio
59109
# python-dateutil
60-
urllib3==2.2.2
110+
urllib3==2.4.0
61111
# via
112+
# -c ../requirements.txt
62113
# kubernetes
114+
# kubernetes-asyncio
63115
# pykube-ng
64116
# requests
65117
websocket-client==1.8.0
66118
# via kubernetes
119+
yarl==1.20.0
120+
# via
121+
# -c ../requirements.txt
122+
# aiohttp

0 commit comments

Comments
 (0)