.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto/larger_apps/larger_apps_setup.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_larger_apps_larger_apps_setup.py: .. _larger_apps_build: Setup a Project ---------------- Prerequisites ^^^^^^^^^^^^^^^^ Make sure you have `git `__ and `python `__ >= 3.7 installed. Start a new project ^^^^^^^^^^^^^^^^^^^^ Create a `virtual environment `__ : .. prompt:: bash $ python -m venv ~/venvs/flyte source ~/venvs/flyte/bin/activate Then install `Flytekit `__ on it: .. prompt:: bash (flyte)$ pip install flytekit Then run ``pyflyte init ``, where ```` is the directory that will be created containing the scaffolding for a flyte-ready project. For this guide we're going call it ``my_flyte_project``: .. prompt:: bash (flyte)$ pyflyte init my_flyte_project cd my_flyte_project The ``my_flyte_project`` directory comes with a sample workflow, which can be found under ``flyte/workflows/example.py``. The structure below shows the most important files and how a typical Flyte app should be laid out. .. dropdown:: A typical Flyte app should have these files .. code-block:: text my_flyte_project ├── Dockerfile ├── docker_build_and_tag.sh ├── flyte │ ├── __init__.py │ └── workflows │ ├── __init__.py │ └── example.py └── requirements.txt .. note:: * 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: .. prompt:: bash (flyte)$ python flyte/workflows/example.py .. note:: The workflow needs to be invoked after the ``if __name__ == "__main__"`` entrypoint at the bottom of ``flyte/workflows/example.py``. Expected output: .. prompt:: text Running my_wf() hello world Conclusion ^^^^^^^^^^^ We've successfully created a Flyte project and executed your workflows on a python runtime environment! 🎉 Next, let's learn how to :ref:`deploy to the cloud `. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_larger_apps_larger_apps_setup.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: larger_apps_setup.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: larger_apps_setup.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_