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

Fine grained OS packages installation #11131

Merged

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Apr 28, 2024

What type of PR is this?
/kind design

What this PR does / why we need it:
Refactor the installation of OS packages to select them on two dimensions:

  • OS (ansible_distribution, ansible_os_family, etc)
  • groups

This is similar to the structure used by downloads for the download role.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
This is preparatory work for #10701
Best reviewed commit by commits.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/design Categorizes issue or PR as related to design. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 28, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 28, 2024
@VannTen
Copy link
Contributor Author

VannTen commented Apr 28, 2024

/label tide-merge-method/merge

@k8s-ci-robot
Copy link
Contributor

@VannTen: The label(s) /label tide-merge-method/merge cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to this:

/label tide-merge-method/merge

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.

@VannTen
Copy link
Contributor Author

VannTen commented Apr 28, 2024 via email

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges. label Apr 28, 2024
@VannTen VannTen force-pushed the design/modular_pkgs_install branch 2 times, most recently from ddf1e52 to ef1fee6 Compare April 29, 2024 14:00
@VannTen
Copy link
Contributor Author

VannTen commented Apr 29, 2024

If anyone can provide insight on why container-selinux is missing on Amazon Linux, that'd be helpful !
Figured out : #11139

@VannTen VannTen force-pushed the design/modular_pkgs_install branch from ef1fee6 to d8a54f9 Compare April 29, 2024 15:58
@VannTen VannTen marked this pull request as ready for review April 29, 2024 19:12
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 29, 2024
openssl 1.1.1 is EOL since 12 September 2023, so just use the default
version on tumbleweed like we do on other distributions.
Since the structure we're setting in place for installing packages has
some complexity, add a JSON schema to avoid frustrating errors when
modifying the informations (adding/removing packages install).
Adds infrastructure to install OS packages depending not only on OS
(family, versions, etc) but on groups.
All the informations related to a particular package should reside in
the `pkgs` dictionnary, which takes inspiration from the `downloads`
dictionary structure.
Uses the logic introduced in the previous patch to convert all
kubernetes/preinstall/vars/* os specific files to the `pkgs`
dictionary.

Some niceties for devs:
- always validate the `pkgs` variable to catch mistakes in CI.
- ensure that `pkgs` is always sorted. This makes it easier to find the
  packages you're looking for.
The empty dict means that packages will always be installed on the host.
Some packages requirements depends on inventory variables
(`kube_proxy_mode` in that case but it could apply to others).

As the case seems pretty rare, instead of adding complexity to pkgs, we
add an escape hatch to use jinja conditions.
That should be revisited if we find ourselves shoehorning lots of logic
in this later on.
@VannTen VannTen force-pushed the design/modular_pkgs_install branch from d8a54f9 to 088b1b0 Compare April 29, 2024 19:22
@VannTen
Copy link
Contributor Author

VannTen commented Apr 29, 2024

/cc @MrFreezeex @mzaian

Copy link
Contributor

@mzaian mzaian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mzaian, VannTen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2024
@k8s-ci-robot k8s-ci-robot merged commit 97e71da into kubernetes-sigs:master Apr 30, 2024
60 checks passed
@VannTen VannTen mentioned this pull request May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/design Categorizes issue or PR as related to design. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants