Setup a Project#
Start a new project#
Create a virtual environment :
python -m venv ~/venvs/flyte source ~/venvs/flyte/bin/activate
Then install Flytekit on it:
pip install flytekit
pyflyte init <project_name>, where
<project_name> is the
directory that will be created containing the scaffolding for a flyte-ready
project. For this guide we’re going call it
pyflyte init my_flyte_project cd my_flyte_project
my_flyte_project directory comes with a sample workflow, which can be
flyte/workflows/example.py. The structure below shows the most
important files and how a typical Flyte app should be laid out.
A typical Flyte app should have these files
my_flyte_project ├── Dockerfile ├── docker_build_and_tag.sh ├── flyte │ ├── __init__.py │ └── workflows │ ├── __init__.py │ └── example.py └── requirements.txt
You can use pip-compile to build your requirements file.
The Dockerfile that comes with this is not GPU ready, but is a simple Dockerfile that should work for most of your apps.
Run the Workflow Locally#
The workflow can be run locally, simply by running it as a Python script:
The workflow needs to be invoked after the
if __name__ == "__main__"
entrypoint at the bottom of
Running my_wf() hello world
We’ve successfully created a Flyte project and executed your workflows on a python runtime environment! 🎉 Next, let’s learn how to deploy to the cloud.
Total running time of the script: ( 0 minutes 0.000 seconds)