From 50f16f41a92c163646b5cd0ed8c0d182b040a431 Mon Sep 17 00:00:00 2001 From: Michael Ceruzzi Date: Tue, 19 Nov 2024 13:00:37 +0800 Subject: [PATCH] Add support for Presto CPP --- .../presto/templates/configmap-coordinator.yaml | 10 +++++++++- .../templates/configmap-resource-manager.yaml | 3 ++- charts/presto/templates/configmap-worker.yaml | 3 ++- charts/presto/templates/deployment-worker.yaml | 4 ++-- charts/presto/values.yaml | 15 +++++++++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/charts/presto/templates/configmap-coordinator.yaml b/charts/presto/templates/configmap-coordinator.yaml index d51337c..e60b2be 100644 --- a/charts/presto/templates/configmap-coordinator.yaml +++ b/charts/presto/templates/configmap-coordinator.yaml @@ -29,7 +29,15 @@ data: discovery-server.enabled={{ or (eq .Values.mode "single") (eq .Values.mode "cluster") }} node-scheduler.include-coordinator={{ eq .Values.mode "single" }} resource-manager-enabled={{ eq .Values.mode "ha-cluster" }} - {{- .Values.config | nindent 4 }} + presto.version={{ .Values.image.tag | default .Chart.AppVersion }}{{- if .Values.prestoCpp.enabled }}wCPP{{ .Values.prestoCpp.image.tag }}{{- end }} + {{- if .Values.prestoCpp.enabled }} + native-execution-enabled=true + optimizer.optimize-hash-generation=false + regex-library=RE2J + use-alternative-function-signatures=true + experimental.table-writer-merge-operator-enabled=false + {{- end }} + {{- .Values.coordinator.config | default .Values.config | nindent 4 }} log.properties: |- {{- .Values.log | nindent 4 }} {{- if .Values.resourceGroups.manager }} diff --git a/charts/presto/templates/configmap-resource-manager.yaml b/charts/presto/templates/configmap-resource-manager.yaml index 06bc149..26f3cee 100644 --- a/charts/presto/templates/configmap-resource-manager.yaml +++ b/charts/presto/templates/configmap-resource-manager.yaml @@ -33,7 +33,8 @@ data: resource-manager=true thrift.server.port=8081 thrift.server.ssl.enabled=false - {{- .Values.config | nindent 4 }} + presto.version={{ .Values.image.tag | default .Chart.AppVersion }}{{- if .Values.prestoCpp.enabled }}wCPP{{ .Values.prestoCpp.image.tag }}{{- end }} + {{- .Values.resourceManager.config | default .Values.config | nindent 4 }} log.properties: |- {{- .Values.log | nindent 4 }} {{- if .Values.metrics.enabled }} diff --git a/charts/presto/templates/configmap-worker.yaml b/charts/presto/templates/configmap-worker.yaml index 08bdbc0..6bdb8dd 100644 --- a/charts/presto/templates/configmap-worker.yaml +++ b/charts/presto/templates/configmap-worker.yaml @@ -28,7 +28,8 @@ data: http-server.http.port={{ .Values.service.port }} discovery.uri=http://{{ .Release.Name }}-discovery:{{ .Values.service.port }} resource-manager-enabled={{ eq .Values.mode "ha-cluster" }} - {{- .Values.config | nindent 4 }} + presto.version={{ .Values.image.tag | default .Chart.AppVersion }}{{- if .Values.prestoCpp.enabled }}wCPP{{ .Values.prestoCpp.image.tag }}{{- end }} + {{- .Values.worker.config | default .Values.config | nindent 4 }} log.properties: |- {{- .Values.log | nindent 4 }} {{- if .Values.metrics.enabled }} diff --git a/charts/presto/templates/deployment-worker.yaml b/charts/presto/templates/deployment-worker.yaml index 3a5d8e3..c0d0b00 100644 --- a/charts/presto/templates/deployment-worker.yaml +++ b/charts/presto/templates/deployment-worker.yaml @@ -50,8 +50,8 @@ spec: {{- end }} containers: - name: worker - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ if .Values.prestoCpp.enabled }}{{ .Values.prestoCpp.image.repository }}:{{ .Values.prestoCpp.image.tag | default .Chart.AppVersion }}{{ else }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}{{ end }}" + imagePullPolicy: {{ if .Values.prestoCpp.enabled }}{{ .Values.prestoCpp.image.pullPolicy }}{{ else }}{{ .Values.image.pullPolicy }}{{ end }} {{- with .Values.worker.command }} command: {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} diff --git a/charts/presto/values.yaml b/charts/presto/values.yaml index 59bf129..1d21cc7 100644 --- a/charts/presto/values.yaml +++ b/charts/presto/values.yaml @@ -90,6 +90,8 @@ log: |- resourceManager: # Resource manager JVM options (overwrites common JVM options) jvm: "" + # Resource manager configuration properties (overwrites common config options) + config: ~ # Command to launch resource manager (templated) command: ~ # Arguments to launch resource manager (templated) @@ -142,6 +144,8 @@ coordinator: replicas: 1 # Coordinator JVM options (overwrites common JVM options) jvm: "" + # Coordinator configuration properties (overwrites common config options) + config: ~ # Command to launch coordinator (templated) command: ~ # Arguments to launch coordinator (templated) @@ -194,6 +198,8 @@ worker: replicas: 2 # Worker JVM options (overwrites common JVM options) jvm: "" + # Worker configuration properties (overwrites common config options) + config: ~ # Command to launch worker (templated) command: ~ # Arguments to launch worker (templated) @@ -239,6 +245,15 @@ worker: tolerations: [] # Worker security context (overwrites default security context) securityContext: {} + +# Enables Presto to use C++ based workers +prestoCpp: + enabled: false + # Image details for Presto C++ workers (overrides common image details) + image: + repository: prestodb/presto-native + pullPolicy: IfNotPresent + tag: ~ # Catalogs catalog: {}