Install

Prerequisites

  1. Docker

Spin up a cluster

See cluster configuration to learn how you can customize your cluster and EC2 instances for an overview of several EC2 instance types.

# install the CLI on your machine
bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/0.13/get-cli.sh)"
# provision infrastructure on AWS and spin up a cluster
cortex cluster up

Note: This will create resources in your AWS account which aren't included in the free tier, e.g. an EKS cluster, two Elastic Load Balancers, and EC2 instances (quantity and type as specified above). To use GPU nodes, you may need to subscribe to the EKS-optimized AMI with GPU Support and file an AWS support ticket to increase the limit for your desired instance type.

Deploy a model

# clone the Cortex repository
git clone -b 0.13 https://github.com/cortexlabs/cortex.git
# navigate to the TensorFlow iris classification example
cd cortex/examples/tensorflow/iris-classifier
# deploy the model to the cluster
cortex deploy
# view the status of the api
cortex get --watch
# stream logs from the api
cortex logs iris-classifier
# get the api's endpoint
cortex get iris-classifier
# classify a sample
curl -X POST -H "Content-Type: application/json" \
-d '{ "sepal_length": 5.2, "sepal_width": 3.6, "petal_length": 1.4, "petal_width": 0.3 }' \
<API endpoint>

Cleanup

# delete the api
cortex delete iris-classifier

See uninstall if you'd like to spin down your cluster.