Skip to content

Commit

Permalink
Upgrade trino to 436 and docker image to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
aakashnand committed Jan 29, 2024
1 parent 8c67c04 commit b117875
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
with:
context: ./ranger-admin/
push: true
tags: aakashnand/trino-ranger-demo:v3.0
tags: aakashnand/trino-ranger-demo:v4.0
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
env
15 changes: 8 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
environment:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: -Xms500m -Xmx500m
ports:
- 9200:9200
networks:
Expand All @@ -26,10 +27,11 @@ services:
volumes:
- ranger-pg-data:/var/lib/postgresql/data
ranger-admin:
image: aakashnand/trino-ranger-demo:v3.0
image: aakashnand/trino-ranger-demo:v4.0
#build: ranger-admin
container_name: ranger-admin
hostname: ranger-admin
entrypoint: /root/docker-entrypoint.sh
entrypoint: /root/ranger-admin/docker-entrypoint.sh
deploy:
resources:
limits:
Expand All @@ -43,13 +45,12 @@ services:
networks:
- trino-ranger-demo
volumes:
- ./ranger-admin/install.properties:/root/install.properties
- ./ranger-admin/docker-entrypoint.sh:/root/docker-entrypoint.sh
- ./ranger-admin:/root/ranger-admin
trino:
image: trinodb/trino:406
hostname: my-localhost-trino
image: trinodb/trino:436
hostname: localhost-trino
user: root
container_name: my-localhost-trino
container_name: localhost-trino
entrypoint: /root/docker-entrypoint.sh
networks:
- trino-ranger-demo
Expand Down
9 changes: 5 additions & 4 deletions ranger-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ RUN apt-get update
ENV TZ=Asia/Tokyo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y install sudo wget bc python apt-transport-https gnupg
RUN apt-get -y install ca-certificates curl sudo wget bc apt-transport-https gnupg python-is-python3 python3-venv
RUN curl -s https://repos.azul.com/azul-repo.key | sudo gpg --dearmor -o /usr/share/keyrings/azul.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | sudo tee /etc/apt/sources.list.d/zulu.list
RUN wget -O /root/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.2.23.jar
RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
RUN curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-2_all.deb
RUN sudo apt-get -y install ./zulu-repo_1.0.0-2_all.deb && sudo apt-get -y update && sudo apt-get -y install zulu11-jdk
RUN sudo apt-get -y update && sudo apt-get -y install zulu11-jdk
WORKDIR /root
ADD https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v1.0/ranger-2.1.0-admin.tar.gz /root
ADD https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v1.0/ranger-3.0.0-SNAPSHOT-admin.tar.gz /root
ENV JAVA_HOME=/usr/lib/jvm/zulu11
19 changes: 16 additions & 3 deletions ranger-admin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#!/bin/bash

RANGER_VERSION=2.1.0
RANGER_VERSION=3.0.0-SNAPSHOT

TAR_FILE=ranger-${RANGER_VERSION}-admin.tar.gz
DOWNLOAD_URL=https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v1.0/${TAR_FILE}

# Check if the tar file exists
if [ -f "$TAR_FILE" ]; then
echo "Tar file $TAR_FILE already exists."
else
echo "Tar file $TAR_FILE does not exist. Downloading from $DOWNLOAD_URL..."
wget $DOWNLOAD_URL -O $TAR_FILE
echo "Download completed."
fi

#wget https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v1.0/ranger-${RANGER_VERSION}-admin.tar.gz && \
tar xvf ranger-${RANGER_VERSION}-admin.tar.gz && \
cd /root/ranger-${RANGER_VERSION}-admin/ && \
cp /root/install.properties /root/ranger-${RANGER_VERSION}-admin/ && \
cp /root/ranger-admin/install.properties /root/ranger-${RANGER_VERSION}-admin/ && \
./setup.sh && \
ranger-admin start && \
python -m venv /root/ranger-admin/.env && source /root/ranger-admin/.env/bin/activate && pip install -r /root/ranger-admin/requirement.txt
python /root/ranger-admin/trino_service_setup.py && \
tail -f /root/ranger-${RANGER_VERSION}-admin/ews/logs/ranger-admin-*-.log
16 changes: 13 additions & 3 deletions trino/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/bash
RANGER_VERSION=ranger-3.0.0-SNAPSHOT-trino-plugin-405-406
cd /root && \
curl https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v1.0/${RANGER_VERSION}.tar.gz --output ${RANGER_VERSION}.tar.gz -L &&
microdnf install gzip -y
RANGER_VERSION=ranger-3.0.0-SNAPSHOT-trino-plugin-436
TAR_FILE=/root/${RANGER_VERSION}.tar.gz
cd /root
# Check if the tar file exists
if [ -f "$TAR_FILE" ]; then
echo "Tar file $TAR_FILE already exists."
else
echo "Tar file $TAR_FILE does not exist. Downloading from $DOWNLOAD_URL..."
curl -k https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v1.0/${RANGER_VERSION}.tar.gz --output ${RANGER_VERSION}.tar.gz -L
echo "Download completed."
fi

mkdir -p /root/${RANGER_VERSION} && \
tar xvf ${RANGER_VERSION}.tar.gz -C /root/${RANGER_VERSION} --strip-components 1 && \
yes | cp -rf /root/install.properties /root/${RANGER_VERSION}/ && \
Expand Down

0 comments on commit b117875

Please sign in to comment.