### Setup Pulp Development Environment Source: https://pulpproject.org/pulpcore/docs/dev/tutorials/quickstart Use oci-env to clone repositories, install the client, configure the environment, build images, and start the Pulp service. Ensure pulpcore is added to DEV_SOURCE_PATH. ```bash # 1. clone required repos to the same basedir git clone https://github.com/pulp/oci_env.git git clone https://github.com/pulp/pulpcore.git git clone https://github.com/pulp/pulp-openapi-generator.git # required for 'generate-client' below # 1.1 add more repos as necessary to the same basedir git clone https://github.com/pulp/pulp_rpm.git # 2. install oci-env client cd oci_env pip3 install -e client # 3. use minimal compose.env # At least add pulpcore to DEV_SOURCE_PATH like this: DEV_SOURCE_PATH=pulpcore cp compose.env.example compose.env # 4. build the images and start the service oci-env compose build oci-env compose up # 5. do basic setup oci-env generate-client -i oci-env generate-client -i pulp_file ``` -------------------------------- ### Create and Sync Quickstart Repository Source: https://pulpproject.org/pulp_deb/docs/user/guides/sync This example demonstrates the basic steps to create a remote, a repository, sync content, create a publication, and a distribution for APT content. ```bash NAME='quickstart-nginx-bookworm-amd64' REMOTE_OPTIONS=( --url=http://nginx.org/packages/debian/ --distribution=bookworm --component=nginx --architecture=amd64 ) pulp deb remote create --name=${NAME} ${REMOTE_OPTIONS[@]} pulp deb repository create --name=${NAME} --remote=${NAME} pulp deb repository sync --name=${NAME} pulp deb publication create --repository=${NAME} pulp deb distribution create --name=${NAME} --base-path=${NAME} --repository=${NAME} ``` -------------------------------- ### Quickstart: Upload a Debian Package using Pulp CLI Source: https://pulpproject.org/pulp_deb/docs/user/guides/upload This example demonstrates the basic steps to create a repository, download a package, upload it, and publish it using the Pulp CLI. ```bash NAME='quickstart-upload-vim-amd64' pulp deb repository create --name=${NAME} wget ftp.de.debian.org/debian/pool/main/v/vim/vim_9.0.1378-2_amd64.deb pulp deb content upload --repository=${NAME} --file=vim_9.0.1378-2_amd64.deb pulp deb publication create --repository=${NAME} pulp deb distribution create --name=${NAME} --base-path=${NAME} --repository=${NAME} ``` ```shell deb http:///pulp/content/quickstart-uploaded-vim-amd64/ pulp upload ``` -------------------------------- ### Install and Run with docker-compose Source: https://pulpproject.org/pulp-oci-images/docs/admin/tutorials/quickstart This sequence installs docker-compose, clones the Pulp OCI images repository, and then starts the containers using docker-compose. It also demonstrates how to scale specific services. ```bash pip install docker-compose git clone git@github.com:pulp/pulp-oci-images.git cd images/compose docker-compose up docker-compose scale pulp_api=4 pulp_content=4 ``` -------------------------------- ### Install and Run with podman-compose Source: https://pulpproject.org/pulp-oci-images/docs/admin/tutorials/quickstart This sequence installs podman-compose, clones the Pulp OCI images repository, and then starts the containers using podman-compose. This is suitable for local development and testing. ```bash pip install podman-compose git clone git@github.com:pulp/pulp-oci-images.git cd images/compose podman-compose up ``` -------------------------------- ### Install and Run Pulp Smash Source: https://pulpproject.org/blog/2016/07/01/pulp-smash-introduction Install the pulp-smash library using pip and then run it from the command line. Follow the on-screen instructions for further setup. ```bash pip install pulp-smash python -m pulp_smash  # follow the instructions ``` -------------------------------- ### Provision Vagrant Environment Source: https://pulpproject.org/blog/2016/07/05/getting-started-on-pulp-and-pulp-smash-8211-a-pulpqe-intern-summary Copies the example Vagrantfile, starts the Vagrant VM, and reloads it to apply provisioning. The reload command reboots the machine to finalize updates. ```bash $ cd pulp $ cp Vagrantfile.example Vagrantfile $ vagrant up $ vagrant reload ``` -------------------------------- ### Install Prerequisites Source: https://pulpproject.org/pulp-cli/docs/dev/guides/bootstrap Installs necessary Python packages for plugin development. ```bash pip install cookiecutter click pyyaml tomlkit ``` -------------------------------- ### Install and Run Pulp UI Frontend Source: https://pulpproject.org/pulp-ui Installs frontend dependencies using npm and starts the development server. The UI will be accessible at http://localhost:8002/. ```bash npm install npm run start ``` -------------------------------- ### Create and Sync Example Repository Source: https://pulpproject.org/pulp_deb/docs/user/guides/advanced_copy Sets up a source repository with test content from a remote URL. This is the initial step before copying packages. ```bash NAME='advanced-copy-example' REMOTE_OPTIONS=( --url=https://fixtures.pulpproject.org/debian/ --distribution=ragnarok --distribution=ginnungagap --architecture=ppc64 --architecture=armeb --policy=on_demand ) pulp deb remote create --name=${NAME} ${REMOTE_OPTIONS[@]} pulp deb repository create --name=${NAME}-src --remote=${NAME} pulp deb repository sync --name=${NAME}-src ``` -------------------------------- ### Create Plugin Overview Files Source: https://pulpproject.org/pulp-docs/docs/dev/guides/create-plugin-overviews Use the `touch` command to create the `index.md` files for the User Manual and Developer Manual overviews. ```bash # "User Manual" Overview touch docs/index.md # "Dev Manual" Overview touch docs/dev/index.md ``` -------------------------------- ### Setup Pulp Repository Source: https://pulpproject.org/pulp_rpm/docs/user/guides/modify Run this setup to create sample repositories and a remote for experimenting with modification operations. ```bash pulp rpm repository create --name modify_test_repo pulp rpm repository create --name fixture_repo pulp rpm remote create --name fixture_remote --url https://fixtures.pulpproject.org/rpm-unsigned/ pulp rpm repository sync --repository fixture_repo --remote fixture_remote ``` -------------------------------- ### Getting Content with a Specific QuerySet Source: https://pulpproject.org/pulpcore/docs/dev/reference/code-api/platform-api/app/models Retrieves content for a repository version, optionally restricting the results to a provided `content_qs`. This example shows how to get a queryset of `File` objects. ```python >>> repository_version = ... >>> >>> # Return a queryset of File objects in the repository >>> repository_version.get_content(content_qs=File.objects)) ``` -------------------------------- ### Set up 'isofile' repository Source: https://pulpproject.org/pulpcore/docs/admin/guides/import-export-repos Creates a file repository named 'isofile', adds a remote to it, and syncs content. This prepares another repository with data for export. ```bash # create the repository ISOFILE_HREF=$(http POST :/pulp/api/v3/repositories/file/file/ name=isofile | jq -r '.pulp_href') # add remote http POST :/pulp/api/v3/remotes/file/file/ name=isofile url=https://fixtures.pulpproject.org/file/PULP_MANIFEST # find remote's href REMOTE_HREF=$(http :/pulp/api/v3/remotes/file/file/ | jq -r ".results[] | select(.name == \"isofile\") | .pulp_href") # sync the repository to give us some content http POST :$ISOFILE_HREF'sync/' remote=$REMOTE_HREF ``` -------------------------------- ### Serve local documentation preview Source: https://pulpproject.org/pulpcore/docs/dev/tutorials/quickstart-docs Starts a local web server to preview documentation changes made with `pulp-docs`. ```bash pulp-docs serve ``` -------------------------------- ### GET Request to List OSTree Refs Source: https://pulpproject.org/pulp_ostree/restapi Example of a GET request to list OSTree refs. Supports various query parameters for filtering and sorting. Requires basic or cookie authentication. ```http GET /pulp/api/v3/content/ostree/refs/ ``` ```http http://localhost:24817/pulp/api/v3/content/ostree/refs/ ``` -------------------------------- ### Setup and Sync Repository Source: https://pulpproject.org/pulp_rpm/docs/user/guides/prune Before pruning, set up a remote, create a repository, and sync it. This ensures you have content to prune. ```bash pulp rpm remote create --name zoo --policy on_demand --url https://fixtures.pulpproject.org/rpm-signed/ ``` ```bash pulp rpm repository create --name zoo --remote zoo ``` ```bash pulp rpm repository sync --name zoo ``` -------------------------------- ### Get Approximate Database Size Source: https://pulpproject.org/pulp-operator/docs/admin/guides/upgrade/postgres-upgrade Use this command to estimate the current size of the PostgreSQL database before starting the upgrade process. ```bash kubectl -n $PULP_NAMESPACE exec ${PULP_CR}-database-0 -- psql -U pulp -c "SELECT pg_size_pretty(pg_database_size('pulp'));" ``` -------------------------------- ### Add Custom Detail Route Source: https://pulpproject.org/pulpcore/docs/dev/learn/subclassing/viewsets Add custom endpoints to a Viewset using the @decorators.detail_route decorator. This example adds a 'hello' GET endpoint. ```python class PackageViewSet(ContentViewSet): endpoint_name = 'packages' @decorators.detail_route(methods=('get',)) def hello(self, request): return Response("Hey!") ``` -------------------------------- ### Re-sync and Re-publish Quickstart Repository Source: https://pulpproject.org/pulp_deb/docs/user/guides/sync Use this to re-synchronize an existing repository and create a new publication. The distribution is automatically updated if it was initially created with the --repository flag. ```bash pulp deb repository sync --name=${NAME} pulp deb publication create --repository=${NAME} ``` -------------------------------- ### Create Repository and Set Labels Source: https://pulpproject.org/pulpcore/docs/user/guides/manage-labels Use these commands to create a new repository and then assign key/value labels to it. The `show` command verifies the labels. ```bash # create a new repository pulp file repository create --name myrepo # set some labels pulp file repository label set --name myrepo --key environment --value production pulp file repository label set --name myrepo --key reviewed --value true # call show to view the repo's labels pulp file repository show --name myrepo ``` -------------------------------- ### Setup and Run Linting Tools Source: https://pulpproject.org/pulp-cli/docs/dev/guides/contributing Install necessary linting tools and run formatting and static analysis checks. These commands should be run before committing code. ```bash pip install -r lint_requirements.txt # setup, needed only once ``` ```bash make format # reformatting with ruff ``` ```bash make lint # checking with shellcheck, ruff and mypy ``` ```bash make format lint # both in one command ``` -------------------------------- ### Download Pulp Docker Setup Script Source: https://pulpproject.org/blog/2015/05/21/use-docker-to-try-pulp Download the start.sh script to set up a Pulp Docker environment. This script is used to configure and run the Pulp deployment. ```bash $ wget https://raw.githubusercontent.com/pulp/packaging/docker/dockerfiles/centos/start.sh $ sudo source start.sh /path/to/lots/of/storage/ ``` -------------------------------- ### Test Pulp CLI Plugin Commands Source: https://pulpproject.org/pulp-cli/docs/dev/guides/bootstrap Execute your custom plugin commands from the command line after installation. This example demonstrates how to invoke a command with a required option. ```bash pulp my-plugin my-resource my-command --data "example" ``` -------------------------------- ### Test Pulp Status API Source: https://pulpproject.org/blog/2018/09/07/installing-pulp3-on-openshift Example URL to test the Pulp installation by accessing its status API. Replace 'example.com:24817' with your actual Pulp service endpoint. ```http http example.com:24817/pulp/api/v3/status/ ``` -------------------------------- ### Set up 'zoo' repository Source: https://pulpproject.org/pulpcore/docs/admin/guides/import-export-repos Creates a repository named 'zoo', adds a remote to it, and syncs content from the remote. This prepares a repository with data for export. ```bash # Create the repository export ZOO_HREF=$(http POST :/pulp/api/v3/repositories/rpm/rpm/ name=zoo | jq -r '.pulp_href') # add a remote http POST :/pulp/api/v3/remotes/rpm/rpm/ name=zoo url=https://fixtures.pulpproject.org/rpm-signed/ policy='immediate' # find remote's href export REMOTE_HREF=$(http :/pulp/api/v3/remotes/rpm/rpm/ | jq -r ".results[] | select(.name == \"zoo\") | .pulp_href") # sync the repository to give us some content http POST :$ZOO_HREF'sync/' remote=$REMOTE_HREF ``` -------------------------------- ### Example Repository Version and Content Source: https://pulpproject.org/pulp_rpm/docs/user/guides/modify These are example outputs showing the latest repository version href and a list of content location hrefs within a repository. ```text "/pulp/api/v3/repositories/rpm/rpm/018ea4da-702b-7b20-b427-393efe196193/versions/3/" ``` ```text "zebra-0.1-2.noarch.rpm" ``` ```text "wolf-9.4-2.noarch.rpm" ``` ```text "whale-0.2-1.noarch.rpm" ``` ```text "walrus-5.21-1.noarch.rpm" ``` ```text "walrus-0.71-1.noarch.rpm" ``` -------------------------------- ### Configure Pulp Container with Environment Variables Source: https://pulpproject.org/pulp-oci-images/docs/admin/reference/available-images/multi-process-images Modify the container start command to include environment variables for configuration. Examples include setting worker counts and timeouts. ```bash podman run -e PULP_WORKERS=4 -e PULP_GUNICORN_TIMEOUT=30 -e PULP_API_WORKERS_MAX_REQUESTS=1000 -e PULP_API_WORKERS_MAX_REQUESTS_JITTER=50 ... ``` -------------------------------- ### Set Up Queryset and Content Mapping Source: https://pulpproject.org/pulpcore/docs/dev/learn/subclassing/import-export Implement `set_up_queryset` to define the content associated with the main repository and any sub-repositories. This method populates the `content_mapping` dictionary, ensuring correct association during import/export. ```python def set_up_queryset(self): """Set up the queryset and our content_mapping.""" content = MyContent.objects.filter(pk__in=self.repo_version.content) self.content_mapping[self.repository_version.repository.name] = content for repo in self.subrepos(self.repo_version): subrepo_content = repo.latest_repository_version.content self.content_mapping[repo.name] = subrepo_content content |= subrepo_content return content class Meta: model = MyContent ``` -------------------------------- ### OSTree Remote Response Sample Source: https://pulpproject.org/pulp_ostree/restapi Example JSON response for a GET request to an OSTree remote endpoint. Includes fields for count, pagination, and detailed remote repository information. ```json { "count": 123, "next": "http://api.example.org/accounts/?offset=400&limit=100", "previous": "http://api.example.org/accounts/?offset=200&limit=100", "results": [ { "pulp_href": "http://example.com", "prn": "string", "pulp_created": "2019-08-24T14:15:22Z", "pulp_last_updated": "2019-08-24T14:15:22Z", "name": "string", "url": "string", "ca_cert": "string", "client_cert": "string", "tls_validation": true, "proxy_url": "string", "pulp_labels": { "property1": "string", "property2": "string" }, "download_concurrency": 0, "max_retries": 0, "policy": "immediate", "total_timeout": 0, "connect_timeout": 0, "sock_connect_timeout": 0, "sock_read_timeout": 0, "headers": [ { } ], "rate_limit": 0, "hidden_fields": [ { "name": "string", "is_set": true } ], "depth": 0, "include_refs": [ "string" ], "exclude_refs": [ "string" ] } ] } ``` -------------------------------- ### Register Plugin via setup.py Entry Points Source: https://pulpproject.org/pulpcore/docs/dev/learn/other/how-plugins-work Register your plugin's app config in setup.py using the 'pulpcore.plugin' entry point. ```python entry_points={ 'pulpcore.plugin': [ 'pulp_myplugin = pulp_myplugin:default_app_config', ] } ``` -------------------------------- ### Start Pulp CLI Interactive Shell Mode Source: https://pulpproject.org/pulp-cli/docs/user/guides/advanced_features Launch the interactive shell by running 'pulp shell'. You need to install the 'shell' extra requirements first. Use 'help' for a list of commands. ```bash pulp shell ``` -------------------------------- ### Create Domain with FileSystem Storage Source: https://pulpproject.org/pulpcore/docs/user/guides/create-domains Example of creating a domain using the FileSystem storage backend. Ensure the MEDIA_ROOT path is correctly configured. ```bash pulp domain create \ --name foo \ --description foo \ --storage-class pulpcore.app.models.storage.FileSystem \ --storage-settings "{\"MEDIA_ROOT\": \"/var/lib/pulp/media/\"}" ``` -------------------------------- ### Repository Version GET Response Source: https://pulpproject.org/pulp_container/docs/user/tutorials/sync-and-host Example JSON response detailing the content summary of a specific repository version, including added, present, and removed content counts for blobs, manifests, and tags. ```json { "pulp_created": "2019-09-05T14:29:45.563089Z", "pulp_href": "/pulp/api/v3/repositories/container/container/ffcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/", "base_version": null, "content_summary": { "added": { "container.blob": { "count": 31, "href": "/pulp/api/v3/content/container/blobs/?repository_version_added=/pulp/api/v3/repositories/container/container/fcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/" }, "container.manifest": { "count": 21, "href": "/pulp/api/v3/content/container/manifests/?repository_version_added=/pulp/api/v3/repositories/container/container/fcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/" }, "container.tag": { "count": 8, "href": "/pulp/api/v3/content/container/tags/?repository_version_added=/pulp/api/v3/repositories/container/container/fcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/" } }, "present": { "container.blob": { "count": 31, "href": "/pulp/api/v3/content/container/blobs/?repository_version=/pulp/api/v3/repositories/container/container/fcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/" }, "container.manifest": { "count": 21, "href": "/pulp/api/v3/content/container/manifests/?repository_version=/pulp/api/v3/repositories/container/container/fcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/" }, "container.tag": { "count": 8, "href": "/pulp/api/v3/content/container/tags/?repository_version=/pulp/api/v3/repositories/container/container/fcf03266-f0e4-4497-8434-0fe9d94c8053/versions/1/" } }, "removed": {} }, "number": 1 } ``` -------------------------------- ### Registering a Pulp CLI Plugin (setup.py) Source: https://pulpproject.org/pulp-cli/docs/dev/learn/architecture Alternatively, register a plugin using the entry_points argument in setup.py. ```python entry_points={ "pulp_cli.plugins": [ "myplugin=pulpcore.cli.myplugin", ], } ``` -------------------------------- ### Response Sample (200 OK - Repository Versions List) Source: https://pulpproject.org/pulpcore/restapi Example of a successful JSON response for listing repository versions, including pagination and results. ```json { "count": 123, "next": "http://api.example.org/accounts/?offset=400&limit=100", "previous": "http://api.example.org/accounts/?offset=200&limit=100", "results": [ { "pulp_href": "http://example.com", "prn": "string", "pulp_created": "2019-08-24T14:15:22Z", "pulp_last_updated": "2019-08-24T14:15:22Z", "number": 0, "repository": "http://example.com", "base_version": "http://example.com", "content_summary": { "added": { "property1": { }, "property2": { } }, "removed": { "property1": { }, "property2": { } }, "present": { "property1": { }, "property2": { } } }, "vuln_report": "string" } ] } ``` -------------------------------- ### Customized Containerfile for Single-Process Pulp-Minimal Image Source: https://pulpproject.org/pulp-oci-images/docs/admin/guides/build-your-own-pulp-image This Containerfile example shows how to customize the single-process `pulp-minimal` image. It includes steps for installing core Pulp components, custom plugins, and additional requirements. ```dockerfile ARG FROM_TAG="latest" # The single-process pulp-minimal image must inherit from pulp/base # The tags follow pulpcore-versioning 3.Y(.Z), we recommend using "latest" FROM pulp/base:${FROM_TAG} COPY images/assets/requirements.extra.txt /requirements.extra.txt COPY images/assets/requirements.minimal.txt /requirements.minimal.txt # Here you customize the plugins and their versions that you want to install RUN pip install --upgrade \ pulpcore[s3,google,azure] \ pulp-custom-plugin \ -r /requirements.extra.txt \ -r /requirements.minimal.txt \ -c /constraints.txt && \ rm -rf /root/.cache/pip # Prevent pip-installed /usr/local/bin/pulp-content from getting run instead of # our /usr/bin/pulp-content script. RUN rm -f /usr/local/bin/pulp-content # collectstatic makes the api browsable in a web browser USER pulp:pulp RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link USER root:root # Correct the permissions needed for Pulp folders RUN chmod 2775 /var/lib/pulp/{scripts,media,tmp,assets} RUN chown :root /var/lib/pulp/{scripts,media,tmp,assets} ``` -------------------------------- ### Langpacks Example Snippet for RPM Repositories Source: https://pulpproject.org/blog/2016/05/05/langpacks-support-added-to-pulp-290 This snippet demonstrates the format of langpacks metadata entries within a comps.xml file. It shows how to associate package names with their corresponding langpack install commands. ```xml ``` -------------------------------- ### Setup Pulp Backend Directory Source: https://pulpproject.org/pulp-ui Creates necessary directories for Pulp backend configuration and storage. ```bash mkdir -p ~/pulp-backend-oci/{settings/certs,pulp_storage,pgsql,containers} cd ~/pulp-backend-oci/ echo " CONTENT_ORIGIN='http://$(hostname):8080' ANSIBLE_API_HOSTNAME='http://$(hostname):8080' ANSIBLE_CONTENT_HOSTNAME='http://$(hostname):8080/pulp/content' " >> settings/settings.py ``` -------------------------------- ### Install Pulp CLI with uv (TL;DR) Source: https://pulpproject.org/pulp-cli/docs/user/guides/installation Quick installation of pulp-cli with pygments for colorized output using uv. ```bash uv tool install pulp-cli[pygments] pulp config create -e # insert your server configuration here pulp status ``` -------------------------------- ### Example Python Docstring Source: https://pulpproject.org/pulpcore/docs/dev/reference/code-style-guide This docstring follows Google's Python Style Guide conventions and is parsable by Sphinx's Napoleon plugin. It includes a summary line, detailed explanation, arguments, and return values. ```python def example_function(): """ The first section is a summary, which should be restricted to a single line. More detailed information follows the summary after a blank line. This section can be as many lines as necessary. Args: arg1 (str): The argument is visible, and its type is clearly indicated. much_longer_argument (str): Types and descriptions are not aligned. Returns: bool: The return value and type is very clearly visible. """ ``` -------------------------------- ### Pulp Repository and Distribution Setup Source: https://pulpproject.org/pulp_certguard/docs/user/tutorials/yum-howto Configures a Pulp repository, remote, syncs content, creates a publication, and sets up a distribution. It includes steps for creating a repository, a remote for content, syncing the repository, creating a publication, and finally, a distribution. Task progress should be monitored via the Pulp API. ```bash # create repo http POST http://localhost:24817/pulp/api/v3/repositories/ name=boomi-epel # Lookup the thing we just made export REPO_HREF=$(http http://localhost:24817/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "boomi-epel") | .pulp_href') # create new remote http POST http://localhost:24817/pulp/api/v3/remotes/rpm/rpm/ name='boomi-epel-remote' url='file:///usr/local/lib/pulp/staging/epel/' policy='immediate' export REMOTE_HREF=$(http :24817/pulp/api/v3/remotes/rpm/rpm/ | jq -r '.results[] | select(.name == "boomi-epel-remote") | .pulp_href') # Sync the repo http POST http:/localhost:24817${REMOTE_HREF}sync/ repository=$REPO_HREF # { # "task": "/pulp/api/v3/tasks/abb42ba7-77f9-49c4-af05-3af407ab8596/" # } # Inspect the new thingy.... http GET http://localhost:24817${REPO_HREF}versions/1/ # Create a publication http POST http://localhost:24817/pulp/api/v3/publications/rpm/rpm/ repository=$REPO_HREF # get repo-version (display/informational) export PUBLICATION_HREF=$(http :24817/pulp/api/v3/publications/rpm/rpm/ | jq -r '.results[] | select(.repository_version|test("'"$REPO_HREF"'.")) | .pulp_href') http POST http://localhost:24817/pulp/api/v3/distributions/rpm/rpm/ name='boomi-epel-distro' base_path='boomi-epel' publication=$PUBLICATION_HREF #Follow the task progress here: http GET http://localhost:24817/pulp/api/v3/tasks/ http GET http://localhost:24817/pulp/api/v3/tasks/uuid-of-single-task-for-reasonable-responses # THe CONTENT_HOST setting is super important for this. Set it to something valid. # View all the published stats http GET http://localhost:24817/pulp/api/v3/distributions/rpm/rpm/ # Get the repo metadata from the published end point on the yum side http GET http://localhost:24816/pulp/content/boomi-epel-2/repodata/repomd.xml ``` -------------------------------- ### Register Custom Handler with Content App Source: https://pulpproject.org/pulpcore/docs/dev/reference/code-api/plugins-api/content-app Register your custom Handler with Pulp's Content App by adding a route to the aiohttp application. This example shows how to associate a GET request to a specific URL pattern with your Handler's stream_content method. ```python from pulpcore.content import app app.add_routes([web.get(r'/my/custom/{somevar:.+}', MyHandler().stream_content)]) ``` -------------------------------- ### Create and Sync NVIDIA CUDA Flat Repository Source: https://pulpproject.org/pulp_deb/docs/user/guides/sync This example demonstrates the workflow for synchronizing an NVIDIA CUDA flat APT repository. It includes creating a remote, a repository, syncing the data, and setting up publication and distribution. ```bash NAME='nvidia-cuda-flat-amd64' REMOTE_OPTIONS=( --url=http://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/ --distribution=/ --architecture=amd64 ) pulp deb remote create --name=${NAME} ${REMOTE_OPTIONS[@]} pulp deb repository create --name=${NAME} --remote=${NAME} pulp deb repository sync --name=${NAME} pulp deb publication create --repository=${NAME} pulp deb distribution create --name=${NAME} --base-path=${NAME} ``` -------------------------------- ### Install Pulp Installer Collection Source: https://pulpproject.org/blog/2020/08/13/pulp-36-is-generally-available Install or upgrade the pulp_installer collection from Ansible Galaxy. Use the --force flag to upgrade if a previous version is installed. ```bash ansible-galaxy collection install --force pulp.pulp_installer ``` -------------------------------- ### Build HTML Documentation Source: https://pulpproject.org/pulpcore/docs/dev/learn/other/documentation Navigate to the docs directory and use 'make html' to build the project's HTML documentation. ```bash (pulp) $ cd docs (pulp) $ make html ``` -------------------------------- ### Install pulp-cli-deb Source: https://pulpproject.org/pulp_deb/docs/user/guides/api_tooling Install the pulp-cli-deb package to enable Pulp CLI for pulp_deb. This also installs the core pulp-cli package. ```bash pip install pulp-cli-deb ``` -------------------------------- ### Manually Start a Failed Service Source: https://pulpproject.org/pulp-oci-images/docs/admin/reference/available-images/multi-process-images If a service fails to start, you can attempt to start it manually using the `s6-rc change` command. ```bash s6-rc change servicename ``` -------------------------------- ### Install oci-env Python Client Source: https://pulpproject.org/oci_env/docs/dev/tutorials/quickstart Navigate to the oci_env directory and install the client using pip. Python 3 is required. ```bash cd oci_env # if pip3 isn't available, try pip. Python 3 is required for oci-env. pip3 install -e client ``` -------------------------------- ### Create Installer File Index Source: https://pulpproject.org/pulp_deb/api.json Creates a new installer file index. An InstallerFileIndex represents the indices for a set of installer files. ```APIDOC ## POST /pulp/api/v3/content/deb/installer_file_indices/ ### Description An InstallerFileIndex represents the indices for a set of installer files. Associated artifacts: Exactly one 'SHA256SUMS' and/or 'MD5SUMS' file. Each InstallerFileIndes is associated with a single component-architecture combination within a single Release. Note that installer files are currently used exclusively for verbatim publications. The APT publisher (both simple and structured mode) does not make use of installer content. ### Method POST ### Endpoint /pulp/api/v3/content/deb/installer_file_indices/ ### Parameters #### Header Parameters - **X-Task-Diagnostics** (array) - Optional - List of profilers to use on tasks. ### Summary Create an installer file index ```