From f0adbb0c55085aefae760b78e4bc7df27f0cd16f Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Wed, 20 Nov 2019 21:38:03 -0800 Subject: [PATCH] Make instance volume size configurable --- cli/cmd/lib_cluster_config.go | 5 +++++ docs/cluster/config.md | 3 +++ manager/eks.yaml | 1 + pkg/lib/clusterconfig/clusterconfig.go | 10 ++++++++++ 4 files changed, 19 insertions(+) diff --git a/cli/cmd/lib_cluster_config.go b/cli/cmd/lib_cluster_config.go index 3469fa02e8..a200f543da 100644 --- a/cli/cmd/lib_cluster_config.go +++ b/cli/cmd/lib_cluster_config.go @@ -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}) } diff --git a/docs/cluster/config.md b/docs/cluster/config.md index 06da67fc7b..dae7ae7cc1 100644 --- a/docs/cluster/config.md +++ b/docs/cluster/config.md @@ -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 diff --git a/manager/eks.yaml b/manager/eks.yaml index f2a2c63910..e25344dd5c 100644 --- a/manager/eks.yaml +++ b/manager/eks.yaml @@ -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 diff --git a/pkg/lib/clusterconfig/clusterconfig.go b/pkg/lib/clusterconfig/clusterconfig.go index d1a97446d6..1dfb3d3c96 100644 --- a/pkg/lib/clusterconfig/clusterconfig.go +++ b/pkg/lib/clusterconfig/clusterconfig.go @@ -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"` @@ -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{ @@ -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})