This release is a pre-release and may not be stable for production use.
Couler
Couler is a programming language for describing workflows. It shares Python's syntax, but only a small subset -- the function definition and invocation. Couler is also the name of a compiler, which translates Couler programs into Argo YAML files.
Motivations
A motivation of Couler comes from the requirement of SQLFlow. SQLFlow translates SQL programs, with optionally AI syntax extension, into Couler programs, which, the Couler compiler translates into Argo YAML files.
SQLFlow needs Couler because it needs Argo. It needs Argo because it requires a workflow execution engine. It requires a workflow engine because, in most setups, the SQLFlow server cannot merely translates each SQL statement into a Python submitter program and runs them one-by-one. If it does so, the SQLFlow engine works like the workflow engine and needs to keep the status of the executions of workflows. However, unfortunately, as SQLFlow runs on Kubernetes as a service, which is the most common case, each server instance might be preempted at any time. The SQLFlow server could indeed save the status in robust storage like etcd; however, that introduces a lot of code and makes SQLFlow a duplication of reliable workflow engines like Argo.
We build Couler on top of Argo for some reasons:
- Argo YAML is less comprehensive, and it is hard to debug if we make SQLFlow generate YAML files directly.
- As we introduce Couler as a human-readable intermediate representation, it would benefit Python programmers in addition to SQLFlow users.
The Design
Steps and Functions
Couler users write a workflow as a Python program, where each step is a Python function definition, and the workflow itself is a sequence of function invocations. We want step-functions like the following.
couler.mysql.run(sql)couler.mysql.export_table(table, filename)couler.xgboost.train(model_def, training_data)couler.xgboost.predict(trained_mode, test_data)
Couler Core
When users define a step function, they could call the following fundamental functions provided by Couler.
couler.run_container(docker_image, cmd, args)starts a container to run a command-line with arguments. It returns values extracted from the standard output.couler.run_script(docker_image, function_name)runs a Python function defined in the current Couler program in a container. It returns values extracted from the standard output.couler.when(condition, step)runs a step if the condition lambda returns true.couler.map(step, a_list)repeatedly runs a step for each of the value in a given Python list.
Step Zoo
A collection of Couler step functions from a step zoo. Because each step runs in a Docker container, the step zoo might also container some Dockerfiles. It recommended configuring the CI/CD system to build the Docker images from Dockerfiles automatically.
Argo and Docker Mode
To make the debug even comfortable, we can make Couler support a Docker mode in addition to the Argo mode. In both ways, each step runs as a Docker container. The difference is that the containers run on a Kubernetes cluster in the Argo mode, but on the local host computer in Docker mode.
Metadata
Release files for couler 0.0.0.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| couler-0.0.0.dev0.tar.gz | 7.5 kB | Without provenance | Details for couler-0.0.0.dev0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| couler-0.0.0.dev0-py3-none-any.whl | Python 3 | none | any | Details for couler-0.0.0.dev0-py3-none-any.whl |
Total release size: 16.2 kB
Release files / couler-0.0.0.dev0.tar.gz
| Download URL | couler-0.0.0.dev0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06b51ab1e0989762f3f8ac7089a9be8b5e8e688776849d1e612b2efdf2ab6473
|
|
BLAKE2b-256 checksum How to use checksums |
08235f5426a669fd17388cc83542a14551e1391c57eaf5d3d108c80a84aa485a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.2
|
Release files / couler-0.0.0.dev0-py3-none-any.whl
| Download URL | couler-0.0.0.dev0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5585aaf2c22e1853b9f0aede2fa83b36b0552fbb9b74278bbaeaa5b2c5ab9fcd
|
|
BLAKE2b-256 checksum How to use checksums |
c9b275626a022f6cd2cd2efa9d57967f0571d1006dd28e5ae5fc3f9237ffa37e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.2
|
Security for couler 0.0.0.dev0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.