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

bazel: derive exec path of go binaries from action graph #1841

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

mikedanese
Copy link
Contributor

Output paths are not a stable API and all our conditional path
construction here is fragile. This replaces the old path construction
with queries to the action graph.

Part of unblocking: kubernetes/kubernetes#94449

cc @justaugustus @BenTheElder

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 9, 2020
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 9, 2020
@BenTheElder
Copy link
Member

Output paths are not a stable API

That's a bit ridiculous. The bazel output directories are documented. In any sane build system I would expect to be able to obtain built binaries without having to construct some query and parse the output :/

This is another one for kubernetes/kubernetes#88553 @dims @thockin @justaugustus

and all our conditional path construction here is fragile.

I also take issue with this. We're only conditionally checking against one breakage ever when upstream introduced limited cross compilation in 1.14+, which changed the binary names. There's nothing fragile about the existing logic, bazel's output is fragile.

@BenTheElder
Copy link
Member

/lgtm
/approve

I appreciate filing a fix for kubernetes/kubernetes#94449, but I think this highlights why we have near zero adoption of this build outside of CI.

A consumer should be able to predict something like bazel-bin/cmd/kubelet without needing to construct a command and parse json etc.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, mikedanese

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 Sep 9, 2020
@BenTheElder
Copy link
Member

/retest

@mikedanese
Copy link
Contributor Author

That's a bit ridiculous.

Agree, this one had me scratching my head...

@justaugustus
Copy link
Member

I agree that bazel makes me feel ridiculous on a regular basis.
Opened kubernetes/test-infra#19166 to add 1.19 kind tests and drop the tests for 1.16 and 1.15 branches (which are now EOL).

@justaugustus
Copy link
Member

@BenTheElder -- you may want/need to override the pull-kind-conformance-parallel-1-15 job if it continues to fail.

Output paths are not a stable API and all our conditional path
construction here is fragile. This replaces the old path construction
with queries to the action graph.

Part of unblocking: kubernetes/kubernetes#94449
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2020
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 9, 2020
@mikedanese
Copy link
Contributor Author

1.15 is still on bazel 0.23 it looks like and aquery didn't support json output. I modified this to use proto instead of json since it seemed the easiest but if you don't like this, we could all:

  1. munge the info out of textproto
  2. less ideally, stop supporting 1.15... what's the support policy for kind?

@justaugustus
Copy link
Member

I agree that bazel makes me feel ridiculous on a regular basis.
Opened kubernetes/test-infra#19166 to add 1.19 kind tests and drop the tests for 1.16 and 1.15 branches (which are now EOL).

@mikedanese -- Already opened a PR to drop those tests.

@justaugustus
Copy link
Member

what's the support policy for kind?

Probably(/hopefully) the same as Kubernetes, so dev (1.20), 1.19, 1.18, and 1.17.

@mikedanese mikedanese force-pushed the bzl branch 2 times, most recently from 29491d7 to e0ff673 Compare September 9, 2020 22:04
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 9, 2020
@mikedanese
Copy link
Contributor Author

Ok, then I'll drop the last commit and we can skip 1.15.

@BenTheElder
Copy link
Member

BenTheElder commented Sep 9, 2020

KIND currently supports 1.13+ (kubeadm beta versions) but we only need bazel in Kubernetes CI.
EDIT: and versions that are not in CI are best-effort.

I'm fine with dropping bazel-only support from anything Kubernetes isn't running CI for.

@BenTheElder
Copy link
Member

kubernetes/test-infra#19168 disables bazel in that job.
I'm OK bypassing broken CI to merge this though.

@BenTheElder
Copy link
Member

we're also hitting pod pending timeouts on prow w/ running the jobs :/
/test pull-kind-conformance-parallel-1-16
/test pull-kind-e2e-kubernetes
(prow pending timeout)

@mikedanese
Copy link
Contributor Author

For posterity since GH UI lost it, the dropped commit that made this work for 1.15 is here: 29491d7

@k8s-ci-robot
Copy link
Contributor

@mikedanese: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kind-conformance-parallel-1-15 e0ff673 link /test pull-kind-conformance-parallel-1-15
pull-kind-conformance-parallel-1-17 e0ff673 link /test pull-kind-conformance-parallel-1-17

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@BenTheElder
Copy link
Member

bypassing e2e flakes and ensuring this one goes in now.

@BenTheElder BenTheElder merged commit 6514282 into kubernetes-sigs:master Sep 9, 2020
@BenTheElder BenTheElder added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2020
@mikedanese mikedanese deleted the bzl branch September 9, 2020 22:54
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. 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