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

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
discdiver committed Mar 26, 2024
1 parent 673f38b commit 9429c6a
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions prefect_gcp/aiplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,52 @@
Examples:
Run a job using Vertex AI Custom Training:
Run a job using Vertex AI Custom Training:
```python
from prefect_gcp.credentials import GcpCredentials
from prefect_gcp.aiplatform import VertexAICustomTrainingJob
gcp_credentials = GcpCredentials.load("BLOCK_NAME")
job = VertexAICustomTrainingJob(
region="us-east1",
image="us-docker.pkg.dev/cloudrun/container/job:latest",
gcp_credentials=gcp_credentials,
)
job.run()
```
Run a job that runs the command `echo hello world` using Google Cloud Run Jobs:
```python
from prefect_gcp.credentials import GcpCredentials
from prefect_gcp.aiplatform import VertexAICustomTrainingJob
```python
from prefect_gcp.credentials import GcpCredentials
from prefect_gcp.aiplatform import VertexAICustomTrainingJob
gcp_credentials = GcpCredentials.load("BLOCK_NAME")
job = VertexAICustomTrainingJob(
region="us-east1",
image="us-docker.pkg.dev/cloudrun/container/job:latest",
gcp_credentials=gcp_credentials,
)
job.run()
```
gcp_credentials = GcpCredentials.load("BLOCK_NAME")
job = VertexAICustomTrainingJob(
command=["echo", "hello world"],
region="us-east1",
image="us-docker.pkg.dev/cloudrun/container/job:latest",
gcp_credentials=gcp_credentials,
)
job.run()
```
Run a job that runs the command `echo hello world` using Google Cloud Run Jobs:
Preview job specs:
```python
from prefect_gcp.credentials import GcpCredentials
from prefect_gcp.aiplatform import VertexAICustomTrainingJob
gcp_credentials = GcpCredentials.load("BLOCK_NAME")
job = VertexAICustomTrainingJob(
command=["echo", "hello world"],
region="us-east1",
image="us-docker.pkg.dev/cloudrun/container/job:latest",
gcp_credentials=gcp_credentials,
)
job.run()
```
```python
from prefect_gcp.credentials import GcpCredentials
from prefect_gcp.aiplatform import VertexAICustomTrainingJob
Preview job specs:
gcp_credentials = GcpCredentials.load("BLOCK_NAME")
job = VertexAICustomTrainingJob(
command=["echo", "hello world"],
region="us-east1",
image="us-docker.pkg.dev/cloudrun/container/job:latest",
gcp_credentials=gcp_credentials,
)
job.preview()
```
```python
from prefect_gcp.credentials import GcpCredentials
from prefect_gcp.aiplatform import VertexAICustomTrainingJob
gcp_credentials = GcpCredentials.load("BLOCK_NAME")
job = VertexAICustomTrainingJob(
command=["echo", "hello world"],
region="us-east1",
image="us-docker.pkg.dev/cloudrun/container/job:latest",
gcp_credentials=gcp_credentials,
)
job.preview()
```
""" # noqa

Expand Down Expand Up @@ -291,9 +291,9 @@ async def generate_work_pool_base_job_template(self) -> dict:
), "Failed to generate default base job template for Cloud Run worker."
for key, value in self.dict(exclude_unset=True, exclude_defaults=True).items():
if key == "command":
base_job_template["variables"]["properties"]["command"][
"default"
] = shlex.join(value)
base_job_template["variables"]["properties"]["command"]["default"] = (
shlex.join(value)
)
elif key in [
"type",
"block_type_slug",
Expand Down

0 comments on commit 9429c6a

Please sign in to comment.