You are pointing at a gaping hole in pulp_deb functionality. Currently there really isn’t any good way (not sure if there is any way) for users to create their own Releases and components, and add content (upload packages) to them.
Right now, “components”, “releases”, and “architectures”, can only really be created via sync. Even if that metadata content was created via sync, you cannot (easily) add additional manually uploaded packages to those repo structure elements. The current workaround for publishing manually uploaded packages is to use the option simple=True
during publish, which basically invents an additional release named “default”, with a single component named “all” during publish, and simply adds all packages present in the repo version to that default/all
release-component combination. This is currently the only way to include uploaded packages in a pulp_deb APT publication.
This is very far from ideal. We recently started a discussion with how Katello is currently handling package uploads for both pulp_rpm and pulp_deb (see here) because there are challenges even with the simpler case of pulp_rpm.
Personally I feel like the whole model for content upload across all of Pulp is not very user friendly, since it is essentially up to users to figure out what needs to become an artifact, and what needs to become a content unit, whether those artifacts and content units already exist in Pulp and how to add the final result to a repository. During sync, by comparison, all of that is up to the plugin author and the sync code, as it should be. As a user, I care about adding the file I have (for example some actual .deb
package) to a particular Pulp repository. I should not have to worry about how Pulp turns that file into de-duplicated artifacts and content units. I believe this is true for all plugins, but it becomes really obvious in the case of pulp_deb, where packages are not just “present in the repo version or not present in the repo version”, but should also be associated with a particular release/distribution-component combination. It’s just not reasonable to expect users to understand pulp_deb’s internal plumbing on how those associations are represented in the DB.
Having described the Problem, I am going to pitch a possible solution that I have kicking around my brain (but which has not yet received a lot of discussion): What if there was a upload/
API endpoint, right next to the existing sync/
endpoint on repositories. This endpoint would provide a well defined interface for uploading a deb package to that repository, while also allowing the specification of a ReleaseComponent, that the package should be added to. It is then up to the upload code, to create artifacts and content or else retrieve existing artifacts and content as needed. If the user did not specify a ReleaseComponent, some default fallback ReleaseComponent could be used (perhaps uploaded/all
). That way, uploaded packages would no longer depend on the (simple=True
) publication workaround, and users would no longer need to worry about whether the things they are trying to add to some repo already exist in Pulp or not.
I am of course open to alternative ideas.