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

Installation framework for python packages #11158

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented May 3, 2024

What type of PR is this?
/kind design

What this PR does / why we need it:
Some ansible module requires specific python libraries on the hosts
managed by ansible.
In particular, the kubernetes.core.k8s module (which is a better
alternative than our own custom kubernetes-sigs.kubespray.kube module)
require "kubernetes".
Another potential useful candidate would be python "cryptography", which
would allow us to use the community.crypto collection, advantageously
replacing the ad-hoc stuff we have in roles/etcd.

To allow granular python packages installation (only install where
needed), we reuse the infrastructure introduced in 663fcd1 (Filter
packages installation by OS and by group, 2024-04-05) to also install
python packages in a dedicated kubespray virtualenv.

This is the last preparation PR for #10701 (which I'm gonna update after posting this)

Special notes for your reviewer:

  • This is missing supply-chain security (I plan to use pip-tools to compile fully resolved stack with hashes, see commits)

  • I'm not completely decided on the way to use different ansible modules which requires different python stacks:

    1. All packages in one virtualenv
    2. One virtualenv for each module or module set (kubernetes.core.k8s / community.crypto.* for instances)

2 might be preferrable to avoid dependencies clashs, but I don't know if this is an actual concern in practice ; I'd appreciate opinions on that.

/cc @MrFreezeex @mzaian @floryut @ErikJiang @yankay

Does this PR introduce a user-facing change?:

NONE

Some ansible module requires specific python libraries on the hosts
managed by ansible.
In particular, the kubernetes.core.k8s module (which is a better
alternative than our own custom kubernetes-sigs.kubespray.kube module)
require "kubernetes".
Another potential useful candidate would be python "cryptography", which
would allow us to use the community.crypto collection, advantageously
replacing the ad-hoc stuff we have in roles/etcd.

To allow granular python packages installation (only install where
needed), we reuse the infrastructure introduced in 663fcd1 (Filter
packages installation by OS and by group, 2024-04-05) to also install
python packages in a dedicated kubespray virtualenv.

This implementation is missing a critical part, supply chain
security. This will be addressed soon.
@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 the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 3, 2024
@k8s-ci-robot k8s-ci-robot added kind/design Categorizes issue or PR as related to design. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 3, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: VannTen
Once this PR has been reviewed and has the lgtm label, please assign mzaian for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 3, 2024
@VannTen
Copy link
Contributor Author

VannTen commented May 3, 2024

/label tide/merge-method-merge

@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 May 3, 2024
@VannTen
Copy link
Contributor Author

VannTen commented May 14, 2024

I'm actually contemplating using poetry (only in the dev workflow, mind you) to export a "cross-platform" (poetry cross-platform stuff has some caveats, from what I understand) requirements.txt instead of killing myself over trying to install a specific python version for all supported os targets 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. size/M Denotes a PR that changes 30-99 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

2 participants