Task #2702
closed
Install Plugins into Pulp 3 development env
Tags:
Dev Environment, Pulp 2
Description
I recently added a task to the 3.0 dev playbook to install pulp_file into the platform virtualenv on install. As seen in the comments on that block, this is a bit of a placeholder just to get pulp_file into platform so that you can do fun things with the platform API.
We need to come up with a mechanism that ansible can easily use for installing plugins for Pulp 3. Maybe this is continuing to rely on each plugin providing a "pulp-dev.py" executable, maybe we require all plugins to be installable with "python setup.py develop"; whatever we go with would ideally be consistent across plugins.
In addition to installing plugins into the platform virtualenv for use together, we should also make sure to install plugins into their own virtualenvs, allowing them to be worked on in isolation from other plugins.
I took a quick stab at adding a similar block to install the pulp_file plugin into its own VM:
diff --git a/ansible/roles/dev/tasks/main.yml b/ansible/roles/dev/tasks/main.yml
index eab0c9b..c2c6a06 100644
--- a/ansible/roles/dev/tasks/main.yml
+++ b/ansible/roles/dev/tasks/main.yml
@@ -153,6 +153,20 @@
- pulp_file
when: "{{ [item] | issubset(pulp_available_plugins) }}"
+# very similar to the previous task, with the same limitations based on the method of
+# development installs for pulp 3 plugins being undefined, except this installs each plugin package
+# in its own virtualenv so it can be worked on in isolation
+- name: Install Plugin packages into Plugin Virtualenvs
+ command: "{{ pulp_venv_dir }}/{{ item }}/bin/python setup.py develop"
+ args:
+ chdir: "{{ pulp_devel_dir }}/{{ item }}"
+ # If we stick with running setup.py develop for all plugins, we'd want to do it for all available
+ # plugins. For now, it only works with pulp_file
+ # with_items: "{{ pulp_available_plugins }}"
+ with_items:
+ - pulp_file
+ when: "{{ [item] | issubset(pulp_available_plugins) }}"
+
- block:
- name: Install crane config
template:
While this did work, the platform code didn't appear to "see" the pulp.plugin entry point provided by pulp_file, so the app didn't get loaded by Django. I expect I'm missing something simple, but at the moment I'm not sure what.
- Status changed from NEW to ASSIGNED
- Assignee set to amacdona@redhat.com
@dkliban and I were talking about the vagrant environment being slimmed down to just include core by default and the developer installs their own plugin on top. We need to make that easy.
I think in terms of plugin installation methods there are three options.
a) python setup.py develop
b) python setup.py install
c) an rpm based installation of the plugin
I think we should never have plugins provide a pulp-dev.py
- Status changed from ASSIGNED to CLOSED - COMPLETE
Some other changes make this task obsolete.
1. Plugins should not be installed into their own virtualenv, they must be installed into the same virtualenv as pulp. This is necessary for plugin discovery by the workers.
2. Recently, I moved the plugin install [0] to its own role, which uses the ansible `pip` module.
The `plugin` role will have to be updated only if we change how plugins are installed. Pulp plugins should be installed using one of the 3 methods in https://pulp.plan.io/issues/2702#note-3 so I am closing the issue.
[0]: https://github.com/pulp/devel/pull/56/files#diff-c674e6be1d4fd8bed7f77bad58146d18R26
- Tags Dev Environment added
Also available in: Atom
PDF