On Mon, Jan 18, 2016 at 7:46 PM, Partha Aji <[email protected]> wrote: > > Katello has a need to mirror repositories quickly on a clone operation. To > achieve this katello uses a custom distributor for some yum based repos. > This distributor copies the metadata along with the content instead of > regenerating the metadata from scratch as is the case with a typical pulp > clone operation. The code for this custom distributor is here -> > https://github.com/Katello/pulp-katello-plugins/blob/master/pulp_katello/distributors/yum_clone_distributor/distributor.py > > This works fine for pulp 2.6 but 2.8 has undergone a major revision in > this functionality as far as I can see. I am getting basic errors for lines > like > > https://github.com/Katello/pulp-katello-plugins/blob/master/pulp_katello/distributors/yum_clone_distributor/distributor.py#L21 > > "from pulp.server.managers.repo.distributor import RepoDistributorManager" > > I notice this file has been removed in > https://github.com/pulp/pulp/commit/49ff77364d4f5ecdbe9369ebb8c666591b2aa09d > with other changes. >
Yes, the things pulp called "managers" were really a home-brew DB access layer that we're replacing with a mix of mongoengine for the "model", plus "controllers". The basic operations from managers are covered by mongoengine, and the more advanced operations are now found in pulp.server.controllers. > > Anyway given the change in 2.8 functionality I have the following > questions, > > 1) Do we even this metadata copying custom clone distributor > functionality. Can we set something in pulp to automatically copy the > metadata instead of regenerating from scratch when we clone huge repos (>7K > packages). (this would be ideal really!) > Pulp doesn't do this yet, but I agree it should. It's also a bit late in the release cycle to get that integrated, but let's talk about options. A bit farther in the future, I have an idea for tracking multiple versioned publications all associated with a single repo that has changed over time, which could fit katello's use case. Let's brainstorm on it some time. > 2) If this is something katello needs to add. Is there updated > documentation on writing/converting Distributors > Not really. The basic guidance is that for anything you want to accomplish, try to use a mix of the mongoengine models and the pulp controllers. > 3) Can some one confirm if the main change I 'd need to do is something > along > https://github.com/parthaa/pulp-katello-plugins/commit/6e4a79d61a9704541455216c3d13644bf6f1a8a3 > . (I am sure theres more work to do but just checking if its in the correct > direction) > That looks about right. You can specify the type in the "objects" call. Better yet, you can call "get" to automatically raise an exception if more or less than 1 result is found. Then you can just get rid of the "find_yum_distributor" function and replace it with something like this: dist = model.Distributor.objects.get(repo_id=repo_id, distributor_type_id='yum_distributor') It looks like this is the extent of your database access in this distributor, so I don't think you'll have much else to worry about in terms of compatibility. Michael
_______________________________________________ Pulp-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/pulp-list
