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

Performance bot wait for binary before run #9988

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

daehyeok
Copy link
Contributor

@daehyeok daehyeok commented Dec 17, 2020

fixes #9697

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 17, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @daehyeok. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 17, 2020
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

Hey @daehyeok thank you for taking this issue on. I've left a few comments, but overall I think this can be simplified considerably. Instead of writing new functions, we can just set a timer on b.Download() in mkcmp, and continuously retry for up to 10 minutes. WDYT?

pkg/perf/monitor/execute.go Outdated Show resolved Hide resolved
obj := client.Bucket(bucket).Object(fmt.Sprintf("%d/minikube-%s-amd64", b.pr, runtime.GOOS))
if _, err := obj.Attrs(ctx); err != nil {
return fmt.Errorf("minikube binary for pr %v does not exist in bucket", b.pr)
obj, err := newObjectFromStorage(ctx, client, b.pr)

Choose a reason for hiding this comment

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

Why was this code moved into a new function? It doesn't seem like there is any difference between newObjectFromStorage and the code that was here before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just want to reuse code for IsExist function.

pr = strings.TrimPrefix(pr, prPrefix)
// try to convert to int
i, err := strconv.Atoi(pr)
i, err := extractPRIDFromPath(pr)

Choose a reason for hiding this comment

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

We shouldn't need to extract the PR ID from path, since it is passed into the function as a string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it's bad naming for function. It's convert pr number to integer(from path string). Original code also convert it for Binary struct, I want to reuse too for new function.

b := &Binary{
   path: localMinikubePath(i),
   pr:   i,
}

Copy link
Contributor Author

@daehyeok daehyeok left a comment

Choose a reason for hiding this comment

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

mkcmp run as external command. I'm not sure how can i handling error from mkcmp.

Is it any good way to distinguish between binary not exist error(in storage) and others?

obj := client.Bucket(bucket).Object(fmt.Sprintf("%d/minikube-%s-amd64", b.pr, runtime.GOOS))
if _, err := obj.Attrs(ctx); err != nil {
return fmt.Errorf("minikube binary for pr %v does not exist in bucket", b.pr)
obj, err := newObjectFromStorage(ctx, client, b.pr)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just want to reuse code for IsExist function.

pr = strings.TrimPrefix(pr, prPrefix)
// try to convert to int
i, err := strconv.Atoi(pr)
i, err := extractPRIDFromPath(pr)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it's bad naming for function. It's convert pr number to integer(from path string). Original code also convert it for Binary struct, I want to reuse too for new function.

b := &Binary{
   path: localMinikubePath(i),
   pr:   i,
}

pkg/perf/monitor/execute.go Outdated Show resolved Hide resolved
Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

Hey @daehyeok sorry I wasn't clear.

We try to download the binary here:

if err := b.download(); err != nil {

and we fail if it doesn't work. We could add a retry here, to continuously attempt to download the binary once every minute for 10 minutes. I think 10 minutes is a safe bet because jenkins take around 4 minutes to build and upload the binaries.

We shouldn't need any additional code.

@daehyeok
Copy link
Contributor Author

@priyawadhwa oh sorry i misunderstood. I thought you want to mkcmp return error but still retying in monitor/execute.go.
I will fix it.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 29, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: daehyeok, tstromberg

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 Jan 6, 2021
@priyawadhwa priyawadhwa merged commit 95c92eb into kubernetes:master Jan 6, 2021
@daehyeok daehyeok deleted the wait_binary branch January 9, 2021 20: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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

performance bot wait for binary before run
5 participants