Flytesnacks encompasses code examples built on top of Flytekit Python
To get the hang of Python SDK, refer to the Getting Started tutorial before exploring the examples.
User Guide section has code examples, tips, and tricks that showcase the usage of Flyte features and integrations.
Tutorials section has real-world examples, ranging from machine learning training, data processing to feature engineering.
Flytesnacks currently has all examples in Python (Flytekit Python SDK). In the future, Java examples employing Flytekit JAVA will be out.
Here are the setup instructions to start contributing to flytesnacks
repo:
-
Determine where to put your new code:
-
Contains examples that demonstrates functionality available within core flytekit. These examples should be runnable locally.
-
Contains examples that leverage one or more of the available plugins.
-
Contains examples that demonstrates usage of Flyte to solve real world problems. These are more generally more complex examples that may require extra setup or that can only run on larger clusters.
-
-
Create a directory After determining where to put your example, create a directory under the appropriate parent directory. Each example directory should contain:
- Dockerfile
- Makefile
- README.rst
- init.py
- requirements.in
- sandbox.config It might be easier to copy one of the existing examples and modify it to your needs.
-
Add it to CI Examples are references in this github workflow Add a new entry under
strategy -> matrix -> directory
with the name of your directory as well as its relative path. -
Test your code!
- If the Python code can be run locally, just use
python <my file>
to run it. - If the Python code has to be tested in a cluster:
- Install flytectl by running
brew install flyteorg/homebrew-tap/flytectl
. Learn more about install and configuration of flytectl - Run the
make start
command in the root directory of the flytesnacks repo - Visit https://localhost:30081/console to view the Flyte console consisting of the examples present in flytesnacks/cookbook/core directory
- To fetch new dependencies and rebuild the image, run
make register
- If examples from a different directory (other than
core
) have to registered, enter the sandbox first:make shell
and then runmake -C <directory> register
.
- Install flytectl by running
- If the Python code can be run locally, just use
docs
folder in flytesnacks
houses the user guide and tutorials present in the documentation. Refer to the documentation contribution guide to get acquainted with the guidelines.
Refer to the issues section in the contribution guide if you'd like to file an issue relating to flytesnacks
code or documentation.