Skip to content

Commit 3763505

Browse files
authored
Add GCP documentation (#1671)
1 parent 5faccdd commit 3763505

File tree

10 files changed

+156
-4
lines changed

10 files changed

+156
-4
lines changed

.gitbook.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ redirects:
88
tutorial: ../examples/pytorch/text-generator/README.md
99
tutorial/realtime: ../examples/pytorch/text-generator/README.md
1010
tutorial/batch: ../examples/batch/image-classifier/README.md
11-
install: ./aws/install.md
12-
uninstall: ./aws/uninstall.md
13-
update: ./aws/update.md
11+
install: ./cloud/install.md
12+
uninstall: ./cloud/uninstall.md
13+
update: ./cloud/update.md

docs/cloud/install.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Install
2+
3+
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
4+
5+
## AWS
6+
7+
To spin up Cortex using AWS as the cloud provider, follow [these instructions](../aws/install.md).
8+
9+
## GCP
10+
11+
To spin up Cortex using GCP as the cloud provider, follow [these instructions](../gcp/install.md).
12+
13+
## Local
14+
15+
If you'll only be using Cortex locally, install it with `pip install cortex`.

docs/cloud/uninstall.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Uninstall
2+
3+
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
4+
5+
## AWS
6+
7+
To spin down a Cortex cluster on AWS, follow [these instructions](../aws/uninstall.md).
8+
9+
## GCP
10+
11+
To spin down a Cortex cluster on GCP, follow [these instructions](../gcp/uninstall.md).
12+
13+
## Local
14+
15+
To uninstall the Cortex CLI, run `pip uninstall cortex`.

docs/cloud/update.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Update
2+
3+
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
4+
5+
## AWS
6+
7+
To update the configuration of a running Cortex cluster on AWS, follow [these instructions](../aws/update.md).
8+
9+
## GCP
10+
11+
It is currently not possible to update a Cortex cluster running on GCP.

docs/deployments/batch-api/predictors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ cloudpickle==1.6.0
109109
Cython==0.29.21
110110
dill==0.3.2
111111
fastapi==0.61.1
112+
google-cloud-storage==1.32.0
112113
joblib==0.16.0
113114
Keras==2.4.3
114115
msgpack==1.0.0
@@ -143,6 +144,7 @@ cloudpickle==1.6.0
143144
Cython==0.29.21
144145
dill==0.3.1.1
145146
fastapi==0.54.1
147+
google-cloud-storage==1.32.0
146148
joblib==0.16.0
147149
msgpack==1.0.0
148150
neuron-cc==1.0.20600.0+0.b426b885f
@@ -244,6 +246,7 @@ The following Python packages are pre-installed in TensorFlow Predictors and can
244246
boto3==1.14.53
245247
dill==0.3.2
246248
fastapi==0.61.1
249+
google-cloud-storage==1.32.0
247250
msgpack==1.0.0
248251
numpy==1.19.1
249252
opencv-python==4.4.0.42
@@ -331,6 +334,7 @@ The following Python packages are pre-installed in ONNX Predictors and can be us
331334
boto3==1.14.53
332335
dill==0.3.2
333336
fastapi==0.61.1
337+
google-cloud-storage==1.32.0
334338
msgpack==1.0.0
335339
numpy==1.19.1
336340
onnxruntime==1.4.0

docs/deployments/realtime-api/predictors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ cloudpickle==1.6.0
202202
Cython==0.29.21
203203
dill==0.3.2
204204
fastapi==0.61.1
205+
google-cloud-storage==1.32.0
205206
joblib==0.16.0
206207
Keras==2.4.3
207208
msgpack==1.0.0
@@ -236,6 +237,7 @@ cloudpickle==1.6.0
236237
Cython==0.29.21
237238
dill==0.3.1.1
238239
fastapi==0.54.1
240+
google-cloud-storage==1.32.0
239241
joblib==0.16.0
240242
msgpack==1.0.0
241243
neuron-cc==1.0.20600.0+0.b426b885f
@@ -362,6 +364,7 @@ The following Python packages are pre-installed in TensorFlow Predictors and can
362364
boto3==1.14.53
363365
dill==0.3.2
364366
fastapi==0.61.1
367+
google-cloud-storage==1.32.0
365368
msgpack==1.0.0
366369
numpy==1.19.1
367370
opencv-python==4.4.0.42
@@ -478,6 +481,7 @@ The following Python packages are pre-installed in ONNX Predictors and can be us
478481
boto3==1.14.53
479482
dill==0.3.2
480483
fastapi==0.61.1
484+
google-cloud-storage==1.32.0
481485
msgpack==1.0.0
482486
numpy==1.19.1
483487
onnxruntime==1.4.0

docs/gcp/credentials.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Credentials
2+
3+
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
4+
5+
1. Create a service account for your GCP project as described [here](https://cloud.google.com/iam/docs/creating-managing-service-accounts#iam-service-accounts-create-console) with the following roles (these roles could be more restrictive if required):
6+
1. `Editor` role.
7+
1. `Kubernetes Engine Admin` role.
8+
1. `Container Registry Service Agent` role.
9+
1. `Storage Admin` role.
10+
1. `Storage Object Admin` role.
11+
1. Generate a service account key for your service account as described [here](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) and export it as a JSON file.
12+
1. Export the `GOOGLE_APPLICATION_CREDENTIALS` variable and point it to the downloaded service account key from the previous step. For example: `export GOOGLE_APPLICATION_CREDENTIALS=/home/ubuntu/.config/gcloud/sample-269400-9a41792a969b.json`

docs/gcp/install.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Install
2+
3+
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
4+
5+
## Spin up Cortex on your GCP account
6+
7+
Make sure [Docker](https://docs.docker.com/install) is running on your machine.
8+
9+
If you're using GPUs, make sure your GPU quota is sufficient (see [here](https://cloud.google.com/compute/quotas)).
10+
11+
```bash
12+
# install the CLI
13+
pip install cortex
14+
15+
# spin up Cortex on your GCP account
16+
cortex cluster-gcp up # or: cortex cluster-gcp up --config cluster.yaml (see configuration options below)
17+
18+
# set the default environment
19+
cortex env default gcp
20+
```
21+
22+
<!-- CORTEX_VERSION_MINOR -->
23+
Try the [tutorial](../../examples/pytorch/text-generator/README.md).
24+
25+
## Configure Cortex
26+
27+
<!-- CORTEX_VERSION_MINOR -->
28+
```yaml
29+
# cluster.yaml
30+
31+
# GKE cluster name
32+
cluster_name: cortex
33+
34+
# GCP project ID
35+
project: <your GCP project ID>
36+
37+
# GCP zone for your cluster
38+
zone: us-central1-a
39+
40+
# instance type
41+
instance_type: n1-standard-2
42+
43+
# GPU to attach to your instance (optional)
44+
accelerator_type: nvidia-tesla-t4
45+
46+
# minimum number of instances
47+
min_instances: 1
48+
49+
# maximum number of instances
50+
max_instances: 5
51+
```
52+
53+
The docker images used by the Cortex cluster can also be overridden, although this is not common. They can be configured by adding any of these keys to your cluster configuration file (default values are shown):
54+
55+
<!-- CORTEX_VERSION_BRANCH_STABLE -->
56+
```yaml
57+
image_operator: quay.io/cortexlabs/operator:master
58+
image_manager: quay.io/cortexlabs/manager:master
59+
image_downloader: quay.io/cortexlabs/downloader:master
60+
image_statsd: quay.io/cortexlabs/statsd:master
61+
image_istio_proxy: quay.io/cortexlabs/istio-proxy:master
62+
image_istio_pilot: quay.io/cortexlabs/istio-pilot:master
63+
image_pause: quay.io/cortexlabs/pause:master
64+
```
65+
66+
The default docker images used for your Predictors are listed in the instructions for [system packages](../deployments/system-packages.md), and can be overridden in your [Realtime API configuration](../deployments/realtime-api/api-configuration.md).

docs/gcp/uninstall.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Uninstall
2+
3+
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
4+
5+
## Spin down Cortex
6+
7+
```bash
8+
# spin down Cortex
9+
cortex cluster-gcp down
10+
11+
# uninstall the CLI
12+
pip uninstall cortex
13+
rm -rf ~/.cortex
14+
```
15+
16+
If you modified your bash profile, you may wish to remove `source <(cortex completion bash)` from it (or remove `source <(cortex completion zsh)` for `zsh`).
17+
18+
*Note: The `cortex cluster-gcp down` command doesn't wait for the cluster to come down. You can ensure that the cluster has been removed by checking the GKE console.*

docs/summary.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Table of contents
22

33
* [Deploy machine learning models to production](../README.md)
4-
* [Install](aws/install.md)
4+
* [Install](cloud/install.md)
55
* [Tutorial](https://docs.cortex.dev/v/master/deployments/realtime-api/text-generator) <!-- CORTEX_VERSION_MINOR -->
66
* [GitHub](https://github.com/cortexlabs/cortex)
77
* [Examples](https://github.com/cortexlabs/cortex/tree/master/examples) <!-- CORTEX_VERSION_MINOR -->
88
* [Contact us](contact.md)
99

1010
## Running Cortex on AWS
1111

12+
* [Install](aws/install.md)
1213
* [Credentials](aws/credentials.md)
1314
* [Security](aws/security.md)
1415
* [Spot instances](aws/spot.md)
@@ -20,6 +21,12 @@
2021
* [Update](aws/update.md)
2122
* [Uninstall](aws/uninstall.md)
2223

24+
## Running Cortex on GCP
25+
26+
* [Install](gcp/install.md)
27+
* [Credentials](gcp/credentials.md)
28+
* [Uninstall](gcp/uninstall.md)
29+
2330
## Deployments
2431

2532
* [Realtime API](deployments/realtime-api.md)

0 commit comments

Comments
 (0)