Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flyteorg/flytekit-python-template
CookieCutter template for getting started with Flyte python projects
https://github.com/flyteorg/flytekit-python-template
cookiecutter cookiecutter-template data-science docker extensible flyte flytekit-python getting-started machine-learning project-structure python3
Last synced: 9 days ago
JSON representation
CookieCutter template for getting started with Flyte python projects
- Host: GitHub
- URL: https://github.com/flyteorg/flytekit-python-template
- Owner: flyteorg
- Created: 2021-02-01T20:33:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-29T16:20:30.000Z (6 months ago)
- Last Synced: 2024-05-30T06:01:43.438Z (6 months ago)
- Topics: cookiecutter, cookiecutter-template, data-science, docker, extensible, flyte, flytekit-python, getting-started, machine-learning, project-structure, python3
- Language: Python
- Homepage: https://docs.flyte.org/en/latest/getting_started.html
- Size: 189 KB
- Stars: 17
- Watchers: 5
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
In this repository you'll find a collection of [cookiecutter](https://cookiecutter.readthedocs.io/en/latest/) templates for making [Flyte](https://github.com/flyteorg/flyte) projects.
We use cookiecutter's ability to define [multiple templates to be defined in the same repository](https://cookiecutter.readthedocs.io/en/latest/advanced/directories.html). Each cookiecutter template is defined in a separate directory, e.g. the template used in Flyte's [Getting Started](https://docs.flyte.org/en/latest/getting_started.html) guide lives in a directory called `basic-template-imagespec`.
## Images
Compiled images for all templates can be found in our [ghcr.io registry](https://github.com/flyteorg/flytekit-python-template/pkgs/container/flytekit-python-template)
### ImageSpec vs Dockerfile
Flytekit uses the `basic-template-imagespec` template by default when you initialize a new project with `pyflyte init`. That template uses [ImageSpec](https://docs.flyte.org/en/latest/user_guide/customizing_dependencies/imagespec.html), which builds Docker images without a Dockerfile, so doesn't contain a Dockerfile or `docker-build.sh` script.
However, some templates in this repository contain a Dockerfile and `docker-build.sh` script that you can use to build a Docker image for your Flyte project:
```
# help
./docker_build.sh -h# build an image with defaults
./docker_build.sh# build an image with custom values
./docker_build.sh -p {{ cookiecutter.project_name }} -r -v
```**Note:** You should only use `docker-build.sh` script to build a Docker image for a Flyte project that contains a Dockerfile.
## Usage
Each template can be rendered by specifying the `--directory` flag to cookiecutter. For example, in order to generate a project using the `basic-template-imagespec` template, run:
$ cookiecutter https://github.com/flyteorg/flytekit-python-template.git --directory="basic-template-imagespec"
This should prompt for a few variables that will be used to set up the project.