Story #3693
closedLazy for Pulp3
100%
Description
Motivation¶
Pulp3 users would greatly benefit from the "lazy" feature capabilities that Pulp2 RPM users enjoy. Unfortunately that support was specific to Pulp2 RPM. In Pulp2 we are motivated to introduce this feature and do it in a way that places minimal requirements on plugin writers.
Usage¶
The user can specify to use "lazy" when syncing any given Remote by setting the policy
attribute on the Remote. The default policy
is "immediate", so to use lazy this option must be specified explicitly. Lazy behavior is not the default because not all plugins can support it, but all plugins can support "immediate".
Here are the modes of lazy operation:
policy=immediate -> downloads now while the task runs (no lazy). Also the default if unspecified.
policy=on_demand -> All the steps in the diagram. Content that is downloaded is saved so that it's only ever downloaded once.
policy=streamed -> All the steps in the diagram except step the saving of the Artifact. If squid pushes the bits out of the cache, it will be re-downloaded again to serve to other clients requesting the same bits.
A plugin must specifically add "lazy support", so verify that a plugin supports the lazy feature set.
Plugin Involvement¶
To add "lazy support" to any given Pulp3 plugin, there are a few things a plugin writer must do.
1. Add/Remove RemoteArtifact
as needed to reflect the artifacts in the remote repository.
2. Check the Remote.policy attribute. If 'immediate' do the normal thing. If 'streamed' or 'on_demand' continue to step 3.
3. For each Artifact
object, instead of downloading and saving it locally, save the equivalent RemoteArtifact
instead and associate that with the ContentArtifact
object.
Once supported, plugin writer's will be able to use both streamed
and on_demand
options.
Design¶
See the call sequence diagram below:
^ diagram built by this image builder page using this gist data.
Files
Related issues
Fixes Travis from Lazy changes
https://pulp.plan.io/issues/3693 re #3693