Project

Profile

Help

Task #2868

Updated by jortel@redhat.com over 7 years ago

WORK IN PROGRESS 

 h1. Overview 

 The platform needs to support the composition and inventory of publications.    Each _publication_ is a representation of a repository's content that can be consumed by a specific technology.    An example of a technology is YUM.    A publication is created by a _Publisher_ associated with the repository and is provided by a plugin.    A repository may have multiple publishers.    A publication is composed of two types of files.    The first is a content Artifact.    The second, is _metadata_ created by the publisher when the publication is created.    Once created, a publication may be distributed for consumption in many ways.    The platform will support common online distributing such as HTTP and HTTPS and offline distributing such as creating an ISO. 

 Additional Goals 
 * Clean separation between publishing and how a publication is distributed. 
 * Eliminate the use of symlinks as the primary method of publishing. 
 * Eliminate need for each plugin to provide an Apache .conf file for distributing via http/https. 
 * Prevent orphaned content from being deleted while published. 

 h1. Design 

 h3. Tables 

 The _Publication_ table contains publications and is associated to the Publisher that created it.    A Distributor defines a method for making publications available for consumption.    Attributes currently modeled on _Publisher_ pertaining to distribution such as Auth would be removed to the appropriate _Distributor_. 


 *Publication* 
 * [pk] *id* - The primary key. 
 * [fk] *publisher_id* - The publisher that created the publication.    Constraint ensure it's deleted when the publication is deleted. 
 * *created* - When the publication was created. 
 * *base_path* - The base path for the publication.    This is the root of the path component of URLs. 

 The _PublishedArtifact_ table contains linkage to both content Artifacts and generated metadata files. 


 *PublishedArtifact* 
 * [pk] *id* - The primary key. 
 * [fk] *publication_id* - A publication.    Constraint ensure it's deleted when the publication is deleted. 
 * [fk] *artifact_id* - An (optional) associated content artifact. 
 * *relative_path* - The relative path component within the URL that is also relative to the Publication.base_path. 

 *PublishedMetadata* 
 * [pk] *id* - The primary key. 
 * [fk] *publication_id* - A publication.    Constraint ensure it's deleted when the publication is deleted. 
 * *file* - An (optional) absolute path to a metadata file.    Stored in: /var/lib/pulp/published/metadata/<id>/<name> 
 * *relative_path* - The relative path component within the URL that is also relative to the Publication.base_path. 

 The _Distributor_ tables define how a publication is made available for consumption. 


 *Distributor* 
 * [pk] *id* - The primary key. 
 * [fk] *publisher_id* - A publisher.    Constraint ensure it's deleted when the distributor is deleted. 

 *HttpDistributor*(Distributor) 
 * *username* - The (optional) username used for basic-auth. 
 * *password* - The (optional) username used for basic-auth. 


 *HttpsDistributor*(HttpDistributor) 
 * *ca_certificate* - An (optional) absolute path to a CA certificate. 

 h1. General Flows 

 h2. Create A Repository 

 <pre> 
 1. Create a repository. 
 2. Create a publisher associated with the repository. 
 3. Create desired distributors associated with the publisher such as http and/or https. 
 </pre> 


 h2. Publishing:  

 _"The publisher will compose a publication"_ 

 <pre> 
 1. Publisher creates a publication using the plugin API. 
 2. Publisher adds content artifacts to the publication. 
 3. Publisher generates some metadata files in the working dir. 
 4. Publisher adds the metadata files to the publication using the plugin API.  
 5. Publisher commits (publishes) the publication.    The plugin API ensures this is atomic. 
 </pre> 

 h2. Client makes a GET request for content (or metadata): 

 <pre> 
 1. Request is routed to the content (WSGI) application (just like in pulp2 for RPM). 
 2. Query the PublishedArtifact and PublishedMetadata tables by URL path component to get the artifact. 
 3. Find distributor based on URL protocol.    404 when not found. 
 4. forward the artifact storage path (or metadata path) to: 
    <not stored locally> 
        streamer 
    <stored locally> 
        x-send (or stream using django in dev environments) 
 5. Done. 
 </pre> 

 h1. Apache Configuration 

 The platform will provide an /etc/httpd/conf.d/pulp.conf that configures support for HTTP and HTTPS.    Pubished content would be consumed using URLs with a base of:  

 <pre> 
 /pulp/published/<path> 
 </pre> 

 where _path_ is the <Publication.base_path>/(<PublishedArtifact.relative_path>|<PublishedMetadata.relative_path>) <Publication.base_path>/(<PublishedArtifact.relative_path>, <PublishedMetadata.relative_path>) 

 h1. Exporting 

 The platform would provide a _resource_ for exporting a _Publication_ in different formats such as ISO and static file trees.

Back