Code Monkey home page Code Monkey logo

prefect-demo's Introduction

Prefect Demo

ci

Prefect 2 (aka Orion) examples running self-contained in a local kubernetes cluster. Batteries (mostly) included. ๐Ÿ”‹

Getting started

Prerequisites:

  • make
  • node (required for pyright)
  • python >= 3.10
  • docker & docker compose
  • k3d (for creating a local kubernetes cluster)
  • kubectl
  • helm

To start:

Examples

Flows:

Deployments to Kubernetes created via:

Usage

Local

  1. make param-flow or make dask-flow or make ray-flow or make sub-flow
  2. make ui then navigate to http://localhost:4200/

The orion sqlite database is stored in ~/.prefect/prefect.db

Kubernetes

Create k3d cluster with an image registry, minio (for remote storage), the prefect agent and api

make kubes

Create deployments that run on kubernetes

make deploy

UI

Prefect UI: http://localhost:4200/

Minio UI: http://localhost:9001. User: minioadmin pass: minioadmin.

API

Prefect API: http://localhost:4200/api/

Docs

  • Blocks - an overview and look into the database tables for Blocks.
  • Deployment - an overview of the deployment process.

References

  • Tutorials from which some of the examples are taken

Cloud

To run flows with a cloud workspace set:

export PREFECT_API_URL=https://api.prefect.cloud/api/accounts/$accountid/workspaces/$workspaceid
export PREFECT_API_KEY=<your api key>

$accountid and $workspaceid are visible in the URL when you login to Prefect Cloud. The api key can be created from your user profile (bottom left).

Setting the environment variables is recommended. An alternative method is to login using:

prefect cloud login --key <your api key>

However be aware that this stores your api url and key as plain text ~/.prefect/profiles.toml.

Ray

Create a kubernetes ray cluster

make kubes-ray

Ray dashboard: http://localhost:8265

Known issues

Major

Minor

See all roadmap tagged issues for planned work.

Troubleshooting

Flows are late

Check the logs of the agent/worker:

make kubes-logs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.