Project

Profile

Help

Story #3693

closed

Lazy for Pulp3

Added by bmbouter almost 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
(Total: 0:00 h)
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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:

lazy diagram revised after streamer + content app merged

^ diagram built by this image builder page using this gist data.


Files

lazy_diagram_v4.png (86.3 KB) lazy_diagram_v4.png lazy diagram revised after streamer + content app merged bmbouter, 12/13/2018 10:57 PM

Sub-issues 25 (0 open25 closed)

Python Support - Story #1884: As a user, I can lazily sync python packagesMODIFIEDCodeHeeler

Actions
Story #2507: The streamer needs to try all RemoteArtifact entires related to a ContentArtifactCLOSED - CURRENTRELEASEbmbouter

Actions
Story #3320: Support On_demand and Background downloadersCLOSED - DUPLICATE

Actions
Task #3694: Document how to install and configure squidCLOSED - WONTFIX

Actions
Task #3695: Document how to add lazy to a pluginCLOSED - CURRENTRELEASEbmbouter

Actions
Task #3696: Add the streamer's settings to settings.yaml in the content app areaCLOSED - CURRENTRELEASEjortel@redhat.com

Actions
Task #3697: Have Pulp do a simple redirect (no signing) to squid when the content app needs to serve a RemoteArtifactCLOSED - CURRENTRELEASEjortel@redhat.com

Actions
Task #3698: Make the streamer download using a configured downloader, configured by the correct remote.CLOSED - CURRENTRELEASEbmbouter

Actions
Task #3699: Make the streamer create an Artifact and update ContentArtifact with the foreign keyCLOSED - CURRENTRELEASEbmbouter

Actions
Task #3763: Add "policy" attribute to RemoteCLOSED - CURRENTRELEASEbmbouter

Actions
Task #3776: Bootstrap streamerCLOSED - WONTFIXbmbouter

Actions
Story #3894: As a user, I can use Pulp as a pass-through cacheCLOSED - CURRENTRELEASEdkliban@redhat.com

Actions
File Support - Task #4160: Add lazy sync to pulp_fileCLOSED - CURRENTRELEASEbmbouter

Actions
Story #4181: As a streamer user, I have content protection like in Pulp itselfCLOSED - CURRENTRELEASEbmbouter

Actions
Story #4209: As a plugin writer, I can implement lazy sync for plugins with multiple metadata filesCLOSED - CURRENTRELEASEmdellweg

Actions
RPM Support - Story #4212: As a user, I have lazy syncCLOSED - CURRENTRELEASEdalley

Actions
Story #4218: As a user, I have documentation on the lazy-sync workflowCLOSED - CURRENTRELEASEbmbouter

Actions
Story #4239: merge the content-app & streamerCLOSED - CURRENTRELEASEbmbouter

Actions
Task #4243: Rename 'cache_only' policyCLOSED - CURRENTRELEASEbmbouter

Actions
Issue #4246: Lazy sync does not create additional RemoteArtifact objectsCLOSED - CURRENTRELEASEjortel@redhat.comActions
File Support - Issue #4249: README has example of policy='cache_only' but no info about the streamerCLOSED - WORKSFORMEActions
Story #4273: As a plugin writer, I can import the Content app, subclass it, and register that with the aiohttp app instance which is a singletonCLOSED - CURRENTRELEASEbmbouter

Actions
Issue #4289: Content delivery breaks if remote is deletedCLOSED - CURRENTRELEASEbmbouterActions
Task #4302: Ansible installer for Pulp3 needs to add a systemd unit file for the pulp_content_app serviceCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Test #4362: Ansible installer for Pulp3 needs to add a systemd unit file for the pulp_content_app serviceCLOSED - COMPLETEActions

Related issues

Related to Pulp - Test #4126: Test sync with different download policiesCLOSED - COMPLETEkersomActions
Related to Pulp - Test #4496: Test that one can consume content from Pulp using lazy syncCLOSED - COMPLETEkersomActions

Also available in: Atom PDF