# braindump - CSE repo/version/content/artifact preso ## Intro ## Agenda * Repositories, Content, and Artifacts - Oh My! (Repository, RepositoryVersion, Content, Artifact) * Where Did All Of This Content Come From? (Remote) * I Have Content - Now What? (Publication, Distribution) * How Do We Get To Emerald City? (full-path sync-to-install) * Example: Authenticating to Upstream - where are my certs?!? * Example: Artifact: Is it there yet? * Example: How Can I Find my Content? ## Repositories, Content, and Artifacts - Oh My! ### Repositories and RepositoryVersions * Repositories are sequences of RepositoryVersions * RepositoryVersions are "bags of Content" * Once created, RepositoryVersions are Immutable - you can remove them, but not change them * "What's in my Repository?" is really "What's in the latest_version of my Repository?" ### Content and Artifacts * Content is all the context describing what a particular "bag of bits" is * Example: an RPM is not just a stream of bits. It is the **context** of that "stream of bits" * Name/Epoch/Version/Release/Arch * Changelog * Requires * Provides * etc etc etc * Content lives **in the Pulp database** * Content is described as a "Model", in Django Terms * example: find all RPM model-names using pulpcore-manager * An "Artifact" is the **physical bits** of a given piece of content * Artifacts **live on disk** * an Artifact's address is its SHA256 (example here) * Some Content (e.g., Advisories) do not exist as Artifacts - they only ever exist "in the database" * All Content **can** exist without an Artifact - this is what on_demand sync does * I can know the metadata for a specific RPM, based on the content of repodata/primary.xml * To **i* that RPM, I need its Artifact ### TL;DR * Repositories have RepositoryVersions * RepositoryVersions hold Content * Content lives "in the database" * The deliverable **bits** for a piece of Content, are its Artifact * Artifacts live on disk * The Artifact for a piece of Content may not exist on disk, until someone asks for it! ### Picture! * Repository, RepositoryVersion, Content, ContentArtifact, Artifact graphic (Package) * ## Where does Content come from? * a Remote is a description of some "upstream" location that holds Content * Remotes hold all the info needed to access that "upstream": * url * authentication information (login/pwd, certificates, etc) * proxy-information * When you **synchronize** a Repository, you tell it *to pull Content from a specified Remote and create a RepositoryVersion that holds it* * If you use on_demand - you get Content, but not its Artifacts. ### Picture! * As above, now with Remote, RemoteArtifact ## How do I make the Content in a RepositoryVersion visible to a Client? ### Publication * An RPM repository with no repomd.xml or primary.xml.gz would not be very useful * Repositories have **metadata** that describes the layout/contents of a given RepositoryVersion * Once a repositoryVersion has all its Content, it must be **published** to create this metadata ### Distribution * Building a Repository/Version/Publication takes time to get everything sync'd/uploaded/whatever you're doing * You don't want end-users able to "see" a given RepositoryVersion until it's completely ready * Distributions are the last step in making a Repository's Content available to end-users * A Distribution points-to a specific RepositoryVersion, and maps it to a specified base-path under /pulp/content/ * Typically, it's the Repository's name - but it doesn't have to be * A Distribution that points at a Repository is really pointing at Repository.latest_version ### Picture! * As above, now with Publication, Distribution ## From start to "dnf install" * Example: repository - remote - sync - publish - distribution - curl /pulp/content/foo/Packages/k/kangaroo... * Do a "tree" of /artifact/ post-on-demand ## Example: Finding Authentication Information * It's in the database * The REST API won't let you look at it * You can use pulpcore-manager * EXAMPLE HERE ## Example: How Do I Find a Content's Artifact? ## Example: How Do I Find the Repositories Holding Content X? ## Tools! * How did we make these pretty pictures? * How can I massage the data pulp-cli returns? * How can I just poke at Pulp's REST API directly?