diff --git a/ops/helm-charts/metrics-calculation-service/Chart.yaml b/ops/helm-charts/metrics-calculation-service/Chart.yaml index 10915bdc..87eba5dd 100644 --- a/ops/helm-charts/metrics-calculation-service/Chart.yaml +++ b/ops/helm-charts/metrics-calculation-service/Chart.yaml @@ -3,5 +3,5 @@ name: metrics-calculation-service description: The metrics calculation service type: application -version: 0.7.0 +version: 0.8.0 appVersion: 0.1.0 \ No newline at end of file diff --git a/ops/helm-charts/metrics-calculation-service/templates/app.yaml b/ops/helm-charts/metrics-calculation-service/templates/app.yaml index a02e50ba..f4ee8c0d 100644 --- a/ops/helm-charts/metrics-calculation-service/templates/app.yaml +++ b/ops/helm-charts/metrics-calculation-service/templates/app.yaml @@ -19,20 +19,35 @@ spec: serviceAccountName: {{ include "mcs.fullname" . }} containers: - name: metrics-calculation-service - # TODO: Remove latest tag and use a specific version image: {{ .Values.mcs.image.repo }}:{{ .Values.mcs.image.tag }} command: ["uvicorn"] - args: - - "metrics_tools.compute.server:app" - - "--host" - - "0.0.0.0" - - "--port" - - "8000" - - "--log-config" - - "/config/log_config.yaml" - imagePullPolicy: Always + args: + - "metrics_tools.compute.server:app" + - "--host" + - "0.0.0.0" + - "--port" + - "8000" + - "--log-config" + - "/config/log_config.yaml" + imagePullPolicy: Always ports: - containerPort: 8000 + {{- with .Values.mcs.frontend.affinity }} + affinity: + {{ toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.mcs.frontend.nodeSelector }} + nodeSelector: + {{ toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.mcs.frontend.tolerations }} + tolerations: + {{ toYaml . | nindent 12 }} + {{- end }} + {{- with. Values.mcs.frontend.resources }} + resources: + {{ toYaml . | nindent 12 }} + {{- end }} volumeMounts: - name: config mountPath: /config diff --git a/ops/helm-charts/metrics-calculation-service/templates/service.yaml b/ops/helm-charts/metrics-calculation-service/templates/service.yaml index cab124ed..856f2ce3 100644 --- a/ops/helm-charts/metrics-calculation-service/templates/service.yaml +++ b/ops/helm-charts/metrics-calculation-service/templates/service.yaml @@ -8,5 +8,5 @@ spec: {{ include "mcs.selectorLabels" . | nindent 4 }} ports: - protocol: TCP - port: {{ .Values.mcs.service.port }} + port: {{ .Values.mcs.frontend.service.port }} targetPort: 8000 \ No newline at end of file diff --git a/ops/helm-charts/metrics-calculation-service/values.yaml b/ops/helm-charts/metrics-calculation-service/values.yaml index 6e0c5dcc..96d55022 100644 --- a/ops/helm-charts/metrics-calculation-service/values.yaml +++ b/ops/helm-charts/metrics-calculation-service/values.yaml @@ -1,8 +1,13 @@ global: fullnameOverride: "" mcs: - service: - port: 8000 + frontend: + service: + port: 8000 + affinity: {} + nodeSelector: {} + tolerations: [] + resources: {} logging: format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" root: diff --git a/ops/k8s-apps/production/metrics-calculation-service/custom-helm-values.yaml b/ops/k8s-apps/production/metrics-calculation-service/custom-helm-values.yaml index 0a8c43c9..c40ea324 100644 --- a/ops/k8s-apps/production/metrics-calculation-service/custom-helm-values.yaml +++ b/ops/k8s-apps/production/metrics-calculation-service/custom-helm-values.yaml @@ -5,6 +5,18 @@ metadata: spec: values: mcs: + frontend: + resources: + requests: + cpu: "3000m" + memory: "8Gi" + tolerations: + - key: pool_type + operator: Equal + value: standard + effect: NoSchedule + nodeSelector: + pool_type: standard cluster: name: mcs-worker namespace: production-mcs diff --git a/warehouse/metrics_tools/factory/factory.py b/warehouse/metrics_tools/factory/factory.py index 7e0d0ce6..cf3fc77a 100644 --- a/warehouse/metrics_tools/factory/factory.py +++ b/warehouse/metrics_tools/factory/factory.py @@ -675,7 +675,7 @@ def generated_rolling_query( start=start, end=end, dialect="duckdb", - batch_size=1, + batch_size=env.ensure_int("SQLMESH_MCS_BATCH_SIZE", 10), columns=columns, ref=ref, locals=sqlmesh_vars,