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

feat(openstack-aws): Add owner/lifetime info in VM's metadata #207

Merged
merged 4 commits into from
Nov 14, 2022

Conversation

kaleemsiddiqu
Copy link
Contributor

Owner and lifetime info will be added into VM's metadata for Openstack/AWS providers. This info will give info who owns the VM and what is the lifetime of the VM which will be used for notifying owners and cleaning up the resources based on lifetime of the VMs.
If owner info not fetched, user notified with custom error message for follow up action to take up.

Signed-off-by: ksiddiqu [email protected]

@kaleemsiddiqu kaleemsiddiqu added the enhancement New feature or request label Nov 3, 2022
@kaleemsiddiqu kaleemsiddiqu force-pushed the addition-of-owner-lifetime-mrack branch 2 times, most recently from 1e875ef to 4353266 Compare November 3, 2022 17:36
@Tiboris Tiboris changed the title feat(openstack/aws): Add owner/lifetime info in VM's metadata feat(openstack-aws): Add owner/lifetime info in VM's metadata Nov 3, 2022
@Tiboris
Copy link
Member

Tiboris commented Nov 3, 2022

First of all thanks for the PR very much. Let us re-visit changes.

Just a note also a title of PR must comply with commit message check i have changed it a bit.
Fist note if possible could you divide this to commit per provider change?

@Tiboris Tiboris self-requested a review November 3, 2022 17:42
src/mrack/transformers/transformer.py Outdated Show resolved Hide resolved
src/mrack/transformers/transformer.py Outdated Show resolved Hide resolved
src/mrack/transformers/transformer.py Outdated Show resolved Hide resolved
src/mrack/transformers/transformer.py Outdated Show resolved Hide resolved
@kaleemsiddiqu kaleemsiddiqu force-pushed the addition-of-owner-lifetime-mrack branch 2 times, most recently from 500c9bb to 1718a4f Compare November 8, 2022 08:04
@kaleemsiddiqu
Copy link
Contributor Author

First of all thanks for the PR very much. Let us re-visit changes.

Just a note also a title of PR must comply with commit message check i have changed it a bit. Fist note if possible could you divide this to commit per provider change?

Updated code in two commits

@kaleemsiddiqu kaleemsiddiqu force-pushed the addition-of-owner-lifetime-mrack branch from 1718a4f to ae35a3f Compare November 8, 2022 08:58
Copy link
Contributor

@pvoborni pvoborni left a comment

Choose a reason for hiding this comment

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

Comments added, but in general:

  • I'd avoid excessive writes on "info" level. We could be more chatty on debug level, but still on the extend that it is usable for somebody who is investigating an issue.
  • methods should not only what their name says
  • unit tests needs fixing (I didn't look to deep in it, but probably global context is not initialized)
  • you might check with @Tiboris about the gssapi import - it being optional

src/mrack/transformers/transformer.py Outdated Show resolved Hide resolved
src/mrack/transformers/transformer.py Show resolved Hide resolved
src/mrack/transformers/transformer.py Show resolved Hide resolved
src/mrack/transformers/transformer.py Show resolved Hide resolved
src/mrack/providers/aws.py Outdated Show resolved Hide resolved
@Tiboris
Copy link
Member

Tiboris commented Nov 10, 2022

@kaleemsiddiqu could you please also add line (with some comment)

require-owner = true

to the https://github.com/neoave/mrack/blob/main/src/mrack/data/mrack.conf ?

Copy link
Contributor

@pvoborni pvoborni left a comment

Choose a reason for hiding this comment

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

I've tested various scenarios and it works well.

So the only remaining part is the mrack.spec discussion. Otherwise it is good from my PoV.

Doc changes can be done in a separate MR.

@kaleemsiddiqu kaleemsiddiqu self-assigned this Nov 10, 2022
Copy link
Member

@Tiboris Tiboris left a comment

Choose a reason for hiding this comment

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

Please add

Requires:       python3-gssapi

after line https://github.com/neoave/mrack/blob/main/mrack.spec#L46

Owner and lifetime info will be added into VM's metadata
for Openstack provider. This info will give info who
owns the VM and what is the lifetime of the VM which will
be used for notifying owners and cleaning up the resources
based on lifetime of the VMs.
If owner info not fetched, user notified with custom error
message for follow up action to take up.

Signed-off-by: ksiddiqu <[email protected]>
Owner and lifetime info will be added into VM's metadata
for AWS provider. This info will give info who
owns the VM and what is the lifetime of the VM which will
be used for notifying owners and cleaning up the resources
based on lifetime of the VMs.
If owner info not fetched, user notified with custom error
message for follow up action to take up.

Signed-off-by: ksiddiqu <[email protected]>
Integration test test_actions.py failing due to
introduction of new option(require-owner) in mrack.conf
as global_context was not set which is now being
set using a fixture in test_actions.py

Signed-off-by: ksiddiqu <[email protected]>
@kaleemsiddiqu kaleemsiddiqu force-pushed the addition-of-owner-lifetime-mrack branch from 91bde71 to 4f681b5 Compare November 11, 2022 13:26
@Tiboris
Copy link
Member

Tiboris commented Nov 14, 2022

Thanks @kaleemsiddiqu for all the changes you did and updates. I would like to kindly ask you to change the spec file to add:

Recommends:       python3-gssapi

after line https://github.com/neoave/mrack/blob/main/mrack.spec#L46 which will create weak dependency on the package.

With addition to setup.py (https://github.com/neoave/mrack/blob/main/setup.py#L56 ) :

    extras_require={
        "krb-owner": ["gssapi"],
    },

gssapi pkg now required for new added mrack
feature to add owner/lifetime info into the
VM

Signed-off-by: ksiddiqu <[email protected]>
Copy link
Member

@Tiboris Tiboris left a comment

Choose a reason for hiding this comment

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

Thanks for the patch @kaleemsiddiqu fixes and patience lets ship this ! :)

@Tiboris Tiboris merged commit fd4e0db into neoave:main Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants