-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add flavor page #389
Feat/add flavor page #389
Conversation
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Works for me. I already added it to the flavor manager docs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! From my POV, two things should be improved though:
- the script should output valid HTML; to that end, it could read the index.html and insert its output into some conveniently marked (easy to find) position
- the error messages should also be improved; all I got at first try was
TypeError: cannot unpack non-iterable NoneType object
-- it could at least say "The cause is probably that the name given is not a valid SCS flavor name"
As always, I volunteer to implement these or similar improvements.
I had this on my list as well.
For some wrong flavors you do get useful hints where the parser failed, for some you don't. An option is of course to use some open source tooling that is meant to support syntax parsing rather than coding it yourself. I had a quick check back then and decided that coming up with my own is easier. But that may have been due to insufficient research. If you go there, we'd have a second independent implementation of the flavor spec, which may help with testing.
I would want to take the easy steps (using templating to generate good HTML) quickly but then do a first merge. |
This produces valid html, hopefully. Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
…k/standards into feat/add-flavor-page
So, this should be producing good HTML now. |
I think we can merge this AS-IS in a first step. This can be improved and beautified in a 2nd step. Same with the generator. |
# from a CGI form with flavor | ||
# | ||
# (c) Kurt Garloff <[email protected]>, 11/2023 | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be AGPLv3 for code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All code in this directory is CC-BY-SA-4.0, which is a weak copyleft license.
CC is not a good license for compiled code, as it does not have any provisions for source code availability when distributing binary code. That is not a problem for scripting languages ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if one could distribute pyc files. I guess it would probably be a hassle for everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall fine, only very minor things in the comments.
Plus: could you add some snippet documenting how you integrated the cgi script into the website? Some config for nginx or Apache?
@@ -271,6 +271,9 @@ It goes beyond the above example in checking that the discoverable | |||
features of flavors (vCPUs, RAM, Disk) match what the flavor names claim. | |||
This is used for SCS-compatible compliance testing. | |||
|
|||
The web page <https://flavors.scs.community/> | |||
has a flavor name parser and (soon) generator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add that the functionality of the website is analogous to some of the scripts mentioned above (and in what way).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The flavor name parsing and (soon) flavor name generation of these scripts is also exposed via the web page https://flavors.scs.community/."
# import os | ||
import sys | ||
import re | ||
# import traceback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we get rid of the imports that are commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those were required before but have been replaced ...
Feel free to push a change to remove them.
Signed-off-by: Kurt Garloff <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Code for PoC for SovereignCloudStack/issues#483
Totally Web 1.0, that's my generation ...