+ - 0:00:00
Notes for current slide
Notes for next slide

Prow as Tekton pipeline trigger

anarcher@gmail.com

2019-07-06

1 / 22

prowlogo

2 / 22

What is Prow?

Prow is a Kubernetes-based CI/CD system

3 / 22

What is Prow?

Prow is a Kubernetes-based CI/CD system

Jobs can be triggered by various types of events and report their status to many different services.

4 / 22

What is Prow?

Prow is a Kubernetes-based CI/CD system

Jobs can be triggered by various types of events and report their status to many different services.

In addition to job execution, Prow provides GitHub automationn in the form of policy enforcement, chat-ops via /foo style commands, and automatic PR merging.

5 / 22

What is Prow?

Prow is a Kubernetes-based CI/CD system

Jobs can be triggered by various types of events and report their status to many different services.

In addition to job execution, Prow provides GitHub automationn in the form of policy enforcement, chat-ops via /foo style commands, and automatic PR merging.

Microservices architecture provides the core components that you need and allows for extendability and replacement.

6 / 22

What is Prow?

Prow is a Kubernetes-based CI/CD system

Jobs can be triggered by various types of events and report their status to many different services.

In addition to job execution, Prow provides GitHub automationn in the form of policy enforcement, chat-ops via /foo style commands, and automatic PR merging.

Microservices architecture provides the core components that you need and allows for extendability and replacement.

The Kubernetes project does a lot of testing, on the order of 10000 jobs per day covering everything from build and unit tests, to end-to-end testing on real clusters deployed from source all the way up to ~5000 node scalability and performance tests.

7 / 22

8 / 22

Prow/horologium

Responsible for scheduling Periodic jobs

kind: ConfigMap
metadata:
name: config
data:
config.yaml: |
periodics:
- interval: 10m
agent: kubernetes
name: echo-test
spec:
containers:
- image: alpine
command: ["/bin/date"]
9 / 22
apiVersion: prow.k8s.io/v1
kind: ProwJob
metadata:
creationTimestamp: "2019-07-10T19:43:11Z"
labels:
created-by-prow: "true"
prow.k8s.io/id: f379e510-a34a-11e9-a876-1afb1ac8a26e
prow.k8s.io/job: echo-test
prow.k8s.io/type: periodic
name: f379e510-a34a-11e9-a876-1afb1ac8a26e
namespace: prow
spec:
agent: kubernetes
cluster: default
job: echo-test
namespace: prow-test-pods
pod_spec:
containers:
- command:
- /bin/date
image: alpine
name: ""
resources: {}
type: periodic
status:
build_id: "1149041418853945344"
completionTime: "2019-07-10T19:43:47Z"
description: Job succeeded.
pod_name: f379e510-a34a-11e9-a876-1afb1ac8a26e
prev_report_states:
github-reporter: success
startTime: "2019-07-10T19:43:11Z"
state: success
10 / 22

horologium

11 / 22

Prow/plank

Controller that manages job execution and lifecycle of kubernetes jobs.

spec:
agent: kubernetes
cluster: default
context: test-pod
job: test-pod
namespace: prow-msshin-test-pods
pod_spec:
containers:
- image: alpine
command: ["/bin/printenv"]
status:
build_id: "1148512931902656513"
completionTime: "2019-07-09T08:43:45Z"
description: Job succeeded.
pod_name: 956c3fc4-a225-11e9-aadf-a660c8b9b0b2
startTime: "2019-07-09T08:43:11Z"
state: success
12 / 22

Prow/deck

13 / 22

Prow/sinker

  • Clean up
  • Deletes completed prow jobs & pods
14 / 22

Prow/hook

  • It is a stateless server that listens for GitHub webhooks and dispatches them to the appropriate plugins.
  • Hook's plugins are used to trigger jobs, implement 'slash' commands, post to Slack, and more.
  • https://prow.k8s.io/plugins

15 / 22

config.yaml

postsubmits:
org/repo:
- name: bar-job # As for periodics.
decorate: true # As for periodics.
spec: {} # As for periodics.
max_concurrency: 10 # Run no more than this number concurrently.
branches: # Regexps, only run against these branches.
- ^master$
skip_branches: # Regexps, do not run against these branches.
- ^release-.*$
16 / 22

plugin.yaml

plugins:
{ORG}/{REPO}:
- size
- trigger
- help
- hold

prow.k8s.io

17 / 22

Tekton pipeline controller in Prow

postsubmits:
- name: hello-pipeline
agent: tekton-pipeline
namespace: test-pods
labels:
anarcher.dev/job: prow
pipeline_run_spec:
pipelineRef:
name: hello
resources:
- name: source-repo
resourceRef:
name: PROW_IMPLICIT_GIT_REF
- name: docker-image
resourceRef:
name: test-image
branches:
- ^master$
18 / 22

Prow/pipeline

  • Pipeline controller makes tekton/PipelineRun and tekton/PipelineResource (git resource references)

  • reference values in pipeline_run_spec git resource references like PROW_IMPLICIT_GIT_REF will be substituted for the actual resource names by the controller before the pipelinerun is created.

resources:
- name: source-repo
resourceRef:
name: PROW_IMPLICIT_GIT_REF
19 / 22

20 / 22

22 / 22

prowlogo

2 / 22
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow