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
Adds lazy download support #132
Conversation
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. This also adjusts the Remote.get_downloader() method signature to take `url` or `remote_artifact` as kwargs instead of `url` as a positional parameter. This allows plugin writers (and the streamer) to get downloaders configured with digest and size validation automatically from remote_artifacts. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. This also adjusts the Remote.get_downloader() method signature to take `url` or `remote_artifact` as kwargs instead of `url` as a positional parameter. This allows plugin writers (and the streamer) to get downloaders configured with digest and size validation automatically from remote_artifacts. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. This also adjusts the Remote.get_downloader() method signature to take `url` or `remote_artifact` as kwargs instead of `url` as a positional parameter. This allows plugin writers (and the streamer) to get downloaders configured with digest and size validation automatically from remote_artifacts. https://pulp.plan.io/issues/3763 closes pulp#3763
| dv = DeclarativeVersion(first_stage, repository, mirror=mirror) | ||
| else: | ||
| dv = DeclarativeVersion(first_stage, repository, mirror=mirror, download_artifacts=False) | ||
| dv.create() |
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.
Suggest:
download_artifacts = (remote.policy == POLICY_MODE.IMMEDIATE)
dv = DeclarativeVersion(first_stage, repository, mirror=mirror, download_artifacts=download_artifacts)
to reduce code duplication.
Let's compare using the constants.POLICY_MODE instead of the string literal.
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.
For me to use POLICY_MODE here I would need to import from pulpcore.constants which a plugin should not do directly. We need this to be in the plugin API somewhere. Maybe we should just import them through pulpcore.plugin.constants?
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.
Actually the Django docs show putting these types of things on the models themselves. After just importing a bunch of things "through" the plugin API, it seems easier just to do that instead. What about that?
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.
Yeah, having the constants on a model would be good.
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.
Ok I'll do that, thanks.
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.
Thanks for the PR @bmbouter.
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. This also adjusts the Remote.get_downloader() method signature to take `url` or `remote_artifact` as kwargs instead of `url` as a positional parameter. This allows plugin writers (and the streamer) to get downloaders configured with digest and size validation automatically from remote_artifacts. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. This also adjusts the Remote.get_downloader() method signature to take `url` or `remote_artifact` as kwargs instead of `url` as a positional parameter. This allows plugin writers (and the streamer) to get downloaders configured with digest and size validation automatically from remote_artifacts. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp#3738 pulp_file now meaningfully uses the 'policy' attribute when syncing content. This is meant to be used with this PR: pulp/pulp#3738 https://pulp.plan.io/issues/4160 closes #4160
Required PR: pulp/pulp_file#132 This includes a serializer that validates input correctly. This also switches the finalize, write_data, and handle_headers callbacks to be coroutines themselves. This is required because within those callbacks the streamer needs to await on coroutines and that can only be done from withing a coroutine itself. This also adjusts the Remote.get_downloader() method signature to take `url` or `remote_artifact` as kwargs instead of `url` as a positional parameter. This allows plugin writers (and the streamer) to get downloaders configured with digest and size validation automatically from remote_artifacts. https://pulp.plan.io/issues/3763 closes pulp#3763
Required PR: pulp/pulp#3738
pulp_file now meaningfully uses the 'policy' attribute when syncing
content.
This is meant to be used with this PR:
pulp/pulp#3738
https://pulp.plan.io/issues/4160
closes #4160