From 38655a6421800afcd81a13310d98a441439e4594 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Thu, 29 Feb 2024 10:35:25 -0500 Subject: [PATCH] trino: Allow installing UDFs at arbitrary URL This is needed for when we're invoked from a different container than the one with our server. --- docker/trino/install-udfs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/trino/install-udfs b/docker/trino/install-udfs index ae8a492..9d2f639 100755 --- a/docker/trino/install-udfs +++ b/docker/trino/install-udfs @@ -1,6 +1,13 @@ #!/bin/bash +# +# Install UDFs into Trino. +# +# Usage: install-udfs [trino_url] set -euo pipefail -until curl -s http://localhost:8080/v1/info | grep -q '"starting":false'; do sleep 1; done -trino --file "/etc/trino/trino_compat.sql" +# URL of our Trino server. +trino_url="${1:-"http://localhost:8080"}" + +until curl -s "$trino_url/v1/info" | grep -q '"starting":false'; do sleep 1; done +trino --file "/etc/trino/trino_compat.sql" "$trino_url"