Skip to content

Commit

Permalink
Remove PipelineParams
Browse files Browse the repository at this point in the history
 - Move ServiceAccount and Results to PipelineRun
  • Loading branch information
nader-ziada committed Nov 29, 2018
1 parent c747227 commit b133117
Show file tree
Hide file tree
Showing 37 changed files with 191 additions and 1,143 deletions.
2 changes: 0 additions & 2 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func main() {

pipelineInformer := pipelineInformerFactory.Pipeline().V1alpha1().Pipelines()
pipelineRunInformer := pipelineInformerFactory.Pipeline().V1alpha1().PipelineRuns()
pipelineParamsInformer := pipelineInformerFactory.Pipeline().V1alpha1().PipelineParamses()
// Build all of our controllers, with the clients constructed above.
controllers := []*controller.Impl{
// Pipeline Controllers
Expand All @@ -133,7 +132,6 @@ func main() {
pipelineInformer,
taskInformer,
taskRunInformer,
pipelineParamsInformer,
resourceInformer,
),
}
Expand Down
1 change: 0 additions & 1 deletion cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func main() {
Handlers: map[schema.GroupVersionKind]webhook.GenericCRD{
v1alpha1.SchemeGroupVersion.WithKind("Pipeline"): &v1alpha1.Pipeline{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineParams"): &v1alpha1.PipelineParams{},
v1alpha1.SchemeGroupVersion.WithKind("Task"): &v1alpha1.Task{},
v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{},
Expand Down
2 changes: 1 addition & 1 deletion config/200-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rules:
resources: ["customresourcedefinitions"]
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
- apiGroups: ["pipeline.knative.dev"]
resources: ["tasks", "taskruns", "pipelines", "pipelineruns", "pipelineparamses", "pipelineresources"]
resources: ["tasks", "taskruns", "pipelines", "pipelineruns", "pipelineresources"]
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
- apiGroups: ["build.knative.dev"]
resources: ["builds", "buildtemplates", "clusterbuildtemplates"]
Expand Down
18 changes: 0 additions & 18 deletions config/300-pipelineparams.yaml

This file was deleted.

37 changes: 3 additions & 34 deletions docs/Concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Below diagram lists the main custom resources created by Pipeline CRDs:

* [Task](#task)
* [Pipeline](#pipeline)
* [PipelineParams](#pipelineparams)
* [Runs](#runs)
* [PipelineResources](#pipelineresources)

Expand Down Expand Up @@ -148,38 +147,6 @@ Read more on PipelineResources and their types [here](./using.md)
`PipelineResources` in a pipelines are the set of objects that are going to be used
as inputs and outputs of a `TaskRun`.

### PipelineParams

`PipelineParams` contains parameters for a [Pipeline](#pipeline). One `Pipeline`
can be invoked with many different instances of `PipelineParams`, which can allow
for scenarios such as running against PRs and against a user’s personal setup.
`PipelineParams` can control:

* Which **serviceAccount** to use (provided to all tasks)
* Where **results** are stored (e.g. in GCS)

For example:

```yaml
apiVersion: pipeline.knative.dev/v1alpha1
kind: PipelineParams
metadata:
name: pipelineparams-sample
namespace: default
spec:
serviceAccount: 'demoServiceAccount'
results:
runs:
type: 'gcs'
url: 'gcs://somebucket/results/runs'
logs:
type: 'gcs'
url: 'gcs://somebucket/results/logs'
tests:
type: 'gcs'
url: 'gcs://somebucket/results/tests'
```

### Runs

To invoke a [`Pipeline`](#pipeline) or a [`Task`](#task), you must create a corresponding
Expand Down Expand Up @@ -264,11 +231,13 @@ task in the pipeline.
`PipelineRuns` tie together:

* A [Pipeline](#pipeline)
* A [PipelineParam](#pipelineparams)
* The [PipelineResources](#pipelineresources) to use for each [Task](#task)
* Which **serviceAccount** to use (provided to all tasks)
* Where **results** are stored (e.g. in GCS)

A `PipelineRun` could be created:

* By a user manually
* In response to an event (e.g. in response to a Github event, possibly processed via
[Knative eventing](https://github.com/knative/eventing))

5 changes: 1 addition & 4 deletions docs/using.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
1. Create or copy [Task definitions](#creating-a-task) for the tasks you’d like to run.
Some can be generic and reused (e.g. building with Kaniko) and others will be
specific to your project (e.g. running your particular set of unit tests).
2. Create a `PipelineParams` definition which includes parameters such as what repos
to run against, where to store results, etc.
3. Create a `Pipeline` which expresses the Tasks you would like to run and what
[Resources](#creating-resources) the Tasks need.
Use [`providedBy`](#providedBy) to express the order the `Tasks` should run in.
Expand Down Expand Up @@ -139,8 +137,7 @@ ${inputs.params.NAME}
In order to run a Pipeline, you will need to provide:

1. A Pipeline to run (see [creating a Pipeline](#creating-a-pipeline))
2. `PipelineParams` which specify the service account to use and where to put logs (see [the example `PipelineParams`](examples/pipelineparams.yaml))
3. The `PipelineResources` to use with this Pipeline.
2. The `PipelineResources` to use with this Pipeline.

On its own, a `Pipeline` declares what `Tasks` to run, and what order to run them in
(implied by [`providedBy`](#providedby)). When running a `Pipeline`, you will
Expand Down
16 changes: 14 additions & 2 deletions examples/invocations/guestbook-pipeline-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@ metadata:
spec:
pipelineRef:
name: guestbook-example
pipelineParamsRef:
name: pipelineparams-sample
triggerRef:
type: manual
serviceAccount: 'demoServiceAccount'
results:
runs:
name: 'runsBucket'
type: 'gcs'
url: 'gcs://somebucket/results/runs'
logs:
name: 'logBucket'
type: 'gcs'
url: 'gcs://somebucket/results/logs'
tests:
name: 'testBucket'
type: 'gcs'
url: 'gcs://somebucket/results/tests'
resources:
- name: build-guestbook
inputs:
Expand Down
16 changes: 14 additions & 2 deletions examples/invocations/kritis-pipeline-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@ metadata:
spec:
pipelineRef:
name: kritis-pipeline
pipelineParamsRef:
name: pipelineparams-sample
triggerRef:
type: manual
serviceAccount: 'demoServiceAccount'
results:
runs:
name: 'runsBucket'
type: 'gcs'
url: 'gcs://somebucket/results/runs'
logs:
name: 'logBucket'
type: 'gcs'
url: 'gcs://somebucket/results/logs'
tests:
name: 'testBucket'
type: 'gcs'
url: 'gcs://somebucket/results/tests'
resources:
- name: unit-test-kritis
inputs:
Expand Down
20 changes: 0 additions & 20 deletions examples/pipelineparams.yaml

This file was deleted.

5 changes: 2 additions & 3 deletions pkg/apis/pipeline/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ var _ apis.Defaultable = (*Pipeline)(nil)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Pipeline describes a DAG of Tasks to execute. It expresses how outputs
// of tasks feed into inputs of subsequent tasks, and how parameters from
// a PipelineParams should be fed into each task. The DAG is constructed
// of tasks feed into inputs of subsequent tasks. The DAG is constructed
// from the 'prev' and 'next' of each PipelineTask as well as Task dependencies.
// +k8s:openapi-gen=true
type Pipeline struct {
Expand All @@ -59,7 +58,7 @@ type Pipeline struct {
}

// PipelineTask defines a task in a Pipeline, passing inputs from both
// PipelineParams and from the output of previous tasks.
// Params and from the output of previous tasks.
type PipelineTask struct {
Name string `json:"name"`
TaskRef TaskRef `json:"taskRef"`
Expand Down
25 changes: 0 additions & 25 deletions pkg/apis/pipeline/v1alpha1/pipelineparams_defaults.go

This file was deleted.

99 changes: 0 additions & 99 deletions pkg/apis/pipeline/v1alpha1/pipelineparams_types.go

This file was deleted.

Loading

0 comments on commit b133117

Please sign in to comment.