This is a collection of short "how to" articles demonstrating the various capabilities and idiomatic usage of Flytekit. Note this currently does not include articles/tid-bits on how to use the Flyte platform at large, though in the future we may expand it to that.
- Write and Execute a Task
- Create a workflow from Tasks
- Launch Plans
- Multiple Schedules for a Workflow
- Executing pre-created tasks & workflows
- Interact with Past Workflow / Task Executions
- Working with Types
- Composing a Workflow from shared tasks and workflows
- Map/Array Tasks
- Compose a Workflow from other workflows
- Dynamically Generate a Workflow at Runtime
- Dynamic Tasks
- Tasks without flytekit or Using arbitrary containers
- Jupyter notebook as a task
- Different container per task
- Customize Offloaded Data Location
Each example is organized into a separate folder at this layer, and each has the Readme file linked to in the Contents, as well as supporting .py and .ipynb files, some of which contain information in a lot more depth.
Careful care has been taken to ensure that all the .py files contained in this guide are fully usable and compilable into Flyte entities. Readers that want to run these workflows for themselves should
- Follow instructions in the main Flyte documentation to set up a local Flyte cluster. All the commands in this book assume that you are using Docker Desktop. If you are using minikube or another K8s deployment, the commands will need to be modified.
- Please also ensure that you have a Python virtual environment installed and activated, and have pip installed the requirements.
- Use flyte-cli to create a project named
flytesnacks
(the name the Makefile is set up to use).
The examples written in this cookbook are meant to used in two ways, as a reference to read, and a live project to iterate and test on your local (or EKS/GCP/etc K8s cluster). To make some simple changes to the code in this cookbook to just try things out, or to just see it run on your local cluster, the iteration cycle should be
- Make your changes and commit (the steps below require a clean git tree).
- Activate your Python virtual environment with the requirements installed.
make docker_build
This will build the image tagged with justflytecookbook:<sha>
, no registry will be prefixed.make register_sandbox
This will register the Flyte entities in this cookbook against your local installation.
If you are just iterating locally, there is no need to push your Docker image. For Docker for Desktop at least, locally built images will be available for use in its K8s cluster.
If you would like to later push your image to a registry (Dockerhub, ECR, etc.), you can
REGISTRY=docker.io/corp make docker_push