Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Add pipeline strawman example #319

Closed
wants to merge 1 commit into from

Conversation

bobcatfish
Copy link
Contributor

@bobcatfish bobcatfish commented Aug 29, 2018

This PR is for discussion purposes only, not for merging :)

@dlorenc @imjasonh @tejal29 @aaron-prindle and I have been working on a
strawman proposal for adding a Pipeline CRD and also for possibly
evolving the Build CRD into a slightly more generic Task CRD.

(Note credit for the examples - which make up the bulk of this PR - goes to @tejal29!)

This PR demonstrates some paper prototype examples of what it could look
like to define pipelines using the CRDs described in the README.

Take a look at the README and examples/README for more info!

@dlorenc @imjasonh @tejal29 @aaron-prindle and I have been working on a
strawman proposal for adding a Pipeline CRD and also for possibly
envolving the Build CRD into a slightly more generic Task CRD.

This PR demonstrates some paper prototype examples of what it could look
like to define pipelines using the CRDs described in the README.
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bobcatfish
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: mattmoor

If they are not already assigned, you can assign the PR to them by writing /assign @mattmoor in a comment when ready.

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

@imjasonh
Copy link
Member

/hold not for merging

Copy link
Member

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together, looking forward to discussing in more detail at the WG today. 🎉

* [Tasks](#tasks) can exist and be invoked completely independently of
[pipelines](#pipelines); they are highly cohesive and loosely coupled
* Test results are a first class concept, being able to navigate test results
easily is powerful (e.g. see failures easily, dig into logs, like sponge)
Copy link
Member

Choose a reason for hiding this comment

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

Is Sponge a well-known concept externally? I only see this blog post mentioning it publicly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hah! good catch XD

from is not known to a task, so they can be provided by a Pipeline or by a user invoking a Task directly.

`Tasks` are basically [knative BuildTemplates](https://github.com/knative/build-templates)
with additional input types and clearly defined outputs.
Copy link
Member

Choose a reason for hiding this comment

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

Should this mention that we expect that Build can eventually transition to Task, or is that something we don't want to commit to so strongly out the gate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can mention that's a possibility anyway


Here are the Task Types that are defined.

1. `build-push`: This task as the name suggests build an image via kaniko and pushes it to registry.
Copy link
Member

Choose a reason for hiding this comment

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

Linkify kaniko?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call

* What **sources** the `Pipeline` runs against
* Which **serviceAccount** to use (provided to all tasks)
* What **artifact** stores are used (e.g. Docker registries)
* Where **results** are stored (e.g. in GCS)
Copy link
Member

Choose a reason for hiding this comment

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

I think artifacts could also end up in GCS (e.g., jars, debs, maybe generated docs?), in which case we'd need to consider what makes those an "artifact" and not a "result"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I've added a note to the working group design doc


Finally, we have 2 example [Pipelines](../README.md#pipeline) in [./pipelines](./pipelines)

1. [Kritis](.pipelines/kritis.yaml): This exmaple demonstrates how to configure a pipeline which runs unit test, build an image, deploys it to test and then run integration tests.
Copy link
Member

Choose a reason for hiding this comment

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

typo: ./pipelines/kritis.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ty ty

# TODO: just guessing how helm works
- name: deploy
image: kubernetes-helm
args: ['deploy', '--path=', '${pathToHelmChart}', '--set image=${image}', '${helmArgs}']
Copy link
Member

Choose a reason for hiding this comment

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

typo (even though it's just for illustration): --path=${pathToHelmChart}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ty ty

@@ -0,0 +1,50 @@
apiVersion: kan.k8s.io/v1beta1
Copy link
Member

Choose a reason for hiding this comment

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

kan.k8s.io -> pipeline.knative.dev ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah we should change that for sure

@srinivashegde86
Copy link

/hold

@bobcatfish
Copy link
Contributor Author

Moved this to the pipeline repo: tektoncd/pipeline#1

@bobcatfish bobcatfish closed this Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants