Skip to content

Commit fa227d1

Browse files
committed
Remove region from external data
1 parent 2b5f8e7 commit fa227d1

File tree

32 files changed

+924
-719
lines changed

32 files changed

+924
-719
lines changed

cli/cmd/get.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"strings"
2323
"time"
2424

25+
"github.com/cortexlabs/yaml"
2526
"github.com/spf13/cobra"
2627

2728
"github.com/cortexlabs/cortex/pkg/lib/errors"
@@ -412,8 +413,8 @@ func describeAPI(name string, resourcesRes *schema.GetResourcesResponse) (string
412413
out += "Method: POST\n"
413414
out += `Header: "Content-Type: application/json"` + "\n"
414415

415-
if api.Model != nil {
416-
model := ctx.Models[api.ModelName]
416+
if modelName, ok := yaml.ExtractAtSymbolText(api.Model); ok {
417+
model := ctx.Models[modelName]
417418
resIDs := strset.New()
418419
combinedInput := []interface{}{model.Input, model.TrainingInput}
419420
for _, res := range ctx.ExtractCortexResources(combinedInput, resource.ConstantType, resource.RawColumnType, resource.AggregateType, resource.TransformedColumnType) {

docs/apis/apis.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Serve models at scale and use them to build smarter applications.
77
```yaml
88
- kind: api
99
name: <string> # API name (required)
10-
external_model:
11-
path: <string> # path to a zipped model dir (e.g. s3://my-bucket/model.zip)
12-
region: <string> # S3 region (default: us-west-2)
10+
model: <string> # path to a zipped model dir (e.g. s3://my-bucket/model.zip)
1311
compute:
1412
replicas: <int> # number of replicas to launch (default: 1)
1513
cpu: <string> # CPU request per replica (default: Null)
@@ -24,9 +22,7 @@ See [packaging models](packaging-models.md) for how to create the zipped model.
2422
```yaml
2523
- kind: api
2624
name: my-api
27-
external_model:
28-
path: s3://my-bucket/my-model.zip
29-
region: us-west-2
25+
model: s3://my-bucket/my-model.zip
3026
compute:
3127
replicas: 3
3228
gpu: 2

docs/apis/packaging-models.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ Upload the zipped file to Amazon S3, e.g.
1717
$ aws s3 cp model.zip s3://my-bucket/model.zip
1818
```
1919

20-
Specify `external_model` in an API, e.g.
20+
Specify `model` in an API, e.g.
2121

2222
```yaml
2323
- kind: api
2424
name: my-api
25-
external_model:
26-
path: s3://my-bucket/model.zip
27-
region: us-west-2
25+
model: s3://my-bucket/model.zip
2826
```

docs/apis/tutorial.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ Add to `cortex.yaml`:
3232
```yaml
3333
- kind: api
3434
name: iris-type
35-
external_model:
36-
path: s3://cortex-examples/iris-tensorflow.zip
37-
region: us-west-2
35+
model: s3://cortex-examples/iris-tensorflow.zip
3836
compute:
3937
replicas: 3
4038
```

docs/pipelines/apis.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ Serve models at scale and use them to build smarter applications.
77
```yaml
88
- kind: api
99
name: <string> # API name (required)
10-
model: <string> # reference to a model (e.g. @dnn) (this or external_model must be specified)
11-
external_model: # (this or model must be specified)
12-
path: <string> # path to a zipped model dir (e.g. s3://my-bucket/model.zip)
13-
region: <string> # S3 region (default: us-west-2)
10+
model: <string> # reference to a model (e.g. @dnn) or path to a zipped model dir (e.g. s3://my-bucket/model.zip)
1411
compute:
1512
replicas: <int> # number of replicas to launch (default: 1)
1613
cpu: <string> # CPU request per replica (default: Null)
1714
gpu: <string> # gpu request per replica (default: Null)
1815
mem: <string> # memory request per replica (default: Null)
1916
```
2017
21-
See [packaging models](packaging-models.md) for how to create the zipped model (for use in `external_model`).
18+
See [packaging models](packaging-models.md) for how to create a zipped model (only if using an externally-built models).
2219
2320
## Example
2421

docs/pipelines/constants.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ Constants represent literal values which can be used in other Cortex resources.
88
- kind: constant
99
name: <string> # constant name (required)
1010
type: <output_type> # the type of the constant (optional, will be inferred from value if not specified)
11-
value: <output_value> # a literal value (this or external_model must be specified)
12-
external_model: # (this or value must be specified)
13-
path: <string> # path to a JSON object (e.g. s3://my-bucket/constant.json)
14-
region: <string> # S3 region (default: us-west-2)
11+
value: <output_value> # a literal value (this or path must be specified)
12+
path: <string> # path to a JSON object (e.g. s3://my-bucket/constant.json) (this or value must be specified)
1513

1614
```
1715

docs/pipelines/environments.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Transfer data at scale from data warehouses like S3 into the Cortex environment.
2626
data:
2727
type: csv # file type (required)
2828
path: s3a://<bucket_name>/<file_name> # S3 is currently supported (required)
29-
region: us-west-2 # S3 region (default: us-west-2)
3029
drop_null: <bool> # drop any rows that contain at least 1 null value (default: false)
3130
csv_config: <csv_config> # optional configuration that can be provided
3231
schema:
@@ -65,7 +64,6 @@ csv_config:
6564
data:
6665
type: parquet # file type (required)
6766
path: s3a://<bucket_name>/<file_name> # S3 is currently supported (required)
68-
region: us-west-2 # S3 region (default: us-west-2)
6967
drop_null: <bool> # drop any rows that contain at least 1 null value (default: false)
7068
schema:
7169
- parquet_column_name: <string> # name of the column in the parquet file (required)

docs/pipelines/packaging-models.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ Upload the zipped file to Amazon S3, e.g.
1717
$ aws s3 cp model.zip s3://my-bucket/model.zip
1818
```
1919

20-
Specify `external_model` in an API, e.g.
20+
Specify `model` in an API, e.g.
2121

2222
```yaml
2323
- kind: api
2424
name: my-api
25-
external_model:
26-
path: s3://my-bucket/model.zip
27-
region: us-west-2
25+
model: s3://my-bucket/model.zip
2826
```

examples/iris/cortex.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
- kind: api
55
name: iris-type
6-
external_model:
7-
path: s3://cortex-examples/iris-tensorflow.zip
8-
region: us-west-2
6+
model: s3://cortex-examples/iris-tensorflow.zip
97
compute:
108
replicas: 3

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// replace these lines in go.mod:
66
// github.com/GoogleCloudPlatform/spark-on-k8s-operator v1alpha1-0.5-2.4.0
77
// github.com/argoproj/argo v2.3.0
8-
// github.com/cortexlabs/yaml v2.2.3
8+
// github.com/cortexlabs/yaml v2.2.4
99
// k8s.io/client-go v10.0.0
1010
// k8s.io/api 89a74a8d264df0e993299876a8cde88379b940ee
1111
// k8s.io/apimachinery 2b1284ed4c93a43499e781493253e2ac5959c4fd
@@ -20,8 +20,8 @@ go 1.12
2020
require (
2121
github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20181208011959-62db1d66dafa
2222
github.com/argoproj/argo v2.3.0+incompatible
23-
github.com/aws/aws-sdk-go v1.20.7
24-
github.com/cortexlabs/yaml v0.0.0-20190624201412-7f31702857b6
23+
github.com/aws/aws-sdk-go v1.20.8
24+
github.com/cortexlabs/yaml v0.0.0-20190626164117-202ab3a3d475
2525
github.com/davecgh/go-spew v1.1.1
2626
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
2727
github.com/go-openapi/spec v0.19.2 // indirect

0 commit comments

Comments
 (0)