Skip to content

Commit

Permalink
chore(weave): Fix deploy docs and code (#1481)
Browse files Browse the repository at this point in the history
* init

* init
  • Loading branch information
tssweeney authored Apr 4, 2024
1 parent 481f6ac commit 446b709
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion docs/docs/guides/tools/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@ hide_table_of_contents: true

# Deploy

## Deploy to GCP

:::note
`weave deploy` requires your machine to have `gcloud` installed and configured. `weave deploy gcp` will use pre-configured configuration when not directly specified by command line arguments.
:::

Given a Weave ref to any Weave Model you can run:

```
weave deploy gcp <ref>
```

to deploy a gcp cloud function that serves your model.
to deploy a gcp cloud function that serves your model. The last line of the deployment will look like `Service URL: <PATH_TO_MODEL>`. Visit `<PATH_TO_MODEL>/docs` to interact with your model!

Run

```
weave deploy gcp --help
```

to see all command line options.
4 changes: 2 additions & 2 deletions weave/deploy/gcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def deploy(
"""Deploy the weave application."""
enforce_login()
if region is None:
region = gcloud(["config", "get", "compute/region", "--format=json"])
if region is []:
region = gcloud(["config", "get", "functions/region", "--format=json"])
if region == []:
raise ValueError(
"No default region set. Run `gcloud config set functions/region <region>` or set the region argument."
)
Expand Down

0 comments on commit 446b709

Please sign in to comment.