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

Refactor bootstrap-os #10983

Merged
merged 4 commits into from
Mar 27, 2024

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Mar 6, 2024

What type of PR is this?
/kind design
/kind cleanup

What this PR does / why we need it:

Special notes for your reviewer:
I'll submit the ansible upgrade in a separate but first fount is broken on 2.15

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/design Categorizes issue or PR as related to design. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 6, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 6, 2024
@VannTen VannTen force-pushed the design/refactor_boostrap branch 8 times, most recently from be82f54 to ff9539c Compare March 8, 2024 19:49
@VannTen
Copy link
Contributor Author

VannTen commented Mar 12, 2024

actually include_vars still override tasks vars, so this won't help...

I wonder if we could rely more on ansible python autodiscovery since I guess it has improved since the time where ansible_python_interpreter workarounds was added in bootstrap 🤔
@floryut @mzaian @MrFreezeex Opinions ?

@VannTen VannTen marked this pull request as draft March 12, 2024 12:20
@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 Mar 12, 2024
VannTen added 3 commits March 14, 2024 11:24
Coreos was replaced by flatcar in 058438a but the file was copied
instead of moved.
Using directly ID and VARIANT_ID with first_found allow for less manual
includes.
Distro "families" are simply handled by symlinks.
- Allows users to override the chosen python_interpreter with group_vars
  easily (group_vars have lesser precedence than facts)
- Allows us to use vars at the task scope to use a virtual env

Ansible python discovery has improved, so those workarounds should not
be necessary anymore.
Special workaround for Flatcar, due to upstream ansible not willing to
support it.
@VannTen VannTen force-pushed the design/refactor_boostrap branch from 482eb9f to 55f2aca Compare March 15, 2024 09:14
@VannTen VannTen marked this pull request as ready for review March 15, 2024 09:20
@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 Mar 15, 2024
@VannTen
Copy link
Contributor Author

VannTen commented Mar 26, 2024

/cc @MrFreezeex

- &search
files:
- "{{ os_release_dict['ID'] }}-{{ os_release_dict['VARIANT_ID'] }}.yml"
- "{{ os_release_dict['ID'] }}.yml"
Copy link
Member

Choose a reason for hiding this comment

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

It's a bit a nit but I kinda like the fact there was a prefix "bootstrap-" there but I am fine with that if you prefer this.

Copy link
Contributor Author

@VannTen VannTen Mar 27, 2024

Choose a reason for hiding this comment

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

I tend to dislike repeated prefix stuff when there is already a "namespace" (roles/boostrap-os/tasks/bootstrap-*), it tends to make me cringe 😄 . But that's not something really important, I'm fine with either way.

Copy link
Member

@MrFreezeex MrFreezeex Mar 27, 2024

Choose a reason for hiding this comment

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

Hmm well to me that was more something to quickly distinguish the code that loads through this than the rest but as it's only main.yml it's not super important either

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah I see that you mean. In that case I would rather have something like tasks/os/{{ distrib }}. But since we currently only have the distro specific tasks / vars here, I think that's not really needed for now.

Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

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

Thanks for the very nice cleanup :D
/lgtm

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

VannTen commented Mar 27, 2024 via email

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.

Thanks a lot @VannTen and @MrFreezeex for the review

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MrFreezeex, 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 Mar 27, 2024
@k8s-ci-robot k8s-ci-robot merged commit c58497c into kubernetes-sigs:master Mar 27, 2024
60 checks passed
@mzaian mzaian mentioned this pull request Apr 26, 2024
VannTen added a commit to VannTen/kubespray that referenced this pull request Apr 29, 2024
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the
boostrap-os include but didn't adapt the amazon linux tasks to the
actual ID of amazon linux ('amzn')

Re-enable the CI so we can avoid that kind of breakage.
dibi-codes pushed a commit to fino-digital/kubespray that referenced this pull request May 7, 2024
* Remove leftover files for Coreos

Coreos was replaced by flatcar in 058438a but the file was copied
instead of moved.

* Remove workarounds for resolved ansible issues

* boostrap: Use first_found to include per distro

Using directly ID and VARIANT_ID with first_found allow for less manual
includes.
Distro "families" are simply handled by symlinks.

* boostrap: don't set ansible_python_interpreter

- Allows users to override the chosen python_interpreter with group_vars
  easily (group_vars have lesser precedence than facts)
- Allows us to use vars at the task scope to use a virtual env

Ansible python discovery has improved, so those workarounds should not
be necessary anymore.
Special workaround for Flatcar, due to upstream ansible not willing to
support it.
k8s-ci-robot pushed a commit that referenced this pull request May 8, 2024
c58497c (Refactor bootstrap-os (#10983), 2024-03-27) refactored the
boostrap-os include but didn't adapt the amazon linux tasks to the
actual ID of amazon linux ('amzn')

Re-enable the CI so we can avoid that kind of breakage.
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
* Remove leftover files for Coreos

Coreos was replaced by flatcar in 058438a but the file was copied
instead of moved.

* Remove workarounds for resolved ansible issues

* boostrap: Use first_found to include per distro

Using directly ID and VARIANT_ID with first_found allow for less manual
includes.
Distro "families" are simply handled by symlinks.

* boostrap: don't set ansible_python_interpreter

- Allows users to override the chosen python_interpreter with group_vars
  easily (group_vars have lesser precedence than facts)
- Allows us to use vars at the task scope to use a virtual env

Ansible python discovery has improved, so those workarounds should not
be necessary anymore.
Special workaround for Flatcar, due to upstream ansible not willing to
support it.
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the
boostrap-os include but didn't adapt the amazon linux tasks to the
actual ID of amazon linux ('amzn')

Re-enable the CI so we can avoid that kind of breakage.
Rickkwa pushed a commit to Rickkwa/kubespray that referenced this pull request Jun 26, 2024
* Remove leftover files for Coreos

Coreos was replaced by flatcar in 058438a but the file was copied
instead of moved.

* Remove workarounds for resolved ansible issues

* boostrap: Use first_found to include per distro

Using directly ID and VARIANT_ID with first_found allow for less manual
includes.
Distro "families" are simply handled by symlinks.

* boostrap: don't set ansible_python_interpreter

- Allows users to override the chosen python_interpreter with group_vars
  easily (group_vars have lesser precedence than facts)
- Allows us to use vars at the task scope to use a virtual env

Ansible python discovery has improved, so those workarounds should not
be necessary anymore.
Special workaround for Flatcar, due to upstream ansible not willing to
support it.
Rickkwa pushed a commit to Rickkwa/kubespray that referenced this pull request Jun 26, 2024
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the
boostrap-os include but didn't adapt the amazon linux tasks to the
actual ID of amazon linux ('amzn')

Re-enable the CI so we can avoid that kind of breakage.
davidumea pushed a commit to elastisys/kubespray that referenced this pull request Oct 25, 2024
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the
boostrap-os include but didn't adapt the amazon linux tasks to the
actual ID of amazon linux ('amzn')

Re-enable the CI so we can avoid that kind of breakage.
kpoxo6op pushed a commit to kpoxo6op/kubespray that referenced this pull request Dec 27, 2024
c58497c (Refactor bootstrap-os (kubernetes-sigs#10983), 2024-03-27) refactored the
boostrap-os include but didn't adapt the amazon linux tasks to the
actual ID of amazon linux ('amzn')

Re-enable the CI so we can avoid that kind of breakage.
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants