Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aakashnand committed Sep 26, 2021
1 parent 570392d commit 8b4e22d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 11 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-push-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci
on:
push:
paths:
- "ranger-admin/*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./ranger-admin/
push: true
tags: aakashnand/trino-ranger-demo:v1.0
21 changes: 14 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
- 9200:9200
networks:
- trino-ranger-demo
volumes:
- ranger-es-data:/usr/share/elasticsearch/data
postgresql:
image: postgres:13
container_name: psql01
Expand All @@ -21,19 +23,21 @@ services:
- 5432:5432
networks:
- trino-ranger-demo
volumes:
- ranger-pg-data:/var/lib/postgresql/data
ranger-admin:
image: trino-ranger-demo:v2.1.0
container_name: ranger-admin
hostname: ranger-admin
entrypoint: bash -c "cd /root/ranger-2.1.0-admin/ && ./setup.sh && ranger-admin start && tail -f /root/ranger-2.1.0-admin/ews/logs/ranger-admin-*-.log "
deploy:
resources:
limits:
cpus: '2'
memory: 6G
reservations:
cpus: '1'
memory: 5G
resources:
limits:
cpus: '2'
memory: 6G
reservations:
cpus: '1'
memory: 5G
ports:
- 6080:6080
networks:
Expand All @@ -56,3 +60,6 @@ services:
networks:
trino-ranger-demo:
driver: bridge
volumes:
ranger-es-data:
ranger-pg-data:
9 changes: 6 additions & 3 deletions ranger-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +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 curl vim sudo openjdk-11-jdk wget bc git g++ gcc python python3 python3-pip apt-transport-https ca-certificates
RUN wget -O /usr/share/java/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.2.23.jar
RUN apt-get -y install sudo wget bc python apt-transport-https gnupg
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
WORKDIR /root
RUN wget https://github.com/aakashnand/trino-ranger-demo/releases/download/trino-ranger-demo-v2.1.0/ranger-2.1.0-admin.tar.gz
RUN tar xvf ranger-2.1.0-admin.tar.gz
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ENV JAVA_HOME=/usr/lib/jvm/zulu11
2 changes: 1 addition & 1 deletion ranger-admin/install.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DB_FLAVOR=postgres
#
#SQL_CONNECTOR_JAR=/usr/share/java/ojdbc6.jar
#SQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
SQL_CONNECTOR_JAR=/usr/share/java/postgresql.jar
SQL_CONNECTOR_JAR=/root/postgresql.jar
#SQL_CONNECTOR_JAR=/usr/share/java/sqljdbc4.jar
#SQL_CONNECTOR_JAR=/opt/sqlanywhere17/java/sajdbc4.jar
#SQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
Expand Down

0 comments on commit 8b4e22d

Please sign in to comment.