Skip to content

Latest commit

 

History

History
186 lines (144 loc) · 7.6 KB

File metadata and controls

186 lines (144 loc) · 7.6 KB

Trino server custom tarball

This project is an example setup for creating a custom tar.gz package of Trino built on top of the core package available with Trino 472 and newer. The example includes configuration files, a limited subset of Trino plugins, and instructions for your own customizations.

Use it as a base to create your own custom tarballs suitable for your needs with different deployment use cases and clusters.

The following sections contain information for building, using, and customizing the tarball.

General information

Users can install Trino using the tarball on any Linux system. For development and testing purposed MacOS is also supported.

The Trino project provides a trino-server-core tarball with the minimal plugins and a default trino-server tarball with all available plugins. Both tarballs do not contain any configuration files, and require further customizations after extracting the tarball to create an installation that can be started and run.

Instructions for this process are available in the Trino documentation

This project uses the core tarball and adds necessary configuration files and a limited subset of plugins to create a tarball with the following characteristics:

  • Catalog abyss using the Blackhole connector.
  • Catalog brain using the Memory connectors, configured for UDF storage in the default schema, and brain.default is added to the SQL path.
  • Catalog generator using the Faker connector.
  • Catalog llm using the AI functions plugin, the llm.ai schema location is added to the SQL path so AI functions can be invoked by name alone. Requires a locally running Ollama.
  • Catalog monitor using the JMX connector.
  • Catalog tpch using the TPC-H connector.
  • Catalog tpcds using the TPC-DS connector.
  • Memory configured to 4GB set in jvm.config suitable for local testing on a small workstation.
  • Node configured to act as coordinator and worker to allow single node use.
  • Environment name set to custom in node.properties.
  • Logging in log.properties set to WARN for io.trino to keep startup output quiet, with io.trino.server.Server left at INFO so the ======== SERVER STARTED ======== banner is logged once the server is ready to accept queries.
  • Preview Web UI enabled.
  • Launcher script for PPC architecture removed.
  • ml functions plugin from trino-server-core removed.
  • geospatial functions plugin from trino-server-core removed.

The project is configured for Trino 482.

Building

The build requirements for the project are identical to Trino build requirements:

  • Linux or MacOS
  • Java 25

Download and extract or clone the repository to work with the trino-packages directory locally on your machine.

Run a build with Maven:

cd trino-packages
./mvnw clean install

The project downloads the core tarball of the configured Trino release, adds configurations files from src/main/resources and a limited number of plugins configured in src/main/provisio/trino-custom.xml, and repackages it into a new tarball package.

As of Trino 477, the trino-server-core tarball and the individual plugin zips are no longer published to Maven Central. The script src/main/script/prefetch.sh runs in the Maven validate phase, parses the active <artifact> entries from src/main/provisio/trino-custom.xml, downloads the matching files from the corresponding Trino GitHub release, and installs them into the local Maven repository so that provisio can resolve them by GAV during the package phase.

After a successful build, you find the tarball in the trino-packages/trino-server-custom/target directory with the name trino-server-custom-482.tar.gz. The specific version depends on the property dep.trino.version configured in trino-packages/trino-server-custom/pom.xml.

The Maven ci profile adds a smoke test that runs after the package phase. Invoke it locally with:

./mvnw -P ci verify

The smoke test is implemented as src/main/script/smoke-test.sh and wired into the integration-test phase via exec-maven-plugin. It extracts the built tarball into target/smoke-test, starts Trino in daemon mode, polls http://localhost:8080/v1/info until the node reports state=ACTIVE, then stops the server. On timeout the script dumps launcher.log and the tail of server.log so the failure mode is visible. The same job runs in the GitHub Actions build workflow on every push and pull request. The smoke test requires Java 25 on PATH and a free TCP port 8080 on the host.

Installation

Build the project on any machine, and copy the tarball package from the trino-server-custom/target directory to the server on which you want to install Trino. The server must meet the Trino requirements for the specific Trino version, for example Java 25 for Trino 482.

Find details in the Trino documentation

Extract the tar.gz package to install Trino:

tar xfvz trino-server-custom-482.tar.gz

You can run Trino from the resulting directory for testing:

cd trino-server-custom-482
./bin/launcher run

Stop the server by interrupting the script with CTRL-C.

Startup takes a few minutes while plugins load. The server is ready when var/log/server.log contains the banner line:

INFO	main	io.trino.server.Server	======== SERVER STARTED ========

Use the launcher script also for running in the background and other operations.

Connect with the Trino CLI or any other client to explore catalogs and schemas, and run your SQL queries.

Customization

The project setup is an example and can be customized to suit your needs with some of the following steps:

  • Customize your configuration by modifying the files in src/main/resources.
  • Add further configuration files in src/main/resources.
  • Add catalogs by adding catalog properties files in src/main/resources/etc/catalog and uncommenting the relevant connector plugins in src/main/provisio/trino-custom.xml.
  • Remove any unwanted configurations and catalogs in src/main/resources.
  • Remove any unwanted plugins by commenting the artifactSet out src/main/provisio/trino-custom.xml.
  • Add custom plugins as extracted directories of JAR files in src/main/resources/plugin or define them as artifactSet in src/main/provisio/trino-custom.xml to download them from your local Maven repository, a repository manager, or the Maven Central Repository.

Use multiple copies of the project to create different tarballs for coordinator and worker nodes and for different Trino clusters.

Refer to the plugin documentation and other Trino documentation for more details.

Updating to other Trino version

The project is configured to build a custom tarball for Trino 482. Updates to newer versions can be contributed to the repository or can be done locally. The following steps are necessary:

  • Update the property dep.trino.version in trino-packages/trino-server-custom/pom.xml to the desired Trino version.
  • Confirm that the matching trino-server-core-<version>.tar.gz and the selected plugin zips are present on the corresponding Trino GitHub release page.
  • If necessary, adjust the included configuration files in src/main/resources.
  • Add any newly available plugins as <artifactSet> entries in src/main/provisio/trino-custom.xml.
  • Update the documentation in this README.md file.