Skip to content

Feat/flavor checker direct - #163

Merged
garloff merged 13 commits into
mainfrom
feat/flavor-checker-direct
Jan 13, 2023
Merged

garloff merged 13 commits into
mainfrom
feat/flavor-checker-direct

Conversation

@garloff

@garloff garloff commented Dec 15, 2022

Copy link
Copy Markdown
Member

Rather than feeding the output from openstack flavor list -f value -c Name to flavor-name-check.py, we can create a tool that uses the openstacksdk to retrieve the flavor list and directly check.
This has one big advantage: We get some data (like vCPUs and RAM and root disk size) from OpenStack and can compare it with what's advertized in a name.
And indeed, found one warning (overprovided resources) on gx-scs and one error (underprovided resources) each on plus-pco and wavestack.

This gets us close to a complete conformance test for flavors.

Short of actually booting VMs and looking inside and doing long-term performance testing ...

We get the list of flavors and check compliance of them.

Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Overproviding is allowed, we only warn.
For underprovisioning, we produce an error.

Signed-off-by: Kurt Garloff <[email protected]>
@garloff garloff added IaaS Issues or pull requests relevant for Team1: IaaS standards Issues / ADR / pull requests relevant for standardization & certification SCS enables with an excellent toolbox SCS is standardized SCS is standardized labels Dec 15, 2022
@tibeer

tibeer commented Dec 16, 2022

Copy link
Copy Markdown

Why was this pull request created? I thought there is a task that is passed to another person working on exactly this topic.

@frosty-geek

Copy link
Copy Markdown
Member

My guess is that "somebody' was bored on the sofa and wanted to do a little finger exercise ☺️

@garloff

garloff commented Dec 16, 2022

Copy link
Copy Markdown
Member Author

Why was this pull request created? I thought there is a task that is passed to another person working on exactly this topic.

Because we wanted to have
(a) the code that creates compliant flavors (flavor-manager)
and
(b) the conformance check tool
created independently from each other.

This PR is completing the pre-existing work on (b).

I understand from your comment that you assumed working on (b) as well which would turn some of the work into duplicated efforts.

Not ideal. Communication breakdown?

I consider the tool as the reference for judging flavor conformity. If that has been superceded by some other tool, I have missed that news and the rationale I guess.

@berendt

berendt commented Dec 16, 2022

Copy link
Copy Markdown
Contributor

The problem is that we have SovereignCloudStack/issues#236 and the work on it is to be bundled by Tim in the new openstack-flavor-manager (https://github.com/osism/openstack-flavor-manager). If we continue to work here in parallel, this will lead to redundancies etc.

IMO we should stop working here and proceed in openstack-flavor-manager. The first code is already there and Tim is currently working on it.

@garloff

garloff commented Dec 16, 2022

Copy link
Copy Markdown
Member Author

So the flavor-manager will do the SCS flavor spec conformance checking in the future?
Is that what we want?

If so, we need to ensure it can be invoked on non-SCS OpenStack envs and be ran in a mode that does just that: SCS Conformance Checking.

I would then remove both pieces of the current test tool here to avoid confusion and to avoid the frustration of duplicated work.

The only piece remaining here would be a README, a YAML with the list of mandatory flavors plus - if we have a good way to express the grammar - a file that describes the naming grammar. (I fear that regexps are not the best way to denote grammars although I made heavy use of them in my parser.)

(Probably the current code will be reused for the gx-self-description-generator, that was actually the cause for me looking at it again.)

@fkr

fkr commented Dec 16, 2022

Copy link
Copy Markdown
Member

My suggestion would be as follows:

  • As a reference, I'd go ahead and merge this into the tree, since it does not harm to have more than implementation of the validation - especially if they're authored individually.
  • We should make sure the scope of the current work on the osism flavor manager is clear and easy to understand. I'll make sure to further outline the stuff that @tibeer and I discussed (which in tl;dr is part of the osism issue that @berendt referenced)

If need be, we can schedule a call to outline this together next week (I'm on PTO, but can submerge from that in order to not block the work from @tibeer on this).

We only recommend 0.5, 1, 1.5, 2, ... 9.5, 10, 11, 12, 13, ...
and warn for numbers that are not integers if >= 10 and not halfed
integers for smaller memory sizes. (This gives us still plenty of
flexibility.)

Another change was naming the return values as cpuram is more readable
than ret[0].

Signed-off-by: Kurt Garloff <[email protected]>
@garloff garloff mentioned this pull request Dec 16, 2022
@garloff

garloff commented Dec 21, 2022 •

Copy link
Copy Markdown
Member Author

Discussed this in the IaaS team meeting:

  • Conformance tests (and other artifacts used to validate standards compliance) live next to the standards in the standards repository (currently still: Docs/Design-Docs repo).
  • The reference implementation can use/reference code from the standards repo to do its job as needed or alternatively do its own independent implementation (possibly still consuming some artifacts from the standards repo) -- the canonical place for standards compliance though will always be the standards repo
  • If the most mature conformance check implementation for a standard currently is somewhere else (e.g. in image-manager), we should split it out and move it to the standards repo
  • The conformance checks in the standards repo should be linked with a framework into a testsuite that can be ran and integrated into a continuous conformance validation process

@tibeer tibeer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against PlusCloud Open:

columbia@columbia tools % ./flavor-names-openstack.py 
scs-community-beermann:
  FlavorReport:
    GoodSCSFlavors:
    - SCS-16V:64
    - SCS-16V:64:100
    - SCS-1V:0.5
    - SCS-1V:0.5:20
    - SCS-1V:1
    - SCS-1V:1:10
    - SCS-1V:1:20
    - SCS-2V:2
    - SCS-2V:2:20
    - SCS-2V:4:100
    - SCS-2V:4:20
    - SCS-2V:4:50
    - SCS-2V:8:100
    - SCS-4V:16:100
    - SCS-4V:32:50
    - SCS-4V:8:100
    - SCS-4V:8:50
    - SCS-8V:16:100
    - SCS-8V:32:50
    - SCS-8V:8
    - SCS-8V:8:100
    MandatoryFlavors:
    - SCS-16V:32
    - SCS-16V:32:100
    - SCS-1L:1
    - SCS-1L:1:5
    - SCS-1V:2
    - SCS-1V:2:5
    - SCS-1V:4
    - SCS-1V:4:10
    - SCS-1V:8
    - SCS-1V:8:20
    - SCS-2V:16
    - SCS-2V:16:50
    - SCS-2V:4
    - SCS-2V:4:10
    - SCS-2V:8
    - SCS-2V:8:20
    - SCS-4V:16
    - SCS-4V:16:50
    - SCS-4V:32
    - SCS-4V:32:100
    - SCS-4V:8
    - SCS-4V:8:20
    - SCS-8V:16
    - SCS-8V:16:50
    - SCS-8V:32
    - SCS-8V:32:100
    MissingFlavors: []
    WarnSCSFlavors: []
    WrongSCSFlavors: []
    nonSCSFlavors:
    - octavia
  FlavorSummary:
    GoodSCSFlavors: 21
    MandatoryFlavors: 26
    MissingFlavors: 0
    WrongSCSFlavors: 0
    errors: 0
    nonSCSFlavors: 1
    warnings: 0

columbia@columbia tools % 

I would assume, that the tool should report five missing flavors, since 26 are mandatory and only 21 are good.
Or do I misunderstand the output?

- Replaced tabs by spaces
- switched partly to newer string formatting style
- fixed indentation issues
- removed code-linebreaks as they reduce readability
- removed trailing backslashes inside braces as they are obsolete

Signed-off-by: Tim Beermann <[email protected]>
@garloff

garloff commented Jan 10, 2023

Copy link
Copy Markdown
Member Author

You misinterpreted the output:
The tool found all 26 mandatory flavors.
It found an additional good 21 flavors, i.e. 21 flavors that comply with the SCS naming spec.
It also found one non SCS flavor, which is fine, as non-SCS flavors are allowed.
Thus all good, exit code zero.

What would not have been allowed:

  • Missing flavors
  • Flavors that start with "SCS-" but which do not comply with the spec rules (or which report parameters from the OpenStack glance API which are not aligned with what the names claim)

So from my perspective all good. Do we need better wording in the report? Or better documentation?

@tibeer

tibeer commented Jan 11, 2023

Copy link
Copy Markdown

I would then change the output to something like this

  SCSFlavorSummary:
    TotalAmount: 47
    MandatoryFlavorsPresent: 26
    MandatoryFlavorsMissing: 0
    OptionalFlavorsValid: 21
    OptionalFlavorsWrong: 0
  OtherFlavorSummary:
    TotalAmount: 1
  TotalSummary:
    Errors: 0
    Warnings: 0

What do you think?

Tim suggested a better report format discussing PR#163 at
SovereignCloudStack/docs#163 (comment)
which we implement.

Also: Don't list all flavors by category by default, but just the
Summary with the numbers. Option -v/--verbose produces the full
report though.

Sidenote: As we have dicts, the field order is determined by the Python
implementation (using Alphabetical ordering). If we prefer a different
ordering, we might need to use some ordered dict implementation.

Signed-off-by: Kurt Garloff <[email protected]>
@garloff

garloff commented Jan 13, 2023

Copy link
Copy Markdown
Member Author

I would then change the output to something like this

[...]

What do you think?

I like it and I implemented it. Please check!

Signed-off-by: Kurt Garloff <[email protected]>
Mainly superfluous () after if. (Yes, I have written C for too long.)

Signed-off-by: Kurt Garloff <[email protected]>
…udStack/Docs into feat/flavor-checker-direct
@tibeer
tibeer self-requested a review January 13, 2023 12:59

@tibeer tibeer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Ready to be merged.

@garloff
garloff merged commit edff02b into main Jan 13, 2023
@garloff
garloff deleted the feat/flavor-checker-direct branch January 13, 2023 13:02
fkr pushed a commit that referenced this pull request Jan 26, 2023
* Add script using OpenStack API to check flavors.

We get the list of flavors and check compliance of them.

* Print output report in YAML.

* Fix output report dict structure.

* Check vCPUs, RAM, Disk OpenStack data vs name.

Overproviding is allowed, we only warn.
For underprovisioning, we produce an error.

* Count errors for underperforming flavors.

* Some comments help with code reading.

* Warn for strange memory sizes.

We only recommend 0.5, 1, 1.5, 2, ... 9.5, 10, 11, 12, 13, ...
and warn for numbers that are not integers if >= 10 and not halfed
integers for smaller memory sizes. (This gives us still plenty of
flexibility.)

Another change was naming the return values as cpuram is more readable
than ret[0].

* Fixed formatting.

- Replaced tabs by spaces
- switched partly to newer string formatting style
- fixed indentation issues
- removed code-linebreaks as they reduce readability
- removed trailing backslashes inside braces as they are obsolete

* Implement Tim's suggestion who to report result.

Tim suggested a better report format discussing PR#163 at
SovereignCloudStack/docs#163 (comment)
which we implement.

Also: Don't list all flavors by category by default, but just the
Summary with the numbers. Option -v/--verbose produces the full
report though.

Sidenote: As we have dicts, the field order is determined by the Python
implementation (using Alphabetical ordering). If we prefer a different
ordering, we might need to use some ordered dict implementation.

* Make it pass flake8 tests.

* Address a few of the pylint complaints.

Mainly superfluous () after if. (Yes, I have written C for too long.)

Signed-off-by: Kurt Garloff <[email protected]>

Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Tim Beermann <[email protected]>
Co-authored-by: Tim Beermann <[email protected]>
fkr added a commit that referenced this pull request Mar 24, 2023
* (see #180) initial commit for an Status Page ADR.
This ADR contains why we decided to create a complete new application

* (see #180) include decisions made in a earlier discussion

* (see #180) update introduction

* (see #180) a small design fix for related documents section

* Add a first draft for a dev and testing cloud ressources overview (#167)

* Add a first draft for a dev ressources overview

Signed-off-by: Eduard Itrich <[email protected]>

* added projects for @costelter to review

Signed-off-by: Ralf Heiringhoff <[email protected]>

Signed-off-by: Eduard Itrich <[email protected]>
Signed-off-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Ralf Heiringhoff <[email protected]>

* partner ressources (#171)

* Add a first draft for a dev ressources overview
* added projects for @costelter to review
* updated out-dated PlusDemonstrator Docs
added partner api endpoints in clouds-public.yaml
* fixed gfm typos
* more fixes
* minor final fixes
* Capitalize title

Signed-off-by: Eduard Itrich <[email protected]>
Signed-off-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>

* Fix counting SCS flavors. (#165)

- Fix counting SCS flavors
- Added comments to better explain scs var, -i mode
- Also exit code documentation
- Fixed formatting
  - Replaced tabs by spaces
  - switched partly to newer string formatting style
  - fixed indentation issues
  - removed code-linebreaks as they reduce readability
  - removed trailing backslashes inside braces as they are obsolete
  - removed unnecessary import of "os"
  - renamed some variables to improve readability

Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Tim Beermann <[email protected]>
Co-authored-by: Tim Beermann <[email protected]>

* ease collaboration & transparency (#172)

* improved user handling to ease collaboration & transparency within the team
* added link to the gx-scs environment
* fixed link
* Use github-flavored markdown for note sections (#173)

See https://stackoverflow.com/questions/50544499/how-to-make-a-styled-markdown-admonition-box-in-a-github-gist for reference

Signed-off-by: Ralf Heiringhoff <[email protected]>
Signed-off-by: Eduard Itrich <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>

* typos & whitespaces fix on cloud-ressources.md (#174)

* improved user handling to ease collaboration & transparency within the team

Signed-off-by: Ralf Heiringhoff <[email protected]>

* added link to the gx-scs environment

Signed-off-by: Ralf Heiringhoff <[email protected]>

* fixed link

Signed-off-by: Ralf Heiringhoff <[email protected]>

* Use github-flavored markdown for note sections (#173)

See https://stackoverflow.com/questions/50544499/how-to-make-a-styled-markdown-admonition-box-in-a-github-gist for reference

Signed-off-by: Eduard Itrich <[email protected]>

Signed-off-by: Eduard Itrich <[email protected]>

* minor fixes

Signed-off-by: Ralf Heiringhoff <[email protected]>

Signed-off-by: Ralf Heiringhoff <[email protected]>
Signed-off-by: Eduard Itrich <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>

* removed copy & waste error (#175)

Signed-off-by: Ralf Heiringhoff <[email protected]>

Signed-off-by: Ralf Heiringhoff <[email protected]>

* Remove more copy & waste issues (#178)

Signed-off-by: Eduard Itrich <[email protected]>

Signed-off-by: Eduard Itrich <[email protected]>

* Update plusserver-gx-scs.md (#179)

* Update plusserver-gx-scs.md
* fix URL syntax

Signed-off-by: Ralf Heiringhoff <[email protected]>

* updated cloud-resources.md (#176)

* added missing svc user
* added related projects to svc user
* fixed table

Signed-off-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>

* Update plusserver-gx-scs.md (#181)

left and right mix up

Signed-off-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>

* Update README.md (#180)

fixed dead link + reworded it to point to the partner resources instead

Signed-off-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>

* Feat/flavor checker direct (#163)

* Add script using OpenStack API to check flavors.

We get the list of flavors and check compliance of them.

* Print output report in YAML.

* Fix output report dict structure.

* Check vCPUs, RAM, Disk OpenStack data vs name.

Overproviding is allowed, we only warn.
For underprovisioning, we produce an error.

* Count errors for underperforming flavors.

* Some comments help with code reading.

* Warn for strange memory sizes.

We only recommend 0.5, 1, 1.5, 2, ... 9.5, 10, 11, 12, 13, ...
and warn for numbers that are not integers if >= 10 and not halfed
integers for smaller memory sizes. (This gives us still plenty of
flexibility.)

Another change was naming the return values as cpuram is more readable
than ret[0].

* Fixed formatting.

- Replaced tabs by spaces
- switched partly to newer string formatting style
- fixed indentation issues
- removed code-linebreaks as they reduce readability
- removed trailing backslashes inside braces as they are obsolete

* Implement Tim's suggestion who to report result.

Tim suggested a better report format discussing PR#163 at
SovereignCloudStack/docs#163 (comment)
which we implement.

Also: Don't list all flavors by category by default, but just the
Summary with the numbers. Option -v/--verbose produces the full
report though.

Sidenote: As we have dicts, the field order is determined by the Python
implementation (using Alphabetical ordering). If we prefer a different
ordering, we might need to use some ordered dict implementation.

* Make it pass flake8 tests.

* Address a few of the pylint complaints.

Mainly superfluous () after if. (Yes, I have written C for too long.)

Signed-off-by: Kurt Garloff <[email protected]>

Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Tim Beermann <[email protected]>
Co-authored-by: Tim Beermann <[email protected]>

* Proposal for a standard to technically describe SCS certification levels (#148)

* Add initial draft for the proposal SCS Standards YAML

* Add a first round of key values for certification yaml and give example

* Fix some typos and ammend section on list of standards

* Fix SCS capitalization issue

* Add missing full stop at end of file

* Add flag to distinguish between mandatory and optional standards

* Promote proposal to state

* Rename state to condition

Signed-off-by: Eduard Itrich <[email protected]>

Signed-off-by: Eduard Itrich <[email protected]>
Co-authored-by: Kurt Garloff <[email protected]>

* Add decision record template (#168)

Signed-off-by: Joshua Mühlfort <[email protected]>
Co-authored-by: Kurt Garloff <[email protected]>

* Add dNation Dev Project cloud resource (#188)

* Add dNation Dev Project cloud resource

Signed-off-by: Roman Hros <[email protected]>

* added project id

Signed-off-by: Ralf Heiringhoff <[email protected]>

Signed-off-by: Roman Hros <[email protected]>
Signed-off-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Ralf Heiringhoff <[email protected]>

* remove files that exist in docs repository (#189)

Signed-off-by: maxwolfs <[email protected]>

Signed-off-by: maxwolfs <[email protected]>

* some minor rewordings and additions on the reasoning.

While there sprinkle another link

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* rename as per discussion

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* incorporate decision matrix

based on a discussion in Team OPS with input from @horazont

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* start reworking some of the sections

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* fix list

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* reword to be precise

* remove related documents. One of them (comparison) was incorporated.

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* fix(link): status page comparison moved

Signed-off-by: Jan Schoone <[email protected]>

* fix: minor typos

Signed-off-by: Jan Schoone <[email protected]>

* just link to section in same document.

discussed with @jschoone

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* finalize naming

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* rename to match the numbering scheme according to the tracks

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* rename to reflect reality

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

* Address comments wrote by @garloff

Signed-off-by: Joshua Mühlfort <[email protected]>

* rename to contain the track number in the filename

Signed-off-by: Felix Kronlage-Dammers <[email protected]>

---------

Signed-off-by: Eduard Itrich <[email protected]>
Signed-off-by: Ralf Heiringhoff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Tim Beermann <[email protected]>
Signed-off-by: Ralf Heiringhoff <[email protected]>
Signed-off-by: Joshua Mühlfort <[email protected]>
Signed-off-by: Roman Hros <[email protected]>
Signed-off-by: maxwolfs <[email protected]>
Signed-off-by: Felix Kronlage-Dammers <[email protected]>
Signed-off-by: Jan Schoone <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Eduard Itrich <[email protected]>
Co-authored-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Ralf Heiringhoff <[email protected]>
Co-authored-by: Kurt Garloff <[email protected]>
Co-authored-by: Tim Beermann <[email protected]>
Co-authored-by: Joshua Mühlfort <[email protected]>
Co-authored-by: Roman Hros <[email protected]>
Co-authored-by: Max Wolfs <[email protected]>
Co-authored-by: Jan Schoone <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IaaS Issues or pull requests relevant for Team1: IaaS SCS is standardized SCS is standardized standards Issues / ADR / pull requests relevant for standardization & certification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants