Skip to content

Commit

Permalink
Updates language around Prefect server and Cloud in the docs (#14511)
Browse files Browse the repository at this point in the history
Co-authored-by: Bill Palombi <[email protected]>
  • Loading branch information
discdiver and billpalombi authored Jul 9, 2024
1 parent a5d9f3a commit 82867e6
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 56 deletions.
2 changes: 1 addition & 1 deletion docs/3.0rc/api-ref/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Prefect auto-generates reference documentation for the following components:
- **[Prefect Python SDK](https://prefect-python-sdk-docs.netlify.app/)**: used to build, test, and execute workflows.
- **Prefect REST API**: used by workflow clients and the Prefect UI for orchestration and data retrieval.
- Prefect Cloud REST API documentation is available at <a href="https://app.prefect.cloud/api/docs" target="_blank">https://app.prefect.cloud/api/docs</a>.
- The REST API documentation for a locally hosted open-source Prefect server is available in the [Prefect REST API Reference](3.0rc/api-ref/server).
- The REST API documentation for self-hosted Prefect server is available in the [Prefect REST API Reference](3.0rc/api-ref/server).


When self-hosting, you can access REST API documentation at the `/docs` endpoint of your [`PREFECT_API_URL`](/3.0rc/manage/settings-and-profiles/) - for example, if you ran `prefect server start` with no additional configuration you can find this reference at <a href="http://localhost:4200/docs" target="_blank">http://localhost:4200/docs</a>.
23 changes: 14 additions & 9 deletions docs/3.0rc/api-ref/rest-api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ description: Prefect REST API for interacting with the orchestration engine and

The Prefect API is organized around REST. It is used for communicating data from clients to a self-hosted Prefect server instance so that orchestration can be performed. This API is consumed by clients such as the Prefect Python SDK or the server dashboard.

Prefect Cloud and a locally hosted Prefect server each provide a REST API.
Prefect Cloud and self-hosted Prefect server each provide a REST API.

- Prefect Cloud:
- [Interactive Prefect Cloud REST API documentation](https://app.prefect.cloud/api/docs)
- [Finding your Prefect Cloud details](#finding-your-prefect-cloud-details)
- A self-hosted server instance:
- Interactive REST API documentation for a self-hosted Prefect server instance is available under **Server API** on the sidebar naviagtion or at `http://localhost:4200/docs` or the `/docs` endpoint of the [PREFECT_API_URL](/3.0rc/manage/settings-and-profiles/) you have configured to access the server. You must have the server running with `prefect server start` to access the interactive documentation.
- Self-hosted Prefect server:
- Interactive REST API documentation for self-hosted Prefect server is available under **Server API** on the sidebar naviagtion or at `http://localhost:4200/docs` or the `/docs` endpoint of the [PREFECT_API_URL](/3.0rc/manage/settings-and-profiles/) you have configured to access the server. You must have the server running with `prefect server start` to access the interactive documentation.

## Interacting with the REST API
## Interact with the REST API

You can interact with the Prefect REST API in several ways:

Expand All @@ -22,23 +22,26 @@ You can interact with the Prefect REST API in several ways:
- Use an HTTP library in your language of choice
- Use [curl](https://curl.se/) from the command line

### PrefectClient with a Prefect server
This example uses `PrefectClient` with a locally hosted Prefect server:
### PrefectClient with self-hosted Prefect server
This example uses `PrefectClient` with self-hosted Prefect server:

```python
import asyncio
from prefect.client.orchestration import get_client


async def get_flows():
client = get_client()
r = await client.read_flows(limit=5)
return r


r = asyncio.run(get_flows())

for flow in r:
print(flow.name, flow.id)


if __name__ == "__main__":
asyncio.run(get_flows())
```
Expand All @@ -60,6 +63,7 @@ This example uses the Requests library with Prefect Cloud to return the five new
```python
import requests


PREFECT_API_URL="https://api.prefect.cloud/api/accounts/abc-my-cloud-account-id-is-here/workspaces/123-my-workspace-id-is-here"
PREFECT_API_KEY="123abc_my_api_key_goes_here"
data = {
Expand Down Expand Up @@ -114,7 +118,7 @@ PREFECT_API_KEY='123abc_my_api_key_is_here'
Alternatively, view your Account ID and Workspace ID in your browser URL. For example: `https://app.prefect.cloud/account/abc-my-account-id-is-here/workspaces/123-my-workspace-id-is-here`.


## REST Guidelines
## REST guidelines

The REST APIs adhere to the following guidelines:

Expand Down Expand Up @@ -142,7 +146,7 @@ The REST APIs adhere to the following guidelines:
- `POST /collection/action` is how we implement non-CRUD actions. For example, to set a flow run's state, we use `POST /flow_runs/:id/set_state`.
- `POST /collection/action` may also be used for read-only queries. This is to allow us to send complex arguments as body arguments (which often cannot be done via `GET`). Examples include `POST /flow_runs/filter`, `POST /flow_runs/count`, and `POST /flow_runs/history`.

## Filtering
## Filter results

Objects can be filtered by providing filter criteria in the body of a `POST` request. When multiple criteria are specified, logical AND will be applied to the criteria.

Expand Down Expand Up @@ -194,11 +198,12 @@ For example, to query for flows with the tag `"database"` and failed flow runs,

The Prefect REST API can be fully described with an OpenAPI 3.0 compliant document. [OpenAPI](https://swagger.io/docs/specification/about/) is a standard specification for describing REST APIs.

To generate the Prefect server's complete OpenAPI document, run the following commands in an interactive Python session:
To generate self-hosted Prefect server's complete OpenAPI document, run the following commands in an interactive Python session:

```python
from prefect.server.api.server import create_app


app = create_app()
openapi_doc = app.openapi()
```
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/automate/automate-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ This **Automate** section explains how create workflows that run automatically a
- [Track activity through events](/3.0rc/automate/events/events/) discusses how to observe events that create a record of activity.
- [Trigger actions on events](/3.0rc/automate/events/automations-triggers/) shows how to use events to trigger actions.
- [Define custom event triggers](/3.0rc/automate/events/custom-triggers/) discusses advanced trigger options.
- [Receive events with webhooks](/3.0rc/automate/events/webhook-triggers/) explains how to use webhooks to receive events from external systems with Prefect cloud.
- [Receive events with webhooks](/3.0rc/automate/events/webhook-triggers/) explains how to use webhooks to receive events from external systems with Prefect Cloud.
- [Manage incidents](/3.0rc/automate/incidents/) show how Prefect Cloud can help identify, resolve, and document issues in mission-critical workflows.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Learn about where to store your flow code.
---

When a deployment runs, the execution environment needs access to the flow code.
Flow code is not stored in a Prefect server instance or in Prefect Cloud.
Flow code is not stored in Prefect server or Prefect Cloud.

You have several flow code storage options.

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/deploy/infrastructure-concepts/work-pools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ If you don't use the `--type` flag to specify an infrastructure type, you are pr
| Modal - Push | Execute flow runs on Modal. Requires a Modal account. Flow runs are pushed directly to your Modal workspace, without the need for a Prefect worker. |
| Prefect Managed | Execute flow runs within containers on Prefect managed infrastructure. |
</Tab>
<Tab title="Prefect server instance">
<Tab title="Self-hosted Prefect server">

| Infrastructure Type | Description |
| ---------------------------- | ------------------------ |
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/deploy/run-flows-in-local-processes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ A few optional steps for exploration include:
**Hybrid execution option**

Prefect's deployment interface allows you to choose a hybrid execution model.
Whether you use Prefect Cloud or host a Prefect server instance, you can run workflows in the
Whether you use Prefect Cloud or self-host Prefect server, you can run workflows in the
environments best suited to their execution.
This model enables efficient use of your infrastructure resources while maintaining the privacy
of your code and data.
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/develop/artifacts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Prefect artifacts:
- are visually rich annotations on flow and task runs
- are human-readable visual metadata produced in code
- come in standardized formats such as tables, progress indicators, images, Markdown, or links
- are stored on Prefect Cloud or a Prefect server instance and rendered in the Prefect UI
- are stored in Prefect Cloud or Prefect server and rendered in the Prefect UI
- make it easy to visualize outputs or side effects that your runs produce, and capture updates over time

![Markdown artifact sales report screenshot](/3.0rc/img/ui/md-artifact-info.png)
Expand Down
4 changes: 2 additions & 2 deletions docs/3.0rc/develop/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Blocks are instantiation of these classes with specific values.
Configure blocks through Python code or through the UI.
Access blocks for use in Python code.

Block values are stored in Prefect Cloud or your self-hosted Prefect server instance.
Blocks are stored in your Prefect Cloud account or your self-hosted Prefect server instance.
You can share blocks with other users in your Prefect Cloud workspace.

To see block types available for configuration, use `prefect block type ls`
Expand Down Expand Up @@ -444,7 +444,7 @@ class S3Bucket(Block):
...
```

Then [register the updated block type](#register-blocks) with either Prefect Cloud or your self-hosted Prefect server instance.
Then [register the updated block type](#register-blocks) with either your Prefect Cloud account or your self-hosted Prefect server instance.

If you have any existing blocks of this type that were created before the update and
you'd prefer to not re-create them, migrate them to the new version of your block type by adding the missing values:
Expand Down
12 changes: 6 additions & 6 deletions docs/3.0rc/develop/deferred-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ conda activate python-tasks
pip install -U prefect marvin fastapi==0.107
```

#### Step 3: Connect to Prefect Cloud or a local Prefect server instance
#### Step 3: Connect to Prefect Cloud or a self-hosted Prefect server

You can use either Prefect Cloud or a local Prefect server instance for these examples (if not set already).
Use either Prefect Cloud or a self-hosted Prefect server for these examples.

You must have `PREFECT_API_URL` set to send tasks to task workers.

If you're using a local Prefect server instance with a SQLite backing database (the default database),
If you're using a Prefect server with a SQLite backing database (the default database),
save this value to your active Prefect Profile with the following command:

```bash
Expand All @@ -149,12 +149,12 @@ prefect config set PREFECT_API_URL=http://127.0.0.1:4200/api
If using Prefect Cloud, set the `PREFECT_API_URL` value to the Prefect Cloud API URL and add your
[API key](https://docs.prefect.io/cloud/users/api-keys/).

The examples that use docker (examples 4 and 5) use a local Prefect server instance by default.
The examples that use docker (examples 4 and 5) use a Prefect server by default.
You can switch to Prefect Cloud by changing the `PREFECT_API_URL` and adding a variable for your API key in the
`docker-compose.yaml`.
Or use a local server instance backed by a PostgreSQL database by setting the `PREFECT_API_DATABASE_CONNECTION_URL`.
Or use a Prefect server backed by a PostgreSQL database by setting the `PREFECT_API_DATABASE_CONNECTION_URL`.

If using a local Prefect server instance instead of Prefect Cloud, start your server by running the following command:
If using Prefect server instead of Prefect Cloud, start your server by running the following command:

```bash
prefect server start
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/develop/inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ if __name__ == "__main__":
asyncio.run(sender())
```

To run the example, you need a Python environment with Prefect installed, pointed at either Prefect Cloud or a self-hosted Prefect server instance.
To run the example, you need a Python environment with Prefect installed, pointed at either a Prefect Cloud account or a self-hosted Prefect server instance.

With your environment set up, start a flow runner in one terminal with the following command:

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/develop/interact-with-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ In the CLI, install the Prefect integration library for your cloud provider:

## Register the block types

Register the new block types with Prefect Cloud (or with your self-hosted Prefect server instance):
Register the new block types with your Prefect Cloud account (or with your self-hosted Prefect server instance):

<Tabs>
<Tab title="AWS">
Expand Down
4 changes: 2 additions & 2 deletions docs/3.0rc/develop/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Variables enable you to store and reuse non-sensitive bits of data, such as conf
They are:

- named, mutable values of any JSON type
- scoped to a Prefect server instance or a single workspace in Prefect Cloud
- scoped to a self-hosted Prefect server instance or a single workspace in a Prefect Cloud account
- meant for values with infrequent writes and frequent reads (but you can create or
modify variables at any time)
- cacheable for quicker retrieval
Expand Down Expand Up @@ -37,7 +37,7 @@ Optionally, you can add tags to a variable.

### Through the Prefect UI

View all the variables in your Prefect server instance or Prefect Cloud workspace
View all the variables in your self-hosted Prefect server instance or Prefect Cloud account workspace
in the **Variables** page of the Prefect UI. Both the name and value of all variables
are visible to anyone with access to the server or workspace.

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/develop/write-flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ For example, by running a script or importing the function into an interactive s
You can also create a flow run by:

- Using external schedulers such as `cron` to invoke a flow function
- Triggering a [deployment](/3.0rc/deploy/infrastructure-examples/docker/) of that flow on Prefect Cloud or a self-hosted Prefect server instance
- Triggering a [deployment](/3.0rc/deploy/infrastructure-examples/docker/) of that flow in Prefect Cloud or self-hosted Prefect server
- Starting a flow run for the deployment through a schedule, the Prefect UI, or the Prefect API

However you run your flow, Prefect monitors the flow run, capturing its state for observability.
Expand Down
8 changes: 4 additions & 4 deletions docs/3.0rc/get-started/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Review the `pip install` output messages for the `Scripts` folder path on your s

## Minimal Prefect installation

The `prefect-client` library is a minimal installation of Prefect designed for interacting with Prefect Cloud or a remote self-hosted server instance.
The `prefect-client` library is a minimal installation of Prefect designed for interacting with Prefect Cloud or a remote self-hosted Prefect server instance.

`prefect-client` enables a subset of Prefect's capabilities with a smaller installation size, making it ideal for use in lightweight, resource-constrained, or ephemeral environments.
It omits all CLI and server components found in the `prefect` library.
Expand All @@ -60,10 +60,10 @@ pip install -U prefect-client
You also need an API server, either:

* [Prefect Cloud](/3.0rc/manage/cloud/), a managed solution that provides strong scaling, performance, and security, or
* Your own hosted [Prefect server instance](/3.0rc/manage/self-host/)
* [Self-hosted Prefect server](/3.0rc/manage/self-host/), an API server that you run on your own infrastructure where you are responsible for scaling and any authentication and authorization.

Now that you have Prefect installed, go through the [quickstart](/3.0rc/get-started/quickstart/) to try it out.

Learn more about release versions in the [Prefect Release Notes](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md).
Learn more about release versions in the [Prefect release notes](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md).

See our [Contributing guide](/contribute/dev-contribute/) for instructions on installing Prefect for development.
See our [Contributing docs](/contribute/dev-contribute/) for instructions on installing Prefect for development.
5 changes: 3 additions & 2 deletions docs/3.0rc/get-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If needed, see [Install Prefect](/3.0rc/get-started/install/) for other options.

## Connect to Prefect's API

Connect to the Prefect API, either Prefect Cloud hosted by us, or a local Prefect server instance:
Connect to the Prefect API, either Prefect Cloud hosted by us, or a self-hosted Prefect server that you maintain:

<Tabs>
<Tab title="Prefect Cloud">
Expand Down Expand Up @@ -161,7 +161,8 @@ Deploy your flow to Cloud using a managed work pool.
1. View your new work pool on the **Work Pools** page of the UI.
</Tab>
<Tab title="Local server">
Deploy your flow to your local server using a Process type work pool.
Deploy your flow to a self-hosted Prefect server instance using a Process type work pool.
1. Create a Process type work pool:
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/manage/cloud/connect-to-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This involves:
## Log into Prefect Cloud from a terminal

Configure a local execution environment to use Prefect Cloud as the API server for flow runs.
You will "log in" to Prefect Cloud from a local environment where you want to run a flow.
You will log in a to Prefect Cloud account from the local environment where you want to run a flow.

### Steps

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/manage/cloud/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Prefect Cloud overview
description: Observe and orchestrate workflow applications with the Prefect Cloud platform.
---

Prefect Cloud is a hosted workflow application platform with all the capabilities of an open source Prefect server instance plus additional features.
Prefect Cloud is a hosted workflow application platform with all the capabilities of the open source Prefect server plus additional features.

- [Connect to Prefect Cloud](/3.0rc/manage/cloud/connect-to-cloud/) shows how to configure a local execution environment to access Prefect Cloud.

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0rc/manage/manage-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ The **Use Prefect Cloud** section covers how to interact with Prefect Cloud.
See the [Prefect Cloud overview](/3.0rc/manage/cloud/) for a discussion of the pages in this section.


- [Host Prefect server](/3.0rc/manage/self-host/) explains how to self-host a Prefect server instance.
- [Host Prefect server](/3.0rc/manage/self-host/) explains how to self-host Prefect server.
- [Configure settings and profiles](/3.0rc/manage/self-host/) shows how to conigure API interactions through environment variables or Prefect profiles.
- [Manage run metadata in Python](/3.0rc/manage/self-host/) demonstrates how to interact with the API in Python through the `PrefectClient`.
Loading

0 comments on commit 82867e6

Please sign in to comment.