Task #2181
closedCreate basic implementation of base classes of the plugin interface
100%
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
Updated by amacdona@redhat.com about 8 years ago
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.
Updated by semyers about 8 years ago
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.
Updated by bmbouter about 8 years ago
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
Updated by bmbouter about 8 years ago
- 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)
Updated by bmbouter about 8 years ago
Here is what I was thinking for the design. The base objects in pulp.plugins should consider these approaches:
Validation interface
- Platform validation is done on the base object using the validation interface
- Additional validation can be provided on subclassed objects using the validation interface which should call the parent object too
- I recommend doing it similar to the 3 step validation of Django models use. https://docs.djangoproject.com/en/1.10/ref/models/instances/#validating-objects
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
Updated by bmbouter about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to bmbouter
Updated by bmbouter about 8 years ago
- Status changed from ASSIGNED to POST
PR available at: https://github.com/pulp/pulp/pull/2734
Added by bmbouter about 8 years ago
Added by bmbouter about 8 years ago
Revision 06ed427a | View on GitHub
Creates basic pulp.plugin package
This PR adds the following base objects as part of the plugin API.
- Cataloger
- Importer
- Profiler
- Publisher
It also imports the following objects from pulp.platform.models for usage by plugins:
- ProgressBar
- ProgressSpinner
- Repository
- RepositoryContent
It removes several modules from the old pulp.plugins package.
Updated by bmbouter about 8 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|06ed427a6973b6bef80af5cd699f130418f03608.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
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