-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add trino container. * Try using container script --------- Co-authored-by: Lloyd Tabb <ltabb@meta.com>
- Loading branch information
Showing
4 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! /bin/bash | ||
rm -rf .tmp | ||
mkdir .tmp | ||
|
||
# generate config file | ||
> ./.tmp/bigquery.properties | ||
cat << EOF > ./.tmp/bigquery.properties | ||
connector.name=bigquery | ||
bigquery.project-id=advance-lacing-417917 | ||
bigquery.credentials-key=$BQ_CREDENTIALS_KEY | ||
bigquery.arrow-serialization.enabled=false | ||
EOF | ||
|
||
# run docker | ||
docker run -p 8090:8080 -d -v ./.tmp/bigquery.properties:/etc/trino/catalog/bigquery.properties --name trino-malloy trinodb/trino | ||
|
||
# wait for server to start | ||
counter=0 | ||
while ! docker logs trino-malloy 2>&1 | grep -q "SERVER STARTED" | ||
do | ||
sleep 1 | ||
counter=$((counter+1)) | ||
# if doesn't start after 2 minutes, output logs and kill process | ||
if [ $counter -eq 120 ] | ||
then | ||
docker logs trino-malloy >& ./.tmp/trino-malloy.logs | ||
docker rm -f trino-malloy | ||
echo "Trino did not start successfully, check .tmp/trino-malloy.logs" | ||
exit 1 | ||
break | ||
fi | ||
done | ||
|
||
echo "Trino running on port localhost:8090" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/bash | ||
|
||
# clear tmp files | ||
rm -rf .tmp | ||
|
||
# stop container | ||
docker rm -f trino-malloy |