Skip to content

Commit

Permalink
Make instance volume size configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
deliahu committed Nov 21, 2019
1 parent 5d1853e commit f0adbb0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/cmd/lib_cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ func confirmClusterConfig(clusterConfig *clusterconfig.ClusterConfig, awsCreds *
if clusterConfig.LogGroup != defaultCC.LogGroup {
items = append(items, table.KV{K: "log group", V: clusterConfig.LogGroup})
}

if clusterConfig.InstanceVolumeSize != defaultCC.InstanceVolumeSize {
items = append(items, table.KV{K: "instance volume size", V: clusterConfig.InstanceVolumeSize})
}

if clusterConfig.Telemetry != defaultCC.Telemetry {
items = append(items, table.KV{K: "telemetry", V: clusterConfig.Telemetry})
}
Expand Down
3 changes: 3 additions & 0 deletions docs/cluster/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ log_group: cortex
# Name of the EKS cluster Cortex will create
cluster_name: cortex

# Volume size for each instance in the cluster (in GiB)
instance_volume_size: 50

# Flag to enable collection of anonymous usage stats and error reports
telemetry: true

Expand Down
1 change: 1 addition & 0 deletions manager/eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ metadata:
nodeGroups:
- name: ng-1
instanceType: $CORTEX_INSTANCE_TYPE
volumeSize: $CORTEX_INSTANCE_VOLUME_SIZE
minSize: $CORTEX_MIN_INSTANCES
maxSize: $CORTEX_MAX_INSTANCES
desiredCapacity: $CORTEX_MIN_INSTANCES
Expand Down
10 changes: 10 additions & 0 deletions pkg/lib/clusterconfig/clusterconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type ClusterConfig struct {
Region string `json:"region" yaml:"region"`
Bucket string `json:"bucket" yaml:"bucket"`
LogGroup string `json:"log_group" yaml:"log_group"`
InstanceVolumeSize int64 `json:"instance_volume_size" yaml:"instance_volume_size"`
Telemetry bool `json:"telemetry" yaml:"telemetry"`
ImagePredictorServe string `json:"image_predictor_serve" yaml:"image_predictor_serve"`
ImagePredictorServeGPU string `json:"image_predictor_serve_gpu" yaml:"image_predictor_serve_gpu"`
Expand Down Expand Up @@ -111,6 +112,14 @@ var Validation = &cr.StructValidation{
Default: "cortex",
},
},
{
StructField: "InstanceVolumeSize",
Int64Validation: &cr.Int64Validation{
Default: 50,
GreaterThanOrEqualTo: pointer.Int64(20), // large enough to fit docker images and any other overhead
LessThanOrEqualTo: pointer.Int64(16384),
},
},
{
StructField: "Telemetry",
BoolValidation: &cr.BoolValidation{
Expand Down Expand Up @@ -373,6 +382,7 @@ func (cc *InternalClusterConfig) String() string {
items = append(items, table.KV{K: "region", V: cc.Region})
items = append(items, table.KV{K: "bucket", V: cc.Bucket})
items = append(items, table.KV{K: "log group", V: cc.LogGroup})
items = append(items, table.KV{K: "instance volume size", V: cc.InstanceVolumeSize})
items = append(items, table.KV{K: "telemetry", V: cc.Telemetry})
items = append(items, table.KV{K: "image_predictor_serve", V: cc.ImagePredictorServe})
items = append(items, table.KV{K: "image_predictor_serve_gpu", V: cc.ImagePredictorServeGPU})
Expand Down

0 comments on commit f0adbb0

Please sign in to comment.