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

Optimize getMachine function #240

Conversation

sempervictus
Copy link

The getMachine is incredibly inefficient fetching a list of all machines and their components in order to look up the name or ID of just one and then doing it all over again for each component of that machine's configuration. The API provides for a Machine.Get call when using the machine ID or a params struct for Machines.Get which can specify Hostname - a commonly used element in resource calls.

Return a machine found by its ID before performing lookup on the list of all machines, then try to find a machine in the list by the hostname parameter, and finally fall back to the current list lookup dumping all data and iterating through it for a few fields.

Testing:
Qualified on lab cluster showing reduction of 30m plan to < 3m.

The getMachine is incredibly inefficient fetching a list of all
machines and their components in order to look up the name or ID of
just one and then doing it all over again for each component of
that machine's configuration. The API provides for a Machine.Get
call when using the machine ID or a params struct for Machines.Get
which can specify Hostname - a commonly used element in resource
calls.

Return a machine found by its ID before performing lookup on the
list of all machines, then try to find a machine in the list by
the hostname parameter, and finally fall back to the current list
lookup dumping all data and iterating through it for a few fields.

Testing:
  Qualified on lab cluster showing reduction of 30m plan to < 3m.
Copy link

Hey! undefined has not signed the Canonical CLA which is required to get this contribution merged on this project.

Please head over to https://ubuntu.com/legal/contributors to read more about it.

@sempervictus
Copy link
Author

Hey! undefined has not signed the Canonical CLA which is required to get this contribution merged on this project.
Please head over to https://ubuntu.com/legal/contributors to read more about it.

Canonical is free to contact our legal department and pay for the review, redlining, and negotiation process involved in this sort of thing.

@r00ta
Copy link
Contributor

r00ta commented Oct 26, 2024

The point is very simple: NO CLA = No green pipeline = we have to close this PR.

The MAAS repositories are not monitored by the legal department of Canonical: discussing the CLA here is off-topic. As already discussed previously, you are free to contact the legal department with the proper channels.

@sempervictus
Copy link
Author

The lawyers are the ones who reached out to the contributors through the CI check... They should be the ones participating in these public forum discussions on the merits of their actions. We work all over the industry with most of us having done so since before Canonical existed: i've never seen an engineer promote, write, or drive the enforcement of such efforts; why are they the ones answering for them?

FOSS isn't supposed to be adversarial, its supposed to be collegiate. How would any normal person react if they walked into a community space collaborating to make something better only to be slapped at the door with an opaque blob of legalese as a predicate for participation which seeks to strip them of the ability to benefit from the work (why else would it even exist if not to advantage one side of the other)? Why is the reaction expected to be any different online? There are still people making decisions for the company to behave in this manner and the opacity of the infrastructure does not change that - a person bears responsibility for the way this works and that person is doing themselves no favors by making this look like a big corporation trying to step on little contributors.

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.

2 participants