Skip to content

Commit 34480cd

Browse files
committed
Add project files to docs
1 parent 6bf16aa commit 34480cd

File tree

6 files changed

+49
-22
lines changed

6 files changed

+49
-22
lines changed

cli/cmd/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var deployCmd = &cobra.Command{
4444
Use: "deploy",
4545
Short: "create or update a deployment",
4646
Long: `
47-
This command sends all deployment configuration and code to Cortex.
47+
This command sends all project configuration and code to Cortex.
4848
If validations pass, Cortex will attempt to create the desired state.`,
4949
Args: cobra.NoArgs,
5050
Run: func(cmd *cobra.Command, args []string) {

cli/cmd/refresh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var refreshCmd = &cobra.Command{
3131
Use: "refresh",
3232
Short: "deploy and override existing deployment",
3333
Long: `
34-
This command sends all deployment configuration and code to Cortex.
34+
This command sends all project configuration and code to Cortex.
3535
If validations pass, Cortex will attempt to create the desired state,
3636
and override the existing deployment.`,
3737
Args: cobra.NoArgs,

docs/cluster/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## deploy
44

55
```text
6-
This command sends all deployment configuration and code to Cortex.
6+
This command sends all project configuration and code to Cortex.
77
If validations pass, Cortex will attempt to create the desired state.
88
99
Usage:
@@ -50,7 +50,7 @@ Flags:
5050
## refresh
5151

5252
```text
53-
This command sends all deployment configuration and code to Cortex.
53+
This command sends all project configuration and code to Cortex.
5454
If validations pass, Cortex will attempt to create the desired state,
5555
and override the existing deployment.
5656

docs/deployments/python-packages.md

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

docs/deployments/request-handlers.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,50 @@ boto3==1.9.228
7878
msgpack==0.6.1
7979
numpy==1.17.2
8080
requests==2.22.0
81-
tensorflow==1.14.0 # In TensorFlow serving images only
82-
onnxruntime==0.5.0 # In ONNX serving images only
81+
tensorflow==1.14.0 # For TensorFlow models only
82+
onnxruntime==0.5.0 # For ONNX models only
8383
```
8484

85-
You can install additional PyPI packages and import your own Python packages. See [Python Packages](../piplines/python-packages.md) for more details.
85+
## PyPI packages
86+
87+
You can install additional PyPI packages and import them your handlers. Cortex looks for a `requirements.txt` file in the top level Cortex project directory (i.e. the directory which contains `cortex.yaml`):
88+
89+
```text
90+
./iris-classifier/
91+
├── cortex.yaml
92+
├── handler.py
93+
├── ...
94+
└── requirements.txt
95+
```
96+
97+
## Project files
98+
99+
Cortex makes all files in the project directory (i.e. the directory which contains `cortex.yaml`) available to pre and post inference handlers. Python generated files and files and folders that start with `.` are excluded.
100+
101+
The contents of the project directory is available in `/mnt/project/` in the API containers. For example, if this is your project directory:
102+
103+
```text
104+
./iris-classifier/
105+
├── cortex.yaml
106+
├── config.json
107+
├── handler.py
108+
├── ...
109+
└── requirements.txt
110+
```
111+
112+
You can access `config.json` in `handler.py` like this:
113+
114+
```python
115+
import json
116+
117+
with open('/mnt/project/config.json', 'r') as config_file:
118+
config = json.load(config_file)
119+
120+
def pre_inference(sample, metadata):
121+
print(config)
122+
...
123+
```
124+
125+
## System packages
126+
127+
You can also install additional system packages. See [System Packages](system-packages.md) for more details.

docs/summary.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* [Packaging models](deployments/packaging-models.md)
1616
* [Request handlers](deployments/request-handlers.md)
1717
* [Compute](deployments/compute.md)
18-
* [Python packages](deployments/python-packages.md)
1918
* [System packages](deployments/system-packages.md)
2019
* [CLI commands](cluster/cli.md)
2120
* [Resource statuses](deployments/statuses.md)

0 commit comments

Comments
 (0)