• Stars
    star
    211
  • Rank 180,606 (Top 4 %)
  • Language
    Python
  • License
    Other
  • Created almost 4 years ago
  • Updated 11 months 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 tool empowering developers to build, observe, and react to data pipelines
Python
14,421
star
2

marvin

✨ Build AI interfaces that spark joy
Python
4,607
star
3

prefect-recipes

Snippets and templates representing common Customer Success patterns
HCL
214
star
4

ui

The home of the Prefect 1 UI
Vue
177
star
5

langchain-prefect

Tools for using Langchain with Prefect
Python
92
star
6

prefect-aws

Prefect integrations with AWS.
Python
87
star
7

prefect-helm

Helm charts for deploying Prefect Services
Smarty
80
star
8

prefect-dbt

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

prefect-collection-template

Template to quickly bootstrap a Prefect Collection
Python
64
star
10

prefect-dask

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

prefect-gcp

Prefect integrations with Google Cloud Platform.
Python
49
star
12

prefect-ray

Prefect integrations with Ray
Python
48
star
13

prefect-shell

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

prefect-kubernetes

Prefect integrations for interacting with Kubernetes.
Python
45
star
15

prefect-databricks

Prefect integrations for interacting with Databricks.
Python
39
star
16

prefect-azure

Prefect integrations with Microsoft Azure
Python
35
star
17

prefect-airbyte

Python
34
star
18

prefect-snowflake

Prefect integrations for orchestrating Snowflake.
Python
34
star
19

prefect-email

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

prefect-openmetadata

Prefect integration with OpenMetadata
Python
31
star
21

prefect-openai

Prefect integrations for working with OpenAI.
Python
31
star
22

prefect-github

Prefect integrations for interacting with GitHub
Python
29
star
23

prefect-twitter

Prefect integrations for interacting with Twitter.
Python
26
star
24

prefect-docker

Prefect integrations for working with Docker
Python
26
star
25

prefect-postgres

Prefect integrations for interacting with postgres.
Python
24
star
26

prefect-great-expectations

Prefect integrations for interacting with Great Expectations
Python
24
star
27

prefect-design

Vue
23
star
28

prefect-twilio

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

prefect-sendgrid

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

prefect-sqlalchemy

Prefect integrations with SQLAlchemy.
Python
20
star
31

prefect-slack

Prefect integrations with Slack
Python
18
star
32

prefect-jupyter

Prefect integrations interacting with Jupyter.
Python
16
star
33

miter-design

Miter Design component library made with β™‘ by Prefect
SCSS
14
star
34

prefect-monte-carlo

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

prefect-monday

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

prefect-gitlab

A Prefect collection for working with GitLab repositories.
Python
13
star
37

prefect-binder-tutorial

Jupyter Notebook
12
star
38

prefect-ui-library

Vue and Typescript library for Prefect 2 and Prefect Cloud 2
Vue
12
star
39

prefect-intel

Prefect / Intel collaboration
Python
12
star
40

prefect-hightouch

Prefect integrations for interacting with Hightouch.
Python
11
star
41

terraform-provider-prefect

Go
11
star
42

marvin-recipes

applications of https://github.com/PrefectHQ/marvin
Python
10
star
43

actions-prefect-deploy

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

prefect-hex

Prefect integrations for interacting with Hex.
Python
9
star
45

memory-graphql

Frontend Developer Coding Challenge
JavaScript
9
star
46

vue-compositions

A collection of reusable vue compositions
TypeScript
7
star
47

prefect-bitbucket

Prefect integrations for working with Bitbucket repositories
Python
7
star
48

prefect-background-task-examples

Examples of using Prefect for background tasks in web applications
Python
7
star
49

prefect-collection-registry

Source of truth for collection contents across the Prefect ecosystem
Python
6
star
50

memory

Junior Frontend Developer Coding Challenge
JavaScript
5
star
51

sample_flows

Prefect's example Flows
Python
5
star
52

graphs

Large scale graphs designed for Prefect
TypeScript
5
star
53

prefect-census

Prefect integrations for working with Census syncs
Python
5
star
54

prefect-firebolt

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

prefect-demos

Sales Engineering demo repository
Python
4
star
56

premojis

Emojis for Prefect
4
star
57

prometheus-prefect-exporter

Prometheus Prefect Exporter
Python
3
star
58

vue-charts

Vue
3
star
59

legacy-api-docs

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

hello-projects

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

prefect-demo-stocks

Python
2
star
62

test_flows

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

eslint-config

JavaScript
1
star
64

actions-prefect-auth

A GitHub Action for authenticating into Prefect Cloud
1
star
65

GitHub-Issue-Autoresponder

Python
1
star
66

qa-wolf-flows

Flows used by QA Wolf for testing
Python
1
star