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

Fix CI job race condition #262

Merged
merged 1 commit into from
Mar 19, 2019
Merged

Conversation

wangzhen127
Copy link
Member

@wangzhen127 wangzhen127 commented Mar 19, 2019

Current CI job has race condition. The related CI jobs are:

The CI jobs are configured to run every 2 hours. The race condition happens as follows:

  1. Time t: All 3 CI jobs run. ci-npd-build push the new builds to staging (with new sha1 value).
  2. Time t+2hour: All 3 CI jobs run again. ci-npd-build starts to run, but hasn't finished the build. ci-npd-e2e-kubernetes-gce-gci downloads the ci.env pushed in step 1 at time t.
  3. Time t+2hour+2min: ci-npd-build finishes building and pushes a new build to staging.
  4. Time t+2hour+5min: ci-npd-e2e-kubernetes-gce-gci created the cluster and try to download NPD build. It used the old ci.env as downloaded in step 2, but the NPD build on staging has been updated to the new build in step 3. Then the sha1 value does not match. NPD installation fails with following error:
Mar 19 14:51:37.716008 e2e-69-7abb6-minion-group-23dx configure.sh[787]: Downloading node-problem-detector-v0.6.2-10-g796c8d0.tar.gz.
Mar 19 14:51:37.738122 e2e-69-7abb6-minion-group-23dx configure.sh[787]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Mar 19 14:51:37.738404 e2e-69-7abb6-minion-group-23dx configure.sh[787]:                                  Dload  Upload   Total   Spent    Left  Speed
Mar 19 14:51:38.062481 e2e-69-7abb6-minion-group-23dx configure.sh[787]: [237B blob data]
Mar 19 14:51:38.124829 e2e-69-7abb6-minion-group-23dx configure.sh[787]: == node-problem-detector-v0.6.2-10-g796c8d0.tar.gz corrupted, sha1 f815d9b7fdec53a0363bb77c19b575c8296dc1fe doesn't match expected 2b7e70b122f338bf75c4beb909f6ded0a569c042 ==
Mar 19 14:51:38.125255 e2e-69-7abb6-minion-group-23dx configure.sh[787]: == Hash validation of https://storage.googleapis.com/node-problem-detector-staging/ci/node-problem-detector/node-problem-detector-v0.6.2-10-g796c8d0.tar.gz failed. Retrying. ==

This PR adds current time to version and tag, so that the NPD builds will not be overridden. The GCS bucket is configured to only keep the builds for 7 days, so old files will be cleaned up.

Part of #236.

@wangzhen127
Copy link
Member Author

/assign @Random-Liu

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 19, 2019
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 19, 2019
@wangzhen127 wangzhen127 changed the title Resolve CI job race condition Fix CI job race condition Mar 19, 2019
@wangzhen127 wangzhen127 force-pushed the ci-race branch 2 times, most recently from 5164c1e to 981330d Compare March 19, 2019 17:06
@Random-Liu
Copy link
Member

ci-npd-build can only build but not uploading files if the commit number is the same, right?

In this way, you will always have consistent tar + sha

test/build.sh Outdated Show resolved Hide resolved
@Random-Liu
Copy link
Member

/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 19, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Random-Liu, wangzhen127

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:
  • OWNERS [Random-Liu,wangzhen127]

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 97f09be into kubernetes:master Mar 19, 2019
@wangzhen127 wangzhen127 deleted the ci-race branch March 19, 2019 22:34
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/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.

3 participants