clusterconfig

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validation = &cr.StructValidation{
	StructFieldValidations: []*cr.StructFieldValidation{
		{
			StructField: "InstanceType",
			StringPtrValidation: &cr.StringPtrValidation{
				Validator: validateInstanceType,
			},
		},
		{
			StructField: "MinInstances",
			Int64PtrValidation: &cr.Int64PtrValidation{
				GreaterThan: pointer.Int64(0),
			},
		},
		{
			StructField: "MaxInstances",
			Int64PtrValidation: &cr.Int64PtrValidation{
				GreaterThan: pointer.Int64(0),
			},
		},
		{
			StructField: "ClusterName",
			StringValidation: &cr.StringValidation{
				Default: "cortex",
			},
		},
		{
			StructField: "Region",
			StringValidation: &cr.StringValidation{
				Default: "us-west-2",
			},
		},
		{
			StructField: "Bucket",
			StringValidation: &cr.StringValidation{
				Default:    "",
				AllowEmpty: true,
			},
		},
		{
			StructField: "LogGroup",
			StringValidation: &cr.StringValidation{
				Default: "cortex",
			},
		},
		{
			StructField: "Telemetry",
			BoolValidation: &cr.BoolValidation{
				Default: true,
			},
		},
		{
			StructField: "ImagePredictorServe",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/predictor-serve:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImagePredictorServeGPU",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/predictor-serve-gpu:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageTFServe",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/tf-serve:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageTFServeGPU",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/tf-serve-gpu:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageTFAPI",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/tf-api:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageONNXServe",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/onnx-serve:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageONNXServeGPU",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/onnx-serve-gpu:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageOperator",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/operator:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageManager",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/manager:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageDownloader",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/downloader:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageClusterAutoscaler",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/cluster-autoscaler:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageMetricsServer",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/metrics-server:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageNvidia",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/nvidia:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageFluentd",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/fluentd:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageStatsd",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/statsd:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageIstioProxy",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/istio-proxy:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageIstioPilot",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/istio-pilot:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageIstioCitadel",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/istio-citadel:" + consts.CortexVersion,
			},
		},
		{
			StructField: "ImageIstioGalley",
			StringValidation: &cr.StringValidation{
				Default: "cortexlabs/istio-galley:" + consts.CortexVersion,
			},
		},

		{
			Key: "aws_access_key_id",
			Nil: true,
		},
		{
			Key: "aws_secret_access_key",
			Nil: true,
		},
		{
			Key: "cortex_aws_access_key_id",
			Nil: true,
		},
		{
			Key: "cortex_aws_secret_access_key",
			Nil: true,
		},
	},
}

Functions

func ErrorInstanceTypeTooSmall

func ErrorInstanceTypeTooSmall() error

func ErrorInvalidAWSCredentials

func ErrorInvalidAWSCredentials() error

func PromptValidation

func PromptValidation(skipPopulatedFields bool, promptInstanceType bool, defaults *ClusterConfig) *cr.PromptValidation

func SetFileDefaults

func SetFileDefaults(clusterConfig *ClusterConfig) error

This does not set defaults for fields that are prompted from the user

Types

type ClusterConfig

type ClusterConfig struct {
	InstanceType           *string `json:"instance_type" yaml:"instance_type"`
	MinInstances           *int64  `json:"min_instances" yaml:"min_instances"`
	MaxInstances           *int64  `json:"max_instances" yaml:"max_instances"`
	ClusterName            string  `json:"cluster_name" yaml:"cluster_name"`
	Region                 string  `json:"region" yaml:"region"`
	Bucket                 string  `json:"bucket" yaml:"bucket"`
	LogGroup               string  `json:"log_group" yaml:"log_group"`
	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"`
	ImageTFServe           string  `json:"image_tf_serve" yaml:"image_tf_serve"`
	ImageTFServeGPU        string  `json:"image_tf_serve_gpu" yaml:"image_tf_serve_gpu"`
	ImageTFAPI             string  `json:"image_tf_api" yaml:"image_tf_api"`
	ImageONNXServe         string  `json:"image_onnx_serve" yaml:"image_onnx_serve"`
	ImageONNXServeGPU      string  `json:"image_onnx_serve_gpu" yaml:"image_onnx_serve_gpu"`
	ImageOperator          string  `json:"image_operator" yaml:"image_operator"`
	ImageManager           string  `json:"image_manager" yaml:"image_manager"`
	ImageDownloader        string  `json:"image_downloader" yaml:"image_downloader"`
	ImageClusterAutoscaler string  `json:"image_cluster_autoscaler" yaml:"image_cluster_autoscaler"`
	ImageMetricsServer     string  `json:"image_metrics_server" yaml:"image_metrics_server"`
	ImageNvidia            string  `json:"image_nvidia" yaml:"image_nvidia"`
	ImageFluentd           string  `json:"image_fluentd" yaml:"image_fluentd"`
	ImageStatsd            string  `json:"image_statsd" yaml:"image_statsd"`
	ImageIstioProxy        string  `json:"image_istio_proxy" yaml:"image_istio_proxy"`
	ImageIstioPilot        string  `json:"image_istio_pilot" yaml:"image_istio_pilot"`
	ImageIstioCitadel      string  `json:"image_istio_citadel" yaml:"image_istio_citadel"`
	ImageIstioGalley       string  `json:"image_istio_galley" yaml:"image_istio_galley"`
}

func GetFileDefaults

func GetFileDefaults() (*ClusterConfig, error)

This does not set defaults for fields that are prompted from the user

func (*ClusterConfig) SetBucket

func (cc *ClusterConfig) SetBucket(awsAccessKeyID string, awsSecretAccessKey string) error

type Error

type Error struct {
	Kind ErrorKind
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type ErrorKind

type ErrorKind int
const (
	ErrUnknown ErrorKind = iota
	ErrInstanceTypeTooSmall
	ErrInvalidAWSCredentials
)

func (ErrorKind) MarshalBinary

func (t ErrorKind) MarshalBinary() ([]byte, error)

MarshalBinary satisfies BinaryMarshaler

func (ErrorKind) MarshalText

func (t ErrorKind) MarshalText() ([]byte, error)

MarshalText satisfies TextMarshaler

func (ErrorKind) String

func (t ErrorKind) String() string

func (*ErrorKind) UnmarshalBinary

func (t *ErrorKind) UnmarshalBinary(data []byte) error

UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack

func (*ErrorKind) UnmarshalText

func (t *ErrorKind) UnmarshalText(text []byte) error

UnmarshalText satisfies TextUnmarshaler

type InternalClusterConfig

type InternalClusterConfig struct {
	ClusterConfig
	ID                string `json:"id"`
	APIVersion        string `json:"api_version"`
	OperatorInCluster bool   `json:"operator_in_cluster"`
}

func (*InternalClusterConfig) String

func (cc *InternalClusterConfig) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL