diff --git a/Makefile b/Makefile index 8581b1ef79..aae1d9fe94 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,6 @@ ci-build-images: @./build/build-image.sh images/istio-galley istio-galley @./build/build-image.sh images/istio-pilot istio-pilot @./build/build-image.sh images/istio-proxy istio-proxy - @./build/build-image.sh images/istio-mixer istio-mixer ci-push-images: @./build/push-image.sh manager @@ -173,7 +172,6 @@ ci-push-images: @./build/push-image.sh istio-galley @./build/push-image.sh istio-pilot @./build/push-image.sh istio-proxy - @./build/push-image.sh istio-mixer ci-build-cli: diff --git a/cli/cmd/get.go b/cli/cmd/get.go index be95e20ce9..99c714f9d7 100644 --- a/cli/cmd/get.go +++ b/cli/cmd/get.go @@ -338,20 +338,13 @@ func getAPIMetrics(appName, apiName string) (*schema.APIMetrics, error) { } func appendNetworkMetrics(apiTable table.Table, apiMetrics *schema.APIMetrics) table.Table { - latency := "-" - if apiMetrics.NetworkStats.Latency != nil { - latency = fmt.Sprintf("%.9g", *apiMetrics.NetworkStats.Latency) - } - headers := []table.Header{ - {Title: "avg latency"}, {Title: "2XX", Hidden: apiMetrics.NetworkStats.Code2XX == 0}, {Title: "4XX", Hidden: apiMetrics.NetworkStats.Code4XX == 0}, {Title: "5XX", Hidden: apiMetrics.NetworkStats.Code5XX == 0}, } row := []interface{}{ - latency, apiMetrics.NetworkStats.Code2XX, apiMetrics.NetworkStats.Code4XX, apiMetrics.NetworkStats.Code5XX, diff --git a/cortex.sh b/cortex.sh index 540a738bcd..207707bad5 100755 --- a/cortex.sh +++ b/cortex.sh @@ -145,7 +145,6 @@ export CORTEX_IMAGE_ISTIO_CITADEL="${CORTEX_IMAGE_ISTIO_CITADEL:-cortexlabs/isti export CORTEX_IMAGE_ISTIO_GALLEY="${CORTEX_IMAGE_ISTIO_GALLEY:-cortexlabs/istio-galley:$CORTEX_VERSION_STABLE}" export CORTEX_IMAGE_ISTIO_PILOT="${CORTEX_IMAGE_ISTIO_PILOT:-cortexlabs/istio-pilot:$CORTEX_VERSION_STABLE}" export CORTEX_IMAGE_ISTIO_PROXY="${CORTEX_IMAGE_ISTIO_PROXY:-cortexlabs/istio-proxy:$CORTEX_VERSION_STABLE}" -export CORTEX_IMAGE_ISTIO_MIXER="${CORTEX_IMAGE_ISTIO_MIXER:-cortexlabs/istio-mixer:$CORTEX_VERSION_STABLE}" export CORTEX_ENABLE_TELEMETRY="${CORTEX_ENABLE_TELEMETRY:-""}" export CORTEX_TELEMETRY_URL="${CORTEX_TELEMETRY_URL:-"https://telemetry.cortexlabs.dev"}" @@ -205,7 +204,6 @@ function install_cortex() { -e CORTEX_IMAGE_ISTIO_GALLEY=$CORTEX_IMAGE_ISTIO_GALLEY \ -e CORTEX_IMAGE_ISTIO_PILOT=$CORTEX_IMAGE_ISTIO_PILOT \ -e CORTEX_IMAGE_ISTIO_PROXY=$CORTEX_IMAGE_ISTIO_PROXY \ - -e CORTEX_IMAGE_ISTIO_MIXER=$CORTEX_IMAGE_ISTIO_MIXER \ -e CORTEX_ENABLE_TELEMETRY=$CORTEX_ENABLE_TELEMETRY \ $CORTEX_IMAGE_MANAGER } diff --git a/dev/registry.sh b/dev/registry.sh index d17226dd0e..3d3d85a1c2 100755 --- a/dev/registry.sh +++ b/dev/registry.sh @@ -41,7 +41,6 @@ function create_registry() { aws ecr create-repository --repository-name=cortexlabs/istio-pilot --region=$REGISTRY_REGION || true aws ecr create-repository --repository-name=cortexlabs/istio-galley --region=$REGISTRY_REGION || true aws ecr create-repository --repository-name=cortexlabs/istio-proxy --region=$REGISTRY_REGION || true - aws ecr create-repository --repository-name=cortexlabs/istio-mixer --region=$REGISTRY_REGION || true aws ecr create-repository --repository-name=cortexlabs/operator --region=$REGISTRY_REGION || true aws ecr create-repository --repository-name=cortexlabs/tf-serve --region=$REGISTRY_REGION || true aws ecr create-repository --repository-name=cortexlabs/tf-api --region=$REGISTRY_REGION || true @@ -137,7 +136,6 @@ elif [ "$cmd" = "update" ]; then build_and_push $ROOT/images/istio-pilot istio-pilot latest build_and_push $ROOT/images/istio-galley istio-galley latest build_and_push $ROOT/images/istio-proxy istio-proxy latest - build_and_push $ROOT/images/istio-mixer istio-mixer latest fi build_and_push $ROOT/images/tf-api tf-api latest diff --git a/docs/cluster/config.md b/docs/cluster/config.md index a5494c4043..f1f439b151 100644 --- a/docs/cluster/config.md +++ b/docs/cluster/config.md @@ -56,7 +56,6 @@ export CORTEX_IMAGE_CLUSTER_AUTOSCALER="cortexlabs/cluster-autoscaler:master" export CORTEX_IMAGE_NVIDIA="cortexlabs/nvidia:master" export CORTEX_IMAGE_METRICS_SERVER="cortexlabs/metrics-server:master" export CORTEX_IMAGE_ISTIO_PROXY="cortexlabs/istio-proxy:master" -export CORTEX_IMAGE_ISTIO_MIXER="cortexlabs/istio-mixer:master" export CORTEX_IMAGE_ISTIO_PILOT="cortexlabs/istio-pilot:master" export CORTEX_IMAGE_ISTIO_CITADEL="cortexlabs/istio-citadel:master" export CORTEX_IMAGE_ISTIO_GALLEY="cortexlabs/istio-galley:master" diff --git a/docs/cluster/development.md b/docs/cluster/development.md index 4a31f6b8ee..b697d64e1f 100644 --- a/docs/cluster/development.md +++ b/docs/cluster/development.md @@ -74,7 +74,6 @@ export CORTEX_IMAGE_CLUSTER_AUTOSCALER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com export CORTEX_IMAGE_NVIDIA="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/nvidia:latest" export CORTEX_IMAGE_METRICS_SERVER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/metrics-server:latest" export CORTEX_IMAGE_ISTIO_PROXY="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-proxy:latest" -export CORTEX_IMAGE_ISTIO_MIXER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-mixer:latest" export CORTEX_IMAGE_ISTIO_PILOT="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-pilot:latest" export CORTEX_IMAGE_ISTIO_CITADEL="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-citadel:latest" export CORTEX_IMAGE_ISTIO_GALLEY="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-galley:latest" diff --git a/images/istio-mixer/Dockerfile b/images/istio-mixer/Dockerfile deleted file mode 100644 index 59fb952073..0000000000 --- a/images/istio-mixer/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM docker.io/istio/mixer:1.2.2 diff --git a/manager/install_cortex.sh b/manager/install_cortex.sh index bd8d93c422..081b2d5ae6 100755 --- a/manager/install_cortex.sh +++ b/manager/install_cortex.sh @@ -98,17 +98,6 @@ function setup_istio() { echo -n "." envsubst < manifests/istio-values.yaml | helm template istio-manifests/istio --values - --name istio --namespace istio-system | kubectl apply -f - >/dev/null - envsubst < manifests/istio-metrics.yaml | kubectl apply -f - >/dev/null - - kubectl -n=istio-system create secret generic 'aws-credentials' \ - --from-literal='AWS_ACCESS_KEY_ID'=$CORTEX_AWS_ACCESS_KEY_ID \ - --from-literal='AWS_SECRET_ACCESS_KEY'=$CORTEX_AWS_SECRET_ACCESS_KEY \ - -o yaml --dry-run | kubectl apply -f - >/dev/null - istio_patch="[ - {\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/env/-\", \"value\": {\"name\": \"AWS_ACCESS_KEY_ID\", \"valueFrom\": {\"secretKeyRef\": {\"name\": \"aws-credentials\", \"key\": \"AWS_ACCESS_KEY_ID\"}}}},\ - {\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/env/-\", \"value\": {\"name\": \"AWS_SECRET_ACCESS_KEY\", \"valueFrom\": {\"secretKeyRef\": {\"name\": \"aws-credentials\", \"key\": \"AWS_SECRET_ACCESS_KEY\"}}}},\ - ]" - kubectl patch deployment istio-telemetry -n istio-system --type='json' -p="$istio_patch" >/dev/null } function validate_cortex() { diff --git a/manager/manifests/istio-metrics.yaml b/manager/manifests/istio-metrics.yaml deleted file mode 100644 index e994d9c76a..0000000000 --- a/manager/manifests/istio-metrics.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2019 Cortex Labs, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: config.istio.io/v1alpha2 -kind: instance -metadata: - name: response-time - namespace: $CORTEX_NAMESPACE -spec: - compiledTemplate: metric - params: - value: response.duration - dimensions: - RequestPath: request.url_path | "unknown" ---- -apiVersion: config.istio.io/v1alpha2 -kind: handler -metadata: - name: cortex-request-handler - namespace: $CORTEX_NAMESPACE -spec: - compiledAdapter: cloudwatch - params: - namespace: $CORTEX_NAMESPACE - logGroupName: $CORTEX_LOG_GROUP - logStreamName: $CORTEX_LOG_GROUP - metricInfo: - response-time.instance.cortex: - unit: Milliseconds - logs: {} ---- -apiVersion: config.istio.io/v1alpha2 -kind: rule -metadata: - name: cortex-api-requests - namespace: $CORTEX_NAMESPACE -spec: - match: source.workload.name == "apis-ingressgateway" - actions: - - handler: cortex-request-handler - instances: - - response-time ---- diff --git a/manager/manifests/istio-values.yaml b/manager/manifests/istio-values.yaml index a938a17b3d..a26482e56d 100644 --- a/manager/manifests/istio-values.yaml +++ b/manager/manifests/istio-values.yaml @@ -112,24 +112,11 @@ galley: enabled: true mixer: - image: $CORTEX_IMAGE_ISTIO_MIXER + enabled: false policy: enabled: false telemetry: - enabled: true - replicaCount: 1 - autoscaleMin: 1 - autoscaleMax: 5 - resources: - requests: - cpu: 1000m - memory: 1G - limits: - cpu: 4800m - memory: 4G - env: - AWS_REGION: $CORTEX_REGION - LOG_GROUP_NAME: $CORTEX_LOG_GROUP + enabled: false pilot: image: $CORTEX_IMAGE_ISTIO_PILOT diff --git a/pkg/operator/workloads/metrics.go b/pkg/operator/workloads/metrics.go index 3a7bb9123f..953489ae9c 100644 --- a/pkg/operator/workloads/metrics.go +++ b/pkg/operator/workloads/metrics.go @@ -119,9 +119,7 @@ func getAPIMetricsFunc(ctx *context.Context, api *context.API, period int64, sta } func queryMetrics(ctx *context.Context, api *context.API, period int64, startTime *time.Time, endTime *time.Time) ([]*cloudwatch.MetricDataResult, error) { - networkDataQueries := getNetworkStatsDef(ctx.App.Name, api, period) - latencyMetrics := getLatencyMetricsDef(api.Path, period) - allMetrics := append(latencyMetrics, networkDataQueries...) + allMetrics := getNetworkStatsDef(ctx.App.Name, api, period) if api.Tracker != nil { if api.Tracker.ModelType == userconfig.ClassificationModelType { @@ -246,49 +244,6 @@ func getAPIDimensions(appName string, api *context.API) []*cloudwatch.Dimension } } -func getLatencyMetricsDef(routeName string, period int64) []*cloudwatch.MetricDataQuery { - networkDataQueries := []*cloudwatch.MetricDataQuery{ - { - Id: aws.String("latency"), - Label: aws.String("Latency"), - MetricStat: &cloudwatch.MetricStat{ - Metric: &cloudwatch.Metric{ - Namespace: aws.String(config.Cortex.LogGroup), - MetricName: aws.String("response-time.instance.cortex"), - Dimensions: []*cloudwatch.Dimension{ - { - Name: aws.String("RequestPath"), - Value: aws.String(routeName), - }, - }, - }, - Stat: aws.String("Average"), - Period: aws.Int64(period), - }, - }, - { - Id: aws.String("request_count"), - Label: aws.String("RequestCount"), - MetricStat: &cloudwatch.MetricStat{ - Metric: &cloudwatch.Metric{ - Namespace: aws.String(config.Cortex.LogGroup), - MetricName: aws.String("response-time.instance.cortex"), - Dimensions: []*cloudwatch.Dimension{ - { - Name: aws.String("RequestPath"), - Value: aws.String(routeName), - }, - }, - }, - Stat: aws.String("SampleCount"), - Period: aws.Int64(period), - }, - }, - } - - return networkDataQueries -} - func getRegressionMetricDef(appName string, api *context.API, period int64) []*cloudwatch.MetricDataQuery { metric := &cloudwatch.Metric{ Namespace: aws.String(config.Cortex.LogGroup),