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

Use module mode when building/installing #109464

Merged
merged 4 commits into from May 5, 2022

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Apr 13, 2022

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Targeted change to build with module mode enabled to be able to use buildinfo added in go1.18

Which issue(s) this PR fixes:

xref #82531

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Kubernetes binaries are now built in module mode instead of GOPATH mode

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 13, 2022
@liggitt liggitt changed the title Use module mode when building/installing WIP - Use module mode when building/installing Apr 13, 2022
@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 Apr 13, 2022
@liggitt liggitt force-pushed the gomodule-install branch 3 times, most recently from 0f04fa4 to 0ddef73 Compare April 13, 2022 17:08
@k8s-ci-robot k8s-ci-robot added area/conformance Issues or PRs related to kubernetes conformance tests area/test sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 13, 2022
@liggitt
Copy link
Member Author

liggitt commented Apr 13, 2022

cc @thockin for visibility to chipping away at getting builds into the module world

echo "${target}"
elif [[ "${target}" =~ ^vendor/ ]]; then
# Strip vendor/ prefix, since we're building in gomodule mode.
echo "${target#"vendor/"}"
Copy link
Member Author

Choose a reason for hiding this comment

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

this is because we have external callers invoking our build scripts passing in WHAT=vendor/...

I'll track cleaning that up once all supported release branches have moved to module builds, but until then, we should continue accepting those WHAT targets and fix them up internally to keep producing the right binaries

Copy link
Member

Choose a reason for hiding this comment

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

for the most part (or rather all of?) those should be ginkgo, and the move to v2 will give us a clean point to switch to not using vendor seeing as v2 isn't merged yet. #109111

@liggitt liggitt changed the title WIP - Use module mode when building/installing Use module mode when building/installing Apr 15, 2022
@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 15, 2022
@liggitt liggitt added this to the v1.25 milestone Apr 18, 2022
@endocrimes
Copy link
Member

/triage accepted
/priority important-soon

@@ -33,7 +33,7 @@ var k8sBinDir = flag.String("k8s-bin-dir", "", "Directory containing k8s kubelet
var buildTargets = []string{
"cmd/kubelet",
"test/e2e_node/e2e_node.test",
"vendor/github.com/onsi/ginkgo/ginkgo",
"github.com/onsi/ginkgo/ginkgo",
Copy link
Member

Choose a reason for hiding this comment

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

this change is validated in CI and LGTM. (avoiding a real LGTM on first pass to let someone more familiar with the rest of our build system to review other parts. but they make sense to me too, thanks for the note on vendor/ support)

@liggitt liggitt added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 25, 2022
@liggitt
Copy link
Member Author

liggitt commented Apr 25, 2022

/milestone v1.25

holding to make sure this doesn't disrupt GOPATH / go workspace work @thockin is exploring.

building in module mode would enable using buildinfo to get things like the built-in kustomize version from build module info, which sig-cli was looking into last release

@thockin
Copy link
Member

thockin commented Apr 25, 2022

This definitely impacts my branch. That said, this is way smaller, so it probably makes sense to get this in first, if it is ready

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Archive-it in SIG Node CI/Test Board Apr 27, 2022
@liggitt
Copy link
Member Author

liggitt commented May 5, 2022

/retest

@liggitt
Copy link
Member Author

liggitt commented May 5, 2022

Yeah, this is ready. All the changes (dropping vendor qualification, switching builds to module mode and ensuring they are building using local sources) are moving in the right direction, so I think this is a net positive.

/retest
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2022
@liggitt
Copy link
Member Author

liggitt commented May 5, 2022

/assign @thockin @dims

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels May 5, 2022
@liggitt
Copy link
Member Author

liggitt commented May 5, 2022

/retest

1 similar comment
@liggitt
Copy link
Member Author

liggitt commented May 5, 2022

/retest

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

I will rebase my workspaces on this.

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, thockin

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 merged commit 5e9a6a2 into kubernetes:master May 5, 2022
SIG Node CI/Test Board automation moved this from Archive-it to Done May 5, 2022
SIG Node PR Triage automation moved this from Triage to Done May 5, 2022
@liggitt liggitt deleted the gomodule-install branch August 18, 2022 19:51
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. area/conformance Issues or PRs related to kubernetes conformance tests area/test 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

Successfully merging this pull request may close these issues.

None yet

7 participants