Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

add GCP Cloud Run worker guide #203

Merged
merged 54 commits into from
Oct 23, 2023

Conversation

biancaines
Copy link
Contributor

@biancaines biancaines commented Aug 2, 2023

Closes

Example

Screenshots

Checklist

  • References any related issue by including "Closes #" or "Closes ".
    • If no issue exists and your change is not a small fix, please create an issue first.
  • Includes tests or only affects documentation.
  • Passes pre-commit checks.
    • Run pre-commit install && pre-commit run --all locally for formatting and linting.
  • Includes screenshots of documentation updates.
    • Run mkdocs serve view documentation locally.
  • Summarizes PR's changes in CHANGELOG.md

@biancaines biancaines marked this pull request as ready for review September 1, 2023 15:09
@biancaines biancaines requested a review from a team as a code owner September 1, 2023 15:09
@zzstoatzz zzstoatzz changed the title first commit for new worker and cloud run guide add GCP Cloud Run worker guide Sep 1, 2023
Copy link
Contributor

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

this is awesome! just a couple wording suggestions

docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
1. `prefect.deployments.steps.run_shell_script` : runs a shell command which configures Docker to authenticate with GCR using your Google Cloud credentials.
2. `prefect_docker.deployments.steps.build_docker_image` : builds a Docker image automatically which uses the name and tag chosen previously.

!!!Warning
Copy link
Contributor

Choose a reason for hiding this comment

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

beautiful! nice inclusion

Copy link
Contributor

@EmilRex EmilRex left a comment

Choose a reason for hiding this comment

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

Really great work @biancaines! Love how thorough the guide is! I left some comments, mostly small changes.

docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
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.

Nice stuff @biancaines ! Great attention to detail and helpful tone and content!

docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved

3. Integration with Google Cloud Services: Google Cloud Run easily integrates with other Google Cloud services, such as Google Cloud Storage, Google Cloud Pub/Sub, and Google Cloud Build. This enables you to build end-to-end data pipelines utilizing a variety of services.

4. Portability: Since Cloud Run uses container images, you can develop your pipelines locally using Docker and then deploy them on Google Cloud Run without significant modifications. This portability allows you to run the same pipeline in different environments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
Find your deployment in the UI, and hit the *Quick Run* button.
You have now successfully submitted a flow run to your Cloud Run worker!
If you used the flow script provided in this guide, check the artifacts tab for the flow run once it completes.
You'll have a nice little weather report waiting for you there.
Copy link
Contributor

Choose a reason for hiding this comment

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

Love this - could add a "Hope your day is sunny!" or something to the end.

I suggest a quick recap and next steps sections at the end. Maybe direct to the Serverless Work Pools page in the Prefect docs as something they might be interested in.

biancaines and others added 7 commits September 25, 2023 16:10
…ade formatting changes, swapping square brackets [] for carrots <> wherever a value needs to be swapped out. Added recap, and next steps.
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.

LGTM. I made minor copy-edit suggestions for consistency with other docs.

docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
docs/gcp-worker-guide.md Outdated Show resolved Hide resolved
Copy link
Contributor

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

👏🏼

The next prompt will ask if you'd like to allow unauthentiated invocations to your worker. For this guide, you can select "No".

After a few seconds, you'll be able to see your new `prefect-worker` service by navigating to the Cloud Run page of your Google Cloud console. Additionally, you should be able to see a record of this worker in the Prefect UI on the work pool's page by navigating to the `Worker` tab.
Let's not leave our worker hanging, it's time to give it a job.
Copy link
Contributor

Choose a reason for hiding this comment

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

lol get a job worker

Comment on lines +90 to +93
```bash
gcloud iam service-accounts keys create my_key.json \
--serviceAccount:<SERVICE_ACCOUNT_NAME>@<PROJECT_ID>.iam.gserviceaccount.com
```
Copy link
Contributor

Choose a reason for hiding this comment

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

@biancaines Hi, I am trying out the guide at the moment to setup prefect with cloud run for my org. Thank you so much, it is such a valuable resource! 😊

This command however did not work for me, because --serviceAccount is not recognized as a command:

ERROR: (gcloud.iam.service-accounts.keys.create) unrecognized arguments: --serviceAccount:<my-account-name>@<my-project>.iam.gserviceaccount.com

With the help of the GCP Documentation here, the following command worked for me:

 gcloud iam service-accounts keys create my_key.json \
    --iam-account=<SERVICE_ACCOUNT_NAME>@<PROJECT_ID>.iam.gserviceaccount.com

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @bjarneschroeder ! Thank you for you kind words, and for providing the command you used! I'll give this a try as well, and either swap out the command or create a note that it can be used as an alternative.

Copy link
Contributor

@EmilRex EmilRex left a comment

Choose a reason for hiding this comment

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

🤌

@discdiver discdiver merged commit acae011 into PrefectHQ:main Oct 23, 2023
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants