Task #2181
closed
Create basic implementation of base classes of the plugin interface
Status:
CLOSED - CURRENTRELEASE
Description
This task is to create a PR with a basic object definition of the following 4 object types:
Importer
Distributor
Profiler
Cataloger
This PR should wholesale replace all previous pulp.platform Python modules so that these implementations are the only ones left after it is merged. As such the following Python packages should be deleted all together:
pulp.plugins.conduits
pulp.plugins.migration
pulp.plugins.types
all pulp.plugins.*.py files
These should be left unmodified for now:
pulp.plugins.file
pulp.plugins.loader
pulp.plugins.rsync
pulp.plugins.util
[0]: https://github.com/pulp/pulp/tree/6868481c1a0eeab06d1f18330e7fd7dc533d8007/server/pulp/plugins
I would like to consider adding a new aspect to the plugin API: giving them a space to expose REST endpoints. This would give the plugin writer more freedom to implement the APIs they attempt to mimic. An example of a long term improvement would be that we could merge Crane into the regular pulp_docker plugin.
This should be pretty trivial to do using Django's `include` feature.
amacdona@redhat.com wrote:
I would like to consider adding a new aspect to the plugin API: giving them a space to expose REST endpoints. This would give the plugin writer more freedom to implement the APIs they attempt to mimic. An example of a long term improvement would be that we could merge Crane into the regular pulp_docker plugin.
This should be pretty trivial to do using Django's `include` feature.
I generally like this idea, but with one minor change, which is that the views provided directly by plugins might well be REST endpoints, but could potentially be any django view, and should maybe not be exposed under the '/api/v3/' endpoint.
amacdona@redhat.com wrote:
I would like to consider adding a new aspect to the plugin API: giving them a space to expose REST endpoints. This would give the plugin writer more freedom to implement the APIs they attempt to mimic. An example of a long term improvement would be that we could merge Crane into the regular pulp_docker plugin.
+1 to doing something which could bring Crane into the pulp_docker plugin.
Can the planning for inclusion of REST API endpoints in the plugin API become its own Redmine task. I'm planning to reserve this one for the creation of the pulp.plugin base classes. I'm doing a rewrite to the task contents to have it read as such and I don't want this idea to get lost.
amacdona@redhat.com wrote:
This should be pretty trivial to do using Django's `include` feature.
Agreed
- Subject changed from Plan a redesign the base classes of the plugin interface to Create basic implementation of base classes of the plugin interface
- Description updated (diff)
Here is what I was thinking for the design. The base objects in pulp.plugins should consider these approaches:
Validation interface
Instantiation
- The platform will instantiate the concrete object, e.g. YumImporter which would be a subclass of Importer
- An instantiated object, e.g. YumImporter will have all data from the rest call generically bound to it
- The platform will call the validation interface on the concrete object before calling into it
Call Pattern
- Few or no arguments will be passed along with the call into the concrete object which hands control over to the plugin code
- All data will be bound ahead of time as part of instantiation
- Groomed changed from No to Yes
- Sprint/Milestone set to 26
- Status changed from NEW to ASSIGNED
- Assignee set to bmbouter
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
- Platform Release set to master
- Sprint/Milestone deleted (
26)
- Sprint/Milestone set to 3.0.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Creates basic pulp.plugin package
This PR adds the following base objects as part of the plugin API.
It also imports the following objects from pulp.platform.models for usage by plugins:
It removes several modules from the old pulp.plugins package.
closes #2181 https://pulp.plan.io/issues/2181