-
Notifications
You must be signed in to change notification settings - Fork 684
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
Add bindep for package dependencies #10474
Conversation
Helps address #7988 |
I took this a step further by including all the various packages in the documentation in the bindep.txt file. However, we can have multiple dep files, keep the main I can see how someone might not want to install the entire dependency set if they're not going to use it all. |
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 did some test on RHEL 9, F37, and Ubuntu 22.04, and Ubuntu 23.04, and I left some feedback.
I am unsure about how to best handle the Python dependencies as RHEL doesn't have many of the Python deps that Ubuntu and Fedora have.
bindep.txt
Outdated
python-jinja2 [platform:rpm] | ||
ninja-build [platform:rpm] | ||
|
||
# Red Hat Enterprise Linux 8 and Fedora dependencies, primarily for supporting Python 3 |
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.
No match for argument: ansible-lint
No match for argument: bats
No match for argument: ninja-build
No match for argument: python3-PyGithub
No match for argument: python3-mypy
No match for argument: python3-openpyxl
No match for argument: python3-pandas
No match for argument: python3-sphinx
No match for argument: yamllint
These will need [platform: fedora]
or somehow get rid of RHEL as RHEL doesn't have these packages. How that leaves our requirements.txt.
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 took a pass at moving these into a Fedora section.
Could we work around the issue by moving them to a python-based dependency management tool, and forego the system packages that differ between platforms? |
We have a bunch of utility scripts and some of them require package dependences instead of dependencies we can manage with a requirements.txt (or pip). This commit introduces a tool call bindep [0] that helps python projects manage package dependencies. To use it, you can install bindep: $ pip install bindep $ sudo yum install $(bindep -b)
|
||
```bash | ||
apt-get install cmake make libopenscap8 libxml2-utils ninja-build python3-jinja2 python3-yaml python3-setuptools xsltproc |
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 didn't think the ninja-build package was necessary by default (as noted further down in the documentation), so I didn't include it for the Debian-based systems.
Please correct me if I'm wrong though.
Code Climate has analyzed commit 4c1d7af and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 52.4% (0.0% change). View more on Code Climate. |
Python-specific dependencies that aren't packaged by distributions are being handled in #10487 |
A bit late to the party, but I am not so happy with introducing a tool that is not so common to manage dependencies on a project that has relatively simple dependency tree.
As the bindep is not widely known, not packaged, and its syntax is far from self-explanatory, I am not so happy about including this bit of technology in the project. |
Cool, so you're envisioning
I proposed #10487 to implement requirements files for tracking python dependencies that aren't packaged by distributions. Sounds like this is still useful.
Nice, yeah I dug through these, but they installed a bit more than what I needed.
That's fair. I proposed using bindep as the result of a side discussion with @Mab879 about general dependency management.
I didn't see a way to restrict the installed packages to only what I needed short of modifying the playbook directly. |
Just checked,
Yes, the format is simple, and useful for those without access to package managers support. ...
Pinging @marcusburghardt. I am not sure to what position we got though - perhaps we have the minimal set of packages covered by Anyway, I feel that we need to update some documentation, but |
This role was designed in "modular" view. Currently, it is possible to enable/disable some tasks in the Playbook. e.g.:
But there is not a segmentation of packages, which I personally think that would be a cool improvement, not only for packages but maybe also for python modules. And the good news is that this is relatively easy to achieve with some updates in this Ansible role.
|
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
It sounds like the Ansible approach would need an update to add support for installing package dependencies then. For the python packages, are you planning to point Ansible's pip module to the python requirements file? I'm curious because I'd like to understand if we can still manage the python dependencies in a single place. |
I'm indifferent to the tool that installs, or updates, the binary dependencies required to use the project. I proposed bindep since it was created to solve this specific problem, but we could certainly use something else. I think the important part is having an abstraction, be it Anisble, bindep, or something else, in CI that allows us to install the dependencies, while simplifying the installation path for users. Otherwise, I envision it will only be a matter of time before a package name changes, a dependency is removed, etc, and the documentation will be out-of-sync with what the project actually requires. |
So now, we use invocations of the package manager + pip in our tests. We don't even use Ansible, because the list of dependencies is small and doesn't really change. This makes the added value of bindep very low - whoever wants to, may simply copy-paste the basic and pretty stable list of non-Python packages from tests, and install the rest (which is more likely to change) using pip and the convenient interface of the requirements file that provides those dependency management capabilities where it is needed. |
We have a bunch of utility scripts and some of them require package
dependences instead of dependencies we can manage with a
requirements.txt (or pip).
This commit introduces a tool call
bindep
[0] that helps pythonprojects manage package dependencies.
To use it, you can install bindep:
$ pip install bindep
$ sudo yum install $(bindep -b)