-
Notifications
You must be signed in to change notification settings - Fork 10
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
Integrate ESI into Coldfront #146
base: main
Are you sure you want to change the base?
Conversation
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.
Hi! Just a general comment: ESI doesn't require nova/compute, so that's something you'll want to take out of the ESI quotas (and probably the "small openstack" tests).
src/coldfront_plugin_cloud/tests/functional/openstack_mini/test_allocation.py
Outdated
Show resolved
Hide resolved
@tzumainn Do you have an answer for the other questions I mentioned in my PR comments? I feel like there is a lot more information I need to know before being able to remotely continue solving this issue. |
Whoops, sorry, I missed that there were question in the files themselves; in the future it may be easier to add questions as git comments on the PR and tag the relevant people. Anyway, floating IPs and networks are the only items I can think of that might require allocations, since I think we explicitly do not want ColdFront to limit capacity for leasing nodes. |
src/coldfront_plugin_cloud/management/commands/add_esi_resource.py
Outdated
Show resolved
Hide resolved
src/coldfront_plugin_cloud/management/commands/validate_allocations.py
Outdated
Show resolved
Hide resolved
src/coldfront_plugin_cloud/tests/functional/esi/test_allocations.py
Outdated
Show resolved
Hide resolved
I've answered the ESI specific questions; however, I'm not all that familiar with ColdFront itself, so this questions regarding allocations and the like may be better suited for Kristi. |
ff61b8d
to
32b5df1
Compare
@knikolla I have finished the integration code for now. For some unrelated reason the microshift test case is not working. I will update the README once we finish code review. |
32b5df1
to
de0dcff
Compare
de0dcff
to
602cea4
Compare
@joachimweyl sure - given that ESI is just OpenStack, and I don't have much expertise with ColdFront, I would assume everything just kind of works. |
@knikolla do you approve the ColdFront side? |
README.md
Outdated
@@ -111,6 +111,9 @@ usage: coldfront add_openshift_resource [-h] --name NAME --auth-url AUTH_URL [-- | |||
coldfront add_openshift_resource: error: the following arguments are required: --name, --auth-url | |||
``` | |||
|
|||
### Configuring for ESI | |||
(Quan Pham) TODO Add instructions for configuring ESI |
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.
Populate this section or remove it.
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.
This is still unresolved. Please update or remove.
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.
This is still unresolved. Please update or remove.
src/coldfront_plugin_cloud/management/commands/validate_allocations.py
Outdated
Show resolved
Hide resolved
src/coldfront_plugin_cloud/management/commands/add_esi_resource.py
Outdated
Show resolved
Hide resolved
602cea4
to
371af5c
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.
Almost there!
src/coldfront_plugin_cloud/management/commands/add_openstack_resource.py
Outdated
Show resolved
Hide resolved
src/coldfront_plugin_cloud/management/commands/validate_allocations.py
Outdated
Show resolved
Hide resolved
src/coldfront_plugin_cloud/management/commands/validate_allocations.py
Outdated
Show resolved
Hide resolved
README.md
Outdated
@@ -111,6 +111,9 @@ usage: coldfront add_openshift_resource [-h] --name NAME --auth-url AUTH_URL [-- | |||
coldfront add_openshift_resource: error: the following arguments are required: --name, --auth-url | |||
``` | |||
|
|||
### Configuring for ESI | |||
(Quan Pham) TODO Add instructions for configuring ESI |
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.
This is still unresolved. Please update or remove.
371af5c
to
def0b93
Compare
README.md
Outdated
@@ -111,6 +111,9 @@ usage: coldfront add_openshift_resource [-h] --name NAME --auth-url AUTH_URL [-- | |||
coldfront add_openshift_resource: error: the following arguments are required: --name, --auth-url | |||
``` | |||
|
|||
### Configuring for ESI | |||
(Quan Pham) TODO Add instructions for configuring ESI |
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.
This is still unresolved. Please update or remove.
def0b93
to
6a3b05c
Compare
}, | ||
} | ||
|
||
QUOTA_KEY_MAPPING_ALL_KEYS = {quota_key: quota_name for k in QUOTA_KEY_MAPPING.values() for quota_key, quota_name in k['keys'].items()} |
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 don't understand why this change is needed when the original code is much more readable than this.
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 wanted to turn QUOTA_KEY_MAPPING
and QUOTA_KEY_MAPPING_ALL_KEYS
into class attributes because I wanted the esi.py
module to be able to override it, which would prevent some redundant code down the line.
As for the formatting of QUOTA_KEY_MAPPING_ALL_KEYS
, that's a formatting oversight on my part. I could make initialize it in the allocator's __init__()
function if you'd like, though I thought that would lead to a messier diff.
For now, I've reformatted it to look more proper.
project = self.new_project(pi=user) | ||
allocation = self.new_allocation(project, self.resource, 1) | ||
allocator = esi.ESIResourceAllocator(self.resource, | ||
allocation) |
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.
formatting?
A new option `--esi` has been added to the `add_openstack_resource` command, allowing the creation of ESI resources in Coldfront. Allocations of ESI resources will be initialized with only a network quota of 1 floating IP and network by default. The implementation of this feature required subclassing of the `OpenstackResourceAllocator` to create an allocator class for ESI resources, changes to the various Coldfront commands, the addition of one Openstack quota attribute,a small modification to the CI and test files, and the addition of a test file for ESI allocations.
6a3b05c
to
0a745f2
Compare
Closes #135 To integrate ESI and make use of the existing code, I have made a few small restructuring choices. There’s too many to list, so I will be ready for everyone’s questions on my code changes.
The ESI allocator object, implemented in
esi.py
, subclasses from the Openstack allocator, with a few functions overridden. The ESI allocator only makes quotas for floating IPs and networks. The appropriate Allocation Attributes have been added toattributes.py
The functional test for the ESI integration uses the same Openstack cluster put up by
test-py38-functional-devstack.yaml
.ci/run_functional_tests_openstack.sh
has been edited to also create an ESI coldfront resource and to run the ESI functional tests.