Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

QuanMPhm
Copy link
Contributor

@QuanMPhm QuanMPhm commented Mar 11, 2024

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 to attributes.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.

@naved001 naved001 changed the title Draft PR to intergrate ESI into Coldfront Draft PR to integrate ESI into Coldfront Mar 13, 2024
Copy link

@tzumainn tzumainn left a 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).

@QuanMPhm
Copy link
Contributor Author

@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.

@tzumainn
Copy link

@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.

README.md Outdated Show resolved Hide resolved
ci/devstack_esi.sh Outdated Show resolved Hide resolved
src/coldfront_plugin_cloud/attributes.py Outdated Show resolved Hide resolved
src/coldfront_plugin_cloud/esi.py Outdated Show resolved Hide resolved
src/coldfront_plugin_cloud/esi.py Outdated Show resolved Hide resolved
src/coldfront_plugin_cloud/openstack.py Outdated Show resolved Hide resolved
@tzumainn
Copy link

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.

@QuanMPhm QuanMPhm requested review from naved001 and removed request for naved001 June 28, 2024 19:27
@QuanMPhm QuanMPhm force-pushed the 135/ESI_Support branch 6 times, most recently from ff61b8d to 32b5df1 Compare July 2, 2024 20:10
@QuanMPhm
Copy link
Contributor Author

QuanMPhm commented Jul 2, 2024

@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.

@QuanMPhm QuanMPhm marked this pull request as ready for review July 2, 2024 20:24
src/coldfront_plugin_cloud/esi.py Outdated Show resolved Hide resolved
@QuanMPhm QuanMPhm changed the title Draft PR to integrate ESI into Coldfront Integrate ESI into Coldfront Jul 3, 2024
@QuanMPhm QuanMPhm requested a review from knikolla July 15, 2024 19:23
@joachimweyl
Copy link

@tzumainn once @knikolla approves the ColdFront side are you ready to approve the ESI side?

@tzumainn
Copy link

tzumainn commented Sep 6, 2024

@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.

@joachimweyl
Copy link

@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
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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/attributes.py Outdated Show resolved Hide resolved
src/coldfront_plugin_cloud/attributes.py Outdated Show resolved Hide resolved
src/coldfront_plugin_cloud/esi.py Show resolved Hide resolved
Copy link
Collaborator

@knikolla knikolla left a comment

Choose a reason for hiding this comment

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

Almost there!

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
Copy link
Collaborator

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.

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
Copy link
Collaborator

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.

},
}

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()}
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for ESI
5 participants