Skip to content

Commit

Permalink
Replace presto with trino
Browse files Browse the repository at this point in the history
  • Loading branch information
yaalsn committed Nov 27, 2023
1 parent a602787 commit dd808bb
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ data:
{{- if .Values.presto.security.authentication.jwt.enabled }}
# JWT Authentication
http-server.authentication.type=JWT
http-server.authentication.jwt.key-file={{ template "pulsar.home" . }}/conf/presto/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
http-server.authentication.jwt.key-file={{ template "pulsar.home" . }}/trino/conf/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
{{- end }}

log.properties: |
Expand Down Expand Up @@ -270,13 +270,13 @@ data:
access-control.properties: |
# access-control.properties
access-control.name=file
security.config-file={{ template "pulsar.home" . }}/conf/presto/rules.json
security.config-file={{ template "pulsar.home" . }}/trino/conf/rules.json
security.refresh-period=60s
{{- end}}
{{- if .Values.presto.security.authentication.password.enabled }}
password-authenticator.properties: |
password-authenticator.name=file
file.password-file={{ template "pulsar.home" . }}/presto/{{ .Values.presto.security.authentication.password.passwordFileName }}
file.password-file={{ template "pulsar.home" . }}/trino/{{ .Values.presto.security.authentication.password.passwordFileName }}
file.refresh-period=60s
{{- end}}
{{- end }}
29 changes: 14 additions & 15 deletions charts/pulsar/templates/presto/presto-coordinator-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,11 @@ spec:
{{- end }}
{{- else }}
- >-
cp {{ template "pulsar.home" . }}/conf/presto/node.properties.template {{ template "pulsar.home" . }}/conf/presto/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
echo "node.internal-address=${HOSTNAME}.{{ template "presto.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
ln -s {{ template "pulsar.home" . }}/conf/presto {{ template "pulsar.home" . }}/lib/presto/etc;
cp {{ template "pulsar.home" . }}/trino/conf/node.properties.template {{ template "pulsar.home" . }}/trino/conf/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
echo "node.internal-address=${HOSTNAME}.{{ template "presto.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
bin/pulsar sql-worker run \
--etc-dir={{ template "pulsar.home" . }}/conf/presto \
--etc-dir={{ template "pulsar.home" . }}/trino/conf \
--data-dir={{ template "pulsar.home" . }}/data;
{{- end }}
env:
Expand All @@ -161,38 +160,38 @@ spec:
key: AWS_SECRET_ACCESS_KEY
{{- end }}
volumeMounts:
- mountPath: {{ template "pulsar.home" . }}/conf/presto/node.properties.template
- mountPath: {{ template "pulsar.home" . }}/trino/conf/node.properties.template
name: config-volume
subPath: node.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/log.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/log.properties
name: config-volume
subPath: log.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/jvm.config
- mountPath: {{ template "pulsar.home" . }}/trino/conf/jvm.config
name: config-volume
subPath: jvm.config
- mountPath: {{ template "pulsar.home" . }}/conf/presto/config.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/config.properties
name: config-volume
subPath: config.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/catalog/pulsar.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/catalog/pulsar.properties
name: config-volume
subPath: pulsar.properties
{{- if or .Values.presto.security.authentication.jwt.enabled .Values.presto.security.authentication.password.enabled }}
- mountPath: {{ template "pulsar.home" . }}/conf/presto/rules.json
- mountPath: {{ template "pulsar.home" . }}/trino/conf/rules.json
name: config-volume
subPath: rules.json
{{- end}}
{{- if .Values.presto.security.authentication.password.enabled }}
- mountPath: {{ template "pulsar.home" . }}/conf/presto/password-authenticator.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/password-authenticator.properties
name: config-volume
subPath: password-authenticator.properties
- mountPath: {{ template "pulsar.home" . }}/presto
- mountPath: {{ template "pulsar.home" . }}/trino
name: password-file-volume
{{- end}}
{{- if .Values.presto.security.authentication.jwt.enabled }}
- mountPath: {{ template "pulsar.home" . }}/conf/presto/access-control.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/access-control.properties
name: config-volume
subPath: access-control.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
- mountPath: {{ template "pulsar.home" . }}/trino/conf/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
name: public-key-volume
subPath: {{ .Values.presto.security.authentication.jwt.publicKeyConfigMapKey }}
{{- end}}
Expand Down
19 changes: 9 additions & 10 deletions charts/pulsar/templates/presto/presto-worker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,11 @@ spec:
{{- end }}
{{- else }}
- >-
cp {{ template "pulsar.home" . }}/conf/presto/node.properties.template {{ template "pulsar.home" . }}/conf/presto/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
echo "node.internal-address=${HOSTNAME}.{{ template "presto.worker.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
ln -s {{ template "pulsar.home" . }}/conf/presto {{ template "pulsar.home" . }}/lib/presto/etc;
cp {{ template "pulsar.home" . }}/trino/conf/node.properties.template {{ template "pulsar.home" . }}/trino/conf/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
echo "node.internal-address=${HOSTNAME}.{{ template "presto.worker.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
bin/pulsar sql-worker run \
--etc-dir={{ template "pulsar.home" . }}/conf/presto \
--etc-dir={{ template "pulsar.home" . }}/trino/conf \
--data-dir={{ template "pulsar.home" . }}/data;
{{- end }}
env:
Expand All @@ -166,19 +165,19 @@ spec:
key: AWS_SECRET_ACCESS_KEY
{{- end }}
volumeMounts:
- mountPath: {{ template "pulsar.home" . }}/conf/presto/node.properties.template
- mountPath: {{ template "pulsar.home" . }}/trino/conf/node.properties.template
name: config-volume
subPath: node.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/log.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/log.properties
name: config-volume
subPath: log.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/jvm.config
- mountPath: {{ template "pulsar.home" . }}/trino/conf/jvm.config
name: config-volume
subPath: jvm.config
- mountPath: {{ template "pulsar.home" . }}/conf/presto/config.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/config.properties
name: config-volume
subPath: config.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/catalog/pulsar.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/catalog/pulsar.properties
name: config-volume
subPath: pulsar.properties
- mountPath: /presto/health_check.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ data:
{{- if .Values.presto.security.authentication.jwt.enabled }}
# JWT Authentication
http-server.authentication.type=JWT
http-server.authentication.jwt.key-file={{ template "pulsar.home" . }}/conf/presto/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
http-server.authentication.jwt.key-file={{ template "pulsar.home" . }}/trino/conf/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
{{- end }}
{{- if .Values.presto.coordinator.config.custom }}
{{- range $k, $v := .Values.presto.coordinator.config.custom }}
Expand Down Expand Up @@ -279,13 +279,13 @@ data:
access-control.properties: |
# access-control.properties
access-control.name=file
security.config-file={{ template "pulsar.home" . }}/conf/presto/rules.json
security.config-file={{ template "pulsar.home" . }}/trino/conf/rules.json
security.refresh-period=60s
{{- end}}
{{- if .Values.presto.security.authentication.password.enabled }}
password-authenticator.properties: |
password-authenticator.name=file
file.password-file={{ template "pulsar.home" . }}/presto/{{ .Values.presto.security.authentication.password.passwordFileName }}
file.password-file={{ template "pulsar.home" . }}/trino/{{ .Values.presto.security.authentication.password.passwordFileName }}
file.refresh-period=60s
{{- end}}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ spec:
command: ["sh", "-c"]
args:
- >-
cp {{ template "pulsar.home" . }}/conf/presto/node.properties.template {{ template "pulsar.home" . }}/conf/presto/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
echo "node.internal-address=$(echo ${POD_IP} | tr "." "-").{{ template "presto.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
ln -s {{ template "pulsar.home" . }}/conf/presto {{ template "pulsar.home" . }}/lib/presto/etc;
cp {{ template "pulsar.home" . }}/trino/conf/node.properties.template {{ template "pulsar.home" . }}/trino/conf/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
echo "node.internal-address=$(echo ${POD_IP} | tr "." "-").{{ template "presto.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
{{- if .Values.tls.presto.enabled }}
set -ex;
mkdir -p /pulsar/jks;
Expand All @@ -132,7 +131,7 @@ spec:
{{- end }}
{{- end }}
bin/pulsar sql-worker run \
--etc-dir={{ template "pulsar.home" . }}/conf/presto \
--etc-dir={{ template "pulsar.home" . }}/trino/conf \
--data-dir={{ template "pulsar.home" . }}/data;
env:
- name: POD_IP
Expand All @@ -152,38 +151,38 @@ spec:
key: AWS_SECRET_ACCESS_KEY
{{- end }}
volumeMounts:
- mountPath: {{ template "pulsar.home" . }}/conf/presto/node.properties.template
- mountPath: {{ template "pulsar.home" . }}/trino/conf/node.properties.template
name: config-volume
subPath: node.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/log.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/log.properties
name: config-volume
subPath: log.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/jvm.config
- mountPath: {{ template "pulsar.home" . }}/trino/conf/jvm.config
name: config-volume
subPath: jvm.config
- mountPath: {{ template "pulsar.home" . }}/conf/presto/config.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/config.properties
name: config-volume
subPath: config.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/catalog/pulsar.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/catalog/pulsar.properties
name: config-volume
subPath: pulsar.properties
{{- if or .Values.presto.security.authentication.jwt.enabled .Values.presto.security.authentication.password.enabled }}
- mountPath: {{ template "pulsar.home" . }}/conf/presto/rules.json
- mountPath: {{ template "pulsar.home" . }}/trino/conf/rules.json
name: config-volume
subPath: rules.json
{{- end}}
{{- if .Values.presto.security.authentication.password.enabled }}
- mountPath: {{ template "pulsar.home" . }}/conf/presto/password-authenticator.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/password-authenticator.properties
name: config-volume
subPath: password-authenticator.properties
- mountPath: {{ template "pulsar.home" . }}/presto
- mountPath: {{ template "pulsar.home" . }}/trino
name: password-file-volume
{{- end}}
{{- if .Values.presto.security.authentication.jwt.enabled }}
- mountPath: {{ template "pulsar.home" . }}/conf/presto/access-control.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/access-control.properties
name: config-volume
subPath: access-control.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
- mountPath: {{ template "pulsar.home" . }}/trino/conf/{{ .Values.presto.security.authentication.jwt.publicKeyFileName }}
name: public-key-volume
subPath: {{ .Values.presto.security.authentication.jwt.publicKeyConfigMapKey }}
{{- end}}
Expand Down
21 changes: 10 additions & 11 deletions charts/sn-platform/templates/presto/presto-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,20 @@ spec:
command: ["sh", "-c"]
args:
- >-
cp {{ template "pulsar.home" . }}/conf/presto/node.properties.template {{ template "pulsar.home" . }}/conf/presto/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
echo "node.internal-address=$(echo ${POD_IP} | tr "." "-").{{ template "presto.worker.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/conf/presto/node.properties ;
ln -s {{ template "pulsar.home" . }}/conf/presto {{ template "pulsar.home" . }}/lib/presto/etc;
cp {{ template "pulsar.home" . }}/trino/conf/node.properties.template {{ template "pulsar.home" . }}/trino/conf/node.properties;
echo "node.id=${HOSTNAME}" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
echo "node.internal-address=$(echo ${POD_IP} | tr "." "-").{{ template "presto.worker.service" . }}.{{ template "pulsar.namespace" . }}.svc.cluster.local" >> {{ template "pulsar.home" . }}/trino/conf/node.properties ;
{{- if .Values.tls.presto.enabled }}
set -ex;
mkdir -p /pulsar/jks;
openssl pkcs12 -export -in /pulsar/certs/presto/tls.crt -inkey /pulsar/certs/presto/tls.key -out /pulsar/jks/server-cert.p12 -name presto-coordinator -passout "pass:{{ template "pulsar.presto.jks.password" . }}";
keytool -importkeystore -srckeystore /pulsar/jks/server-cert.p12 -srcstoretype PKCS12 -srcstorepass {{ template "pulsar.presto.jks.password" . }} -alias presto-coordinator -destkeystore /pulsar/jks/presto.keystore.jks -deststorepass {{ template "pulsar.presto.jks.password" . }};
{{- if .Values.tls.presto.trustCertsEnabled }}
echo "y" | keytool -import -alias selfsigned -file /pulsar/certs/presto/ca.crt -keystore /pulsar/jks/trust.jks -trustcacerts -storepass {{ template "pulsar.presto.jks.password" . }};
echo "y" | keytool -import -alias selfsigned -file /pulsar/certs/presto/ca.crt -keystore /pulsar/jks/trust.jks -trustcacerts -storepass {{ template "pulsar.presto.jks.password" . }};
{{- end }}
{{- end }}
bin/pulsar sql-worker run \
--etc-dir={{ template "pulsar.home" . }}/conf/presto \
--etc-dir={{ template "pulsar.home" . }}/trino/conf \
--data-dir={{ template "pulsar.home" . }}/data;
env:
- name: POD_IP
Expand All @@ -143,19 +142,19 @@ spec:
key: AWS_SECRET_ACCESS_KEY
{{- end }}
volumeMounts:
- mountPath: {{ template "pulsar.home" . }}/conf/presto/node.properties.template
- mountPath: {{ template "pulsar.home" . }}/trino/conf/node.properties.template
name: config-volume
subPath: node.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/log.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/log.properties
name: config-volume
subPath: log.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/jvm.config
- mountPath: {{ template "pulsar.home" . }}/trino/conf/jvm.config
name: config-volume
subPath: jvm.config
- mountPath: {{ template "pulsar.home" . }}/conf/presto/config.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/config.properties
name: config-volume
subPath: config.properties
- mountPath: {{ template "pulsar.home" . }}/conf/presto/catalog/pulsar.properties
- mountPath: {{ template "pulsar.home" . }}/trino/conf/catalog/pulsar.properties
name: config-volume
subPath: pulsar.properties
- mountPath: /presto/health_check.sh
Expand Down

0 comments on commit dd808bb

Please sign in to comment.