Skip to content

Commit

Permalink
Allows various container configs with the mcs (#2648)
Browse files Browse the repository at this point in the history
* Allows various container configs with the mcs

* fix random cp error
  • Loading branch information
ravenac95 authored Dec 15, 2024
1 parent bfa3355 commit f124635
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ops/helm-charts/metrics-calculation-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 16 additions & 1 deletion ops/helm-charts/metrics-calculation-service/templates/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ 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:
Expand All @@ -33,6 +32,22 @@ spec:
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions ops/helm-charts/metrics-calculation-service/values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion warehouse/metrics_tools/factory/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f124635

Please sign in to comment.