Skip to content

Commit 02e1226

Browse files
Merge branch 'trinodb:main' into feature/new_pr
2 parents 11a5dd7 + 535802e commit 02e1226

File tree

57 files changed

+1917
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1917
-263
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ ij_java_doc_align_param_comments = false
1919

2020
[*.yml]
2121
indent_size = 2
22+
23+
[*.tsx]
24+
indent_size = 2

.java-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24
1+
24.0.2+12

docker/Dockerfile

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,48 @@
1313

1414
# syntax=docker/dockerfile:1
1515
ARG TRINO_GATEWAY_BASE_IMAGE
16-
FROM ${TRINO_GATEWAY_BASE_IMAGE} AS jdk-download
16+
ARG TRINO_GATEWAY_BUILD_IMAGE
17+
18+
FROM ${TRINO_GATEWAY_BUILD_IMAGE} AS jdk-download
1719
ARG JDK_DOWNLOAD_LINK
18-
ARG JDK_VERSION
19-
ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_VERSION}"
20+
ARG JDK_RELEASE_NAME
21+
ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_RELEASE_NAME}"
2022

2123
RUN \
2224
set -xeuo pipefail && \
23-
microdnf install -y tar gzip && \
25+
dnf install -y tar gzip && \
2426
# Install JDK from the provided archive link \
2527
echo "Downloading JDK from ${JDK_DOWNLOAD_LINK}" && \
2628
mkdir -p "${JAVA_HOME}" && \
2729
curl -#LfS "${JDK_DOWNLOAD_LINK}" | tar -zx --strip 1 -C "${JAVA_HOME}"
2830

31+
FROM ${TRINO_GATEWAY_BUILD_IMAGE} AS packages
32+
33+
RUN \
34+
set -xeuo pipefail && \
35+
mkdir -p /tmp/overlay/usr/libexec/ && \
36+
touch /tmp/overlay/usr/libexec/grepconf.sh && \
37+
chmod +x /tmp/overlay/usr/libexec/grepconf.sh && \
38+
dnf update -y && \
39+
dnf install --installroot /tmp/overlay --setopt install_weak_deps=false --nodocs -y \
40+
less \
41+
zlib `#required by java` \
42+
curl-minimal grep `# required by health-check` \
43+
shadow-utils `# required by useradd` \
44+
tar `# required to support kubectl cp` && \
45+
rm -rf /tmp/overlay/var/cache/*
46+
2947
FROM ${TRINO_GATEWAY_BASE_IMAGE}
3048
WORKDIR /usr/lib/trino-gateway
3149

32-
ARG JDK_VERSION
33-
ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_VERSION}"
50+
ARG JDK_RELEASE_NAME
51+
ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_RELEASE_NAME}"
3452
ENV PATH=$PATH:$JAVA_HOME/bin
3553
COPY --from=jdk-download $JAVA_HOME $JAVA_HOME
54+
COPY --from=packages /tmp/overlay /
3655

3756
RUN \
3857
set -xeu && \
39-
microdnf update -y && \
40-
microdnf install -y tar less shadow-utils && \
4158
groupadd trino --gid 1000 && \
4259
useradd trino --uid 1000 --gid 1000 --create-home && \
4360
mkdir -p /usr/lib/trino-gateway /etc/trino-gateway && \

docker/build.sh

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SOURCE_DIR="${SCRIPT_DIR}/.."
2222

2323
ARCHITECTURES=(amd64 arm64 ppc64le)
2424
TRINO_GATEWAY_VERSION=
25-
JDK_VERSION=$(cat "${SOURCE_DIR}/.java-version")
25+
JDK_RELEASE_NAME=$(cat "${SOURCE_DIR}/.java-version")
2626
# necessary to allow version parsing from the pom file
2727
MVNW_VERBOSE=false
2828

@@ -39,7 +39,7 @@ while getopts ":a:h:r:j:" o; do
3939
exit 0
4040
;;
4141
j)
42-
JDK_VERSION="${OPTARG}"
42+
JDK_RELEASE_NAME="${OPTARG}"
4343
;;
4444
*)
4545
usage
@@ -61,29 +61,18 @@ function check_environment() {
6161
}
6262

6363
function temurin_jdk_link() {
64-
JDK_VERSION="${1}"
64+
JDK_RELEASE_NAME="${1}"
6565
ARCH="${2}"
6666

67-
versionsUrl="https://api.adoptium.net/v3/info/release_names?heap_size=normal&image_type=jdk&os=linux&page=0&page_size=20&project=jdk&release_type=ga&semver=false&sort_method=DEFAULT&sort_order=ASC&vendor=eclipse&version=%28${JDK_VERSION}%2C%5D"
68-
if ! result=$(curl -fLs "$versionsUrl" -H 'accept: application/json'); then
69-
echo >&2 "Failed to fetch release names for JDK version [${JDK_VERSION}, ) from Temurin API : $result"
70-
exit 1
71-
fi
72-
73-
if ! RELEASE_NAME=$(echo "$result" | jq -er '.releases[]' | grep "${JDK_VERSION}" | head -n 1); then
74-
echo >&2 "Failed to determine release name: ${RELEASE_NAME}"
75-
exit 1
76-
fi
77-
7867
case "${ARCH}" in
7968
arm64)
80-
echo "https://api.adoptium.net/v3/binary/version/${RELEASE_NAME}/linux/aarch64/jdk/hotspot/normal/eclipse?project=jdk"
69+
echo "https://api.adoptium.net/v3/binary/version/${JDK_RELEASE_NAME}/linux/aarch64/jdk/hotspot/normal/eclipse?project=jdk"
8170
;;
8271
amd64)
83-
echo "https://api.adoptium.net/v3/binary/version/${RELEASE_NAME}/linux/x64/jdk/hotspot/normal/eclipse?project=jdk"
72+
echo "https://api.adoptium.net/v3/binary/version/${JDK_RELEASE_NAME}/linux/x64/jdk/hotspot/normal/eclipse?project=jdk"
8473
;;
8574
ppc64le)
86-
echo "https://api.adoptium.net/v3/binary/version/${RELEASE_NAME}/linux/ppc64le/jdk/hotspot/normal/eclipse?project=jdk"
75+
echo "https://api.adoptium.net/v3/binary/version/${JDK_RELEASE_NAME}/linux/ppc64le/jdk/hotspot/normal/eclipse?project=jdk"
8776
;;
8877
*)
8978
echo "${ARCH} is not supported for Docker image"
@@ -118,17 +107,19 @@ TAG_PREFIX="trino-gateway:${TRINO_GATEWAY_VERSION}"
118107
#version file is used by the Helm chart test
119108
echo "${TRINO_GATEWAY_VERSION}" > "${SOURCE_DIR}"/trino-gateway-version.txt
120109

121-
TRINO_GATEWAY_BASE_IMAGE=${TRINO_GATEWAY_BASE_IMAGE:-'registry.access.redhat.com/ubi9/ubi-minimal:latest'}
110+
TRINO_GATEWAY_BASE_IMAGE=${TRINO_GATEWAY_BASE_IMAGE:-'registry.access.redhat.com/ubi10/ubi-micro:latest'}
111+
TRINO_GATEWAY_BUILD_IMAGE=${TRINO_GATEWAY_BUILD_IMAGE:-'registry.access.redhat.com/ubi10/ubi:latest'}
122112

123113
for arch in "${ARCHITECTURES[@]}"; do
124-
echo "🫙 Building the image for $arch with JDK ${JDK_VERSION}"
114+
echo "🫙 Building the image for $arch with Temurin JDK release ${JDK_RELEASE_NAME}"
125115
DOCKER_BUILDKIT=1 \
126116
docker build \
127117
"${WORK_DIR}" \
128118
--pull \
129-
--build-arg JDK_VERSION="${JDK_VERSION}" \
130-
--build-arg JDK_DOWNLOAD_LINK="$(temurin_jdk_link "${JDK_VERSION}" "${arch}")" \
119+
--build-arg JDK_RELEASE_NAME="${JDK_RELEASE_NAME}" \
120+
--build-arg JDK_DOWNLOAD_LINK="$(temurin_jdk_link "jdk-${JDK_RELEASE_NAME}" "${arch}")" \
131121
--build-arg TRINO_GATEWAY_BASE_IMAGE="${TRINO_GATEWAY_BASE_IMAGE}" \
122+
--build-arg TRINO_GATEWAY_BUILD_IMAGE="${TRINO_GATEWAY_BUILD_IMAGE}" \
132123
--platform "linux/$arch" \
133124
-f Dockerfile \
134125
-t "${TAG_PREFIX}-$arch"

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
type: bind
1919

2020
postgres:
21-
image: ${TRINO_GATEWAY_POSTGRES_IMAGE:-postgres}
21+
image: ${TRINO_GATEWAY_POSTGRES_IMAGE:-postgres:17-alpine}
2222
environment:
2323
- PGPORT=5432
2424
- POSTGRES_PASSWORD=P0stG&es

docs/development.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Gateway, and can help with pull request reviews and merges.
7171
* [:fontawesome-brands-github: oneonestar - Star Poon](https://github.com/oneonestar)
7272
* [:fontawesome-brands-github: vishalya - Vishal Jadhav](https://github.com/vishalya)
7373
* [:fontawesome-brands-github: wendigo - Mateusz Gajewski](https://github.com/wendigo)
74-
* [:fontawesome-brands-github: willmostly - Will Morrison](https://github.com/willmostly)
7574

7675
## Contributor meetings
7776

docs/installation.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ the key. Finally, you can deploy Trino Gateway with the chart from the root
305305
of this repository:
306306

307307
```shell
308-
helm install tg --values values-override.yaml helm/trino-gateway
308+
helm install tg --values values-override.yaml trino/trino-gateway
309309
```
310310

311311
Secrets for `authenticationSecret` and `backendState` can be provisioned
@@ -381,6 +381,23 @@ that are marked as active.
381381
See [TrinoStatus](routing-rules.md#trinostatus) for more details on
382382
what each Trino status means.
383383

384+
Username and password for the health check can be configured by adding
385+
`backendState` to your configuration. The username and password must be valid
386+
across all backends.
387+
388+
SSL and xForwardProtoHeader can be configured based on whether the
389+
connection between the Trino Gateway and the backend is secure.
390+
By default, both are set to false.
391+
Find more information in [the related Trino documentation](https://trino.io/docs/current/security/tls.html#use-a-load-balancer-to-terminate-tls-https).
392+
393+
```yaml
394+
backendState:
395+
username: "user"
396+
password: "password"
397+
ssl: <false/true>
398+
xForwardedProtoHeader: <false/true>
399+
```
400+
384401
The type of health check is configured by setting
385402

386403
```yaml
@@ -461,15 +478,7 @@ monitor:
461478
This uses a JDBC connection to query `system.runtime` tables for cluster
462479
information. It is required for the query count based routing strategy. This is
463480
recommended over `UI_API` since it does not restrict the Web UI authentication
464-
method of backend clusters. Configure a username and password by adding
465-
`backendState` to your configuration. The username and password must be valid
466-
across all backends.
467-
468-
```yaml
469-
backendState:
470-
username: "user"
471-
password: "password"
472-
```
481+
method of backend clusters.
473482

474483
Trino Gateway uses `explicitPrepare=false` by default. This property was introduced
475484
in Trino 431, and uses a single query for prepared statements, instead of a

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ It copies the following, necessary files to current directory:
2121
```shell
2222
#!/usr/bin/env sh
2323

24-
VERSION=15
24+
VERSION=16
2525
BASE_URL="https://repo1.maven.org/maven2/io/trino/gateway/gateway-ha"
2626
JAR_FILE="gateway-ha-$VERSION-jar-with-dependencies.jar"
2727
GATEWAY_JAR="gateway-ha.jar"

docs/release-notes.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,68 @@
22

33
## 2025
44

5+
### Trino Gateway 16 (17 Sep 2025) { id="16" }
6+
7+
Artifacts:
8+
9+
* [JAR file gateway-ha-16-jar-with-dependencies.jar](https://repo1.maven.org/maven2/io/trino/gateway/gateway-ha/16/gateway-ha-16-jar-with-dependencies.jar)
10+
* Container image `trinodb/trino-gateway:16`
11+
* Source code as
12+
[tar.gz](https://github.com/trinodb/trino-gateway/archive/refs/tags/16.tar.gz)
13+
or [zip](https://github.com/trinodb/trino-gateway/archive/refs/tags/16.zip)
14+
* [Trino Helm chart](https://trinodb.github.io/charts/) `trino/trino-gateway` version `1.16.0`
15+
16+
Changes:
17+
18+
**General**
19+
20+
* [:warning: Breaking change:](#breaking) Require JDK 24 to run Trino Gateway
21+
and use it in the container image.
22+
([#727](https://github.com/trinodb/trino-gateway/pull/727))
23+
* Update database testing and therefore support to PostgreSQL version 17.
24+
([#753](https://github.com/trinodb/trino-gateway/pull/753))
25+
* Allow configuration of a default routing group and error propagation to client
26+
tools. ([#687](https://github.com/trinodb/trino-gateway/pull/687))
27+
* Add an option to add the `X-Forwarded-Proto` HTTP header when fetching cluster
28+
stats to enable Trino Gateway use with clusters behind a TLS-terminations load
29+
balancer.
30+
([#729](https://github.com/trinodb/trino-gateway/pull/729))
31+
* Improve error propagation when using an external routing service.
32+
([#687](https://github.com/trinodb/trino-gateway/pull/687))
33+
* Add support for HTTP header modifications by an external routing service.
34+
([#646](https://github.com/trinodb/trino-gateway/pull/646))
35+
* Add cluster activation status metric and emit to `/v1/jmx`.
36+
([#673](https://github.com/trinodb/trino-gateway/pull/673))
37+
* Improve properties handling for JDBC connection to the database.
38+
([#651](https://github.com/trinodb/trino-gateway/pull/651))
39+
* [:warning: Breaking change:](#breaking) Rename the task delay configuration
40+
for the monitor from `taskDelaySeconds` to `taskDelay` and to support Airlift
41+
duration string instead of second values only.
42+
([#695](https://github.com/trinodb/trino-gateway/pull/695))
43+
44+
**UI**
45+
46+
* Display routing group name in the query history page.
47+
([#607](https://github.com/trinodb/trino-gateway/pull/607))
48+
* Rename `RoutedTo` to `Name` field in query history page.
49+
([#639](https://github.com/trinodb/trino-gateway/pull/639))
50+
* Use external URL for query routing history display.
51+
([#693](https://github.com/trinodb/trino-gateway/pull/693))
52+
* Add separate window for query text in query history page and enable display of
53+
the full query text.
54+
([#740](https://github.com/trinodb/trino-gateway/pull/740))
55+
* Show counts for healthy and unhealthy clusters in the summary section of the
56+
dashboard page.
57+
([#758](https://github.com/trinodb/trino-gateway/pull/758))
58+
* A column sorting to the clusters list on the dashboard page and column sorting
59+
and filtering to the query list on the query history page.
60+
([#752](https://github.com/trinodb/trino-gateway/pull/752))
61+
* Fix UI rendering issues on routing rules page.
62+
([#660](https://github.com/trinodb/trino-gateway/pull/660))
63+
* Fix bug for non-admin users seeing login errors when accessing the UI when
64+
page restrictions are configured.
65+
([#664](https://github.com/trinodb/trino-gateway/pull/664))
66+
567
### Trino Gateway 15 (12 Mar 2025) { id="15" }
668

769
Artifacts:

docs/routers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ backendState:
6767
username: <usernme>
6868
password: <password>
6969
ssl: <false/true>
70+
xForwardedProtoHeader: <false/true>
7071

7172
clusterStatsConfiguration:
7273
monitorType: UI_API

0 commit comments

Comments
 (0)