Skip to content

Commit d4af30c

Browse files
authored
Update docs (#1674)
1 parent 8c834bd commit d4af30c

File tree

289 files changed

+575
-1269
lines changed

Some content is hidden

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

289 files changed

+575
-1269
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/bin/
33
/dev/
44
/docs/
5-
/examples/
5+
/test/
66

77
**/.*
88
**/*.md

.gitbook.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
root: ./docs/
22

33
structure:
4-
readme: ../README.md
4+
readme: ./tutorials/realtime.md
55
summary: summary.md
6-
7-
redirects:
8-
tutorial: ../examples/pytorch/text-generator/README.md
9-
tutorial/realtime: ../examples/pytorch/text-generator/README.md
10-
tutorial/batch: ../examples/batch/image-classifier/README.md
11-
install: ./cloud/install.md
12-
uninstall: ./cloud/uninstall.md
13-
update: ./cloud/update.md

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
<br>
55

6-
<!-- Delete on release branches -->
7-
<!-- CORTEX_VERSION_README_MINOR -->
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)
9-
106
# Deploy machine learning models to production
117

128
Cortex is an open source platform for deploying, managing, and scaling machine learning in production.
@@ -56,8 +52,6 @@ cortex is ready!
5652
#### Implement a predictor
5753

5854
```python
59-
# predictor.py
60-
6155
from transformers import pipeline
6256

6357
class PythonPredictor:
@@ -74,20 +68,13 @@ class PythonPredictor:
7468
api_spec = {
7569
"name": "text-generator",
7670
"kind": "RealtimeAPI",
77-
"predictor": {
78-
"type": "python",
79-
"path": "predictor.py"
80-
},
8171
"compute": {
8272
"gpu": 1,
83-
"mem": "8Gi",
73+
"mem": "8Gi"
8474
},
8575
"autoscaling": {
8676
"min_replicas": 1,
8777
"max_replicas": 10
88-
},
89-
"networking": {
90-
"api_gateway": "public"
9178
}
9279
}
9380
```
@@ -108,19 +95,15 @@ api_spec = {
10895
import cortex
10996

11097
cx = cortex.client("aws")
111-
cx.deploy(api_spec, project_dir=".")
98+
cx.create_api(api_spec, predictor=PythonPredictor)
11299

113100
# creating https://example.com/text-generator
114101
```
115102

116103
#### Consume your API
117104

118-
```python
119-
import requests
120-
121-
endpoint = "https://example.com/text-generator"
122-
payload = {"text": "hello world"}
123-
prediction = requests.post(endpoint, payload)
105+
```bash
106+
$ curl https://example.com/text-generator -X POST -H "Content-Type: application/json" -d '{"text": "hello world"}'
124107
```
125108

126109
<br>
@@ -131,4 +114,4 @@ prediction = requests.post(endpoint, payload)
131114
pip install cortex
132115
```
133116

134-
See the [installation guide](https://docs.cortex.dev/install) for next steps.
117+
[Deploy models](https://docs.cortex.dev) and [join our community](https://gitter.im/cortexlabs/cortex).

build/lint.sh

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ output=$(cd "$ROOT" && find . -type f \
7474
! -path "**/.idea/*" \
7575
! -path "**/.history/*" \
7676
! -path "**/__pycache__/*" \
77-
! -path "./examples/*" \
77+
! -path "./test/*" \
7878
! -path "./dev/config/*" \
7979
! -path "./bin/*" \
8080
! -path "./.circleci/*" \
@@ -137,25 +137,12 @@ if [ "$is_release_branch" = "true" ]; then
137137
exit 1
138138
fi
139139

140-
# Check for version warning comments in examples
141-
output=$(cd "$ROOT/examples" && find . -type f \
142-
! -name "README.md" \
143-
! -name "*.json" \
144-
! -name "*.txt" \
145-
! -name ".*" \
146-
! -name "*.bin" \
147-
-exec grep -L -e "this is an example for cortex release ${git_branch} and may not deploy correctly on other releases of cortex" {} \;)
148-
if [[ $output ]]; then
149-
echo "examples file(s) are missing appropriate version comment:"
150-
echo "$output"
151-
exit 1
152-
fi
153-
154140
else
155141
# Check for version warning comments in docs
156142
output=$(cd "$ROOT/docs" && find . -type f \
157143
! -path "./README.md" \
158144
! -name "summary.md" \
145+
! -path "./tutorials/*" \
159146
! -name "development.md" \
160147
! -name "*.json" \
161148
! -name "*.txt" \
@@ -167,21 +154,6 @@ else
167154
echo "$output"
168155
exit 1
169156
fi
170-
171-
# Check for version warning comments in examples
172-
output=$(cd "$ROOT/examples" && find . -type f \
173-
! -path "./README.md" \
174-
! -path "**/__pycache__/*" \
175-
! -name "*.json" \
176-
! -name "*.txt" \
177-
! -name ".*" \
178-
! -name "*.bin" \
179-
-exec grep -L "WARNING: you are on the master branch; please refer to examples on the branch corresponding to your \`cortex version\` (e\.g\. for version [0-9]*\.[0-9]*\.\*, run \`git checkout -b [0-9]*\.[0-9]*\` or switch to the \`[0-9]*\.[0-9]*\` branch on GitHub)" {} \;)
180-
if [[ $output ]]; then
181-
echo "example file(s) are missing version appropriate comment:"
182-
echo "$output"
183-
exit 1
184-
fi
185157
fi
186158

187159
# Check for trailing whitespace

build/test-examples.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -eou pipefail
1919
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
2020
CORTEX="$ROOT/bin/cortex"
2121

22-
for example in $ROOT/examples/*/cortex.yaml; do
22+
for example in $ROOT/test/*/cortex.yaml; do
2323
timer=1200
2424
example_base_dir=$(dirname "${example}")
2525
retry="false"

cli/cluster/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func ErrorFailedToConnectOperator(originalError error, envName string, operatorU
6262
msg += fmt.Sprintf(" → otherwise you can ignore this message, and prevent it in the future with `cortex env delete %s`\n", envName)
6363
msg += "\nif you have a cluster running:\n"
6464
msg += fmt.Sprintf(" → run `cortex cluster info --configure-env %s` to update your environment (include `--config <cluster.yaml>` if you have a cluster configuration file)\n", envName)
65-
msg += fmt.Sprintf(" → if you set `operator_load_balancer_scheme: internal` in your cluster configuration file, your CLI must run from within a VPC that has access to your cluster's VPC (see https://docs.cortex.dev/v/%s/aws/vpc-peering)\n", consts.CortexVersionMinor)
65+
msg += fmt.Sprintf(" → if you set `operator_load_balancer_scheme: internal` in your cluster configuration file, your CLI must run from within a VPC that has access to your cluster's VPC (see https://docs.cortex.dev/v/%s/)\n", consts.CortexVersionMinor)
6666
}
6767

6868
return errors.WithStack(&errors.Error{

cli/cmd/errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func ErrorMissingAWSCredentials() error {
249249
func ErrorCredentialsInClusterConfig(cmd string, path string) error {
250250
return errors.WithStack(&errors.Error{
251251
Kind: ErrCredentialsInClusterConfig,
252-
Message: fmt.Sprintf("specifying credentials in the cluster configuration is no longer supported, please specify aws credentials using flags (e.g. cortex cluster %s --config %s --aws-key <AWS_ACCESS_KEY_ID> --aws-secret <AWS_SECRET_ACCESS_KEY>) or set environment variables; see https://docs.cortex.dev/v/%s/aws/security#iam-permissions for more information", cmd, path, consts.CortexVersionMinor),
252+
Message: fmt.Sprintf("specifying credentials in the cluster configuration is no longer supported, please specify aws credentials using flags (e.g. cortex cluster %s --config %s --aws-key <AWS_ACCESS_KEY_ID> --aws-secret <AWS_SECRET_ACCESS_KEY>) or set environment variables; see https://docs.cortex.dev/v/%s/ for more information", cmd, path, consts.CortexVersionMinor),
253253
})
254254
}
255255

@@ -343,6 +343,6 @@ func ErrorDeployFromTopLevelDir(genericDirName string, providerType types.Provid
343343
}
344344
return errors.WithStack(&errors.Error{
345345
Kind: ErrDeployFromTopLevelDir,
346-
Message: fmt.Sprintf("cannot deploy from your %s directory - when deploying your API, cortex sends all files in your project directory (i.e. the directory which contains cortex.yaml) to your %s (see https://docs.cortex.dev/v/%s/deployments/realtime-api/predictors#project-files for Realtime API and https://docs.cortex.dev/v/%s/deployments/batch-api/predictors#project-files for Batch API); therefore it is recommended to create a subdirectory for your project files", genericDirName, targetStr, consts.CortexVersionMinor, consts.CortexVersionMinor),
346+
Message: fmt.Sprintf("cannot deploy from your %s directory - when deploying your API, cortex sends all files in your project directory (i.e. the directory which contains cortex.yaml) to your %s (see https://docs.cortex.dev/v/%s/); therefore it is recommended to create a subdirectory for your project files", genericDirName, targetStr, consts.CortexVersionMinor),
347347
})
348348
}

cli/cmd/lib_aws_creds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func promptIfNotAdmin(awsClient *aws.Client, disallowPrompt bool) {
6969
}
7070

7171
if !awsClient.IsAdmin() {
72-
warningStr := fmt.Sprintf("warning: your IAM user%s does not have administrator access. This will likely prevent Cortex from installing correctly, so it is recommended to attach the AdministratorAccess policy to your IAM user (or to a group that your IAM user belongs to) via the AWS IAM console. If you'd like, you may provide separate credentials for your cluster to use after it's running (see https://docs.cortex.dev/v/%s/aws/security for instructions).\n\n", accessKeyMsg, consts.CortexVersionMinor)
72+
warningStr := fmt.Sprintf("warning: your IAM user%s does not have administrator access. This will likely prevent Cortex from installing correctly, so it is recommended to attach the AdministratorAccess policy to your IAM user (or to a group that your IAM user belongs to) via the AWS IAM console. If you'd like, you may provide separate credentials for your cluster to use after it's running (see https://docs.cortex.dev/v/%s/).\n\n", accessKeyMsg, consts.CortexVersionMinor)
7373
if disallowPrompt {
7474
fmt.Print(warningStr)
7575
} else {

0 commit comments

Comments
 (0)