New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Design RFC] The ansible-pulp installer needs to handle multiple versions of Pulp #203
Conversation
Proposed design for #5890 https://pulp.plan.io/issues/5890 [noissue]
This enables the installer to apply logic specific to the Pulp branch, before it goes to install it.
| @@ -26,9 +29,12 @@ Role Variables: | |||
| See `prereq_pip_packages` also. | |||
| * `pulp_install_api_service`: Whether to create systemd service files for | |||
| pulpcore-api. Defaults to "true". | |||
| * `pulp_update`: Whether to update/upgrade pulpcore to the latest stable release from PyPI within `pulp_branch`. Only affects systems where Pulp is already installed. To limit this to micro (z-stream) updates, make sure to set `pulp_branch`. If `pulpcore_version` is set, or `pulp_source_dir` is set, this has no effect and is effectively always `true`. Defaults to "false". | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaning towards renaming both this and the plugin's field to "upgrade", because it controls whether or not "--upgrade" is passed to pip. (The ansible "pip" module's "state: latest" vs "state: present" maps to pip's "--upgrade" option.)
|
|
||
| Updating your install: | ||
|
|
||
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is stil the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and pulp_juicy 1.0.3 -> 1.0.4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is stil the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and pulp_juicy 1.0.3 -> 1.0.4) | |
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is still the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and pulp_juicy 1.0.3 -> 1.0.4) |
|
|
||
| Updating your install: | ||
|
|
||
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is stil the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and plugin pulp_juicy 1.0.3 -> 1.0.4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is stil the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and plugin pulp_juicy 1.0.3 -> 1.0.4) | |
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is still the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and plugin pulp_juicy 1.0.3 -> 1.0.4) |
|
|
||
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is stil the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and pulp_juicy 1.0.3 -> 1.0.4) | ||
| 2. Update ansible-pulp | ||
| 3. re-run the ansible-pulp with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. re-run the ansible-pulp with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. | |
| 3. Re-run the ansible-pulp role with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. |
| 2. Check if your plugins are compatible yet with pulpcore 3.1 yet. **Wait** for the plugins to be updated for compatibility if they are not updated yet before you attempt to update. | ||
| 3. If they are updated for compatibility: | ||
| 1. Update ansible-pulp | ||
| 2. re-run the ansible-pulp with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. re-run the ansible-pulp with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. | |
| 2. Re-run the ansible-pulp role with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. |
|
|
||
| 1. Check if `pulp_branch` has changed to a new stable branch in the latest version of the installer. This will happen whenever a new branch of `pulpcore` is released. Let's assume 3.0 is stil the latest, but there are new micro updates (like pulpcore 3.0.3 -> 3.0.4, and plugin pulp_juicy 1.0.3 -> 1.0.4) | ||
| 2. Update ansible-pulp | ||
| 3. re-run the ansible-pulp with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. re-run the ansible-pulp with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. | |
| 3. Re-run the ansible-pulp role with `update` set to `true` under `pulp_install_plugins`, and `pulp_update` set to `true`. |
| 2. Repeat step 2 from the initial install. Let's assume that , but pulp_juicy has gone to a new branch (pulp_juicy 1.0.3 -> 2.0.0) with major new features, while still being compatible with your pulpcore version (3.0). | ||
| 3.`Change pulp_install_plugins.pulp_juicy.branch` to `2.0`. This is its new current & perpetual value. | ||
| 4. set `pulp_install_plugins.pulp_juicy.update` to `true`; it will upgrade it. Set `pulp_update` to true as a precaution for the latest bugfixes that the plugins may depend on. | ||
| 5. Update ansible-pulp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 5. Update ansible-pulp | |
| 5. Update ansible-pulp. |
| 3.`Change pulp_install_plugins.pulp_juicy.branch` to `2.0`. This is its new current & perpetual value. | ||
| 4. set `pulp_install_plugins.pulp_juicy.update` to `true`; it will upgrade it. Set `pulp_update` to true as a precaution for the latest bugfixes that the plugins may depend on. | ||
| 5. Update ansible-pulp | ||
| 6. Run ansible-pulp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 6. Run ansible-pulp | |
| 6. Run ansible-pulp. |
| @@ -26,9 +29,12 @@ Role Variables: | |||
| See `prereq_pip_packages` also. | |||
| * `pulp_install_api_service`: Whether to create systemd service files for | |||
| pulpcore-api. Defaults to "true". | |||
| * `pulp_update`: Whether to update/upgrade pulpcore to the latest stable release from PyPI within `pulp_branch`. Only affects systems where Pulp is already installed. To limit this to micro (z-stream) updates, make sure to set `pulp_branch`. If `pulpcore_version` is set, or `pulp_source_dir` is set, this has no effect and is effectively always `true`. Defaults to "false". | |||
| * `pulp_branch`: The branch of of pulpcore (or update/upgrade to the latest release from, see `pulp_update`). Defaults to the latest stable branch release of pulpcore at the time of ansible-pulp being released, which is currently `3.0`. It is recommended to set this if you ever plan to re-run the ansible installer; when a new branch is released and if you update ansible-pulp, some of your content plugins may not be compatible yet. An example value is `3.1`. Ignored if `pulp_source_dir` or `pulp_version` is set. Do not set this to a version higher than the current default (unless you are installing a development branch of pulpcore, and have updated ansible-pulp 1st.) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * `pulp_branch`: The branch of of pulpcore (or update/upgrade to the latest release from, see `pulp_update`). Defaults to the latest stable branch release of pulpcore at the time of ansible-pulp being released, which is currently `3.0`. It is recommended to set this if you ever plan to re-run the ansible installer; when a new branch is released and if you update ansible-pulp, some of your content plugins may not be compatible yet. An example value is `3.1`. Ignored if `pulp_source_dir` or `pulp_version` is set. Do not set this to a version higher than the current default (unless you are installing a development branch of pulpcore, and have updated ansible-pulp 1st.) | |
| * `pulp_branch`: The branch of pulpcore (or update/upgrade to the latest release from, see `pulp_update`). Defaults to the latest stable branch release of pulpcore at the time of ansible-pulp being released, which is currently `3.0`. It is recommended to set this if you ever plan to re-run the ansible installer; when a new branch is released and if you update ansible-pulp, some of your content plugins may not be compatible yet. An example value is `3.1`. Ignored if `pulp_source_dir` or `pulp_version` is set. Do not set this to a version higher than the current default (unless you are installing a development branch of pulpcore, and have updated ansible-pulp 1st.) |
| @@ -26,9 +29,12 @@ Role Variables: | |||
| See `prereq_pip_packages` also. | |||
| * `pulp_install_api_service`: Whether to create systemd service files for | |||
| pulpcore-api. Defaults to "true". | |||
| * `pulp_update`: Whether to update/upgrade pulpcore to the latest stable release from PyPI within `pulp_branch`. Only affects systems where Pulp is already installed. To limit this to micro (z-stream) updates, make sure to set `pulp_branch`. If `pulpcore_version` is set, or `pulp_source_dir` is set, this has no effect and is effectively always `true`. Defaults to "false". | |||
| * `pulp_branch`: The branch of of pulpcore (or update/upgrade to the latest release from, see `pulp_update`). Defaults to the latest stable branch release of pulpcore at the time of ansible-pulp being released, which is currently `3.0`. It is recommended to set this if you ever plan to re-run the ansible installer; when a new branch is released and if you update ansible-pulp, some of your content plugins may not be compatible yet. An example value is `3.1`. Ignored if `pulp_source_dir` or `pulp_version` is set. Do not set this to a version higher than the current default (unless you are installing a development branch of pulpcore, and have updated ansible-pulp 1st.) | |||
| * `pulp_version`: Optional. A specific version of pulp to install from PyPI. Ignored if `pulp_source_dir` is set. Overrides `pulp_update` to `true`. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if overriding update here is desired. If you specified '3.0' for example update can still guard, whether to install z-stream updates, or keep the current version.
Or do you think, one should specify ~=3.0.0 or >=3.0.0,<3.1 to have the latest bugfix release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review!
I didn't plan to write any code to override it. Rather, I am mostly certain that the override is a limitation of ansible's pip module, which is a wrapper around the pip command. And I'd rather not write & maintain a ton of code to workaround it ("embrace the constraint.")
I assume that calling the ansible pip module with version (which is only documented as accepting values like 3.0.1, not >=3.0.0) maps to it calling pip install pulpcore==3.0.1. With version undefined, I assume it maps it to calling pip install pulpcore.
I know (because I looked at the code that calling the ansible pip module with state=latest maps to pip install --upgrade, whereas state=present maps to pip install.
However the pip command, --upgrade is ignored whenever the exact version is specified. It will upgrade or downgrade regardless. I just tested this to be certain:
(upgrade-test) [mdepaulo@mdepaulo upgrade-test]$ pip install --upgrade pytest==5.3.1
...
Successfully installed pytest-5.3.1
(upgrade-test) [mdepaulo@mdepaulo upgrade-test]$ pip install --upgrade pytest==5.3.2
...
Successfully installed pytest-5.3.2
(upgrade-test) [mdepaulo@mdepaulo upgrade-test]$ pip install --upgrade pytest==5.3.1
...
Successfully installed pytest-5.3.1
(upgrade-test) [mdepaulo@mdepaulo upgrade-test]$ pip install pytest==5.3.2
...
Successfully installed pytest-5.3.2
(upgrade-test) [mdepaulo@mdepaulo upgrade-test]$ pip install pytest==5.3.1
...
Successfully installed pytest-5.3.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is not documented, but i tried to pass a non exact version to it, and it didn't report an error. I guess we still need to verify this also works as expected, but '<3.1' with or without '--upgrade' should be two different things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The examples suggest that it is possible to have complex version specifiers:
https://docs.ansible.com/ansible/latest/modules/pip_module.html#examples
|
FYI: I wanted to test an installation with 3.0.z now, so i started to add the versions in ansible-pulp. |
|
I was thinking about how having the latest installer keep up with the previous versions, and I think we should consider releasing the installer each time we release pulpcore. It seems unavoidable with this thinking. Assume there will be changingrequirements in pulpcore from a packaging perspective at some point, e.g. process names, extra files/services, etc. For an old installer to adequately handle the installer itself will need an update. Thus the safest way to use the installer is to first update it. If we cut releases as pulpcore releases them, then we can avoid a lot of complexity by having the user on a specific version of pulpcore. The upgrade process is: first get the new installer. I think that makes for a simple upgrade experience. What do you think about ^? |
I'm assuming naming conventions stay the same within a Y-stream branch of pulpcore, but improved compatibility (e.g., support for weirdly configured systems) would be on newer releases of ansible-pulp. And we'd have logic per pulpcore Y-stream branch in the installer. But it would be safe for users to obtain the latest version of ansible-pulp.
I am now leaning towards your proposed approach. One big advantage is that we could always switch models later, and it is less work to implement now. We would not be digging a hole for ourselves if we want to go to something like the original model. The implementation / impacts would include:
I'm researching this, testing things out, and thinking through it some more. |
|
FYI: We implemented the approach listed in the comment immediately above. Closing. |
…Workflows Adapted from the prior design PR: pulp#203 fixes: #6874
…Workflows Adapted from the prior design PR: pulp#203 fixes: #6874
…Workflows Adapted from the prior design PR: pulp#203 fixes: #6874
I am requesting feedback from the Pulp user community on this design (variables, docs, and behavior stated/implied by them) of implementing:
[Epic] The ansible-pulp installer needs to handle multiple versions of Pulp
(Extended details are in the subtasks.)
The following are the design decisions:
The following limitations are being worked around:
The following alternatives are being strongly considered:
pip-compileto overcome pip's limitations. Perhaps as a preflight script.