-
Notifications
You must be signed in to change notification settings - Fork 6
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: configure flavors in Nova automatically #499
Conversation
72c0159
to
87d585e
Compare
87d585e
to
9717207
Compare
9717207
to
a615166
Compare
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 still wondering why not just using ansible and having a playbook for managing a flavor and it takes in the flavor spec as an input?
OK, that's fair question - let me break this down. At the moment the Flavor specifications are presented as collection of YAML files in a specific structured format.
Now, you could of course implement all this logic inside of Ansible (which really is just a YAML wrapper around Python), but I am pretty sure it will get messy and untestable pretty quickly. You could write a custom module for Ansible, which would again be just another Python script. Alternatively, you could manually write out playbooks with some of this data precomputed. However, this approach would result in duplicated data in various formats, which would make it more error-prone and require more work to maintain. For the sake of argument, let's say we decided to use Ansible for all of this and you have a role that sets up flavors in Nova. Now you need to make sure that you run this playbook every time someone adds or removes a new flavor. As far as I know, we do not have the machinery to do that at the moment, so it would probably require additional dependencies like Argo to detect repository changes and yet another container image to execute the Ansible. On top of all that, the testability of such solution would be difficult to achieve and quite convoluted. Based on these considerations, I believe implementing this in a programming language like Python is a more suitable approach than using a markup language. |
99bb0d4
to
d504e52
Compare
Based on the discussion in #499 (comment) this commit removes the repetitive directives to set the application UIDs, GIDs as well as the name and home directory. The new, standardised way is to use: - user with name appuser and UID 1000 - group with name appgroup and GID 1000 - location of the code in /app
069abbc
to
ad51616
Compare
ad51616
to
ae3c1c3
Compare
This adds code that performs simple synchronization of the Flavor Specs defined in a YAML files in particular directory (presumably downloaded through git-sync) with a chosen Nova API instance.
Prior to this change it was down to the client of FlavorSpec to filter out the irrelevant flavors, but now for consistency this filtering happens immediately when the flavors are loaded.
This reverts commit 5ac057b which was added in order to resolve the mismatch between the nova and ironic flavors that had a punctuation in the name. The reverted commit incorrectly changed the resource class name on the Ironic side while it was the Nova side that was missing the underscores. This was resolved in the commit before this one.
ae3c1c3
to
7101e17
Compare
I'll say long term I don't think this is the way to go. This is a lot of code for just flavor handling and we've got to handle images and keystone objects. But it moves us forward. |
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'll say long term I don't think this is the way to go. This is a lot of code for just flavor handling and we've got to handle images and keystone objects. But it moves us forward.
This PR brings a little operator style application that monitors a directory with YAML specifications of the machine flavors. If any of the files in the linked repository changes, the application parses all the specs in a directory, then compares and reconciles them with the configured Nova instance.
Please note that this will NOT delete (prune) flavors that have been removed from the repository.
Closes https://rackspace.atlassian.net/browse/PUC-598
Supersedes #454
Merge with https://github.com/RSS-Engineering/undercloud-deploy/pull/224