Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Prow! Leveraging Developer-Centric CI for Your OSS Project!

Prow! Leveraging Developer-Centric CI for Your OSS Project!

Prow is a CI system maintained by Kubernetes SIG Testing to test Kubernetes on Kubernetes. Prow is designed as a pluggable system of components and it can be used as a generic CI system. The robust architecture of Prow can lead to challenges in deploying it. In the talk, we will navigate the challenges faced when deploying and using Prow, including setting up the Prow control plane components, configuring access for GitHub repos, and enabling Prow plugins. Prow is used by large projects in the CNCF landscape like Kubernetes, Knative, cert-manager, Falco, to name a few. Even though a lot of these projects have deployed Prow successfully, it is a challenge to set up Prow. The talk will highlight the common pitfalls and gotchas that one will run into when deploying Prow. The talk would cover * A roundup of Prow Architecture * Cloud resources required for Prow and setting them up * Capabilities of Prow like running tests, using GitHub comments for interaction, auto merging pull requests.

Nabarun Pal

May 18, 2022
Tweet

More Decks by Nabarun Pal

Other Decks in Technology

Transcript

  1. Prow! Leveraging Developer Centric CI for your OSS project! Arsh

    Sharma & Nabarun Pal KubeCon + CloudNativeCon Europe 2022 1
  2. Arsh Sharma • Developer Experience Engineer at Okteto • Kubernetes

    1.25 CI Signal Lead • New Contributor Ambassador for Kubernetes SIG Docs KubeCon + CloudNativeCon Europe 2022 3
  3. Nabarun Pal • Senior Engineer at VMware • Kubernetes Release

    Engineering • Kubernetes Code of Conduct Committee KubeCon + CloudNativeCon Europe 2022 4
  4. What is Prow? • Kubernetes based CI/CD system • GitHub

    automation through policies KubeCon + CloudNativeCon Europe 2022 5
  5. What is Prow? • Kubernetes based CI/CD system • GitHub

    automation through policies • Configuration as code KubeCon + CloudNativeCon Europe 2022 5
  6. What is Prow? • Kubernetes based CI/CD system • GitHub

    automation through policies • Configuration as code • Highly pluggable KubeCon + CloudNativeCon Europe 2022 5
  7. What is Prow? • Kubernetes based CI/CD system • GitHub

    automation through policies • Configuration as code • Highly pluggable • ChatOps via /honk style commands KubeCon + CloudNativeCon Europe 2022 5
  8. ChatOps • /yolo style commands which allow interacting with GitHub

    issues and PRs KubeCon + CloudNativeCon Europe 2022 6
  9. ChatOps • /yolo style commands which allow interacting with GitHub

    issues and PRs • Assign issues to contributors or PRs to reviewers KubeCon + CloudNativeCon Europe 2022 6
  10. ChatOps • /yolo style commands which allow interacting with GitHub

    issues and PRs • Assign issues to contributors or PRs to reviewers • Label issues and PRs KubeCon + CloudNativeCon Europe 2022 6
  11. ChatOps • /yolo style commands which allow interacting with GitHub

    issues and PRs • Assign issues to contributors or PRs to reviewers • Label issues and PRs • Provide approval for PRs KubeCon + CloudNativeCon Europe 2022 6
  12. ChatOps • /yolo style commands which allow interacting with GitHub

    issues and PRs • Assign issues to contributors or PRs to reviewers • Label issues and PRs • Provide approval for PRs • Run tests for a PR KubeCon + CloudNativeCon Europe 2022 6
  13. ChatOps • /yolo style commands which allow interacting with GitHub

    issues and PRs • Assign issues to contributors or PRs to reviewers • Label issues and PRs • Provide approval for PRs • Run tests for a PR • A lot more stuff! KubeCon + CloudNativeCon Europe 2022 6
  14. Tide • Manages pool of GitHub PRs • Automatically retests

    PRs when they meet the criteria KubeCon + CloudNativeCon Europe 2022 8
  15. Tide • Manages pool of GitHub PRs • Automatically retests

    PRs when they meet the criteria • Merges PRs without user intervention when tests pass KubeCon + CloudNativeCon Europe 2022 8
  16. Testgrid • Interactive dashboard to view test results • And

    they are shown in a grid! KubeCon + CloudNativeCon Europe 2022 9
  17. Inrepo • Define jobs in the same repo where the

    source code is KubeCon + CloudNativeCon Europe 2022 12
  18. Inrepo • Define jobs in the same repo where the

    source code is • In a .prow directory or .prow.yaml file at the root of the repo KubeCon + CloudNativeCon Europe 2022 12
  19. Inrepo • Define jobs in the same repo where the

    source code is • In a .prow directory or .prow.yaml file at the root of the repo • Jobs are NOT defined centrally in this approach KubeCon + CloudNativeCon Europe 2022 12
  20. Centralizing configuration • Have a separate repo for all your

    prow jobs across different repos KubeCon + CloudNativeCon Europe 2022 13
  21. Centralizing configuration • Have a separate repo for all your

    prow jobs across different repos • Jobs are defined centrally in this approach KubeCon + CloudNativeCon Europe 2022 13
  22. Centralizing configuration • Have a separate repo for all your

    prow jobs across different repos • Jobs are defined centrally in this approach • Let's look at kubernetes/test-infra! KubeCon + CloudNativeCon Europe 2022 13
  23. Run tackle Set up the GCP credentials before running tackle

    $ tackle -skip-github ... Let it run and pause where it asks you to specify location for starter.yaml. KubeCon + CloudNativeCon Europe 2022 21
  24. Apply the Prow CRDs $ kubectl apply --server-side=true -f https://raw.githubusercontent.com/kubernetes/test-infra/master/config/prow/cluster/prowjob-crd/prowjob_customresourcedefinition.yaml

    customresourcedefinition.apiextensions.k8s.io/prowjobs.prow.k8s.io serverside-applied KubeCon + CloudNativeCon Europe 2022 22
  25. Create a GCS bucket $ gcloud iam service-accounts create prow-gcs-publisher

    $ identifier="$(gcloud iam service-accounts list --filter 'name:prow-gcs-publisher' --format 'value(email)')" $ gsutil mb gs://master-shifus-knowledge/ $ gsutil iam ch allUsers:objectViewer gs://master-shifus-knowledge $ gsutil iam ch "serviceAccount:${identifier}:objectAdmin" gs://master-shifus-knowledge $ gcloud iam service-accounts keys create --iam-account "${identifier}" service-account.json $ kubectl -n test-pods create secret generic gcs-credentials --from-file=service-account.json $ kubectl -n prow create secret generic gcs-credentials --from-file=service-account.json KubeCon + CloudNativeCon Europe 2022 23
  26. Fetch the starter yaml, make necessary changes and then specify

    to tackle https://git.k8s.io/test-infra/config/prow/cluster/starter/starter- gcs.yaml KubeCon + CloudNativeCon Europe 2022 25
  27. Benefits of using Prow • Enables Effective Collaboration • Accessible!

    • New Contributor Friendly KubeCon + CloudNativeCon Europe 2022 30
  28. Contribute Come join us in Kubernetes SIG Testing to maintain

    Prow. • Mailing List: https://groups.google.com/forum/#!forum/ kubernetes-sig-testing • Slack: #sig-testing on Kubernetes Slack KubeCon + CloudNativeCon Europe 2022 31