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

Modulemd upload and artifact scan #1403

Closed
wants to merge 1 commit into from

Conversation

pavelpicka
Copy link
Contributor

@pavelpicka pavelpicka commented Jul 11, 2019

Upload modulemd and scan for artifact which are already in pulp.
Upload modulemd-defaults. Both at single point
http --form POST :24817/pulp/api/v3/content/modulemd/upload/ file@./modules.yaml.gz
and its viewsets.
http :24817/pulp/api/v3/content/rpm/modulemd/
http :24817/pulp/api/v3/content/rpm/modulemd-defaults/

Supports yaml or compressed yaml (.gz) and returning created resources.

re: #5072
https://pulp.plan.io/issues/5072

@pep8speaks
Copy link

pep8speaks commented Jul 11, 2019

Hello @pavelpicka! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-09-05 14:58:49 UTC


import gi
gi.require_version('Modulemd', '2.0')
from gi.repository import Modulemd as mmdlib
Copy link
Member

Choose a reason for hiding this comment

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

from gi.repository import Modulemd as mmdlib #noqa

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, thank you

@pavelpicka pavelpicka force-pushed the 5072-upload branch 2 times, most recently from 3a8c090 to 098f086 Compare July 11, 2019 14:21
@@ -165,6 +168,10 @@ class PackageSerializer(SingleArtifactContentSerializer):
rpm_header_end = serializers.IntegerField(
help_text=_("Last byte of the header"),
)
rpm_modular = serializers.BooleanField(
Copy link
Contributor

@dralley dralley Jul 11, 2019

Choose a reason for hiding this comment

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

If possible, it would be nice if this were instead a nullable foreign key pointing to the artifact that it belongs to instead of just a boolean. I'm not sure how that would work with lazy sync though?

Copy link
Contributor

Choose a reason for hiding this comment

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

But, on the other hand, if a user tries to delete a module, we need to know what RPMs to delete, and if they try to delete a modular RPM we need to be able to deny them or delete the related units. That's a hard problem too.


endpoint_name = 'modulemd'
queryset = Modulemd.objects.all()
serializer_class = ModulemdSerializer
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I correct that this endpoint will create multiple modulemd from one modules.yaml file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it will create all modulemds which are listed in modulemd.yaml file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since that's the case, I wonder if it should be called something that makes that more clear?

@pavelpicka pavelpicka changed the title Modulemd upload and artifact scan [WIP] Modulemd upload and artifact scan Jul 12, 2019
@pavelpicka pavelpicka force-pushed the 5072-upload branch 4 times, most recently from 9fd6781 to dcbf06f Compare July 16, 2019 12:59
@pavelpicka pavelpicka changed the title [WIP] Modulemd upload and artifact scan Modulemd upload and artifact scan Jul 23, 2019
@goosemania
Copy link
Member

@pavelpicka , does it work for both compressed and uncompressed modules.yaml files?
I believe we decided to support both: https://etherpad.net/p/modularity_use_cases line 30

@pavelpicka
Copy link
Contributor Author

Updated to support compressed modulemd.yaml and move upload endpoint to .../modulemd/upload

Upload modulemd and scan for artifact which are already in pulp.
Upload modulemd-defaults. Both at single point
`http --form POST :24817/pulp/api/v3/content/modulemd/upload/ file@./modules.yaml.gz`
and its views.

Supports yaml or compressed yaml (.gz) and returning created resources.

re #5072
https://pulp.plan.io/issues/5072
@pavelpicka
Copy link
Contributor Author

closing this PR as refactored to better support with #1468

@pavelpicka pavelpicka closed this Oct 3, 2019
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.

None yet

5 participants