Skip to content
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

builder 3.0.0 ansible-core gets updated in user-pip requirements are installed - specifically molecule #594

Closed
rfrancis2823 opened this issue Aug 15, 2023 · 2 comments

Comments

@rfrancis2823
Copy link

ansible-builder will seemingly inadvertently update ansible-core when molecule gets installed in the user-pip requirements file:

Dependencies in v3 builder yml config:

  ansible_core:
    package_pip: ansible-core==2.11.11
  ansible_runner:
    package_pip: ansible-runner==2.1.4
  python_interpreter:
    package_system: "python38"
    python_path: "/usr/bin/python3.8"
  galaxy: aee-galaxy-requirements.yml
  python: aee-pip-requirements.txt
  system: aee-system-pkgs.txt

ansible-core version after build completes:

[root@dfe4c34434ba /]# ansible --version
ansible [core 2.11.11]

Step is in builder build stage:

RUN $PYCMD /output/scripts/introspect.py introspect --sanitize --user-pip=requirements.txt --user-bindep=bindep.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt

Introspect has ansible-core in EXCLUDE_REQUIREMENTS, but this leaves open the possibility that ansible-could get updated by getting caught in dependency resolution. Molecule's ansible-compat dependency being an example:

├── molecule [required: >=3.4.0, installed: 3.5.2]
│   ├── ansible-compat [required: >=0.5.0, installed: 3.0.2]
│   │   ├── ansible-core [required: >=2.12, installed: 2.13.11]
│   │   │   ├── cryptography [required: Any, installed: 36.0.1]
│   │   │   │   └── cffi [required: >=1.12, installed: 1.15.0]
│   │   │   │       └── pycparser [required: Any, installed: 2.21]
│   │   │   ├── Jinja2 [required: >=3.0.0, installed: 3.0.3]
│   │   │   │   └── MarkupSafe [required: >=2.0, installed: 2.0.1]
│   │   │   ├── packaging [required: Any, installed: 21.3]
│   │   │   │   └── pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.6]
│   │   │   ├── PyYAML [required: >=5.1, installed: 5.4.1]
│   │   │   └── resolvelib [required: >=0.5.3,<0.9.0, installed: 0.5.4]

├── ansible-compat [required: >=0.5.0, installed: 3.0.2]
│   ├── ansible-core [required: >=2.12, installed: 2.13.11]
│   │   ├── cryptography [required: Any, installed: 36.0.1]
│   │   │   └── cffi [required: >=1.12, installed: 1.15.0]
│   │   │       └── pycparser [required: Any, installed: 2.21]
│   │   ├── Jinja2 [required: >=3.0.0, installed: 3.0.3]
│   │   │   └── MarkupSafe [required: >=2.0, installed: 2.0.1]
│   │   ├── packaging [required: Any, installed: 21.3]
│   │   │   └── pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.6]
│   │   ├── PyYAML [required: >=5.1, installed: 5.4.1]
│   │   └── resolvelib [required: >=0.5.3,<0.9.0, installed: 0.5.4]

EXCLUDE_REQUIREMENTS can be overridden by also putting the ansible-core version you want in your user requirements file, so there is a workaround. However, since there is a seprate key in the dependencies structure for ansible-core and ansible-runner, I don't think introspect should exclude them if they are defined.

Proposing that builder should append the requirements if ansible core and runner package_pip versions are specified in dependencies. Its not intuitive that it would be allowed to change since it was installed at an earlier stage.

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Aug 15, 2023
@sivel
Copy link
Member

sivel commented Mar 26, 2024

We've recently talked about this scenario while specing out #664

We've decided this is not something we plan to address. Exclusions will continue to only apply to top-level deps. If the EE definition or a collection requirements.txt has indirect dependencies, they will need to be excluded, and explicit constraints applied in the EE definition.

We did talk about the potential of using piptools, and building a full dependency tree, but are not prepared to support such a scenario or the complexities of doing so.

@sivel sivel closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2024
@sivel sivel removed the needs_triage New item that needs to be triaged label Mar 26, 2024
@rfrancis2823
Copy link
Author

rfrancis2823 commented Mar 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants