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

feat: Vertex AI CustomJob worker #211

Merged
merged 21 commits into from
Sep 21, 2023
Merged

feat: Vertex AI CustomJob worker #211

merged 21 commits into from
Sep 21, 2023

Conversation

parkedwards
Copy link
Contributor

@parkedwards parkedwards commented Sep 14, 2023

This PR adds a Vertex AI Custom Worker type, which is a port over from the existing Infrastructure VertexAICustomTrainingJob block

Closes PrefectHQ/prefect#10478

Example

Screenshots

Docs
image
image

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

prefect_gcp/__init__.py Outdated Show resolved Hide resolved
@@ -0,0 +1,123 @@
import uuid
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are passing, but im getting weird SAWArnings

image

@parkedwards parkedwards marked this pull request as ready for review September 15, 2023 19:14
@parkedwards parkedwards requested a review from a team as a code owner September 15, 2023 19:14
@parkedwards
Copy link
Contributor Author

i need to add the documentation docstring + changelog

@parkedwards parkedwards changed the title feat: initial Vertex AI CustomJob worker feat: Vertex AI CustomJob worker Sep 15, 2023
Copy link
Contributor

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

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

I did a good bit of testing with this this morning and it was working great! Nice work!!

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Thanks for creating this so quickly! I have a few comments on structure which may have an impact on implementation. Once we've sorted them out then I can make another detailed pass. Let me know if you have any questions!

prefect_gcp/__init__.py Outdated Show resolved Hide resolved
mkdocs.yml Outdated Show resolved Hide resolved
prefect_gcp/vertex_worker.py Outdated Show resolved Hide resolved
"""Returns a base job body to use for job spec validation.
Note that the values are stubbed and are not used for the actual job."""
return {
"maximum_run_time_hours": "1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

im just validating against the presence of keys, so not going to validate against the provided values (since they generally come from a set of acceptable values)

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Final round of comments after a more thorough review. Once these are taken care of, this should be good to go.

I noticed that there's no kill_infrastructure command on this worker needed to support flow run cancellation. If you'd rather leave that out of this PR, let me know, and I can create an issue to track adding it later.

prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
prefect_gcp/workers/vertex.py Outdated Show resolved Hide resolved
@parkedwards
Copy link
Contributor Author

parkedwards commented Sep 21, 2023

I noticed that there's no kill_infrastructure command on this worker needed to support flow run cancellation. If you'd rather leave that out of this PR, let me know, and I can create an issue to track adding it later.

@desertaxle doh - let me add that, but in a follow up PR bc this one is getting beefy with comments. i'll create an issue for it so i dont forget

#212

_documentation_url = "https://prefecthq.github.io/prefect-gcp/worker/"
_logo_url = "https://images.ctfassets.net/gm98wzqotmnx/4SpnOBvMYkHp6z939MDKP6/549a91bc1ce9afd4fb12c68db7b68106/social-icon-google-cloud-1200-630.png?h=250" # noqa
_documentation_url = "https://prefecthq.github.io/prefect-gcp/cloud_run_worker/"
_logo_url = "https://cdn.sanity.io/images/3ugk85nk/production/10424e311932e31c477ac2b9ef3d53cefbaad708-250x250.png" # noqa
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this pr splits up the worker docs, so this page url needed updating as well

i also swapped the logo urls for all the links, lemme know if i went too far

Copy link
Member

Choose a reason for hiding this comment

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

That's awesome! Thanks!

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@parkedwards parkedwards merged commit 6327600 into main Sep 21, 2023
10 checks passed
@parkedwards parkedwards deleted the feat/vertex-worker branch September 21, 2023 20:58
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.

GCP Vertex AI Worker Type
3 participants