Skip to content

Commit

Permalink
extend chart, add GHA for CI and Release
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekak authored and electrum committed May 19, 2021
1 parent 93d484d commit 7f0562e
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 9 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint and Test Chart
on: push

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Cleanup node
uses: AutoModality/action-clean@1.1.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Run chart-testing (lint)
run: ct lint --charts=charts/trino --validate-maintainers=false
- name: Create kind cluster
uses: helm/kind-action@v1.0.0
- name: Run chart-testing (install)
run: ct install --charts=charts/trino
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Trino Chart

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Cleanup node
uses: AutoModality/action-clean@1.1.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.2
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.0.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30 changes: 30 additions & 0 deletions .github/workflows/sync-readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Sync Readme

on:
push:
branches:
- 'master'
paths:
- 'README.md'

jobs:
sync-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: copy README.md
run: |
cp -f README.md ${{ runner.temp }}/README.md
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
- name: commit
run: |
cp -f ${{ runner.temp }}/README.md .
git config user.name trino_community
git config user.email "trino_community@users.noreply.github.com"
git add README.md
git commit --signoff -m "Sync README from main"
git push
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ The following table lists the configurable parameters of the Trino chart and the
| `server.config.http.port` | | `8080` |
| `server.config.query.maxMemory` | | `"4GB"` |
| `server.config.query.maxMemoryPerNode` | | `"1GB"` |
| `server.config.query.maxTotalMemoryPerNode` | | `"2GB"` |
| `server.config.memory.heapHeadroomPerNode` | | `"1GB"` |
| `server.jvm.maxHeapSize` | | `"8G"` |
| `server.jvm.gcMethod.type` | | `"UseG1GC"` |
| `server.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` |
| `additionalNodeProperties` | | `{}` |
| `additionalJVMConfig` | | `{}` |
| `additionalConfigProperties` | | `{}` |
| `additionalLogProperties` | | `{}` |
| `additionalCatalogs` | | `{}` |
| `securityContext.runAsUser` | | `1000` |
| `securityContext.runAsGroup` | | `1000` |
| `service.type` | | `"ClusterIP"` |
Expand All @@ -36,7 +43,6 @@ The following table lists the configurable parameters of the Trino chart and the
| `affinity` | | `{}` |



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

14 changes: 12 additions & 2 deletions Chart.yaml → charts/trino/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 351
appVersion: "355"

icon: https://trino.io/assets/trino.png

home: https://trino.io/
sources:
- https://github.com/trinodb/charts
- https://github.com/trinodb/trino/tree/master/core/docker

maintainers:
- name: Trino community
File renamed without changes.
29 changes: 26 additions & 3 deletions templates/_helpers.tpl → charts/trino/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,32 @@ Create chart name and version as used by the chart label.
{{- end }}

{{- define "trino.coordinator" -}}
{{ template "trino.fullname" . }}-coordinator
{{- end -}}
{{- if .Values.coordinatorNameOverride }}
{{- .Values.coordinatorNameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}-coordinator
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}-coordinator
{{- end }}
{{- end }}
{{- end }}

{{- define "trino.worker" -}}
{{ template "trino.fullname" . }}-worker
{{- if .Values.workerNameOverride }}
{{- .Values.workerNameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}-worker
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}-worker
{{- end }}
{{- end }}
{{- end }}


{{- define "trino.catalog" -}}
{{ template "trino.fullname" . }}-catalog
{{- end -}}
23 changes: 23 additions & 0 deletions charts/trino/templates/configmap-catalog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "trino.catalog" . }}
labels:
app: {{ template "trino.name" . }}
chart: {{ template "trino.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
role: catalogs
data:
tpch.properties: |
connector.name=tpch
tpch.splits-per-node=4
tpcds.properties: |
connector.name=tpcds
tpcds.splits-per-node=4
{{- range $catalogName, $catalogProperties := .Values.additionalCatalogs }}
{{ $catalogName }}.properties: |
{{- $catalogProperties | nindent 4 }}
{{- end }}


Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ data:
node.environment={{ .Values.server.node.environment }}
node.data-dir={{ .Values.server.node.dataDir }}
plugin.dir={{ .Values.server.node.pluginDir }}
{{- range $configValue := .Values.additionalNodeProperties }}
{{ $configValue }}
{{- end }}

jvm.config: |
-server
Expand All @@ -24,6 +27,14 @@ data:
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-Djdk.attach.allowAttachSelf=true
-XX:-UseBiasedLocking
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.nio.maxCachedBufferSize=2000000
{{- range $configValue := .Values.additionalJVMConfig }}
{{ $configValue }}
{{- end }}

config.properties: |
coordinator=true
Expand All @@ -35,10 +46,18 @@ data:
http-server.http.port={{ .Values.service.port }}
query.max-memory={{ .Values.server.config.query.maxMemory }}
query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }}
query.max-total-memory-per-node={{ .Values.server.config.query.maxTotalMemoryPerNode }}
memory.heap-headroom-per-node={{ .Values.server.config.memory.heapHeadroomPerNode }}
discovery-server.enabled=true
discovery.uri=http://localhost:{{ .Values.service.port }}
{{- range $configValue := .Values.additionalConfigProperties }}
{{ $configValue }}
{{- end }}

log.properties: |
io.trinosql={{ .Values.server.log.trino.level }}
io.trino={{ .Values.server.log.trino.level }}
{{- range $configValue := .Values.additionalLogProperties }}
{{ $configValue }}
{{- end }}

---
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ data:
node.environment={{ .Values.server.node.environment }}
node.data-dir={{ .Values.server.node.dataDir }}
plugin.dir={{ .Values.server.node.pluginDir }}
{{- range $configValue := .Values.additionalNodeProperties }}
{{ $configValue }}
{{- end }}

jvm.config: |
-server
Expand All @@ -25,15 +28,31 @@ data:
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-Djdk.attach.allowAttachSelf=true
-XX:-UseBiasedLocking
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.nio.maxCachedBufferSize=2000000
{{- range $configValue := .Values.additionalJVMConfig }}
{{ $configValue }}
{{- end }}

config.properties: |
coordinator=false
http-server.http.port={{ .Values.service.port }}
query.max-memory={{ .Values.server.config.query.maxMemory }}
query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }}
query.max-total-memory-per-node={{ .Values.server.config.query.maxTotalMemoryPerNode }}
memory.heap-headroom-per-node={{ .Values.server.config.memory.heapHeadroomPerNode }}
discovery.uri=http://{{ template "trino.fullname" . }}:{{ .Values.service.port }}
{{- range $configValue := .Values.additionalConfigProperties }}
{{ $configValue }}
{{- end }}

log.properties: |
io.trinosql={{ .Values.server.log.trino.level }}
io.trino={{ .Values.server.log.trino.level }}
{{- range $configValue := .Values.additionalLogProperties }}
{{ $configValue }}
{{- end }}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ spec:
- name: config-volume
configMap:
name: {{ template "trino.coordinator" . }}
- name: catalog-volume
configMap:
name: {{ template "trino.catalog" . }}
imagePullSecrets:
- name: registry-credentials
containers:
- name: {{ .Chart.Name }}-coordinator
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- mountPath: {{ .Values.server.config.path }}
name: config-volume
- mountPath: {{ .Values.server.config.path }}/catalog
name: catalog-volume
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ spec:
- name: config-volume
configMap:
name: {{ template "trino.worker" . }}
- name: catalog-volume
configMap:
name: {{ template "trino.catalog" . }}
imagePullSecrets:
- name: registry-credentials
containers:
- name: {{ .Chart.Name }}-worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- mountPath: {{ .Values.server.config.path }}
name: config-volume
- mountPath: {{ .Values.server.config.path }}/catalog
name: catalog-volume
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
File renamed without changes.
15 changes: 14 additions & 1 deletion values.yaml → charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Declare variables to be passed into your templates.

image:
repository: trinodb/trino
repository: trinodb/trino
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart version.
tag: latest
Expand All @@ -24,13 +24,26 @@ server:
query:
maxMemory: "4GB"
maxMemoryPerNode: "1GB"
maxTotalMemoryPerNode: "2GB"
memory:
heapHeadroomPerNode: "1GB"
jvm:
maxHeapSize: "8G"
gcMethod:
type: "UseG1GC"
g1:
heapRegionSize: "32M"

additionalNodeProperties: {}

additionalJVMConfig: {}

additionalConfigProperties: {}

additionalLogProperties: {}

additionalCatalogs: {}

securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down

0 comments on commit 7f0562e

Please sign in to comment.