You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We hope Fluid users could represent the above YAML file by the following line.
126
126
127
127
```python
128
-
skaffold_image_leeroy_web = fluid.Image(
128
+
skaffold_image_leeroy_web = fluid.image_resource(
129
129
url="gcr.io/wangkuiyi/leeroy-web")
130
130
```
131
131
@@ -142,7 +142,7 @@ According to the [document](https://github.com/tektoncd/pipeline/blob/master/doc
142
142
The following example from the [Tekton tutorial](https://github.com/tektoncd/pipeline/blob/master/docs/tutorial.md#task-inputs-and-outputs) takes an input resource, an output resource, and two input parameters.
143
143
144
144
```yaml
145
-
goapiVersion: tekton.dev/v1alpha1
145
+
apiVersion: tekton.dev/v1alpha1
146
146
kind: Task
147
147
metadata:
148
148
name: build-docker-image-from-git-source
@@ -185,138 +185,116 @@ We hope Fluid users could represent it by the following Python/Fluid code.
A Pipeline in Tekton defined an ordered series of Tasks. A valid Pipeline declearation
195
-
must include a reference to at last one `Task`, for example:
196
-
197
-
``` yaml
198
-
tasks:
199
-
- name: build-the-image
200
-
taskRef:
201
-
name: build-push
202
-
```
203
-
204
-
The `Pipeline Tasks` in a Pipeline can be connected and run as a Directed Acyclic Graph(DAG), each of the Pipeline Tasks is a node, which can be connected with:
203
+
A Pipeline object is like function declaration.
205
204
206
-
- `runAfter`clauses on the `Pipeline Tasks`.
207
-
- `from`clauses on the `PipelineResources` needed by a `Task`.
205
+
A Pipeline in Tekton defined an ordered series of Tasks. Users can specify whether
206
+
the output of a `Task` is used as an input for the next `Task` using `from` property on `PipelineResources`
208
207
209
-
For an example `Pipeline` spec with `runAfter`:
208
+
As the following example comes from [Tekton's tutorial](https://github.com/tektoncd/pipeline/blob/master/docs/tutorial.md#creating-and-running-a-pipeline)
210
209
211
210
``` yaml
212
-
- name: lint-repo
213
-
taskRef:
214
-
name: pylint
215
-
resources:
216
-
inputs:
217
-
- name: workspace
218
-
resource: my-repo
219
-
- name: test-app
220
-
taskRef:
221
-
name: make-test
222
-
resources:
223
-
inputs:
224
-
- name: workspace
225
-
resource: my-repo
226
-
- name: build-app
227
-
taskRef:
228
-
name: kaniko-build-app
229
-
runAfter:
230
-
- test-app
231
-
resources:
232
-
inputs:
233
-
- name: workspace
234
-
resource: my-repo
235
-
outputs:
236
-
- name: image
237
-
resource: my-app-image
238
-
- name: build-frontend
239
-
taskRef:
240
-
name: kaniko-build-frontend
241
-
runAfter:
242
-
- test-app
243
-
resources:
244
-
inputs:
245
-
- name: workspace
246
-
resource: my-repo
247
-
outputs:
248
-
- name: image
249
-
resource: my-frontend-image
250
-
- name: deploy-all
251
-
taskRef:
252
-
name: deploy-kubectl
211
+
apiVersion: tekton.dev/v1beta1
212
+
kind: Pipeline
213
+
metadata:
214
+
name: tutorial-pipeline
215
+
spec:
253
216
resources:
254
-
inputs:
255
-
- name: my-app-image
256
-
resource: my-app-image
257
-
from:
258
-
- build-app
259
-
- name: my-frontend-image
260
-
resource: my-frontend-image
261
-
from:
262
-
- build-frontend
263
-
```
264
-
265
-
This will result the following execution graph:
266
-
267
-
``` text
268
-
| |
269
-
v v
270
-
test-app lint-repo
271
-
/ \
272
-
v v
273
-
build-app build-frontend
274
-
\ /
275
-
v v
276
-
deploy-all
217
+
- name: source-repo
218
+
type: git
219
+
- name: web-image
220
+
type: image
221
+
tasks:
222
+
- name: build-skaffold-web
223
+
taskRef:
224
+
name: build-docker-image-from-git-source
225
+
params:
226
+
- name: pathToDockerFile
227
+
value: Dockerfile
228
+
- name: pathToContext
229
+
value: /workspace/docker-source/examples/microservices/leeroy-web #configure: may change according to your source
230
+
resources:
231
+
inputs:
232
+
- name: docker-source
233
+
resource: source-repo
234
+
outputs:
235
+
- name: builtImage
236
+
resource: web-image
237
+
- name: deploy-web
238
+
taskRef:
239
+
name: deploy-using-kubectl
240
+
resources:
241
+
inputs:
242
+
- name: source
243
+
resource: source-repo
244
+
- name: image
245
+
resource: web-image
246
+
from:
247
+
- build-skaffold-web
248
+
params:
249
+
- name: path
250
+
value: /workspace/source/examples/microservices/leeroy-web/kubernetes/deployment.yaml #configure: may change according to your source
251
+
- name: yamlPathToImage
252
+
value: "spec.template.spec.containers[0].image"
277
253
```
278
254
279
-
In Python, a function is like a node of the DAG, which connected by the input
280
-
and of output of the functions.
281
-
282
-
We hope Fluid users can write the following program to express a DAG with `fluid.pipeline`:
255
+
We hope Fluid users can write the following program to express the above YAML file:
A PipelineRun object is like a function invocation.
300
269
301
-
@fluid.task
302
-
def deploy_kubectl():
303
-
fluid.step(...)
270
+
A PipelineRun object defines a call to a Pipeline. The following is a PipelineRun example from [Tekton's tutorial](https://github.com/tektoncd/pipeline/blob/master/docs/tutorial.md#creating-and-running-a-pipeline):
0 commit comments