diff --git a/.gitbook.yaml b/.gitbook.yaml index 8e0ed9a10b..7a67fbf248 100644 --- a/.gitbook.yaml +++ b/.gitbook.yaml @@ -8,6 +8,6 @@ redirects: tutorial: ../examples/pytorch/text-generator/README.md tutorial/realtime: ../examples/pytorch/text-generator/README.md tutorial/batch: ../examples/batch/image-classifier/README.md - install: ./aws/install.md - uninstall: ./aws/uninstall.md - update: ./aws/update.md + install: ./cloud/install.md + uninstall: ./cloud/uninstall.md + update: ./cloud/update.md diff --git a/docs/cloud/install.md b/docs/cloud/install.md new file mode 100644 index 0000000000..c210d7c2e4 --- /dev/null +++ b/docs/cloud/install.md @@ -0,0 +1,15 @@ +# Install + +_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_ + +## AWS + +To spin up Cortex using AWS as the cloud provider, follow [these instructions](../aws/install.md). + +## GCP + +To spin up Cortex using GCP as the cloud provider, follow [these instructions](../gcp/install.md). + +## Local + +If you'll only be using Cortex locally, install it with `pip install cortex`. diff --git a/docs/cloud/uninstall.md b/docs/cloud/uninstall.md new file mode 100644 index 0000000000..a162f34dbd --- /dev/null +++ b/docs/cloud/uninstall.md @@ -0,0 +1,15 @@ +# Uninstall + +_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_ + +## AWS + +To spin down a Cortex cluster on AWS, follow [these instructions](../aws/uninstall.md). + +## GCP + +To spin down a Cortex cluster on GCP, follow [these instructions](../gcp/uninstall.md). + +## Local + +To uninstall the Cortex CLI, run `pip uninstall cortex`. diff --git a/docs/cloud/update.md b/docs/cloud/update.md new file mode 100644 index 0000000000..1cf87cc8da --- /dev/null +++ b/docs/cloud/update.md @@ -0,0 +1,11 @@ +# Update + +_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_ + +## AWS + +To update the configuration of a running Cortex cluster on AWS, follow [these instructions](../aws/update.md). + +## GCP + +It is currently not possible to update a Cortex cluster running on GCP. diff --git a/docs/deployments/batch-api/predictors.md b/docs/deployments/batch-api/predictors.md index 426a64ddd2..bd42cd464a 100644 --- a/docs/deployments/batch-api/predictors.md +++ b/docs/deployments/batch-api/predictors.md @@ -109,6 +109,7 @@ cloudpickle==1.6.0 Cython==0.29.21 dill==0.3.2 fastapi==0.61.1 +google-cloud-storage==1.32.0 joblib==0.16.0 Keras==2.4.3 msgpack==1.0.0 @@ -143,6 +144,7 @@ cloudpickle==1.6.0 Cython==0.29.21 dill==0.3.1.1 fastapi==0.54.1 +google-cloud-storage==1.32.0 joblib==0.16.0 msgpack==1.0.0 neuron-cc==1.0.20600.0+0.b426b885f @@ -244,6 +246,7 @@ The following Python packages are pre-installed in TensorFlow Predictors and can boto3==1.14.53 dill==0.3.2 fastapi==0.61.1 +google-cloud-storage==1.32.0 msgpack==1.0.0 numpy==1.19.1 opencv-python==4.4.0.42 @@ -331,6 +334,7 @@ The following Python packages are pre-installed in ONNX Predictors and can be us boto3==1.14.53 dill==0.3.2 fastapi==0.61.1 +google-cloud-storage==1.32.0 msgpack==1.0.0 numpy==1.19.1 onnxruntime==1.4.0 diff --git a/docs/deployments/realtime-api/predictors.md b/docs/deployments/realtime-api/predictors.md index 9bc05823b5..627f37b73a 100644 --- a/docs/deployments/realtime-api/predictors.md +++ b/docs/deployments/realtime-api/predictors.md @@ -202,6 +202,7 @@ cloudpickle==1.6.0 Cython==0.29.21 dill==0.3.2 fastapi==0.61.1 +google-cloud-storage==1.32.0 joblib==0.16.0 Keras==2.4.3 msgpack==1.0.0 @@ -236,6 +237,7 @@ cloudpickle==1.6.0 Cython==0.29.21 dill==0.3.1.1 fastapi==0.54.1 +google-cloud-storage==1.32.0 joblib==0.16.0 msgpack==1.0.0 neuron-cc==1.0.20600.0+0.b426b885f @@ -362,6 +364,7 @@ The following Python packages are pre-installed in TensorFlow Predictors and can boto3==1.14.53 dill==0.3.2 fastapi==0.61.1 +google-cloud-storage==1.32.0 msgpack==1.0.0 numpy==1.19.1 opencv-python==4.4.0.42 @@ -478,6 +481,7 @@ The following Python packages are pre-installed in ONNX Predictors and can be us boto3==1.14.53 dill==0.3.2 fastapi==0.61.1 +google-cloud-storage==1.32.0 msgpack==1.0.0 numpy==1.19.1 onnxruntime==1.4.0 diff --git a/docs/gcp/credentials.md b/docs/gcp/credentials.md new file mode 100644 index 0000000000..464a63faa3 --- /dev/null +++ b/docs/gcp/credentials.md @@ -0,0 +1,12 @@ +# Credentials + +_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_ + +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): + 1. `Editor` role. + 1. `Kubernetes Engine Admin` role. + 1. `Container Registry Service Agent` role. + 1. `Storage Admin` role. + 1. `Storage Object Admin` role. +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. +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` diff --git a/docs/gcp/install.md b/docs/gcp/install.md new file mode 100644 index 0000000000..e65520c4b4 --- /dev/null +++ b/docs/gcp/install.md @@ -0,0 +1,66 @@ +# Install + +_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_ + +## Spin up Cortex on your GCP account + +Make sure [Docker](https://docs.docker.com/install) is running on your machine. + +If you're using GPUs, make sure your GPU quota is sufficient (see [here](https://cloud.google.com/compute/quotas)). + +```bash +# install the CLI +pip install cortex + +# spin up Cortex on your GCP account +cortex cluster-gcp up # or: cortex cluster-gcp up --config cluster.yaml (see configuration options below) + +# set the default environment +cortex env default gcp +``` + + +Try the [tutorial](../../examples/pytorch/text-generator/README.md). + +## Configure Cortex + + +```yaml +# cluster.yaml + +# GKE cluster name +cluster_name: cortex + +# GCP project ID +project: + +# GCP zone for your cluster +zone: us-central1-a + +# instance type +instance_type: n1-standard-2 + +# GPU to attach to your instance (optional) +accelerator_type: nvidia-tesla-t4 + +# minimum number of instances +min_instances: 1 + +# maximum number of instances +max_instances: 5 +``` + +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): + + +```yaml +image_operator: quay.io/cortexlabs/operator:master +image_manager: quay.io/cortexlabs/manager:master +image_downloader: quay.io/cortexlabs/downloader:master +image_statsd: quay.io/cortexlabs/statsd:master +image_istio_proxy: quay.io/cortexlabs/istio-proxy:master +image_istio_pilot: quay.io/cortexlabs/istio-pilot:master +image_pause: quay.io/cortexlabs/pause:master +``` + +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). diff --git a/docs/gcp/uninstall.md b/docs/gcp/uninstall.md new file mode 100644 index 0000000000..db5e91d267 --- /dev/null +++ b/docs/gcp/uninstall.md @@ -0,0 +1,18 @@ +# Uninstall + +_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_ + +## Spin down Cortex + +```bash +# spin down Cortex +cortex cluster-gcp down + +# uninstall the CLI +pip uninstall cortex +rm -rf ~/.cortex +``` + +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`). + +*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.* diff --git a/docs/summary.md b/docs/summary.md index e92d69a771..5c2967a71c 100644 --- a/docs/summary.md +++ b/docs/summary.md @@ -1,7 +1,7 @@ # Table of contents * [Deploy machine learning models to production](../README.md) -* [Install](aws/install.md) +* [Install](cloud/install.md) * [Tutorial](https://docs.cortex.dev/v/master/deployments/realtime-api/text-generator) * [GitHub](https://github.com/cortexlabs/cortex) * [Examples](https://github.com/cortexlabs/cortex/tree/master/examples) @@ -9,6 +9,7 @@ ## Running Cortex on AWS +* [Install](aws/install.md) * [Credentials](aws/credentials.md) * [Security](aws/security.md) * [Spot instances](aws/spot.md) @@ -20,6 +21,12 @@ * [Update](aws/update.md) * [Uninstall](aws/uninstall.md) +## Running Cortex on GCP + +* [Install](gcp/install.md) +* [Credentials](gcp/credentials.md) +* [Uninstall](gcp/uninstall.md) + ## Deployments * [Realtime API](deployments/realtime-api.md)