Skip to content

Commit

Permalink
Allows various container configs with the mcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 committed Dec 15, 2024
1 parent 4b7d3bd commit 150b2a9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 15 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
35 changes: 25 additions & 10 deletions ops/helm-charts/metrics-calculation-service/templates/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 150b2a9

Please sign in to comment.