Skip to content

Commit 578d2d5

Browse files
committed
Merge branch 'master' into feature/gcp
2 parents 9fa623f + c45a888 commit 578d2d5

File tree

146 files changed

+214
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+214
-219
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,48 @@ assignees: ''
77

88
---
99

10-
#### Version
10+
### Version
1111

1212
(use `cortex version` to determine your version)
1313

14-
#### Description
14+
### Description
1515

1616
(describe the bug)
1717

18-
#### Configuration
18+
### Configuration
1919

2020
(paste relevant `cortex.yaml` or `cluster.yaml` configuration)
2121

22-
#### Steps to reproduce
22+
### Steps to reproduce
2323

2424
1. ...
2525
2. ...
2626
3. ...
2727

28-
#### Expected behavior
28+
### Expected behavior
2929

3030
(describe the behavior you expected)
3131

32-
#### Actual behavior
32+
### Actual behavior
3333

3434
(describe the behavior you experienced)
3535

36-
#### Screenshots
36+
### Screenshots
3737

3838
(optional)
3939

40-
#### Stack traces
40+
### Stack traces
4141

4242
(error output from `cortex logs <api name>`)
4343

4444
```text
4545
<paste stack traces here>
4646
```
4747

48-
#### Additional context
48+
### Additional context
4949

5050
(optional)
5151

52-
#### Suggested solution
52+
### Suggested solution
5353

5454
(optional)

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ assignees: ''
77

88
---
99

10-
#### Description
10+
### Description
1111

1212
(describe the feature)
1313

14-
#### Motivation
14+
### Motivation
1515

1616
(how this will improve the product / what problem will this solve / what is the use case)
1717

18-
#### Additional context
18+
### Additional context
1919

2020
(optional)

README.md

Lines changed: 55 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
<!-- Delete on release branches -->
77
<!-- CORTEX_VERSION_README_MINOR -->
8-
9-
[install](https://docs.cortex.dev/install)[documentation](https://docs.cortex.dev)[examples](https://github.com/cortexlabs/cortex/tree/0.22/examples)[support](https://gitter.im/cortexlabs/cortex)
8+
[install](https://docs.cortex.dev/install)[documentation](https://docs.cortex.dev)[examples](https://github.com/cortexlabs/cortex/tree/0.23/examples)[community](https://gitter.im/cortexlabs/cortex)
109

1110
# Deploy machine learning models to production
1211

@@ -16,49 +15,45 @@ Cortex is an open source platform for deploying, managing, and scaling machine l
1615

1716
## Model serving infrastructure
1817

19-
* Supports deploying TensorFlow, PyTorch, sklearn and other models as realtime or batch APIs
20-
* Ensures high availability with availability zones and automated instance restarts
21-
* Scales to handle production workloads with request-based autoscaling
22-
* Runs inference on spot instances with on-demand backups
23-
* Manages traffic splitting for A/B testing
18+
* Supports deploying TensorFlow, PyTorch, sklearn and other models as realtime or batch APIs.
19+
* Ensures high availability with availability zones and automated instance restarts.
20+
* Runs inference on spot instances with on-demand backups.
21+
* Autoscales to handle production workloads.
2422

25-
#### Configure your cluster:
23+
#### Configure Cortex
2624

2725
```yaml
2826
# cluster.yaml
2927

3028
region: us-east-1
31-
availability_zones: [us-east-1a, us-east-1b]
32-
api_gateway: public
3329
instance_type: g4dn.xlarge
3430
min_instances: 10
3531
max_instances: 100
3632
spot: true
3733
```
3834
39-
#### Spin up your cluster on your AWS account:
35+
#### Spin up Cortex on your AWS account
4036
4137
```text
4238
$ cortex cluster up --config cluster.yaml
4339

4440
○ configuring autoscaling ✓
4541
○ configuring networking ✓
4642
○ configuring logging ✓
47-
○ configuring metrics dashboard ✓
4843

4944
cortex is ready!
5045
```
5146

5247
<br>
5348

54-
## Reproducible model deployments
49+
## Reproducible deployments
5550

56-
* Implement request handling in Python
57-
* Customize compute, autoscaling, and networking for each API
58-
* Package dependencies, code, and configuration for reproducible deployments
59-
* Test locally before deploying to your cluster
51+
* Package dependencies, code, and configuration for reproducible deployments.
52+
* Configure compute, autoscaling, and networking for each API.
53+
* Integrate with your data science platform or CI/CD system.
54+
* Test locally before deploying to your cluster.
6055

61-
#### Implement a predictor:
56+
#### Implement a predictor
6257

6358
```python
6459
# predictor.py
@@ -73,70 +68,67 @@ class PythonPredictor:
7368
return self.model(payload["text"])[0]
7469
```
7570

76-
#### Configure an API:
77-
78-
```yaml
79-
# cortex.yaml
80-
81-
name: text-generator
82-
kind: RealtimeAPI
83-
predictor:
84-
path: predictor.py
85-
compute:
86-
gpu: 1
87-
mem: 4Gi
88-
autoscaling:
89-
min_replicas: 1
90-
max_replicas: 10
91-
networking:
92-
api_gateway: public
93-
```
94-
95-
#### Deploy to production:
96-
97-
```text
98-
$ cortex deploy cortex.yaml
99-
100-
creating https://example.com/text-generator
71+
#### Configure an API
10172

102-
$ curl https://example.com/text-generator \
103-
-X POST -H "Content-Type: application/json" \
104-
-d '{"text": "deploy machine learning models to"}'
105-
106-
"deploy machine learning models to production"
73+
```python
74+
api_spec = {
75+
"name": "text-generator",
76+
"kind": "RealtimeAPI",
77+
"predictor": {
78+
"type": "python",
79+
"path": "predictor.py"
80+
},
81+
"compute": {
82+
"gpu": 1,
83+
"mem": "8Gi",
84+
},
85+
"autoscaling": {
86+
"min_replicas": 1,
87+
"max_replicas": 10
88+
},
89+
"networking": {
90+
"api_gateway": "public"
91+
}
92+
}
10793
```
10894

10995
<br>
11096

111-
## API management
97+
## Scalable machine learning APIs
11298

113-
* Monitor API performance
114-
* Aggregate and stream logs
115-
* Customize prediction tracking
116-
* Update APIs without downtime
99+
* Scale to handle production workloads with request-based autoscaling.
100+
* Stream performance metrics and logs to any monitoring tool.
101+
* Serve many models efficiently with multi model caching.
102+
* Configure traffic splitting for A/B testing.
103+
* Update APIs without downtime.
117104

118-
#### Manage your APIs:
105+
#### Deploy to your cluster
119106

120-
```text
121-
$ cortex get
107+
```python
108+
import cortex
122109

123-
realtime api status replicas last update latency requests
110+
cx = cortex.client("aws")
111+
cx.deploy(api_spec, project_dir=".")
124112

125-
text-generator live 34 9h 247ms 71828
126-
object-detector live 13 15h 23ms 828459
113+
# creating https://example.com/text-generator
114+
```
127115

116+
#### Consume your API
128117

129-
batch api running jobs last update
118+
```python
119+
import requests
130120

131-
image-classifier 5 10h
121+
endpoint = "https://example.com/text-generator"
122+
payload = {"text": "hello world"}
123+
prediction = requests.post(endpoint, payload)
132124
```
133125

134126
<br>
135127

136128
## Get started
137129

138-
```text
139-
$ pip install cortex
130+
```bash
131+
pip install cortex
140132
```
141133

142134
See the [installation guide](https://docs.cortex.dev/install) for next steps.

docs/guides/docker-hub-rate-limiting.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
_WARNING: you are on the master branch, please refer to the docs on the branch that matches your `cortex version`_
44

5+
*Note: This guide is only relevant for Cortex version `0.22.1` and earlier. Starting in version `0.23.0`, we've migrated from Docker Hub to Quay (which allows for unlimited image pulls for unauthenticated users). If you upgrade to version >= `0.23.0`, you can disregard this guide.*
6+
57
Docker Hub's [newly enforced rate-limiting policy](https://www.docker.com/increase-rate-limits) can negatively impact your cluster. This is much likelier to be an issue if you've set `subnet_visibility: private` in your cluster configuration file, since with private subnets, all requests from all nodes are routed through the NAT Gateway, and will therefore have the same IP address (docker imposes the rate limit per IP address). If you haven't specified `subnet_visibility` or have set `subnet_visibility: public`, this is less likely to be an issue for you, since each instance will have its own IP address.
68

79
If you are affected by Docker Hub's rate limiting, your may encounter issues such as:
@@ -56,7 +58,7 @@ image_istio_galley: quay.io/cortexlabs/istio-galley:<VERSION>
5658
image_istio_citadel: quay.io/cortexlabs/istio-citadel:<VERSION>
5759
```
5860

59-
For Cortex cluster version < `0.16.0`, please upgrade your cluster to the latest version.
61+
For Cortex cluster version < `0.16.0`, please upgrade your cluster to the latest version. If you upgrade to version >= `0.23.0`, you can disregard this guide.
6062

6163
Once you've updated your cluster configuration file, you can spin up your cluster (e.g. `cortex cluster up --config cluster.yaml`).
6264

docs/guides/self-hosted-images.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ Also, take note of your AWS account ID. The account ID can be found in the _My A
2424

2525
You can use the script below to push the Cortex images to your ECR registry. Make sure to update the `ecr_region`, `aws_account_id`, and `cortex_version` variables at the top of the file. Copy-paste the contents into a new file (e.g. `ecr.sh`), and then run `chmod +x ecr.sh`, followed by `./ecr.sh`. It is recommended to run this from an EC2 instance in the same region as your ECR repository, since it will be much faster.
2626

27+
<!-- CORTEX_VERSION_README -->
2728
```bash
2829
#!/bin/bash
2930
set -euo pipefail
3031

3132
# user set variables
3233
ecr_region="us-west-2"
3334
aws_account_id="620970939130" # example account ID
34-
cortex_version="0.22.1"
35+
cortex_version="0.23.0"
3536

3637
source_registry="quay.io/cortexlabs"
3738
destination_ecr_prefix="cortexlabs"

examples/batch/image-classifier/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Deploy models as Batch APIs
22

3-
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)_
3+
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)_
44

55
This example shows how to deploy a batch image classification api that accepts a list of image urls as input, downloads the images, classifies them, and writes the results to S3.
66

examples/batch/image-classifier/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
- name: image-classifier
44
kind: BatchAPI

examples/batch/image-classifier/predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
import os
44
import requests

examples/batch/onnx/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Batch Image Classifier in ONNX
22

3-
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)_
3+
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)_
44

55
<!-- CORTEX_VERSION_MINOR -->
66
Please refer to the [tutorial](https://docs.cortex.dev/v/master/batch-api/image-classifier#deploy-your-batch-api) to see how to deploy a Batch API with Cortex.

examples/batch/onnx/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
- name: image-classifier
44
kind: BatchAPI

examples/batch/onnx/predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
import requests
44
import numpy as np

examples/batch/tensorflow/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Batch Image Classifier in TensorFlow
22

3-
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)_
3+
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)_
44

55
<!-- CORTEX_VERSION_MINOR -->
66
Please refer to the [tutorial](https://docs.cortex.dev/v/master/batch-api/image-classifier#deploy-your-batch-api) to see how to deploy a Batch API with Cortex.

examples/batch/tensorflow/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
- name: image-classifier
44
kind: BatchAPI

examples/batch/tensorflow/predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
import requests
44
import numpy as np

examples/keras/document-denoiser/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clean Dirty Documents w/ Autoencoders
22

3-
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)_
3+
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)_
44

55
This example model cleans text documents of anything that isn't text (aka noise): coffee stains, old wear artifacts, etc. You can inspect the notebook that has been used to train the model [here](trainer.ipynb).
66

examples/keras/document-denoiser/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
- name: document-denoiser
44
kind: RealtimeAPI

examples/keras/document-denoiser/predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
import boto3, base64, cv2, re, os, requests
44
from botocore import UNSIGNED

examples/keras/document-denoiser/trainer.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
16-
"# _WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)_\n",
16+
"# _WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)_\n",
1717
"\n",
1818
"\n",
1919
"import keras\n",

examples/live-reloading/onnx/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Live-reloading model APIs
22

3-
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)_
3+
_WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)_
44

55
The model live-reloading feature is automatically enabled for the ONNX predictors. This means that any ONNX examples found in the [examples](../..) directory will already have this running.
66

examples/live-reloading/python/mpg-estimator/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.22.*, run `git checkout -b 0.22` or switch to the `0.22` branch on GitHub)
1+
# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)
22

33
- name: mpg-estimator
44
kind: RealtimeAPI

0 commit comments

Comments
 (0)