• Stars
    star
    211
  • Rank 186,867 (Top 4 %)
  • Language
    Python
  • License
    Other
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Prefect API and backend

Please note: If you are new to Prefect, we strongly recommend starting with Prefect 2 and Prefect Cloud 2, as they are in General Availability.

Prefect 1 Core, Server, and Cloud are our first-generation workflow and orchestration tools. You can continue to use them and we'll continue to support them while migrating users to Prefect 2. Prefect 2 can also be self-hosted and does not depend on this repository in any way.

If you're ready to start migrating your workflows to Prefect 2, see our migration guide.

Prefect Server

Please note: this repo is for Prefect Server development. If you want to run Prefect Server, the best first step is to install Prefect and run prefect server start.

If you want to install Prefect Server on Kubernetes, take a look at the Server Helm Chart.

If you would like to work on the Prefect UI or open a UI-specific issue, please visit the Prefect UI repository.

Overview

Prefect Server is an open source backend that makes it easy to monitor and execute your Prefect flows.

Prefect Server consists of a number of related services including:

  • postgres: the database persistence layer
  • hasura: a GraphQL API for Postgres (http://hasura.io)
  • graphql: a Python-based GraphQL server that exposes mutations (actions) representing Prefect Server's logic
  • apollo: an Apollo Server that serves as the main user interaction endpoint, and stitches together the hasura and graphql APIs
  • towel: a variety of utility services that provide maintenance routines, because a towel is just about the most massively useful thing an interstellar hitchhiker can carry
    • scheduler: a service that searches for flows that need scheduling and creates new flow runs
    • lazarus: a service that detects when flow runs ended abnormally and should be restarted
    • zombie_killer: a service that detects when task runs ended abnormally and should be failed

These services are intended to be run within Docker and some CLI commands require docker-compose which helps orchestrate running multiple Docker containers simultaneously.

Installation

  1. Don't Panic.

  2. Make sure you have Python 3.7+ and Prefect installed:

    pip install prefect
    
  3. Clone this repo, then install Prefect Server and its dependencies by running:

    pip install -e .
    cd services/apollo && npm install
    

Note: if installing for local development, it is important to install using the -e flag with [dev] extras: pip install -e ".[dev]"

Running the system as a developer

Note: for deploying Prefect Server, please use the prefect server start CLI command in Prefect Core 0.13.0+.

If you are doing local development on Prefect Server, it is best to run most services as local processes. This allows for hot-reloading as code changes, setting debugging breakpoints, and generally speeds up the pace of iteration.

In order to run the system:

  1. Start the database and Hasura in Docker:

    prefect-server dev infrastructure

    If when starting the infrastructure, you receive an error message stating infrastructure_hasura_1 exited with code 137, it is likely a memory issue with Docker. Bumping Docker Memory to 8GB should solve this.

  2. Run the database migrations and apply Hasura metadata:

    prefect-server database upgrade
  3. In a new terminal, start the services locally:

    prefect-server dev services

You can use the -i (include) or -e (exclude) flags to choose specific services:

# run only apollo and graphql
prefect-server dev services -i apollo,graphql

# run all except graphql
prefect-server dev services -e graphql

Running tests

Prefect Server has three types of tests:

  • unit tests: used to validate individual functions
  • service tests: used to verify functionality throughout Prefect Server
  • integration tests: used to verify functionality between Prefect Core and Server

Prefect Server uses pytest for testing. Tests are organized in a way that generally mimics the src directory. For example, in order to run all unit tests for the API and the GraphQL server, run:

pytest tests/api tests/graphql

Unit tests can be run with only prefect-server dev infrastructure running. Service and integration tests require Prefect Server's services to be running as well.

Filing an issue

Whether you'd like a feature or you're seeing a bug, we welcome users filing issues. Helpful bug issues include:

  • the circumstances surrounding the bug
  • the desired behavior
  • a minimum reproducible example

Helpful feature requests include:

  • a description of the feature
  • how the feature could be helpful
  • if applicable, initial thoughts about feature implementation

Please be aware that Prefect Server feature requests that might compete with propriety Prefect Cloud features will be rejected.

License

Prefect Server is lovingly made by the team at Prefect and licensed under the Prefect Community License. For information on how you can use, extend, and depend on Prefect Server to automate your data, take a look at our license or contact us.

More Repositories

1

prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
Python
16,121
star
2

marvin

✨ Build AI interfaces that spark joy
Python
5,146
star
3

ControlFlow

🦾 Take control of your AI agents
Python
676
star
4

prefect-recipes

Snippets and templates representing common Customer Success patterns
HCL
238
star
5

ui

The home of the Prefect 1 UI
Vue
177
star
6

langchain-prefect

Tools for using Langchain with Prefect
Python
99
star
7

prefect-aws

Prefect integrations with AWS.
Python
84
star
8

prefect-helm

Helm charts for deploying Prefect Services
Smarty
80
star
9

prefect-dbt

Collection of Prefect integrations for working with dbt with your Prefect flows.
Python
70
star
10

prefect-collection-template

Template to quickly bootstrap a Prefect Collection
Python
65
star
11

prefect-dask

Prefect integrations with the Dask execution framework.
Python
54
star
12

prefect-kubernetes

Prefect integrations for interacting with Kubernetes.
Python
50
star
13

prefect-gcp

Prefect integrations with Google Cloud Platform.
Python
49
star
14

prefect-ray

Prefect integrations with Ray
Python
48
star
15

prefect-shell

Prefect tasks and subflows for interacting with shell commands.
Python
46
star
16

prefect-databricks

Prefect integrations for interacting with Databricks.
Python
39
star
17

prefect-azure

Prefect integrations with Microsoft Azure
Python
35
star
18

prefect-airbyte

Python
34
star
19

prefect-snowflake

Prefect integrations for orchestrating Snowflake.
Python
34
star
20

prefect-email

Prefect tasks and subflows for interacting with email
Python
33
star
21

prefect-openmetadata

Prefect integration with OpenMetadata
Python
31
star
22

prefect-openai

Prefect integrations for working with OpenAI.
Python
31
star
23

prefect-design

Vue
29
star
24

prefect-github

Prefect integrations for interacting with GitHub
Python
29
star
25

prefect-twitter

Prefect integrations for interacting with Twitter.
Python
26
star
26

prefect-docker

Prefect integrations for working with Docker
Python
26
star
27

prefect-postgres

Prefect integrations for interacting with postgres.
Python
24
star
28

prefect-great-expectations

Prefect integrations for interacting with Great Expectations
Python
24
star
29

prefect-twilio

Prefect tasks and subflows for interacting with Twilio.
Python
22
star
30

prefect-sendgrid

Prefect tasks and subflows for interacting with SendGrid.
Python
22
star
31

prefect-ui-library

Vue and Typescript library for Prefect 2 and Prefect Cloud 2
TypeScript
20
star
32

prefect-sqlalchemy

Prefect integrations with SQLAlchemy.
Python
20
star
33

prefect-slack

Prefect integrations with Slack
Python
18
star
34

prefect-jupyter

Prefect integrations interacting with Jupyter.
Python
16
star
35

prefect-background-task-examples

Examples of using Prefect for background tasks in web applications
Python
16
star
36

prefect-monte-carlo

A collection of Prefect tasks and flows to orchestrate Monte Carlo.
Python
14
star
37

miter-design

Miter Design component library made with β™‘ by Prefect
SCSS
13
star
38

prefect-monday

Prefect integrations for interacting with monday.com
Python
13
star
39

prefect-binder-tutorial

Jupyter Notebook
12
star
40

marvin-recipes

applications of https://github.com/PrefectHQ/marvin
Python
12
star
41

prefect-gitlab

A Prefect collection for working with GitLab repositories.
Python
12
star
42

prefect-intel

Prefect / Intel collaboration
Python
12
star
43

prefect-hightouch

Prefect integrations for interacting with Hightouch.
Python
11
star
44

terraform-provider-prefect

Go
11
star
45

prefect-operator

A Kubernetes operator for managing Prefect servers and work pools
Go
9
star
46

actions-prefect-deploy

A GitHub Action for deploying a Prefect flow to Prefect Cloud
9
star
47

prefect-hex

Prefect integrations for interacting with Hex.
Python
9
star
48

memory-graphql

Frontend Developer Coding Challenge
JavaScript
9
star
49

vue-compositions

A collection of reusable vue compositions
TypeScript
8
star
50

graphs

Large scale graphs designed for Prefect
TypeScript
8
star
51

prefect-collection-registry

Source of truth for collection contents across the Prefect ecosystem
Python
8
star
52

prefect-bitbucket

Prefect integrations for working with Bitbucket repositories
Python
7
star
53

prefect-demos

Sales Engineering demo repository
Python
6
star
54

memory

Junior Frontend Developer Coding Challenge
JavaScript
5
star
55

sample_flows

Prefect's example Flows
Python
5
star
56

prefect-firebolt

Prefect integrations for working with Firebolt data warehouses.
Python
5
star
57

prefect-census

Prefect integrations for working with Census syncs
Python
5
star
58

prefect-duckdb

Python
4
star
59

premojis

Emojis for Prefect
4
star
60

vue-charts

Vue
4
star
61

prometheus-prefect-exporter

Prometheus Prefect Exporter
Python
3
star
62

legacy-api-docs

Legacy API documentation for https://github.com/PrefectHQ/prefect
HTML
3
star
63

hello-projects

A repository used for demo'ing Prefect projects
Python
2
star
64

prefect-demo-stocks

Python
2
star
65

docs

HTML
2
star
66

eslint-config

JavaScript
1
star
67

GitHub-Issue-Autoresponder

Python
1
star
68

test_flows

A repo of MRE and test work flows
Python
1
star
69

actions-prefect-auth

A GitHub Action for authenticating into Prefect Cloud
1
star
70

documentation

Documentation for Prefect.io v3
MDX
1
star
71

qa-wolf-flows

Flows used by QA Wolf for testing
Python
1
star