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

Add env var to verify-typecheck for serial execution #108618

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

eddiezane
Copy link
Member

@eddiezane eddiezane commented Mar 9, 2022

What type of PR is this?

/kind flake

What this PR does / why we need it:

This PR makes it possible to set serial execution for verify-typecheck.sh. This is needed bring down the memory usage of the flaking job that is getting oom killed. This is due to Go 1.17 requiring double the amount of memory for this (see golang/go#49035).

Which issue(s) this PR fixes:

Ref #107702

Special notes for your reviewer:

I'm not sure if this is the best way to pass these along.

Another option is to make typecheck support an env var

parallel = flag.Int("parallel", 2, "limits how many platforms can be checked in parallel. 0 means no limit.")
.

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/flake Categorizes issue or PR as related to a flaky test. size/XS Denotes a PR that changes 0-9 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. labels Mar 9, 2022
@eddiezane
Copy link
Member Author

/sig testing
/priority important-soon
/assign @liggitt

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 9, 2022
@liggitt
Copy link
Member

liggitt commented Mar 9, 2022

I'm not sure if this is the best way to pass these along.

I'm not sure either

/assign @thockin
(or alternate) for makefile voodoo

@aojea
Copy link
Member

aojea commented Mar 9, 2022

why not defaulting the tool to serial instead?

	serial     = flag.Bool("serial", false, "don't type check platforms in parallel (equivalent to --parallel=1)")

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'm skeptical. Does every verify* script take this argument and know to pass it down? At least a few others use "$@", so I'd expect them to break...

$ grep '$@' hack/verify-*.sh
hack/verify-boilerplate.sh:done < <("${boiler}" "$@")
hack/verify-golangci-lint.sh:    golangci-lint run "$@" >&2 || res=$?
hack/verify-import-aliases.sh:go run cmd/preferredimports/preferredimports.go "$@" || ret=$?
hack/verify-typecheck.sh:go run test/typecheck/main.go "$@" || ret=$?

If the goal is to pass this down to a single script, like verify-typecheck.sh, I think you want something more like make verify TYPECHECK_ARGS="--parallel=1" and then you can use that inside the typecheck script.

Or just change to tool for now, and revert it when our required Go version is safe again.

@@ -128,7 +128,7 @@ verify:
echo "$$VERIFY_HELP_INFO"
else
verify:
KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh
KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh $(ARGS)
Copy link
Member

Choose a reason for hiding this comment

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

This variable is undefined and very ambiguously named, at best.

@@ -133,10 +133,10 @@ function run-cmd {
local tr

if ${SILENT}; then
juLog -output="${output}" -class="verify" -name="${testname}" "$@" &> /dev/null
juLog -output="${output}" -class="verify" -name="${testname}" "$@" "${ARGS:-}" &> /dev/null
Copy link
Member

Choose a reason for hiding this comment

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

Is the goal to pass the args to EVERY verify-* script? Is that right?

@eddiezane eddiezane changed the title Pass ARGS to make verify Add env var to verify-typecheck for serial execution Mar 10, 2022
@eddiezane eddiezane requested a review from thockin March 10, 2022 01:09
@@ -34,8 +34,13 @@ make --no-print-directory -C "${KUBE_ROOT}" generated_files
# that library doesn't work well with multiple modules. Until that is done,
# force this tooling to run in a fake GOPATH.
ret=0
args=( "$@" )
Copy link
Member

Choose a reason for hiding this comment

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

simpler?

TYPECHECK_SERIAL="${TYPECHECK_SERIAL:-false}"
hack/run-in-gopath.sh \
   go run test/typecheck/main.go "$@" --serial "$TYPECHECK_SERIAL" || ret=$?

Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>
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.

/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 Mar 10, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eddiezane, 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2022
@dims
Copy link
Member

dims commented Mar 10, 2022

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 10, 2022
@k8s-ci-robot k8s-ci-robot merged commit fabfb03 into kubernetes:master Mar 10, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 10, 2022
@eddiezane eddiezane deleted the ez/fix-flake-107702 branch March 10, 2022 05:38
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/flake Categorizes issue or PR as related to a flaky test. 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-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants