Skip to content

Commit 7f0562e

Browse files
przemekakelectrum
authored andcommitted
extend chart, add GHA for CI and Release
1 parent 93d484d commit 7f0562e

14 files changed

+223
-9
lines changed

.github/workflows/ci.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint and Test Chart
2+
on: push
3+
4+
jobs:
5+
lint-test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Cleanup node
9+
uses: AutoModality/[email protected]
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v1
16+
with:
17+
version: v3.4.0
18+
- uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.7
21+
- name: Set up chart-testing
22+
uses: helm/[email protected]
23+
- name: Run chart-testing (lint)
24+
run: ct lint --charts=charts/trino --validate-maintainers=false
25+
- name: Create kind cluster
26+
uses: helm/[email protected]
27+
- name: Run chart-testing (install)
28+
run: ct install --charts=charts/trino

.github/workflows/release.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release Trino Chart
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Cleanup node
13+
uses: AutoModality/[email protected]
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- name: Configure Git
19+
run: |
20+
git config user.name "$GITHUB_ACTOR"
21+
git config user.email "[email protected]"
22+
- name: Install Helm
23+
uses: azure/setup-helm@v1
24+
with:
25+
version: v3.5.2
26+
- name: Run chart-releaser
27+
uses: helm/[email protected]
28+
env:
29+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/sync-readme.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sync Readme
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
paths:
8+
- 'README.md'
9+
10+
jobs:
11+
sync-readme:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: copy README.md
17+
run: |
18+
cp -f README.md ${{ runner.temp }}/README.md
19+
- name: Checkout gh-pages
20+
uses: actions/checkout@v2
21+
with:
22+
ref: gh-pages
23+
- name: commit
24+
run: |
25+
cp -f ${{ runner.temp }}/README.md .
26+
git config user.name trino_community
27+
git config user.email "[email protected]"
28+
git add README.md
29+
git commit --signoff -m "Sync README from main"
30+
git push

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,16 @@ The following table lists the configurable parameters of the Trino chart and the
2323
| `server.config.http.port` | | `8080` |
2424
| `server.config.query.maxMemory` | | `"4GB"` |
2525
| `server.config.query.maxMemoryPerNode` | | `"1GB"` |
26+
| `server.config.query.maxTotalMemoryPerNode` | | `"2GB"` |
27+
| `server.config.memory.heapHeadroomPerNode` | | `"1GB"` |
2628
| `server.jvm.maxHeapSize` | | `"8G"` |
2729
| `server.jvm.gcMethod.type` | | `"UseG1GC"` |
2830
| `server.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` |
31+
| `additionalNodeProperties` | | `{}` |
32+
| `additionalJVMConfig` | | `{}` |
33+
| `additionalConfigProperties` | | `{}` |
34+
| `additionalLogProperties` | | `{}` |
35+
| `additionalCatalogs` | | `{}` |
2936
| `securityContext.runAsUser` | | `1000` |
3037
| `securityContext.runAsGroup` | | `1000` |
3138
| `service.type` | | `"ClusterIP"` |
@@ -36,7 +43,6 @@ The following table lists the configurable parameters of the Trino chart and the
3643
| `affinity` | | `{}` |
3744

3845

39-
4046
---
4147
_Documentation generated by [Frigate](https://frigate.readthedocs.io)._
4248

Chart.yaml charts/trino/Chart.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
18+
version: 0.2.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: 351
23+
appVersion: "355"
24+
25+
icon: https://trino.io/assets/trino.png
26+
27+
home: https://trino.io/
28+
sources:
29+
- https://github.com/trinodb/charts
30+
- https://github.com/trinodb/trino/tree/master/core/docker
31+
32+
maintainers:
33+
- name: Trino community
File renamed without changes.

templates/_helpers.tpl charts/trino/templates/_helpers.tpl

+26-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,32 @@ Create chart name and version as used by the chart label.
3232
{{- end }}
3333

3434
{{- define "trino.coordinator" -}}
35-
{{ template "trino.fullname" . }}-coordinator
36-
{{- end -}}
35+
{{- if .Values.coordinatorNameOverride }}
36+
{{- .Values.coordinatorNameOverride | trunc 63 | trimSuffix "-" }}
37+
{{- else }}
38+
{{- $name := default .Chart.Name .Values.nameOverride }}
39+
{{- if contains $name .Release.Name }}
40+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}-coordinator
41+
{{- else }}
42+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}-coordinator
43+
{{- end }}
44+
{{- end }}
45+
{{- end }}
3746

3847
{{- define "trino.worker" -}}
39-
{{ template "trino.fullname" . }}-worker
48+
{{- if .Values.workerNameOverride }}
49+
{{- .Values.workerNameOverride | trunc 63 | trimSuffix "-" }}
50+
{{- else }}
51+
{{- $name := default .Chart.Name .Values.nameOverride }}
52+
{{- if contains $name .Release.Name }}
53+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}-worker
54+
{{- else }}
55+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}-worker
56+
{{- end }}
57+
{{- end }}
58+
{{- end }}
59+
60+
61+
{{- define "trino.catalog" -}}
62+
{{ template "trino.fullname" . }}-catalog
4063
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ template "trino.catalog" . }}
5+
labels:
6+
app: {{ template "trino.name" . }}
7+
chart: {{ template "trino.chart" . }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}
10+
role: catalogs
11+
data:
12+
tpch.properties: |
13+
connector.name=tpch
14+
tpch.splits-per-node=4
15+
tpcds.properties: |
16+
connector.name=tpcds
17+
tpcds.splits-per-node=4
18+
{{- range $catalogName, $catalogProperties := .Values.additionalCatalogs }}
19+
{{ $catalogName }}.properties: |
20+
{{- $catalogProperties | nindent 4 }}
21+
{{- end }}
22+
23+

templates/configmap-coordinator.yaml charts/trino/templates/configmap-coordinator.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ data:
1313
node.environment={{ .Values.server.node.environment }}
1414
node.data-dir={{ .Values.server.node.dataDir }}
1515
plugin.dir={{ .Values.server.node.pluginDir }}
16+
{{- range $configValue := .Values.additionalNodeProperties }}
17+
{{ $configValue }}
18+
{{- end }}
1619

1720
jvm.config: |
1821
-server
@@ -24,6 +27,14 @@ data:
2427
-XX:+HeapDumpOnOutOfMemoryError
2528
-XX:+ExitOnOutOfMemoryError
2629
-Djdk.attach.allowAttachSelf=true
30+
-XX:-UseBiasedLocking
31+
-XX:ReservedCodeCacheSize=512M
32+
-XX:PerMethodRecompilationCutoff=10000
33+
-XX:PerBytecodeRecompilationCutoff=10000
34+
-Djdk.nio.maxCachedBufferSize=2000000
35+
{{- range $configValue := .Values.additionalJVMConfig }}
36+
{{ $configValue }}
37+
{{- end }}
2738

2839
config.properties: |
2940
coordinator=true
@@ -35,10 +46,18 @@ data:
3546
http-server.http.port={{ .Values.service.port }}
3647
query.max-memory={{ .Values.server.config.query.maxMemory }}
3748
query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }}
49+
query.max-total-memory-per-node={{ .Values.server.config.query.maxTotalMemoryPerNode }}
50+
memory.heap-headroom-per-node={{ .Values.server.config.memory.heapHeadroomPerNode }}
3851
discovery-server.enabled=true
3952
discovery.uri=http://localhost:{{ .Values.service.port }}
53+
{{- range $configValue := .Values.additionalConfigProperties }}
54+
{{ $configValue }}
55+
{{- end }}
4056

4157
log.properties: |
42-
io.trinosql={{ .Values.server.log.trino.level }}
58+
io.trino={{ .Values.server.log.trino.level }}
59+
{{- range $configValue := .Values.additionalLogProperties }}
60+
{{ $configValue }}
61+
{{- end }}
4362

4463
---

templates/configmap-worker.yaml charts/trino/templates/configmap-worker.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ data:
1414
node.environment={{ .Values.server.node.environment }}
1515
node.data-dir={{ .Values.server.node.dataDir }}
1616
plugin.dir={{ .Values.server.node.pluginDir }}
17+
{{- range $configValue := .Values.additionalNodeProperties }}
18+
{{ $configValue }}
19+
{{- end }}
1720

1821
jvm.config: |
1922
-server
@@ -25,15 +28,31 @@ data:
2528
-XX:+HeapDumpOnOutOfMemoryError
2629
-XX:+ExitOnOutOfMemoryError
2730
-Djdk.attach.allowAttachSelf=true
31+
-XX:-UseBiasedLocking
32+
-XX:ReservedCodeCacheSize=512M
33+
-XX:PerMethodRecompilationCutoff=10000
34+
-XX:PerBytecodeRecompilationCutoff=10000
35+
-Djdk.nio.maxCachedBufferSize=2000000
36+
{{- range $configValue := .Values.additionalJVMConfig }}
37+
{{ $configValue }}
38+
{{- end }}
2839

2940
config.properties: |
3041
coordinator=false
3142
http-server.http.port={{ .Values.service.port }}
3243
query.max-memory={{ .Values.server.config.query.maxMemory }}
3344
query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }}
45+
query.max-total-memory-per-node={{ .Values.server.config.query.maxTotalMemoryPerNode }}
46+
memory.heap-headroom-per-node={{ .Values.server.config.memory.heapHeadroomPerNode }}
3447
discovery.uri=http://{{ template "trino.fullname" . }}:{{ .Values.service.port }}
48+
{{- range $configValue := .Values.additionalConfigProperties }}
49+
{{ $configValue }}
50+
{{- end }}
3551

3652
log.properties: |
37-
io.trinosql={{ .Values.server.log.trino.level }}
53+
io.trino={{ .Values.server.log.trino.level }}
54+
{{- range $configValue := .Values.additionalLogProperties }}
55+
{{ $configValue }}
56+
{{- end }}
3857

3958
{{- end }}

templates/deployment-coordinator.yaml charts/trino/templates/deployment-coordinator.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,20 @@ spec:
3030
- name: config-volume
3131
configMap:
3232
name: {{ template "trino.coordinator" . }}
33+
- name: catalog-volume
34+
configMap:
35+
name: {{ template "trino.catalog" . }}
36+
imagePullSecrets:
37+
- name: registry-credentials
3338
containers:
3439
- name: {{ .Chart.Name }}-coordinator
3540
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3641
imagePullPolicy: {{ .Values.image.pullPolicy }}
3742
volumeMounts:
3843
- mountPath: {{ .Values.server.config.path }}
3944
name: config-volume
45+
- mountPath: {{ .Values.server.config.path }}/catalog
46+
name: catalog-volume
4047
ports:
4148
- name: http
4249
containerPort: {{ .Values.service.port }}

templates/deployment-worker.yaml charts/trino/templates/deployment-worker.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ spec:
2727
- name: config-volume
2828
configMap:
2929
name: {{ template "trino.worker" . }}
30+
- name: catalog-volume
31+
configMap:
32+
name: {{ template "trino.catalog" . }}
33+
imagePullSecrets:
34+
- name: registry-credentials
3035
containers:
3136
- name: {{ .Chart.Name }}-worker
3237
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3338
imagePullPolicy: {{ .Values.image.pullPolicy }}
3439
volumeMounts:
3540
- mountPath: {{ .Values.server.config.path }}
3641
name: config-volume
42+
- mountPath: {{ .Values.server.config.path }}/catalog
43+
name: catalog-volume
3744
ports:
3845
- name: http
3946
containerPort: {{ .Values.service.port }}
File renamed without changes.

values.yaml charts/trino/values.yaml

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Declare variables to be passed into your templates.
44

55
image:
6-
repository: trinodb/trino
6+
repository: trinodb/trino
77
pullPolicy: IfNotPresent
88
# Overrides the image tag whose default is the chart version.
99
tag: latest
@@ -24,13 +24,26 @@ server:
2424
query:
2525
maxMemory: "4GB"
2626
maxMemoryPerNode: "1GB"
27+
maxTotalMemoryPerNode: "2GB"
28+
memory:
29+
heapHeadroomPerNode: "1GB"
2730
jvm:
2831
maxHeapSize: "8G"
2932
gcMethod:
3033
type: "UseG1GC"
3134
g1:
3235
heapRegionSize: "32M"
3336

37+
additionalNodeProperties: {}
38+
39+
additionalJVMConfig: {}
40+
41+
additionalConfigProperties: {}
42+
43+
additionalLogProperties: {}
44+
45+
additionalCatalogs: {}
46+
3447
securityContext:
3548
runAsUser: 1000
3649
runAsGroup: 1000

0 commit comments

Comments
 (0)