From 8dd5ba3d2b7a20d4ccb7ceb4ecebb78bcba8492a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=B6chlin?= Date: Sun, 25 May 2025 18:28:28 +0200 Subject: [PATCH 1/7] add larger memory flavors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc Schöchlin --- .../SCS-Spec.MandatoryFlavors.verbose.yaml | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml b/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml index 853dd51bb..5534052c6 100644 --- a/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml +++ b/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml @@ -132,6 +132,20 @@ recommended: scs:cpu-type: shared-core scs:name-v1: SCS-8V:32:100 scs:name-v2: SCS-8V-32-100 +- name: SCS-8V-64-100 + cpus: 8 + ram: 65536 + disk: 100 + scs:cpu-type: shared-core + scs:name-v1: SCS-8V:64:100 + scs:name-v2: SCS-8V-64-100 +- name: SCS-8V-128-100 + cpus: 8 + ram: 131072 + disk: 100 + scs:cpu-type: shared-core + scs:name-v1: SCS-8V:128:100 + scs:name-v2: SCS-8V-128-100 - name: SCS-1V-2-5 cpus: 1 ram: 2048 @@ -167,6 +181,20 @@ recommended: scs:cpu-type: shared-core scs:name-v1: SCS-16V:32:100 scs:name-v2: SCS-16V-32-100 +- name: SCS-16V-64-100 + cpus: 16 + ram: 65536 + disk: 100 + scs:cpu-type: shared-core + scs:name-v1: SCS-16V:64:100 + scs:name-v2: SCS-16V-64-100 +- name: SCS-16V-128-100 + cpus: 16 + ram: 131072 + disk: 100 + scs:cpu-type: shared-core + scs:name-v1: SCS-16V:128:100 + scs:name-v2: SCS-16V-128-100 - name: SCS-1V-8-20 cpus: 1 ram: 8192 @@ -188,6 +216,20 @@ recommended: scs:cpu-type: shared-core scs:name-v1: SCS-4V:32:100 scs:name-v2: SCS-4V-32-100 +- name: SCS-4V-64-100 + cpus: 4 + ram: 65536 + disk: 100 + scs:cpu-type: shared-core + scs:name-v1: SCS-4V:64:100 + scs:name-v2: SCS-4V-64-100 +- name: SCS-4V-128-100 + cpus: 4 + ram: 131072 + disk: 100 + scs:cpu-type: shared-core + scs:name-v1: SCS-4V:128:100 + scs:name-v2: SCS-4V-128-100 - name: SCS-1L-1-5 cpus: 1 ram: 1024 @@ -195,4 +237,3 @@ recommended: scs:cpu-type: crowded-core scs:name-v1: SCS-1L:1:5 scs:name-v2: SCS-1L-1-5 - From 12498c9eac43bba62f29de15636a8947975222fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCchse?= Date: Thu, 11 Sep 2025 17:18:50 +0200 Subject: [PATCH 2/7] Include flavors with larger memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Büchse --- .github/workflows/create-flavors-spec.yml | 6 +- .../SCS-Spec.MandatoryFlavors.verbose.yaml | 126 ++++++++---- Tests/iaas/SCS-Spec.MandatoryFlavors.yaml | 32 --- Tests/iaas/generate_flavors_yaml.py | 72 +++++++ Tests/iaas/openstack_test.py | 4 +- Tests/iaas/scs-0100-v3-flavors.yaml | 5 - Tests/iaas/scs-0103-v1-flavors.yaml | 194 ------------------ .../scs_0100_flavor_naming/flavor_names.py | 5 + .../flavor_names_check.py | 5 - .../standard_flavors.py | 23 ++- 10 files changed, 195 insertions(+), 277 deletions(-) delete mode 100644 Tests/iaas/SCS-Spec.MandatoryFlavors.yaml create mode 100755 Tests/iaas/generate_flavors_yaml.py delete mode 100644 Tests/iaas/scs-0100-v3-flavors.yaml delete mode 100644 Tests/iaas/scs-0103-v1-flavors.yaml diff --git a/.github/workflows/create-flavors-spec.yml b/.github/workflows/create-flavors-spec.yml index b3dd57311..e1d16c400 100644 --- a/.github/workflows/create-flavors-spec.yml +++ b/.github/workflows/create-flavors-spec.yml @@ -5,8 +5,8 @@ on: branches: - main paths: - - 'Tests/iaas/standard-flavors/flavor-manager-input.py' - - 'Tests/iaas/scs-0103-v1-flavors.yaml' + - 'Tests/iaas/scs_0103_standard_flavors/standard_flavors.py' + - 'Tests/iaas/generate_flavors_yaml.py' workflow_dispatch: jobs: @@ -27,7 +27,7 @@ jobs: pip install PyYAML==6.0 - name: Run flavor-manager-input.py run: | - python Tests/iaas/standard-flavors/flavor-manager-input.py < Tests/iaas/scs-0103-v1-flavors.yaml > Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml + python Tests/iaas/generate_flavors_yaml.py > Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 with: diff --git a/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml b/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml index 5534052c6..9317997f7 100644 --- a/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml +++ b/Tests/iaas/SCS-Spec.MandatoryFlavors.verbose.yaml @@ -109,6 +109,7 @@ recommended: ram: 4096 disk: 10 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-1V:4:10 scs:name-v2: SCS-1V-4-10 - name: SCS-2V-8-20 @@ -116,6 +117,7 @@ recommended: ram: 8192 disk: 20 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-2V:8:20 scs:name-v2: SCS-2V-8-20 - name: SCS-4V-16-50 @@ -123,6 +125,7 @@ recommended: ram: 16384 disk: 50 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-4V:16:50 scs:name-v2: SCS-4V-16-50 - name: SCS-8V-32-100 @@ -130,27 +133,15 @@ recommended: ram: 32768 disk: 100 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-8V:32:100 scs:name-v2: SCS-8V-32-100 -- name: SCS-8V-64-100 - cpus: 8 - ram: 65536 - disk: 100 - scs:cpu-type: shared-core - scs:name-v1: SCS-8V:64:100 - scs:name-v2: SCS-8V-64-100 -- name: SCS-8V-128-100 - cpus: 8 - ram: 131072 - disk: 100 - scs:cpu-type: shared-core - scs:name-v1: SCS-8V:128:100 - scs:name-v2: SCS-8V-128-100 - name: SCS-1V-2-5 cpus: 1 ram: 2048 disk: 5 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-1V:2:5 scs:name-v2: SCS-1V-2-5 - name: SCS-2V-4-10 @@ -158,6 +149,7 @@ recommended: ram: 4096 disk: 10 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-2V:4:10 scs:name-v2: SCS-2V-4-10 - name: SCS-4V-8-20 @@ -165,6 +157,7 @@ recommended: ram: 8192 disk: 20 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-4V:8:20 scs:name-v2: SCS-4V-8-20 - name: SCS-8V-16-50 @@ -172,6 +165,7 @@ recommended: ram: 16384 disk: 50 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-8V:16:50 scs:name-v2: SCS-8V-16-50 - name: SCS-16V-32-100 @@ -179,27 +173,15 @@ recommended: ram: 32768 disk: 100 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-16V:32:100 scs:name-v2: SCS-16V-32-100 -- name: SCS-16V-64-100 - cpus: 16 - ram: 65536 - disk: 100 - scs:cpu-type: shared-core - scs:name-v1: SCS-16V:64:100 - scs:name-v2: SCS-16V-64-100 -- name: SCS-16V-128-100 - cpus: 16 - ram: 131072 - disk: 100 - scs:cpu-type: shared-core - scs:name-v1: SCS-16V:128:100 - scs:name-v2: SCS-16V-128-100 - name: SCS-1V-8-20 cpus: 1 ram: 8192 disk: 20 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-1V:8:20 scs:name-v2: SCS-1V-8-20 - name: SCS-2V-16-50 @@ -207,6 +189,7 @@ recommended: ram: 16384 disk: 50 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-2V:16:50 scs:name-v2: SCS-2V-16-50 - name: SCS-4V-32-100 @@ -214,26 +197,99 @@ recommended: ram: 32768 disk: 100 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-4V:32:100 scs:name-v2: SCS-4V-32-100 +- name: SCS-1L-1-5 + cpus: 1 + ram: 1024 + disk: 5 + scs:cpu-type: crowded-core + scs:disk0-type: network + scs:name-v1: SCS-1L:1:5 + scs:name-v2: SCS-1L-1-5 +- name: SCS-16V-64 + cpus: 16 + ram: 65536 + scs:cpu-type: shared-core + scs:name-v1: SCS-16V:64 + scs:name-v2: SCS-16V-64 +- name: SCS-16V-64-100 + cpus: 16 + ram: 65536 + disk: 100 + scs:cpu-type: shared-core + scs:disk0-type: network + scs:name-v1: SCS-16V:64:100 + scs:name-v2: SCS-16V-64-100 +- name: SCS-8V-64 + cpus: 8 + ram: 65536 + scs:cpu-type: shared-core + scs:name-v1: SCS-8V:64 + scs:name-v2: SCS-8V-64 +- name: SCS-16V-128 + cpus: 16 + ram: 131072 + scs:cpu-type: shared-core + scs:name-v1: SCS-16V:128 + scs:name-v2: SCS-16V-128 +- name: SCS-8V-64-100 + cpus: 8 + ram: 65536 + disk: 100 + scs:cpu-type: shared-core + scs:disk0-type: network + scs:name-v1: SCS-8V:64:100 + scs:name-v2: SCS-8V-64-100 +- name: SCS-16V-128-100 + cpus: 16 + ram: 131072 + disk: 100 + scs:cpu-type: shared-core + scs:disk0-type: network + scs:name-v1: SCS-16V:128:100 + scs:name-v2: SCS-16V-128-100 +- name: SCS-4V-64 + cpus: 4 + ram: 65536 + scs:cpu-type: shared-core + scs:name-v1: SCS-4V:64 + scs:name-v2: SCS-4V-64 +- name: SCS-8V-128 + cpus: 8 + ram: 131072 + scs:cpu-type: shared-core + scs:name-v1: SCS-8V:128 + scs:name-v2: SCS-8V-128 - name: SCS-4V-64-100 cpus: 4 ram: 65536 disk: 100 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-4V:64:100 scs:name-v2: SCS-4V-64-100 +- name: SCS-8V-128-100 + cpus: 8 + ram: 131072 + disk: 100 + scs:cpu-type: shared-core + scs:disk0-type: network + scs:name-v1: SCS-8V:128:100 + scs:name-v2: SCS-8V-128-100 +- name: SCS-4V-128 + cpus: 4 + ram: 131072 + scs:cpu-type: shared-core + scs:name-v1: SCS-4V:128 + scs:name-v2: SCS-4V-128 - name: SCS-4V-128-100 cpus: 4 ram: 131072 disk: 100 scs:cpu-type: shared-core + scs:disk0-type: network scs:name-v1: SCS-4V:128:100 scs:name-v2: SCS-4V-128-100 -- name: SCS-1L-1-5 - cpus: 1 - ram: 1024 - disk: 5 - scs:cpu-type: crowded-core - scs:name-v1: SCS-1L:1:5 - scs:name-v2: SCS-1L-1-5 + diff --git a/Tests/iaas/SCS-Spec.MandatoryFlavors.yaml b/Tests/iaas/SCS-Spec.MandatoryFlavors.yaml deleted file mode 100644 index ab91c3f50..000000000 --- a/Tests/iaas/SCS-Spec.MandatoryFlavors.yaml +++ /dev/null @@ -1,32 +0,0 @@ -SCS-Spec: - MandatoryFlavors: - - SCS-1V-4 - - SCS-2V-8 - - SCS-4V-16 - - SCS-8V-32 - - SCS-1V-2 - - SCS-2V-4 - - SCS-4V-8 - - SCS-8V-16 - - SCS-16V-32 - - SCS-1V-8 - - SCS-2V-16 - - SCS-4V-32 - - SCS-1L-1 - MandatoryFlavorsV3: - - SCS-2V-4-20s - - SCS-4V-16-100s - RecommendedFlavors: - - SCS-1V-4-10 - - SCS-2V-8-20 - - SCS-4V-16-50 - - SCS-8V-32-100 - - SCS-1V-2-5 - - SCS-2V-4-10 - - SCS-4V-8-20 - - SCS-8V-16-50 - - SCS-16V-32-100 - - SCS-1V-8-20 - - SCS-2V-16-50 - - SCS-4V-32-100 - - SCS-1L-1-5 diff --git a/Tests/iaas/generate_flavors_yaml.py b/Tests/iaas/generate_flavors_yaml.py new file mode 100755 index 000000000..82acb3176 --- /dev/null +++ b/Tests/iaas/generate_flavors_yaml.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +""" +Generate flavor specification file for osism's flavor manager, +cf. https://github.com/osism/openstack-flavor-manager . + +The spec file is output to stdout. +""" +import logging +import sys + +import yaml + +from scs_0100_flavor_naming.flavor_names import compute_flavor_spec +from scs_0103_standard_flavors.standard_flavors import \ + SCS_0103_V1_MANDATORY, SCS_0103_V1_RECOMMENDED + +logger = logging.getLogger(__name__) + + +def convert_flavor_spec(canonical_name, spec): + """convert `spec` into format for openstack-flavor-manager""" + converted = { + 'name': canonical_name, + 'cpus': spec['cpus'], + 'ram': int(1024 * spec['ram']), + } + if 'disk' in spec: + converted['disk'] = spec['disk'] + for k, v in spec.items(): + if not k.startswith('scs:'): + continue + converted[k] = v + return converted + + +def compute_spec_list(canonical_names): + return [ + convert_flavor_spec( + canonical_name, + compute_flavor_spec(canonical_name), + ) + for canonical_name in canonical_names + ] + + +def main(argv): + logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) + + # boilerplate / scaffolding + result = yaml.safe_load(""" +reference: + - field: name + mandatory_prefix: SCS- + - field: public + default: true + - field: disabled + default: false + - field: cpus + - field: ram + - field: disk +mandatory: [] +recommended: [] +""") + + result['mandatory'] = compute_spec_list(SCS_0103_V1_MANDATORY) + result['recommended'] = compute_spec_list(SCS_0103_V1_RECOMMENDED) + + print(yaml.dump(result, sort_keys=False)) + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/Tests/iaas/openstack_test.py b/Tests/iaas/openstack_test.py index 57587c11e..547518167 100755 --- a/Tests/iaas/openstack_test.py +++ b/Tests/iaas/openstack_test.py @@ -14,9 +14,9 @@ import openstack +from scs_0100_flavor_naming.flavor_names import compute_flavor_spec from scs_0100_flavor_naming.flavor_names_check import \ - compute_scs_flavors, compute_scs_0100_syntax_check, compute_scs_0100_semantics_check, \ - compute_flavor_spec + compute_scs_flavors, compute_scs_0100_syntax_check, compute_scs_0100_semantics_check from scs_0101_entropy.entropy_check import \ compute_scs_0101_image_property, compute_scs_0101_flavor_property, compute_canonical_image, \ compute_collected_vm_output, compute_scs_0101_entropy_avail, compute_scs_0101_rngd, \ diff --git a/Tests/iaas/scs-0100-v3-flavors.yaml b/Tests/iaas/scs-0100-v3-flavors.yaml deleted file mode 100644 index a481a9cda..000000000 --- a/Tests/iaas/scs-0100-v3-flavors.yaml +++ /dev/null @@ -1,5 +0,0 @@ -SCS-Spec: - # Empty lists so flavor-names-openstack.py only checks the names for scs-0100. - # The list of flavors will be checked with flavors-openstack.py for scs-0103. - MandatoryFlavors: [] - RecommendedFlavors: [] diff --git a/Tests/iaas/scs-0103-v1-flavors.yaml b/Tests/iaas/scs-0103-v1-flavors.yaml deleted file mode 100644 index 66c02cdd6..000000000 --- a/Tests/iaas/scs-0103-v1-flavors.yaml +++ /dev/null @@ -1,194 +0,0 @@ -meta: - name_key: "scs:name-v2" -flavor_groups: - - status: mandatory - list: - - name: SCS-1V-4 - cpus: 1 - "scs:cpu-type": shared-core - ram: 4 - "scs:name-v1": SCS-1V:4 - "scs:name-v2": SCS-1V-4 - - name: SCS-2V-8 - cpus: 2 - "scs:cpu-type": shared-core - ram: 8 - "scs:name-v1": SCS-2V:8 - "scs:name-v2": SCS-2V-8 - - name: SCS-4V-16 - cpus: 4 - "scs:cpu-type": shared-core - ram: 16 - "scs:name-v1": SCS-4V:16 - "scs:name-v2": SCS-4V-16 - - name: SCS-8V-32 - cpus: 8 - "scs:cpu-type": shared-core - ram: 32 - "scs:name-v1": SCS-8V:32 - "scs:name-v2": SCS-8V-32 - - name: SCS-1V-2 - cpus: 1 - "scs:cpu-type": shared-core - ram: 2 - "scs:name-v1": SCS-1V:2 - "scs:name-v2": SCS-1V-2 - - name: SCS-2V-4 - cpus: 2 - "scs:cpu-type": shared-core - ram: 4 - "scs:name-v1": SCS-2V:4 - "scs:name-v2": SCS-2V-4 - - name: SCS-4V-8 - cpus: 4 - "scs:cpu-type": shared-core - ram: 8 - "scs:name-v1": SCS-4V:8 - "scs:name-v2": SCS-4V-8 - - name: SCS-8V-16 - cpus: 8 - "scs:cpu-type": shared-core - ram: 16 - "scs:name-v1": SCS-8V:16 - "scs:name-v2": SCS-8V-16 - - name: SCS-16V-32 - cpus: 16 - "scs:cpu-type": shared-core - ram: 32 - "scs:name-v1": SCS-16V:32 - "scs:name-v2": SCS-16V-32 - - name: SCS-1V-8 - cpus: 1 - "scs:cpu-type": shared-core - ram: 8 - "scs:name-v1": SCS-1V:8 - "scs:name-v2": SCS-1V-8 - - name: SCS-2V-16 - cpus: 2 - "scs:cpu-type": shared-core - ram: 16 - "scs:name-v1": SCS-2V:16 - "scs:name-v2": SCS-2V-16 - - name: SCS-4V-32 - cpus: 4 - "scs:cpu-type": shared-core - ram: 32 - "scs:name-v1": SCS-4V:32 - "scs:name-v2": SCS-4V-32 - - name: SCS-1L-1 - cpus: 1 - "scs:cpu-type": crowded-core - ram: 1 - "scs:name-v1": SCS-1L:1 - "scs:name-v2": SCS-1L-1 - - status: mandatory - list: - - name: SCS-2V-4-20s - cpus: 2 - "scs:cpu-type": shared-core - ram: 4 - disk: 20 - "scs:disk0-type": ssd - "scs:name-v1": SCS-2V:4:20s - "scs:name-v2": SCS-2V-4-20s - - name: SCS-4V-16-100s - cpus: 4 - "scs:cpu-type": shared-core - ram: 16 - disk: 100 - "scs:disk0-type": ssd - "scs:name-v1": SCS-4V:16:100s - "scs:name-v2": SCS-4V-16-100s - - status: recommended - list: - - name: SCS-1V-4-10 - cpus: 1 - "scs:cpu-type": shared-core - ram: 4 - disk: 10 - "scs:name-v1": SCS-1V:4:10 - "scs:name-v2": SCS-1V-4-10 - - name: SCS-2V-8-20 - cpus: 2 - "scs:cpu-type": shared-core - ram: 8 - disk: 20 - "scs:name-v1": SCS-2V:8:20 - "scs:name-v2": SCS-2V-8-20 - - name: SCS-4V-16-50 - cpus: 4 - "scs:cpu-type": shared-core - ram: 16 - disk: 50 - "scs:name-v1": SCS-4V:16:50 - "scs:name-v2": SCS-4V-16-50 - - name: SCS-8V-32-100 - cpus: 8 - "scs:cpu-type": shared-core - ram: 32 - disk: 100 - "scs:name-v1": SCS-8V:32:100 - "scs:name-v2": SCS-8V-32-100 - - name: SCS-1V-2-5 - cpus: 1 - "scs:cpu-type": shared-core - ram: 2 - disk: 5 - "scs:name-v1": SCS-1V:2:5 - "scs:name-v2": SCS-1V-2-5 - - name: SCS-2V-4-10 - cpus: 2 - "scs:cpu-type": shared-core - ram: 4 - disk: 10 - "scs:name-v1": SCS-2V:4:10 - "scs:name-v2": SCS-2V-4-10 - - name: SCS-4V-8-20 - cpus: 4 - "scs:cpu-type": shared-core - ram: 8 - disk: 20 - "scs:name-v1": SCS-4V:8:20 - "scs:name-v2": SCS-4V-8-20 - - name: SCS-8V-16-50 - cpus: 8 - "scs:cpu-type": shared-core - ram: 16 - disk: 50 - "scs:name-v1": SCS-8V:16:50 - "scs:name-v2": SCS-8V-16-50 - - name: SCS-16V-32-100 - cpus: 16 - "scs:cpu-type": shared-core - ram: 32 - disk: 100 - "scs:name-v1": SCS-16V:32:100 - "scs:name-v2": SCS-16V-32-100 - - name: SCS-1V-8-20 - cpus: 1 - "scs:cpu-type": shared-core - ram: 8 - disk: 20 - "scs:name-v1": SCS-1V:8:20 - "scs:name-v2": SCS-1V-8-20 - - name: SCS-2V-16-50 - cpus: 2 - "scs:cpu-type": shared-core - ram: 16 - disk: 50 - "scs:name-v1": SCS-2V:16:50 - "scs:name-v2": SCS-2V-16-50 - - name: SCS-4V-32-100 - cpus: 4 - "scs:cpu-type": shared-core - ram: 32 - disk: 100 - "scs:name-v1": SCS-4V:32:100 - "scs:name-v2": SCS-4V-32-100 - - name: SCS-1L-1-5 - cpus: 1 - "scs:cpu-type": crowded-core - ram: 1 - disk: 5 - "scs:name-v1": SCS-1L:1:5 - "scs:name-v2": SCS-1L-1-5 diff --git a/Tests/iaas/scs_0100_flavor_naming/flavor_names.py b/Tests/iaas/scs_0100_flavor_naming/flavor_names.py index 47e05139a..fc9791c7d 100644 --- a/Tests/iaas/scs_0100_flavor_naming/flavor_names.py +++ b/Tests/iaas/scs_0100_flavor_naming/flavor_names.py @@ -674,6 +674,11 @@ def flavorname_to_dict(*flavornames: Flavorname, ctx='') -> dict: return result +def compute_flavor_spec(canonical_name: str) -> dict: + # this is a helper for tying together scs_0100 and scs_0103 + return flavorname_to_dict(parser_v3(canonical_name)) + + def _collectattrs(alist, new): "collect list of attitbutes" if alist: diff --git a/Tests/iaas/scs_0100_flavor_naming/flavor_names_check.py b/Tests/iaas/scs_0100_flavor_naming/flavor_names_check.py index c44a6259c..9bbab493b 100644 --- a/Tests/iaas/scs_0100_flavor_naming/flavor_names_check.py +++ b/Tests/iaas/scs_0100_flavor_naming/flavor_names_check.py @@ -38,11 +38,6 @@ def compute_scs_flavors(flavors: typing.List[openstack.compute.v2.flavor.Flavor] return result -def compute_flavor_spec(canonical_name: str) -> dict: - # this is a helper for tying together scs_0100 and scs_0103 - return flavor_names.flavorname_to_dict(flavor_names.parser_v3(canonical_name)) - - def compute_scs_0100_syntax_check(scs_flavors: list) -> bool: """This test ensures that each SCS flavor is indeed named correctly.""" problems = [flv.name for flv, flavorname in scs_flavors if not flavorname] diff --git a/Tests/iaas/scs_0103_standard_flavors/standard_flavors.py b/Tests/iaas/scs_0103_standard_flavors/standard_flavors.py index 83136e8a2..bbedfd496 100644 --- a/Tests/iaas/scs_0103_standard_flavors/standard_flavors.py +++ b/Tests/iaas/scs_0103_standard_flavors/standard_flavors.py @@ -5,7 +5,7 @@ NAME_KEY = "scs:name-v2" -SCS_0103_CANONICAL_NAMES = ( +SCS_0103_V1_MANDATORY = ( "SCS-1V-4", "SCS-2V-8", "SCS-4V-16", @@ -21,6 +21,8 @@ "SCS-1L-1", "SCS-2V-4-20s", "SCS-4V-16-100s", +) +SCS_0103_V1_RECOMMENDED = ( "SCS-1V-4-10", "SCS-2V-8-20", "SCS-4V-16-50", @@ -34,7 +36,26 @@ "SCS-2V-16-50", "SCS-4V-32-100", "SCS-1L-1-5", +) + ( + # larger memory flavors, also recommended + # 1:4 + "SCS-16V-64", + "SCS-16V-64-100", + # 1:8 + "SCS-8V-64", + "SCS-16V-128", + "SCS-8V-64-100", + "SCS-16V-128-100", + # 1:16 + "SCS-4V-64", + "SCS-8V-128", + "SCS-4V-64-100", + "SCS-8V-128-100", + # 1:32 + "SCS-4V-128", + "SCS-4V-128-100", ) +SCS_0103_CANONICAL_NAMES = tuple(sorted(set(SCS_0103_V1_MANDATORY + SCS_0103_V1_RECOMMENDED))) def compute_flavor_lookup(flavors, name_key=NAME_KEY): From 5a220bdd6430c6bc6606b8ac9392faf29617dc4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCchse?= Date: Thu, 11 Sep 2025 17:28:26 +0200 Subject: [PATCH 3/7] Introduce v1.2 of scs-0103: flavors with more RAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Büchse --- Standards/scs-0103-v1-standard-flavors.md | 34 +++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Standards/scs-0103-v1-standard-flavors.md b/Standards/scs-0103-v1-standard-flavors.md index b85d66288..7800cc345 100644 --- a/Standards/scs-0103-v1-standard-flavors.md +++ b/Standards/scs-0103-v1-standard-flavors.md @@ -14,10 +14,7 @@ description: | ## Introduction -This is v1.1 of the standard, which lifts the following restriction regarding the property `scs:name-vN`: -this property may now be used on any flavor, rather than standard flavors only. In addition, the "vN" is -now interpreted as "name variant N" instead of "version N of the naming standard". Note that this change -indeed preserves compliance, i.e., compliance with v1.0 implies compliance with v1.1. +Note that this is v1.2 of this standard. See the closing section for more details. ## Terminology @@ -99,7 +96,7 @@ Note that this statement does not preclude the existence of additional flavors. | SCS-4V-32 | 4 | shared-core | 32 | | | | SCS-1L-1 | 1 | crowded-core | 1 | | | -### Recommended +### Recommended, part 1 | Recommended name | vCPUs | vCPU type | RAM [GiB] | Root disk [GB] | Disk type | | ---------------- | ------ | ------------- | ---------- | --------------- | ---------- | @@ -117,6 +114,26 @@ Note that this statement does not preclude the existence of additional flavors. | SCS-4V-32-100 | 4 | shared-core | 32 | 100 | (any) | | SCS-1L-1-5 | 1 | crowded-core | 1 | 5 | (any) | +### Recommended, part 2 + +The following flavors were added with v1.1 of this standard. If a CSP wants to offer +flavors with more RAM than the ones above, they should try to use these. + +| Recommended name | vCPUs | vCPU type | RAM [GiB] | Root disk [GB] | Disk type | +| ---------------- | ------ | ------------- | ---------- | --------------- | ---------- | +| SCS-16V-64 | 16 | shared-core | 64 | | | +| SCS-16V-64-100 | 16 | shared-core | 64 | 100 | (any) | +| SCS-8V-64 | 8 | shared-core | 64 | | | +| SCS-16V-128 | 16 | shared-core | 128 | | | +| SCS-8V-64-100 | 8 | shared-core | 64 | 100 | (any) | +| SCS-16V-128-100 | 16 | shared-core | 128 | 100 | (any) | +| SCS-4V-64 | 4 | shared-core | 64 | | | +| SCS-8V-128 | 8 | shared-core | 128 | | | +| SCS-4V-64-100 | 4 | shared-core | 64 | 100 | (any) | +| SCS-8V-128-100 | 8 | shared-core | 128 | 100 | (any) | +| SCS-4V-128 | 4 | shared-core | 128 | | | +| SCS-4V-128-100 | 4 | shared-core | 128 | 100 | (any) | + ### Guarantees and properties The figures given in the table (number of CPUs, amount of RAM, root disk size) must match @@ -158,6 +175,13 @@ instance life cycle.) ## Previous standard versions +This is v1.2 of the standard, which adds recommended flavors with more RAM. + +Version 1.1 lifted a restriction regarding the property `scs:name-vN` as follows: +this property may now be used on any flavor, rather than standard flavors only. In addition, the "vN" is +now interpreted as "name variant N" instead of "version N of the naming standard". Note that this change +indeed preserves compliance, i.e., compliance with v1.0 implies compliance with v1.1. + The list of standard flavors used to be part of the flavor naming standard up until [version 3](scs-0100-v3-flavor-naming.md). The following changes have been made to the list in comparison with said standard: From 023b08f90a218316d4fb804eb5af97639d944168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCchse?= Date: Thu, 11 Sep 2025 17:34:56 +0200 Subject: [PATCH 4/7] Remove obsolete check scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Büchse --- .../iaas/scs_0100_flavor_naming/check_yaml.py | 110 ------------------ .../scs_0100_flavor_naming/check_yaml_test.py | 40 ------- playbooks/adr_syntax.yaml | 8 -- 3 files changed, 158 deletions(-) delete mode 100755 Tests/iaas/scs_0100_flavor_naming/check_yaml.py delete mode 100644 Tests/iaas/scs_0100_flavor_naming/check_yaml_test.py diff --git a/Tests/iaas/scs_0100_flavor_naming/check_yaml.py b/Tests/iaas/scs_0100_flavor_naming/check_yaml.py deleted file mode 100755 index 3d6738917..000000000 --- a/Tests/iaas/scs_0100_flavor_naming/check_yaml.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python3 -"""Check flavor names in the YAML files used for scs-0103-v1 with respect to scs-0100-vX. - -For reference, see - - - - - - -Also check that the flavor properties encoded in the YAML match those encoded in the name. -""" - -import sys -from pathlib import Path - -import yaml - -from flavor_names import parser_v2, flavorname_to_dict - - -REQUIRED_FIELDS = ['scs:name-v1', 'scs:name-v2', 'name', 'cpus', 'ram', 'scs:cpu-type'] -DEFAULTS = {'scs:disk0-type': 'network'} - - -class Undefined: - def __repr__(self): - return 'undefined' - - -class Checker: - """ - Auxiliary class that contains the logic for checking a single flavor spec - as well as emitting error messages to stderr. - - Once this program grows (significantly), this class should actually be split - in two in order to follow the single-responsibility principle. - """ - def __init__(self): - self.errors = 0 - - def emit(self, s): - print(f"ERROR: {s}", file=sys.stderr) - self.errors += 1 - - def check_spec(self, flavor_spec): - missing = [key for key in REQUIRED_FIELDS if key not in flavor_spec] - if missing: - self.emit(f"flavor spec missing keys {', '.join(missing)}: {flavor_spec}") - return - name = flavor_spec['name'] - name_v2 = flavor_spec['scs:name-v2'] - try: - flavorname = parser_v2(name_v2) - except Exception: - flavorname = None - if not flavorname: - self.emit(f"flavor {name}: name-v2 '{name_v2}' could not be parsed") - return - undefined = Undefined() - expected = flavorname_to_dict(flavorname) - # add explicit undefined so the final for-loop catches spurious entries - for key in flavor_spec: - if key == 'name': - continue - expected.setdefault(key, undefined) - for key, exp_val in expected.items(): - val = flavor_spec.get(key, DEFAULTS.get(key, undefined)) - if val != exp_val: - self.emit( - f"flavor '{name}': field '{key}' contradicting name-v2 '{name_v2}'; " - f"found {val!r}, expected {exp_val!r}" - ) - - -def check(yaml_dir_path): - if not isinstance(yaml_dir_path, Path): - raise ValueError("yaml_dir_path must be a pathlib.Path") - yaml_paths = sorted(yaml_dir_path.glob("scs-0103-*.yaml")) - main_checker = Checker() - if not yaml_paths: - main_checker.emit("no yaml files found!") - for yaml_path in yaml_paths: - with open(yaml_path, mode="rb") as fileobj: - flavor_spec_data = yaml.safe_load(fileobj) - if 'flavor_groups' not in flavor_spec_data: - main_checker.emit(f"file '{yaml_path.name}': missing field 'flavor_groups'") - continue - checker = Checker() - for group in flavor_spec_data['flavor_groups']: - for flavor_spec in group['list']: - checker.check_spec(flavor_spec) - if checker.errors: - main_checker.emit(f"file '{yaml_path.name}': found {checker.errors} errors") - return main_checker.errors - - -def validate_args(argv): - if len(sys.argv) != 2: - raise RuntimeError("must specify exactly one argument, PATH to the yaml directory") - yaml_path = Path(argv[1]) - if not yaml_path.is_dir(): - raise RuntimeError(f"not a directory: {yaml_path}") - return yaml_path - - -if __name__ == "__main__": - try: - sys.exit(check(validate_args(sys.argv))) - except Exception as e: - print(f"CRITICAL: {e!s}", file=sys.stderr) - sys.exit(1) diff --git a/Tests/iaas/scs_0100_flavor_naming/check_yaml_test.py b/Tests/iaas/scs_0100_flavor_naming/check_yaml_test.py deleted file mode 100644 index 09cb01e62..000000000 --- a/Tests/iaas/scs_0100_flavor_naming/check_yaml_test.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -Pytest based unit and regression tests for check_yaml. - -(c) Martin Morgenstern , 3/2024 -SPDX-License-Identifier: CC-BY-SA-4.0 -""" - -import pytest -from check_yaml import check -from pathlib import Path - - -HERE = Path(__file__).parent -TEST_ROOT = HERE.parent.parent - -CLEAN_YAML_DIR = Path(TEST_ROOT, "iaas") -BUGGY_YAML_DIR = Path(TEST_ROOT, "testing") - -EXPECTED_ERRORS = """ -ERROR: flavor 'SCS-1V-4': field 'scs:cpu-type' contradicting name-v2 'SCS-1V-4'; found 'crowded-core', expected 'shared-core' -ERROR: flavor 'SCS-2V-8': field 'scs:name-v1' contradicting name-v2 'SCS-2V-8'; found 'SCS-2V-8', expected 'SCS-2V:8' -ERROR: flavor 'SCS-4V-16': field 'ram' contradicting name-v2 'SCS-4V-16'; found 12, expected 16.0 -ERROR: flavor 'SCS-8V-32': field 'disk' contradicting name-v2 'SCS-8V-32'; found 128, expected undefined -ERROR: flavor 'SCS-1V-2': field 'cpus' contradicting name-v2 'SCS-1V-2'; found 2, expected 1 -ERROR: flavor 'SCS-2V-4-20s': field 'scs:disk0-type' contradicting name-v2 'SCS-2V-4-20s'; found 'network', expected 'ssd' -ERROR: flavor 'SCS-4V-16-100s': field 'disk' contradicting name-v2 'SCS-4V-16-100s'; found 10, expected 100 -ERROR: file 'scs-0103-v1-flavors-wrong.yaml': found 7 errors -""".strip() - -TEST_PARAMS = ( - (CLEAN_YAML_DIR, 0, ""), - (BUGGY_YAML_DIR, 1, EXPECTED_ERRORS), -) - - -@pytest.mark.parametrize("directory, num_errors, expected_output", TEST_PARAMS) -def test_check_yaml(capsys, directory, num_errors, expected_output): - assert check(directory) == num_errors - captured = capsys.readouterr() - assert captured.err.strip() == expected_output diff --git a/playbooks/adr_syntax.yaml b/playbooks/adr_syntax.yaml index ff8b26053..083a9d0e7 100644 --- a/playbooks/adr_syntax.yaml +++ b/playbooks/adr_syntax.yaml @@ -10,13 +10,5 @@ changed_when: true failed_when: result.rc != 0 - - name: Run test script consistency check script - ansible.builtin.shell: - cmd: python3 Tests/iaas/scs_0100_flavor_naming/check_yaml.py Tests/iaas - chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" - register: result - changed_when: true - failed_when: result.rc != 0 - - ansible.builtin.debug: msg: "{{ result.stdout }} {{ result.stderr }}" From 2f92fd918bc75476f69c98dd6aba9e4eaade79e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCchse?= Date: Thu, 11 Sep 2025 17:36:16 +0200 Subject: [PATCH 5/7] Fix typo in Standards/scs-0103-v1-standard-flavors.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Büchse --- Standards/scs-0103-v1-standard-flavors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/scs-0103-v1-standard-flavors.md b/Standards/scs-0103-v1-standard-flavors.md index 7800cc345..fc7f89ba0 100644 --- a/Standards/scs-0103-v1-standard-flavors.md +++ b/Standards/scs-0103-v1-standard-flavors.md @@ -116,7 +116,7 @@ Note that this statement does not preclude the existence of additional flavors. ### Recommended, part 2 -The following flavors were added with v1.1 of this standard. If a CSP wants to offer +The following flavors were added with v1.2 of this standard. If a CSP wants to offer flavors with more RAM than the ones above, they should try to use these. | Recommended name | vCPUs | vCPU type | RAM [GiB] | Root disk [GB] | Disk type | From 0b8c996f6061c1203f9fa6781cc6fa9c4aa9c43f Mon Sep 17 00:00:00 2001 From: Kurt Garloff Date: Thu, 9 Oct 2025 19:58:47 +0200 Subject: [PATCH 6/7] Remove 1:16, 1:32 and -disk flavors from recommended list. (#998) * Remove 1:16, 1:32 and -disk flavors from recommended list. Instead create language that explains the way how to systematically extend the list to stay in line with what might later be standardized. * Escape underscore for markdown rendering. (#1000) github seems to be able to do without, but not all MD renderers are so tolerant. Signed-off-by: Kurt Garloff --- Standards/scs-0103-v1-standard-flavors.md | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Standards/scs-0103-v1-standard-flavors.md b/Standards/scs-0103-v1-standard-flavors.md index fc7f89ba0..f8483d507 100644 --- a/Standards/scs-0103-v1-standard-flavors.md +++ b/Standards/scs-0103-v1-standard-flavors.md @@ -7,7 +7,7 @@ track: IaaS description: | The SCS-0103 standard outlines mandatory and recommended specifications for flavors and properties in OpenStack environments to ensure uniformity across SCS clouds. Mandatory and recommended flavors are defined with specific - configurations of vCPUs, vCPU types, RAM, and root disk sizes, alongside extra specs like scs:name-vN, scs:cpu-type, + configurations of vCPUs, vCPU types, RAM, and root disk sizes, alongside extra_specs like scs:name-vN, scs:cpu-type, and scs:diskN-type to detail the flavor's specifications. This standard facilitates guaranteed availability and consistency of flavors, simplifying the deployment process for DevOps teams. --- @@ -18,7 +18,7 @@ Note that this is v1.2 of this standard. See the closing section for more detail ## Terminology -extra_specs +extra\_specs: Additional properties on an OpenStack flavor, see [OpenStack Nova user documentation](https://docs.openstack.org/nova/2024.1/user/flavors.html#extra-specs) and @@ -33,9 +33,9 @@ OpenStack providers thus typically offer a large selection of flavors. While flavors can be discovered (`openstack flavor list`), it is helpful for users (DevOps teams), to have a guaranteed set of flavors available on all SCS clouds, so these need not be discovered. -## Properties (extra_specs) +## Properties (extra\_specs) -The following extra_specs are recognized, together with the respective semantics: +The following extra\_specs are recognized, together with the respective semantics: - `scs:name-vN=NAME` (where `N` is a positive integer, and `NAME` is some string) means that `NAME` is a valid name for this flavor according to any major version of the [SCS standard on @@ -53,14 +53,14 @@ The following extra_specs are recognized, together with the respective semantics Whenever ANY of these are present on ANY flavor, the corresponding semantics must be satisfied. -The extra_spec `scs:name-vN` is to be interpreted as "name variant N". This name scheme is designed to be +The extra\_spec `scs:name-vN` is to be interpreted as "name variant N". This name scheme is designed to be backwards compatible with v1.0 of this standard, where `scs:name-vN` is interpreted as "name according to naming standard vN". We abandon this former interpretation for two reasons: 1. the naming standards admit multiple (even many) names for the same flavor, and we want to provide a means of advertising more than one of them (said standards recommend using two: a short one and a long one), 2. the same flavor name may be valid according to multiple versions at the same time, which would lead to - a pollution of the extra_specs with redundant properties; for instance, the name + a pollution of the extra\_specs with redundant properties; for instance, the name `SCS-4V-16` is valid for both [scs-0100-v2](scs-0100-v2-flavor-naming.md) and [scs-0100-v3](scs-0100-v3-flavor-naming.md), and, since it does not use any extension, it will be valid for any future version that only changes the extensions, such as the GPU vendor and architecture. @@ -68,7 +68,7 @@ backwards compatible with v1.0 of this standard, where `scs:name-vN` is interpre Note that it is not required to use consecutive numbers to number the name variants. This way, it becomes easier to remove a single variant (no "closing the gap" required). -If extra_specs of the form `scs:name-vN` are used to specify SCS flavor names, it is RECOMMENDED to include +If extra\_specs of the form `scs:name-vN` are used to specify SCS flavor names, it is RECOMMENDED to include names for the latest stable major version of the standard on flavor naming. ## Standard SCS flavors @@ -122,17 +122,17 @@ flavors with more RAM than the ones above, they should try to use these. | Recommended name | vCPUs | vCPU type | RAM [GiB] | Root disk [GB] | Disk type | | ---------------- | ------ | ------------- | ---------- | --------------- | ---------- | | SCS-16V-64 | 16 | shared-core | 64 | | | -| SCS-16V-64-100 | 16 | shared-core | 64 | 100 | (any) | | SCS-8V-64 | 8 | shared-core | 64 | | | | SCS-16V-128 | 16 | shared-core | 128 | | | -| SCS-8V-64-100 | 8 | shared-core | 64 | 100 | (any) | -| SCS-16V-128-100 | 16 | shared-core | 128 | 100 | (any) | -| SCS-4V-64 | 4 | shared-core | 64 | | | -| SCS-8V-128 | 8 | shared-core | 128 | | | -| SCS-4V-64-100 | 4 | shared-core | 64 | 100 | (any) | -| SCS-8V-128-100 | 8 | shared-core | 128 | 100 | (any) | -| SCS-4V-128 | 4 | shared-core | 128 | | | -| SCS-4V-128-100 | 4 | shared-core | 128 | 100 | (any) | + +Note that no flavors with disks have been added here; providers are of course welcome to +also add variants with unspecified (e.g. `-200`) or ssd+ (e.g. `-200s`) disk types. +Sticking to the 5, 10, 20, 50, 100, 200, 500, 1000 schedule for disk sizes is recommended +in that case to avoid unnecessary fragmentation. + +Likewise, flavors with more vCPUs (e.g. `-32V`, `-64V`) may be added and we recommend +sticking to powers of two and to keep the vCPU to GiB RAM ratios 1:2, 1:4 and 1:8, +unless customers have very specific demands. ### Guarantees and properties From 048c80a9215774e25ed36d4e9b1909707e06e962 Mon Sep 17 00:00:00 2001 From: Kurt Garloff Date: Thu, 9 Oct 2025 19:59:05 +0200 Subject: [PATCH 7/7] Add comment on `--limit-memory` flavor-manager parameter. (#996) Signed-off-by: Kurt Garloff --- Standards/scs-0103-w1-standard-flavors-implementation.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Standards/scs-0103-w1-standard-flavors-implementation.md b/Standards/scs-0103-w1-standard-flavors-implementation.md index e22362074..1f1e0815e 100644 --- a/Standards/scs-0103-w1-standard-flavors-implementation.md +++ b/Standards/scs-0103-w1-standard-flavors-implementation.md @@ -9,7 +9,10 @@ supplements: ## Operational tooling The [openstack-flavor-manager](https://github.com/osism/openstack-flavor-manager) is able to -create all standard, mandatory SCS flavors for you. It takes input that can be generated by +create all standard, mandatory as well as recommended SCS flavors for you. It now has a `--limit-memory` +(defaulting to 32 GiB) to skip the creation of recommended flavors above this memory limit. + +You can generate input for it using the tool [`flavor-manager-input.py`](https://github.com/SovereignCloudStack/standards/blob/main/Tests/iaas/scs_0100_flavor_naming/flavor-manager-input.py). ## Automated tests