Story #3693
Updated by bmbouter over 6 years ago
h2. 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 placel minimal requirements on plugin writers. h2. Usage The user can specify to use "lazy" when syncing any given Remote by setting the <code>policy=on-demand</code> attribute on the Remote. The default <code>policy</code> is "immediate", so using lazy must be specified explicitly. The <code>policy=on-demand</code> is not the default because not all plugins can support "on-demand" but all plugins can support "immediate". A plugin must specifically add "lazy support", so verify that a plugin supports the <code>policy=on-demand</code> argument. h2. Plugin Involvement To add "lazy support" to any given Pulp3 plugin, there are a few things a plugin writer must do. 1. Check the Remote.policy attribute. If 'immediate' do the normal thing. If 'on-demand' go to step 2. 2. For each <code>Artifact</code> object, instead of downloading and saving it locally, save the equivalent <code>RemoteArtifact</code> instead and associate that with the `ContentUnit` object. h2. Design See the call sequence diagram below: !lazy_diagram_v3.png! !lazy_diagram_v2.png! ^ diagram built by "this image builder page":http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000 using "this gist data":https://gist.github.com/bmbouter/f9e7ed5b03efd5e52cf29ba78f3b25c1.