Skip to content

Commit 8ab6d29

Browse files
committed
Update dev instructions
1 parent 887d7ef commit 8ab6d29

File tree

2 files changed

+30
-59
lines changed

2 files changed

+30
-59
lines changed

dev/aws.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ set -euo pipefail
2020
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
2121

2222
source $ROOT/dev/config/build.sh
23-
source $ROOT/dev/config/k8s.sh
2423
source $ROOT/dev/config/cortex.sh
2524
source $ROOT/dev/util.sh
2625

docs/cluster/development.md

Lines changed: 30 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ Create the AWS Elastic Container Registry:
2222
make registry-create
2323
```
2424

25-
Note the registry URL, this will be needed shortly.
25+
Take note of the registry URL, this will be needed shortly.
2626

2727
Create the S3 buckets:
2828

2929
```bash
3030
aws s3 mb s3://cortex-cluster-<your_name>
31-
aws s3 mb s3://cortex-kops-<your_name> # (if you'll be using KOPS)
3231
aws s3 mb s3://cortex-cli-<your_name> # (if you'll be uploading your compiled CLI)
3332
```
3433

@@ -40,37 +39,23 @@ Make the config folder:
4039
mkdir dev/config
4140
```
4241

43-
Create `dev/config/k8s.sh`. Paste the following config, replace `K8S_KOPS_BUCKET` with your bucket name (if using KOPS), and update any other variables as desired:
44-
45-
```bash
46-
# EKS and KOPS
47-
48-
export K8S_NAME="cortex"
49-
export K8S_REGION="us-west-2"
50-
export K8S_NODE_INSTANCE_TYPE="t3.medium"
51-
export K8S_NODES_MAX_COUNT="2"
52-
export K8S_NODES_MIN_COUNT="2"
53-
export K8S_GPU_NODES_MIN_COUNT="0"
54-
export K8S_GPU_NODES_MAX_COUNT="0"
55-
56-
# KOPS only
57-
58-
export K8S_KOPS_BUCKET="cortex-kops-<your_name>"
59-
export K8S_ZONE="us-west-2a"
60-
export K8S_MASTER_INSTANCE_TYPE="t3.micro"
61-
export K8S_MASTER_VOLUME_SIZE="32"
62-
export K8S_NODE_VOLUME_SIZE="32"
63-
```
64-
6542
Create `dev/config/cortex.sh`. Paste the following config, and update `CORTEX_BUCKET`, `CORTEX_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and all registry URLs accordingly:
6643

6744
```bash
45+
export AWS_ACCESS_KEY_ID="XXXXXX"
46+
export AWS_SECRET_ACCESS_KEY="XXXXXX"
47+
6848
export CORTEX_LOG_GROUP="cortex"
6949
export CORTEX_BUCKET="cortex-cluster-<your_name>"
7050
export CORTEX_REGION="us-west-2"
51+
52+
export CORTEX_CLUSTER="cortex"
53+
export CORTEX_NODE_TYPE="t3.small"
54+
export CORTEX_NODES_MIN="2"
55+
export CORTEX_NODES_MAX="5"
7156
export CORTEX_NAMESPACE="cortex"
72-
export CORTEX_ENABLE_TELEMETRY="false"
7357

58+
export CORTEX_IMAGE_MANAGER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/manager:latest"
7459
export CORTEX_IMAGE_ARGO_CONTROLLER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/argo-controller:latest"
7560
export CORTEX_IMAGE_ARGO_EXECUTOR="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/argo-executor:latest"
7661
export CORTEX_IMAGE_FLUENTD="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/fluentd:latest"
@@ -83,14 +68,13 @@ export CORTEX_IMAGE_TF_SERVE="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlab
8368
export CORTEX_IMAGE_TF_SERVE_GPU="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/tf-serve-gpu:latest"
8469
export CORTEX_IMAGE_TF_TRAIN="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/tf-train:latest"
8570
export CORTEX_IMAGE_TF_TRAIN_GPU="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/tf-train-gpu:latest"
86-
export CORTEX_IMAGE_TF_TRANSFORM="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/tf-transform:latest"
71+
export CORTEX_IMAGE_TF_API="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/tf-api:latest"
8772
export CORTEX_IMAGE_PYTHON_PACKAGER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/python-packager:latest"
8873
export CORTEX_IMAGE_CLUSTER_AUTOSCALER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/cluster-autoscaler:latest"
8974
export CORTEX_IMAGE_NVIDIA="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/nvidia:latest"
9075
export CORTEX_IMAGE_METRICS_SERVER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/metrics-server:latest"
9176

92-
export AWS_ACCESS_KEY_ID="XXXXXX"
93-
export AWS_SECRET_ACCESS_KEY="XXXXXX"
77+
export CORTEX_ENABLE_TELEMETRY="false"
9478
```
9579

9680
Create `dev/config/build.sh`. Paste the following config, and update `CLI_BUCKET_NAME`, `CLI_BUCKET_REGION`, `REGISTRY_URL`, and `REGISTRY_REGION` accordingly:
@@ -106,73 +90,61 @@ export CLI_BUCKET_NAME="cortex-cli-<your_name>"
10690
export CLI_BUCKET_REGION="us-west-2"
10791
```
10892

109-
### Kubernetes
93+
### Building
11094

111-
Start Kubernetes cluster and install Cortex on it:
95+
Build and push all Cortex images:
11296

11397
```bash
114-
make eks-up
115-
# or
116-
make kops-up
98+
make registry-all
11799
```
118100

119-
If you're using GPUs on EKS, run this after your GPU nodes join the cluster:
101+
Build and configure the Cortex CLI:
120102

121103
```bash
122-
kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v1.11/nvidia-device-plugin.yml
123-
# check for GPUs:
124-
kubectl get nodes "-o=custom-columns=NAME:.metadata.name,GPU:.status.allocatable.nvidia\.com/gpu"
104+
make cli # The binary will be placed in path/to/cortex/bin/cortex
105+
path/to/cortex/bin/cortex configure
125106
```
126107

127-
### Building
108+
### Cortex Cluster
128109

129-
Build and push all Cortex images (this will take a while):
110+
Start Cortex:
130111

131112
```bash
132-
make registry-all
113+
make cortex-up
133114
```
134115

135-
Build and configure the Cortex CLI:
116+
Tear down the Cortex cluster:
136117

137118
```bash
138-
make cli # The binary will be placed in path/to/cortex/bin/cortex
139-
path/to/cortex/bin/cortex configure
119+
make cortex-down
140120
```
141121

142-
### Deployment
143-
144-
Deploy an example:
122+
### Deployment an Example
145123

146124
```bash
147125
cd examples/iris
148126
path/to/cortex/bin/cortex deploy
149127
```
150128

151-
Tear down the cluster:
152-
153-
```bash
154-
make eks-down
155-
# or
156-
make kops-down
157-
```
158-
159129
## Off-cluster Operator
160130

161131
If you're making changes in the operator and want faster iterations, you can run an off-cluster operator.
162132

163-
1. `make ostop` to stop the in-cluster operator
133+
1. `make operator-stop` to stop the in-cluster operator
164134
1. `make devstart` to run the off-cluster operator (which rebuilds the CLI and restarts the Operator when files change)
165135
1. `path/to/cortex/bin/cortex configure` (on a separate terminal) to configure your cortex CLI to use the off-cluster operator. When prompted for operator URL, use `http://localhost:8888`
166136

137+
Note: `make cortex-up-dev` will start Cortex without installing the operator.
138+
167139
If you want to switch back to the in-cluster operator:
168140

169141
1. `<ctrl+C>` to stop your off-cluster operator
170-
1. `oinstall` to install the operator in your cluster
171-
1. `path/to/cortex/bin/cortex configure` to configure your cortex CLI to use the in-cluster operator. When prompted for operator URL, use the URL shown when running `oinstall`
142+
1. `make operator-start` to install the operator in your cluster
143+
1. `path/to/cortex/bin/cortex configure` to configure your cortex CLI to use the in-cluster operator. When prompted for operator URL, use the URL shown when running `make cortex-info`
172144

173145
## Dev Workflow
174146

175-
1. Install
147+
1. `make cortex-up-dev`
176148
1. `make devstart`
177149
1. Make changes
178150
1. `make registry-dev`

0 commit comments

Comments
 (0)