Metadata-Version: 2.1
Name: prefect
Version: 2.0a1
Summary: Workflow orchestration and management.
Home-page: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: aiofiles (==0.7.0)
Requires-Dist: aiosqlite (<0.18,>=0.17.0)
Requires-Dist: anyio (<4.0,>=3.0)
Requires-Dist: asyncpg (<0.25,>=0.23)
Requires-Dist: coolname (<2.0,>=1.0.0)
Requires-Dist: click (<8.0,>=7.0)
Requires-Dist: cloudpickle (<3.0,>=1.0)
Requires-Dist: croniter (<2.0,>=1.0)
Requires-Dist: distributed (>=2021.8.0)
Requires-Dist: fastapi (<0.68.2,>=0.66)
Requires-Dist: fsspec (>=2021.7.0)
Requires-Dist: httpx (<0.20,>=0.18)
Requires-Dist: pendulum (<3.0,>=2.0)
Requires-Dist: pydantic (<2.0,>=1.8)
Requires-Dist: pyyaml (<=6.0,>=5.0)
Requires-Dist: pytz (>=2021.1)
Requires-Dist: rich (<11.0,>=10.0)
Requires-Dist: sqlalchemy (<2.0,>=1.4.20)
Requires-Dist: typer (<1.0,>=0.4.0)
Requires-Dist: typing-extensions (<4.0,>=3.10.0.1)
Requires-Dist: uvicorn (<0.16.0,>=0.14.0)
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: ipython ; extra == 'dev'
Requires-Dist: mkdocs ; extra == 'dev'
Requires-Dist: mkdocs-material ; extra == 'dev'
Requires-Dist: mkdocstrings ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-asyncio ; extra == 'dev'
Requires-Dist: pytkdocs ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: pytest-env ; extra == 'dev'
Requires-Dist: requests ; extra == 'dev'
Requires-Dist: mock ; (python_version < "3.8") and extra == 'dev'

<p align="center"><img src="docs/img/logos/orion_logo.jpg" width=500></p>

# Orion

A development repo for Prefect Orion; reference documentation can be found at https://orion-docs.prefect.io/

## Installation

```bash
$ git clone https://github.com/PrefectHQ/orion.git
$ pip install -e "./orion[dev]"
```

## Running the Orion server

*Please note steps 1 and 2 are optional. The Orion server will use an in-memory SQLite database by default. If using the in-memory default database, migrations will occur automatically and the database will not persist data when the server is stopped.*
### Step 1: Configure the database connection

Orion server works against SQLite and Postgresql. To specify which database to connect to, set the `PREFECT_ORION_DATABASE_CONNECTION_URL` environment variable.

To connect to a SQLite database (easiest/recommended option):

```bash
export PREFECT_ORION_DATABASE_CONNECTION_URL=sqlite+aiosqlite:////tmp/orion.db
```

To connect to a Postgres database, the connection string should look something like this:

```bash
export PREFECT_ORION_DATABASE_CONNECTION_URL=postgresql+asyncpg://<username>:<password>@<hostname>/<dbname>'
```

### Step 2: Ensuring database is up to date

For the time being, there is no framework for migrations. "Migrating" the database consists of creating the correct tables.

To migrate the database, run the following two lines in a python repl

```python
import prefect, asyncio
asyncio.run(prefect.orion.utilities.database.create_db())
```

Note that for SQLite databases, models are created automatically if the database is in-memory or is being created for the first time.

### Step 3: Running the server

Use the following command to run an Orion server locally:

```bash
uvicorn prefect.orion.api.server:app --reload
```

The `--reload` flag will automatically reload when changes are made the source files.

### Step 4: Interacting with the Orion REST API

The Orion server features interactive documentation, which will **actually make requests against the server and trigger database changes**.

After starting the server, navigate to `localhost:8000/docs`. On this page, you'll find documentation of requests and responses for all endpoints. The docs also pre-populate example data you can use to test out requests.


