An open API service indexing awesome lists of open source software.

https://github.com/sql-machine-learning/fluid


https://github.com/sql-machine-learning/fluid

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

# Fluid: Python Instead of YAML for Google Tekton

Fluid is a Python package allowing users to write Teckton workflows in Python.

Here is an example. To the left is a Python program defining a Task and related TaskRun. To the right is the equivalent YAML file.

```python
import fluid as couler

@couler.task
def echo_hello_world(hello, world="El mundo"):
couler.step(image="ubuntu", cmd=["echo"], args=[hello])
couler.step(image="ubuntu", cmd=["echo"], args=[world])
```

```yaml
---
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: echo-hello-world
spec:
inputs:
params:
- description: ''
name: hello
type: string
- default: El mundo
description: ''
name: world
type: string
steps:
- args:
- $(inputs.params.hello)
command:
- echo
image: ubuntu
name: example-py-12
- args:
- $(inputs.params.world)
command:
- echo
image: ubuntu
name: example-py-13
```

```python
echo_hello_world("Aloha")
```

```yaml
---
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: echo-hello-world-run
spec:
inputs:
params:
- name: hello
value: Aloha
taskRef:
name: echo_hello_world
```

For more information, please refer to the following documents.

- [Tutorial](doc/tutorial.md)
- [Design](doc/design.md)
- [Syntax](doc/syntax.md)