https://github.com/sql-machine-learning/fluid
https://github.com/sql-machine-learning/fluid
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sql-machine-learning/fluid
- Owner: sql-machine-learning
- Created: 2019-12-22T23:59:58.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2020-04-02T02:56:18.000Z (almost 6 years ago)
- Last Synced: 2025-07-15T06:48:45.647Z (7 months ago)
- Language: Python
- Homepage:
- Size: 477 KB
- Stars: 5
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
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)