Skip to content

Commit 88deadb

Browse files
mbuechsefkr
authored andcommitted
Include flavors with larger memory
Signed-off-by: Matthias Büchse <[email protected]>
1 parent be41bfc commit 88deadb

File tree

10 files changed

+195
-277
lines changed

10 files changed

+195
-277
lines changed

.github/workflows/create-flavors-spec.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'Tests/iaas/standard-flavors/flavor-manager-input.py'
9-
- 'Tests/iaas/scs-0103-v1-flavors.yaml'
8+
- 'Tests/iaas/scs_0103_standard_flavors/standard_flavors.py'
9+
- 'Tests/iaas/generate_flavors_yaml.py'
1010
workflow_dispatch:
1111

1212
jobs:
@@ -27,7 +27,7 @@ jobs:
2727
pip install PyYAML==6.0
2828
- name: Run flavor-manager-input.py
2929
run: |
30-
python Tests/iaas/standard-flavors/flavor-manager-input.py < Tests/iaas/scs-0103-v1-flavors.yaml > Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml
30+
python Tests/iaas/generate_flavors_yaml.py > Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml
3131
- name: Commit changes
3232
uses: stefanzweifel/git-auto-commit-action@v4
3333
with:

Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml

Lines changed: 91 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -109,131 +109,187 @@ recommended:
109109
ram: 4096
110110
disk: 10
111111
scs:cpu-type: shared-core
112+
scs:disk0-type: network
112113
scs:name-v1: SCS-1V:4:10
113114
scs:name-v2: SCS-1V-4-10
114115
- name: SCS-2V-8-20
115116
cpus: 2
116117
ram: 8192
117118
disk: 20
118119
scs:cpu-type: shared-core
120+
scs:disk0-type: network
119121
scs:name-v1: SCS-2V:8:20
120122
scs:name-v2: SCS-2V-8-20
121123
- name: SCS-4V-16-50
122124
cpus: 4
123125
ram: 16384
124126
disk: 50
125127
scs:cpu-type: shared-core
128+
scs:disk0-type: network
126129
scs:name-v1: SCS-4V:16:50
127130
scs:name-v2: SCS-4V-16-50
128131
- name: SCS-8V-32-100
129132
cpus: 8
130133
ram: 32768
131134
disk: 100
132135
scs:cpu-type: shared-core
136+
scs:disk0-type: network
133137
scs:name-v1: SCS-8V:32:100
134138
scs:name-v2: SCS-8V-32-100
135-
- name: SCS-8V-64-100
136-
cpus: 8
137-
ram: 65536
138-
disk: 100
139-
scs:cpu-type: shared-core
140-
scs:name-v1: SCS-8V:64:100
141-
scs:name-v2: SCS-8V-64-100
142-
- name: SCS-8V-128-100
143-
cpus: 8
144-
ram: 131072
145-
disk: 100
146-
scs:cpu-type: shared-core
147-
scs:name-v1: SCS-8V:128:100
148-
scs:name-v2: SCS-8V-128-100
149139
- name: SCS-1V-2-5
150140
cpus: 1
151141
ram: 2048
152142
disk: 5
153143
scs:cpu-type: shared-core
144+
scs:disk0-type: network
154145
scs:name-v1: SCS-1V:2:5
155146
scs:name-v2: SCS-1V-2-5
156147
- name: SCS-2V-4-10
157148
cpus: 2
158149
ram: 4096
159150
disk: 10
160151
scs:cpu-type: shared-core
152+
scs:disk0-type: network
161153
scs:name-v1: SCS-2V:4:10
162154
scs:name-v2: SCS-2V-4-10
163155
- name: SCS-4V-8-20
164156
cpus: 4
165157
ram: 8192
166158
disk: 20
167159
scs:cpu-type: shared-core
160+
scs:disk0-type: network
168161
scs:name-v1: SCS-4V:8:20
169162
scs:name-v2: SCS-4V-8-20
170163
- name: SCS-8V-16-50
171164
cpus: 8
172165
ram: 16384
173166
disk: 50
174167
scs:cpu-type: shared-core
168+
scs:disk0-type: network
175169
scs:name-v1: SCS-8V:16:50
176170
scs:name-v2: SCS-8V-16-50
177171
- name: SCS-16V-32-100
178172
cpus: 16
179173
ram: 32768
180174
disk: 100
181175
scs:cpu-type: shared-core
176+
scs:disk0-type: network
182177
scs:name-v1: SCS-16V:32:100
183178
scs:name-v2: SCS-16V-32-100
184-
- name: SCS-16V-64-100
185-
cpus: 16
186-
ram: 65536
187-
disk: 100
188-
scs:cpu-type: shared-core
189-
scs:name-v1: SCS-16V:64:100
190-
scs:name-v2: SCS-16V-64-100
191-
- name: SCS-16V-128-100
192-
cpus: 16
193-
ram: 131072
194-
disk: 100
195-
scs:cpu-type: shared-core
196-
scs:name-v1: SCS-16V:128:100
197-
scs:name-v2: SCS-16V-128-100
198179
- name: SCS-1V-8-20
199180
cpus: 1
200181
ram: 8192
201182
disk: 20
202183
scs:cpu-type: shared-core
184+
scs:disk0-type: network
203185
scs:name-v1: SCS-1V:8:20
204186
scs:name-v2: SCS-1V-8-20
205187
- name: SCS-2V-16-50
206188
cpus: 2
207189
ram: 16384
208190
disk: 50
209191
scs:cpu-type: shared-core
192+
scs:disk0-type: network
210193
scs:name-v1: SCS-2V:16:50
211194
scs:name-v2: SCS-2V-16-50
212195
- name: SCS-4V-32-100
213196
cpus: 4
214197
ram: 32768
215198
disk: 100
216199
scs:cpu-type: shared-core
200+
scs:disk0-type: network
217201
scs:name-v1: SCS-4V:32:100
218202
scs:name-v2: SCS-4V-32-100
203+
- name: SCS-1L-1-5
204+
cpus: 1
205+
ram: 1024
206+
disk: 5
207+
scs:cpu-type: crowded-core
208+
scs:disk0-type: network
209+
scs:name-v1: SCS-1L:1:5
210+
scs:name-v2: SCS-1L-1-5
211+
- name: SCS-16V-64
212+
cpus: 16
213+
ram: 65536
214+
scs:cpu-type: shared-core
215+
scs:name-v1: SCS-16V:64
216+
scs:name-v2: SCS-16V-64
217+
- name: SCS-16V-64-100
218+
cpus: 16
219+
ram: 65536
220+
disk: 100
221+
scs:cpu-type: shared-core
222+
scs:disk0-type: network
223+
scs:name-v1: SCS-16V:64:100
224+
scs:name-v2: SCS-16V-64-100
225+
- name: SCS-8V-64
226+
cpus: 8
227+
ram: 65536
228+
scs:cpu-type: shared-core
229+
scs:name-v1: SCS-8V:64
230+
scs:name-v2: SCS-8V-64
231+
- name: SCS-16V-128
232+
cpus: 16
233+
ram: 131072
234+
scs:cpu-type: shared-core
235+
scs:name-v1: SCS-16V:128
236+
scs:name-v2: SCS-16V-128
237+
- name: SCS-8V-64-100
238+
cpus: 8
239+
ram: 65536
240+
disk: 100
241+
scs:cpu-type: shared-core
242+
scs:disk0-type: network
243+
scs:name-v1: SCS-8V:64:100
244+
scs:name-v2: SCS-8V-64-100
245+
- name: SCS-16V-128-100
246+
cpus: 16
247+
ram: 131072
248+
disk: 100
249+
scs:cpu-type: shared-core
250+
scs:disk0-type: network
251+
scs:name-v1: SCS-16V:128:100
252+
scs:name-v2: SCS-16V-128-100
253+
- name: SCS-4V-64
254+
cpus: 4
255+
ram: 65536
256+
scs:cpu-type: shared-core
257+
scs:name-v1: SCS-4V:64
258+
scs:name-v2: SCS-4V-64
259+
- name: SCS-8V-128
260+
cpus: 8
261+
ram: 131072
262+
scs:cpu-type: shared-core
263+
scs:name-v1: SCS-8V:128
264+
scs:name-v2: SCS-8V-128
219265
- name: SCS-4V-64-100
220266
cpus: 4
221267
ram: 65536
222268
disk: 100
223269
scs:cpu-type: shared-core
270+
scs:disk0-type: network
224271
scs:name-v1: SCS-4V:64:100
225272
scs:name-v2: SCS-4V-64-100
273+
- name: SCS-8V-128-100
274+
cpus: 8
275+
ram: 131072
276+
disk: 100
277+
scs:cpu-type: shared-core
278+
scs:disk0-type: network
279+
scs:name-v1: SCS-8V:128:100
280+
scs:name-v2: SCS-8V-128-100
281+
- name: SCS-4V-128
282+
cpus: 4
283+
ram: 131072
284+
scs:cpu-type: shared-core
285+
scs:name-v1: SCS-4V:128
286+
scs:name-v2: SCS-4V-128
226287
- name: SCS-4V-128-100
227288
cpus: 4
228289
ram: 131072
229290
disk: 100
230291
scs:cpu-type: shared-core
292+
scs:disk0-type: network
231293
scs:name-v1: SCS-4V:128:100
232294
scs:name-v2: SCS-4V-128-100
233-
- name: SCS-1L-1-5
234-
cpus: 1
235-
ram: 1024
236-
disk: 5
237-
scs:cpu-type: crowded-core
238-
scs:name-v1: SCS-1L:1:5
239-
scs:name-v2: SCS-1L-1-5
295+

Tests/iaas/SCS-Spec.MandatoryFlavors.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Generate flavor specification file for osism's flavor manager,
4+
cf. https://github.com/osism/openstack-flavor-manager .
5+
6+
The spec file is output to stdout.
7+
"""
8+
import logging
9+
import sys
10+
11+
import yaml
12+
13+
from scs_0100_flavor_naming.flavor_names import compute_flavor_spec
14+
from scs_0103_standard_flavors.standard_flavors import \
15+
SCS_0103_V1_MANDATORY, SCS_0103_V1_RECOMMENDED
16+
17+
logger = logging.getLogger(__name__)
18+
19+
20+
def convert_flavor_spec(canonical_name, spec):
21+
"""convert `spec` into format for openstack-flavor-manager"""
22+
converted = {
23+
'name': canonical_name,
24+
'cpus': spec['cpus'],
25+
'ram': int(1024 * spec['ram']),
26+
}
27+
if 'disk' in spec:
28+
converted['disk'] = spec['disk']
29+
for k, v in spec.items():
30+
if not k.startswith('scs:'):
31+
continue
32+
converted[k] = v
33+
return converted
34+
35+
36+
def compute_spec_list(canonical_names):
37+
return [
38+
convert_flavor_spec(
39+
canonical_name,
40+
compute_flavor_spec(canonical_name),
41+
)
42+
for canonical_name in canonical_names
43+
]
44+
45+
46+
def main(argv):
47+
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
48+
49+
# boilerplate / scaffolding
50+
result = yaml.safe_load("""
51+
reference:
52+
- field: name
53+
mandatory_prefix: SCS-
54+
- field: public
55+
default: true
56+
- field: disabled
57+
default: false
58+
- field: cpus
59+
- field: ram
60+
- field: disk
61+
mandatory: []
62+
recommended: []
63+
""")
64+
65+
result['mandatory'] = compute_spec_list(SCS_0103_V1_MANDATORY)
66+
result['recommended'] = compute_spec_list(SCS_0103_V1_RECOMMENDED)
67+
68+
print(yaml.dump(result, sort_keys=False))
69+
70+
71+
if __name__ == "__main__":
72+
sys.exit(main(sys.argv[1:]))

Tests/iaas/openstack_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
import openstack
1616

17+
from scs_0100_flavor_naming.flavor_names import compute_flavor_spec
1718
from scs_0100_flavor_naming.flavor_names_check import \
18-
compute_scs_flavors, compute_scs_0100_syntax_check, compute_scs_0100_semantics_check, \
19-
compute_flavor_spec
19+
compute_scs_flavors, compute_scs_0100_syntax_check, compute_scs_0100_semantics_check
2020
from scs_0101_entropy.entropy_check import \
2121
compute_scs_0101_image_property, compute_scs_0101_flavor_property, compute_canonical_image, \
2222
compute_collected_vm_output, compute_scs_0101_entropy_avail, compute_scs_0101_rngd, \

Tests/iaas/scs-0100-v3-flavors.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)