Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New author tutorials #15990

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

New author tutorials #15990

wants to merge 35 commits into from

Conversation

daniel-prefect
Copy link
Contributor

@daniel-prefect daniel-prefect commented Nov 12, 2024

This PR updates the quickstart and adds three new tutorials. These four tutorials collectively serve as a tutorial series to get developers up to speed on Prefect, though they're written in such a way that a developer can start with any of them.

image

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

@daniel-prefect daniel-prefect marked this pull request as ready for review November 15, 2024 21:48
Copy link
Contributor

@discdiver discdiver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Thank you! Left a few suggestions.

1. Open the Prefect dashboard in your browser at [http://localhost:4200](http://localhost:4200).
</Tab>
<Tab title="Prefect Cloud">
1. Head to [https://app.prefect.cloud/](https://app.prefect.cloud/) and sign in or create a forever-free Prefect Cloud account.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Head to [https://app.prefect.cloud/](https://app.prefect.cloud/) and sign in or create a forever-free Prefect Cloud account.
1. Head to [https://app.prefect.cloud/](https://app.prefect.cloud/) and sign in or create a free Prefect Cloud account.

## Publish your code to a remote repository

First, you need to take the code from your local machine and publish it to a remote repository.
We've already published the code you need for this tutorial:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We've already published the code you need for this tutorial:
We've already published the code to GitHub that you need for this tutorial:

<Tab title="Self-hosted">

Deploy your flow to a self-hosted Prefect server instance using a `Process` work pool.
All flow runs submitted to this work pool will run in a local subprocess (the mechanics are similar for other work pool types that run on remote infrastructure).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All flow runs submitted to this work pool will run in a local subprocess (the mechanics are similar for other work pool types that run on remote infrastructure).
All flow runs submitted to this work pool will run in a local subprocess (the creation mechanics are similar for other work pool types that run on remote infrastructure).

## Deploy and schedule your flow

A [deployment](/3.0/deploy/infrastructure-examples/docker/) is used to determine when, where, and how a flow should run.
Deployments elevate flows to remotely configurable entities that have their own API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Deployments elevate flows to remotely configurable entities that have their own API.
Deployments elevate flows to remotely configurable entities that have their own API.
To set a flow to run on a schedule, you need to create a deployment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a redirect for deleted files in mint.json.

return None
```

<Expandable title="full example">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expandables are 🔥

issue_details = []
for issue in all_issues[:5]: # Limit to 5 issues to avoid hitting rate limits
issue_details.append(
fetch_issue_details.submit(repo, issue['number']) # Make requests in parallel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either inline, or probably below, maybe call out what .submit is doing briefly and send folks to another docs page to learn more. It's kind of subtle as is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note where use ".submit" above in short code example.


## Ingest large amounts of data

Use pagination to fetch large amounts of data and run tasks in parallel to analyze the data efficiently:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use pagination to fetch large amounts of data and run tasks in parallel to analyze the data efficiently:
Use pagination to fetch large amounts of data and run tasks concurrently to analyze the data efficiently:

```
</Expandable>

## Structure your code with dependent subflows and tasks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Structure your code with dependent subflows and tasks
## Structure your code with dependent nested flows and tasks

Esewhere in the docs we refer to them as nested flows, good to keep the consistency.

## Put it all together

Here's the complete flow that combines all of these components.
We'll also add retries, caching, and rate limiting to make the workflow more robust.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of goodies! I suggest linking each of the words to where the reader can learn more about these ideas, and adding a line about the benefit of each one might not be bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants