This project provides a Docker Compose setup for running Trino.
- Docker
- Docker Compose
- Google API Service Account credentials (for Sheets connector)
To start the Trino container:
docker-compose up -d
This will start a Trino server that is accessible at http://localhost:8080.
You can connect to Trino using the CLI, which is available in the container:
docker exec -it trino trino
Or you can use the web UI at http://localhost:8080.
The Trino configuration is in the etc
directory:
etc/config.properties
: Basic coordinator configurationetc/jvm.config
: JVM settingsetc/node.properties
: Node-specific configurationetc/catalog/memory.properties
: Memory connector configurationetc/catalog/sheets.properties
: Google Sheets connector configuration
You can add more catalog configurations in the etc/catalog
directory.
The Google Sheets connector requires:
- A Google Cloud project with the Google Sheets API enabled
- A service account with access to the sheets you want to query
- A metadata spreadsheet that defines your schemas and tables
Before running the container:
-
Create a Google Cloud Service Account:
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Navigate to "APIs & Services" > "Enabled APIs" and enable the Google Sheets API
- Go to "IAM & Admin" > "Service Accounts" and create a new service account
- Grant it appropriate roles (at minimum "Viewer" for the sheets you'll access)
- Create a key for the service account (JSON format)
- Download the JSON key file
-
Set up the credentials:
- Place the downloaded JSON key file in the
credentials
directory asservice-account.json
- Share your Google Sheets with the service account's email address (it looks like
something@project-id.iam.gserviceaccount.com
)
- Place the downloaded JSON key file in the
-
Create a metadata spreadsheet:
- Create a new Google Sheet to define your schemas and tables
- Format it according to the template provided in
sheets-metadata-template.csv
- Find the spreadsheet ID in the URL (it's the long string after
/d/
and before/edit
) - Update the
SHEETS_METADATA_ID
environment variable indocker-compose.yml
For more information about the metadata spreadsheet format and how to configure tables, see the Trino Google Sheets connector documentation.
To stop the Trino container:
docker-compose down
This project is licensed under the ISC License - see the LICENSE file for details.