From adc009c60224330cfeb17f9969ca47bea48abd66 Mon Sep 17 00:00:00 2001 From: Masaki Yatsu Date: Sun, 19 Oct 2025 20:38:38 +0900 Subject: [PATCH] feat(querybook): use custom iamge to install sqlalchemy-trino --- querybook/README.md | 193 +++++++++++++++++++++-- querybook/justfile | 3 + querybook/querybook-values.gomplate.yaml | 18 +++ 3 files changed, 205 insertions(+), 9 deletions(-) diff --git a/querybook/README.md b/querybook/README.md index d34315c..d14efa7 100644 --- a/querybook/README.md +++ b/querybook/README.md @@ -54,8 +54,108 @@ QUERYBOOK_NAMESPACE=querybook # Kubernetes namespace QUERYBOOK_HOST=querybook.example.com # External hostname KEYCLOAK_HOST=auth.example.com # Keycloak hostname KEYCLOAK_REALM=buunstack # Keycloak realm name + +# Optional: Use custom Docker image (for testing fixes/patches) +QUERYBOOK_CUSTOM_IMAGE=localhost:30500/querybook # Custom image repository +QUERYBOOK_CUSTOM_IMAGE_TAG=trino-metastore # Custom image tag (default: latest) +QUERYBOOK_CUSTOM_IMAGE_PULL_POLICY=Always # Image pull policy (default: Always) ``` +### Using Custom Image + +To use a custom Querybook image (e.g., with patches or fixes): + +```bash +# Set environment variables +export QUERYBOOK_CUSTOM_IMAGE=localhost:30500/querybook +export QUERYBOOK_CUSTOM_IMAGE_TAG=trino-metastore + +# Install or upgrade Querybook +just querybook::install +# or +just querybook::upgrade +``` + +**When to use custom image**: + +- Testing bug fixes before they are merged upstream +- Applying patches for specific issues (e.g., datetime JSON serialization) +- Using Trino Metastore integration (requires sqlalchemy-trino) +- Using modified versions with custom features + +**Custom image includes** (`trino-metastore` tag): + +- Datetime JSON serialization fixes for WebSocket communication +- `sqlalchemy-trino` package for Metastore integration + +**Custom image behavior** (when `QUERYBOOK_CUSTOM_IMAGE` is set): + +- Pull policy: `Always` (default, override with `QUERYBOOK_CUSTOM_IMAGE_PULL_POLICY`) +- Ensures latest image is always pulled from registry + +**Default behavior** (when `QUERYBOOK_CUSTOM_IMAGE` is not set): + +- Uses official image: `querybook/querybook:latest` +- Pull policy: `IfNotPresent` +- Note: Official image does not include `sqlalchemy-trino`, so Trino Metastore integration will not work + +### Building Custom Image + +To build a custom Querybook image with `sqlalchemy-trino` support: + +1. **Clone Querybook repository**: + + ```bash + git clone https://github.com/pinterest/querybook.git + cd querybook + ``` + +2. **Create requirements/local.txt**: + + ```bash + cat > requirements/local.txt <