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

Log or enforce kubernetes jobs pull from k8s-infra buckets #20885

Merged

Conversation

spiffxp
Copy link
Member

@spiffxp spiffxp commented Feb 17, 2021

To help close out kubernetes/k8s.io#846 (comment)

Now that we have community-owned CI artifacts, jobs that use them should
be pulling CI from gs://k8s-release-dev instead of the google.com-owned
gs://kubernetes-release-dev.

Setup to enforce/fail for smaller subsets of jobs, and warn for larger
sets of jobs over time. This is why there's currently unused code to
verify use of gs://k8s-release, and TODOs to enable later.

As a start:

  • Fail any kubetest jobs not extracting from gs://k8s-release-dev if:
    • they use --extract=ci/latest-fast
    • they use --extract=ci/* and are release-blocking1
  • Warn any other kubetest jobs not extracting from gs://k8s-release-dev

1also catches --extract=gci/ and --extract=v1.2.3+456 but these aren't in active use here

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/config Issues or PRs related to code in /config labels Feb 17, 2021
@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 17, 2021
@spiffxp
Copy link
Member Author

spiffxp commented Feb 17, 2021

This is expected to fail until job configs are updated

$ go test -v -count=1 ./config/tests/jobs/... -run TestKubernetesE2eJobsMustExtractFromK8sInfraBuckets | grep FAIL
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sbeta-alphafeatures: release-blocking jobs using --extract=ci/latest-1.20 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sbeta-default: release-blocking jobs using --extract=ci/latest-1.20 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sbeta-ingress: release-blocking jobs using --extract=ci/latest-1.20 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sbeta-reboot: release-blocking jobs using --extract=ci/latest-1.20 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable1-alphafeatures: release-blocking jobs using --extract=ci/latest-1.19 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable1-ingress: release-blocking jobs using --extract=ci/latest-1.19 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable1-reboot: release-blocking jobs using --extract=ci/latest-1.19 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable2-alphafeatures: release-blocking jobs using --extract=ci/latest-1.18 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable2-ingress: release-blocking jobs using --extract=ci/latest-1.18 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable2-reboot: release-blocking jobs using --extract=ci/latest-1.18 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable3-alphafeatures: release-blocking jobs using --extract=ci/latest-1.17 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable3-ingress: release-blocking jobs using --extract=ci/latest-1.17 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-cos-k8sstable3-reboot: release-blocking jobs using --extract=ci/latest-1.17 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-device-plugin-gpu-stable1: release-blocking jobs using --extract=ci/latest-1.19 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-device-plugin-gpu-stable2: release-blocking jobs using --extract=ci/latest-1.18 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-master-new-gci-kubectl-skew: release-blocking jobs using --extract=ci/k8s-stable1 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-master-new-gci-kubectl-skew: release-blocking jobs using --extract=ci/latest must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-master-new-gci-kubectl-skew-stable2: release-blocking jobs using --extract=ci/k8s-stable2 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gce-master-new-gci-kubectl-skew-stable2: release-blocking jobs using --extract=ci/latest must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gci-gce-scalability-stable1: release-blocking jobs using --extract=ci/latest-1.19 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-e2e-gci-gce-scalability-stable2: release-blocking jobs using --extract=ci/latest-1.18 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-gce-conformance-latest-1-18: release-blocking jobs using --extract=ci/latest-1.18 must have --extract-ci-bucket=k8s-release-dev
    jobs_test.go:1161: FAIL - ci-kubernetes-gce-conformance-latest-1-19: release-blocking jobs using --extract=ci/latest-1.19 must have --extract-ci-bucket=k8s-release-dev
--- FAIL: TestKubernetesE2eJobsMustExtractFromK8sInfraBuckets (0.02s)

@spiffxp
Copy link
Member Author

spiffxp commented Feb 17, 2021

/uncc @wojtek-t
/area jobs
/area release-eng
FYI @kubernetes/release-engineering @kubernetes/ci-signal
/cc @ameukam @hasheddan

@k8s-ci-robot k8s-ci-robot removed the request for review from wojtek-t February 17, 2021 17:43
@k8s-ci-robot k8s-ci-robot added the area/release-eng Issues or PRs related to the Release Engineering subproject label Feb 17, 2021
@@ -1086,25 +1086,96 @@ func TestSigReleaseMasterBlockingOrInformingJobsShouldUseFastBuilds(t *testing.T
}
}

// extractUsesCIBucket returns true if kubetest --extract=foo
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this also true for kubetest2?

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't tell that --extract= was pulling in anything weird so didn't feel the need to add further "is this definitely invoking kubetest in a way we recognize" checks.

/cc @amwat
I think enforcing for kubetest2 is going to require some changes to kubetest2 and the tests here, so I'm opting to ignore for followup later.

  • I don't think kubetest2-gce has support for extracting pre-built versions of kubernetes yet, its readme states it ned
  • kubetest2-tester-ginkgo has --test-package-bucket (default "kubernetes-release") as a start

There may also be other subprojects that pull from kubernetes-release-dev via scripts we can't introspect here, which I'd like to defer to the broader "remove gs://kubernetes-release-dev" effort which might need to be KEP'ed.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah we don't do published released versions for GCE yet in kubetest2

config/tests/jobs/jobs_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 17, 2021
@k8s-ci-robot k8s-ci-robot requested a review from amwat February 17, 2021 18:57
@spiffxp
Copy link
Member Author

spiffxp commented Feb 17, 2021

May need to rebase due to #20880 merging

@spiffxp spiffxp force-pushed the kubetest-jobs-using-k8s-infra-buckets branch from 5971a3a to 07851e9 Compare February 17, 2021 21:22
@@ -1086,25 +1086,96 @@ func TestSigReleaseMasterBlockingOrInformingJobsShouldUseFastBuilds(t *testing.T
}
}

// extractUsesCIBucket returns true if kubetest --extract=foo
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah we don't do published released versions for GCE yet in kubetest2

config/tests/jobs/jobs_test.go Outdated Show resolved Hide resolved
config/tests/jobs/jobs_test.go Outdated Show resolved Hide resolved
Now that we have community-owned CI artifacts, jobs that use them should
be pulling CI from gs://k8s-release-dev instead of the google.com-owned
gs://kubernetes-release-dev.

Setup to enforce/fail for smaller subsets of jobs, and warn for larger
sets of jobs over time. This is why there's currently unused code to
verify use of gs://k8s-release, and TODOs to enable later.

As a start:

- Fail any kubetest jobs not extracting from gs://k8s-release-dev if:
  - they use --extract=ci/latest-fast
  - they use --extract=ci/* and are release-blocking
- Warn any other kubetest jobs not extracting from gs://k8s-release-dev
- Warn how many jobs in total need to be fixed
@spiffxp spiffxp force-pushed the kubetest-jobs-using-k8s-infra-buckets branch from 07851e9 to f7c57df Compare February 17, 2021 22:44
@spiffxp
Copy link
Member Author

spiffxp commented Feb 17, 2021

rebased, squashed review fixes into first commit, left job config changes in their own commits

Copy link
Contributor

@amwat amwat 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

fail = true
jobDesc = "release-blocking jobs"
}
fail := isKubernetesReleaseBlocking(job)
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be dropped?
but anyway this code path isn't exercised yet so can be a follow up

Copy link
Member Author

Choose a reason for hiding this comment

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

doh, thanks, will followup

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amwat, spiffxp

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 aab7695 into kubernetes:master Feb 17, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Feb 17, 2021
@k8s-ci-robot
Copy link
Contributor

@spiffxp: Updated the job-config configmap in namespace default at cluster test-infra-trusted using the following files:

  • key generated.yaml using file config/jobs/kubernetes/generated/generated.yaml
  • key sig-cli-config.yaml using file config/jobs/kubernetes/sig-cli/sig-cli-config.yaml
  • key 1.18.yaml using file config/jobs/kubernetes/sig-release/release-branch-jobs/1.18.yaml
  • key 1.19.yaml using file config/jobs/kubernetes/sig-release/release-branch-jobs/1.19.yaml

In response to this:

To help close out kubernetes/k8s.io#846 (comment)

Now that we have community-owned CI artifacts, jobs that use them should
be pulling CI from gs://k8s-release-dev instead of the google.com-owned
gs://kubernetes-release-dev.

Setup to enforce/fail for smaller subsets of jobs, and warn for larger
sets of jobs over time. This is why there's currently unused code to
verify use of gs://k8s-release, and TODOs to enable later.

As a start:

  • Fail any kubetest jobs not extracting from gs://k8s-release-dev if:
  • they use --extract=ci/latest-fast
  • they use --extract=ci/* and are release-blocking1
  • Warn any other kubetest jobs not extracting from gs://k8s-release-dev

1also catches --extract=gci/ and --extract=v1.2.3+456 but these aren't in active use 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.

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/config Issues or PRs related to code in /config area/jobs area/release-eng Issues or PRs related to the Release Engineering subproject 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. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

4 participants