Skip to content
Merged

Docs #1674

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5f3df04
Update examples
ospillinger Dec 2, 2020
f97ba2d
Delete README.md
ospillinger Dec 2, 2020
780e834
Rename examples to tutorials
ospillinger Dec 3, 2020
82a8272
Update tutorials
ospillinger Dec 5, 2020
22010bf
Update docs
ospillinger Dec 5, 2020
a6695da
Update README.md
ospillinger Dec 5, 2020
49586aa
Update README.md
ospillinger Dec 5, 2020
994a8e1
Reorganize misc docs
ospillinger Dec 5, 2020
91c4ce4
Add a simple version of the batch tutorial
vishalbollu Dec 7, 2020
39efeed
Remove batch example from the batch tutorial
vishalbollu Dec 7, 2020
f251373
Move examples directory to test folder
vishalbollu Dec 7, 2020
f283372
Update tutorials
ospillinger Dec 8, 2020
3c6e53c
Update docs
ospillinger Dec 8, 2020
230540a
Update docs
ospillinger Dec 8, 2020
e11c015
Update docs
ospillinger Dec 8, 2020
f6c11a1
Update .gitbook.yaml
ospillinger Dec 8, 2020
3dce6f0
Revert batch predictor.py
vishalbollu Dec 8, 2020
e598e24
Update docs
ospillinger Dec 8, 2020
68080c3
Update README.md
ospillinger Dec 8, 2020
1f19d61
Update docs
ospillinger Dec 8, 2020
6b03e4e
Tutorials
vishalbollu Dec 8, 2020
9794d75
Merge branch 'docs' of github.com:cortexlabs/cortex into docs
vishalbollu Dec 8, 2020
900718b
Merge branch 'master' into docs
vishalbollu Dec 8, 2020
6d9fe04
Remove cloud folder
vishalbollu Dec 8, 2020
215ab40
Update docs
ospillinger Dec 8, 2020
f41947d
Merge branch 'docs' of https://github.com/cortexlabs/cortex into docs
ospillinger Dec 8, 2020
1c4cea1
Remove references to specific documentation in the code
vishalbollu Dec 9, 2020
6429cb4
Update generate_python_client_md.sh
vishalbollu Dec 9, 2020
f4ed429
Update traffic-splitter.md
vishalbollu Dec 9, 2020
daed845
Update batch.md
vishalbollu Dec 9, 2020
48d0859
Update traffic-splitter.md
vishalbollu Dec 9, 2020
2f4d0f2
Update multi-model.md
vishalbollu Dec 9, 2020
fe8797a
Remove examples from linting and skip version check in tutorials
vishalbollu Dec 9, 2020
c17a49c
Update install.md
vishalbollu Dec 9, 2020
d38a998
Update gcp install docs
vishalbollu Dec 9, 2020
957f695
Merge branch 'docs' of github.com:cortexlabs/cortex into docs
vishalbollu Dec 9, 2020
e51a969
Fix docs links deployments -> workloads
vishalbollu Dec 9, 2020
685194f
Update single-node-deployment.md
vishalbollu Dec 9, 2020
80d77cb
Update summary.md
vishalbollu Dec 9, 2020
0cbbd7c
PR review fixes
vishalbollu Dec 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/bin/
/dev/
/docs/
/examples/
/test/

**/.*
**/*.md
Expand Down
10 changes: 1 addition & 9 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
root: ./docs/

structure:
readme: ../README.md
readme: ./tutorials/realtime.md
summary: summary.md

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: ./cloud/install.md
uninstall: ./cloud/uninstall.md
update: ./cloud/update.md
76 changes: 0 additions & 76 deletions CODE_OF_CONDUCT.md

This file was deleted.

9 changes: 0 additions & 9 deletions CONTRIBUTING.md

This file was deleted.

27 changes: 5 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

<br>

<!-- Delete on release branches -->
<!-- CORTEX_VERSION_README_MINOR -->
[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)

# Deploy machine learning models to production

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

```python
# predictor.py

from transformers import pipeline

class PythonPredictor:
Expand All @@ -74,20 +68,13 @@ class PythonPredictor:
api_spec = {
"name": "text-generator",
"kind": "RealtimeAPI",
"predictor": {
"type": "python",
"path": "predictor.py"
},
"compute": {
"gpu": 1,
"mem": "8Gi",
"mem": "8Gi"
},
"autoscaling": {
"min_replicas": 1,
"max_replicas": 10
},
"networking": {
"api_gateway": "public"
}
}
```
Expand All @@ -108,19 +95,15 @@ api_spec = {
import cortex

cx = cortex.client("aws")
cx.deploy(api_spec, project_dir=".")
cx.create_api(api_spec, predictor=PythonPredictor)

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

#### Consume your API

```python
import requests

endpoint = "https://example.com/text-generator"
payload = {"text": "hello world"}
prediction = requests.post(endpoint, payload)
```bash
$ curl https://example.com/text-generator -X POST -H "Content-Type: application/json" -d '{"text": "hello world"}'
```

<br>
Expand All @@ -131,4 +114,4 @@ prediction = requests.post(endpoint, payload)
pip install cortex
```

See the [installation guide](https://docs.cortex.dev/install) for next steps.
[Deploy models](https://docs.cortex.dev) and [join our community](https://gitter.im/cortexlabs/cortex).
32 changes: 2 additions & 30 deletions build/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ output=$(cd "$ROOT" && find . -type f \
! -path "**/.idea/*" \
! -path "**/.history/*" \
! -path "**/__pycache__/*" \
! -path "./examples/*" \
! -path "./test/*" \
! -path "./dev/config/*" \
! -path "./bin/*" \
! -path "./.circleci/*" \
Expand Down Expand Up @@ -137,25 +137,12 @@ if [ "$is_release_branch" = "true" ]; then
exit 1
fi

# Check for version warning comments in examples
output=$(cd "$ROOT/examples" && find . -type f \
! -name "README.md" \
! -name "*.json" \
! -name "*.txt" \
! -name ".*" \
! -name "*.bin" \
-exec grep -L -e "this is an example for cortex release ${git_branch} and may not deploy correctly on other releases of cortex" {} \;)
if [[ $output ]]; then
echo "examples file(s) are missing appropriate version comment:"
echo "$output"
exit 1
fi

else
# Check for version warning comments in docs
output=$(cd "$ROOT/docs" && find . -type f \
! -path "./README.md" \
! -name "summary.md" \
! -path "./tutorials/*" \
! -name "development.md" \
! -name "*.json" \
! -name "*.txt" \
Expand All @@ -167,21 +154,6 @@ else
echo "$output"
exit 1
fi

# Check for version warning comments in examples
output=$(cd "$ROOT/examples" && find . -type f \
! -path "./README.md" \
! -path "**/__pycache__/*" \
! -name "*.json" \
! -name "*.txt" \
! -name ".*" \
! -name "*.bin" \
-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)" {} \;)
if [[ $output ]]; then
echo "example file(s) are missing version appropriate comment:"
echo "$output"
exit 1
fi
fi

# Check for trailing whitespace
Expand Down
2 changes: 1 addition & 1 deletion build/test-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -eou pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"
CORTEX="$ROOT/bin/cortex"

for example in $ROOT/examples/*/cortex.yaml; do
for example in $ROOT/test/*/cortex.yaml; do
timer=1200
example_base_dir=$(dirname "${example}")
retry="false"
Expand Down
2 changes: 1 addition & 1 deletion cli/cluster/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func ErrorFailedToConnectOperator(originalError error, envName string, operatorU
msg += fmt.Sprintf(" → otherwise you can ignore this message, and prevent it in the future with `cortex env delete %s`\n", envName)
msg += "\nif you have a cluster running:\n"
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)
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)
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)
}

return errors.WithStack(&errors.Error{
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func ErrorMissingAWSCredentials() error {
func ErrorCredentialsInClusterConfig(cmd string, path string) error {
return errors.WithStack(&errors.Error{
Kind: ErrCredentialsInClusterConfig,
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),
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),
})
}

Expand Down Expand Up @@ -343,6 +343,6 @@ func ErrorDeployFromTopLevelDir(genericDirName string, providerType types.Provid
}
return errors.WithStack(&errors.Error{
Kind: ErrDeployFromTopLevelDir,
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),
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),
})
}
2 changes: 1 addition & 1 deletion cli/cmd/lib_aws_creds.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func promptIfNotAdmin(awsClient *aws.Client, disallowPrompt bool) {
}

if !awsClient.IsAdmin() {
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)
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)
if disallowPrompt {
fmt.Print(warningStr)
} else {
Expand Down
Loading