Skip to content

Commit 30913c5

Browse files
authored
RANGER-5386: Docker setup updated to use latest Trino release (apache#719)
1 parent eee8902 commit 30913c5

12 files changed

Lines changed: 251 additions & 305 deletions

dev-support/ranger-docker/.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ OZONE_RUNNER_IMAGE=apache/ozone-runner
6666
OZONE_RUNNER_VERSION=20230615-1
6767

6868
# Trino Configuration
69-
TRINO_VERSION=435
70-
TRINO_PLUGIN_VERSION=3.0.0-SNAPSHOT
69+
TRINO_VERSION=latest
7170

7271
# Debug Configuration
7372
DEBUG_ADMIN=false

dev-support/ranger-docker/Dockerfile.ranger-trino

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,58 +17,6 @@
1717
ARG TRINO_VERSION
1818
FROM trinodb/trino:${TRINO_VERSION}
1919

20-
# trino base image layer has undergone changes in base os image with time.
21-
##########################################
22-
# Trino Versions | OS Layer #
23-
# 359 - 369 | centos 11 #
24-
# 370 - 389 | ubi8 #
25-
# 390 - 391 | azul openjdk #
26-
# 392 | ubi8 #
27-
# 393 - 431 | eclipse-temurin #
28-
# 432 - current | ubi9 #
29-
##########################################
30-
31-
USER root
32-
33-
ARG TRINO_VERSION
34-
ARG TRINO_PLUGIN_VERSION
35-
ENV PLUGIN_DIR=ranger-${TRINO_PLUGIN_VERSION}-trino-plugin
36-
37-
RUN mkdir -p /home/ranger/dist /home/ranger/scripts /opt/ranger
38-
39-
COPY ./dist/version /home/ranger/dist
40-
COPY ./dist/ranger-${TRINO_PLUGIN_VERSION}-trino-plugin.tar.gz /home/ranger/dist
41-
COPY ./scripts/ranger-trino.sh /home/ranger/scripts
42-
COPY ./scripts/ranger-trino-setup.sh /home/ranger/scripts
43-
COPY ./scripts/ranger-trino-plugin-install.properties /home/ranger/scripts
44-
45-
RUN if [ $TRINO_VERSION -ge 370 ] && [ $TRINO_VERSION -lt 390 ] || [ $TRINO_VERSION -eq 392 ]; then\
46-
dnf install -y initscripts;\
47-
dnf install -y openssh-clients;\
48-
dnf install -y openssh-server;\
49-
dnf install -y sudo;\
50-
elif [ $TRINO_VERSION -ge 432 ]; then\
51-
microdnf install -y gzip;\
52-
microdnf install -y initscripts;\
53-
microdnf install -y openssh-clients;\
54-
microdnf install -y openssh-server;\
55-
microdnf install -y sudo;\
56-
else\
57-
apt-get update; DEBIAN_FRONTEND="noninteractive" apt-get -y install ssh sudo;\
58-
fi
59-
60-
RUN tar xvfz /home/ranger/dist/${PLUGIN_DIR}.tar.gz --directory=/opt/ranger && \
61-
ln -s /opt/ranger/${PLUGIN_DIR} /opt/ranger/ranger-trino-plugin && \
62-
rm -f /home/ranger/dist/${PLUGIN_DIR}.tar.gz && \
63-
cp -f /home/ranger/scripts/ranger-trino-plugin-install.properties /opt/ranger/ranger-trino-plugin/install.properties && \
64-
chown -R trino:trino /home/ranger /opt/ranger && \
65-
chown root:root /home/ranger/scripts /home/ranger/scripts/ranger-trino-setup.sh && \
66-
chmod 744 /home/ranger/scripts/ranger-trino-setup.sh /home/ranger/scripts/ranger-trino.sh
67-
68-
# enable trino user to execute setup script as root
69-
RUN echo "trino ALL=(ALL) NOPASSWD:/home/ranger/scripts/ranger-trino-setup.sh" > /etc/sudoers.d/trino
70-
71-
7220
USER trino
7321

74-
ENTRYPOINT ["/home/ranger/scripts/ranger-trino.sh"]
22+
COPY ./config/trino/* /etc/trino/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
access-control.name=ranger
2+
3+
ranger.service.name=dev_trino
4+
ranger.plugin.config.resource=/etc/trino/ranger-trino-security.xml,/etc/trino/ranger-trino-audit.xml,/etc/trino/ranger-policymgr-ssl.xml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
connector.name=hive
2+
hive.metastore.uri=thrift://ranger-hive.rangernw:9083
3+
fs.hadoop.enabled=true
4+
hive.config.resources=/etc/trino/core-site.xml
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
19+
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
20+
<!-- The following properties are used for 2-way SSL client server validation -->
21+
<property>
22+
<name>xasecure.policymgr.clientssl.keystore</name>
23+
<value>hadoopdev-clientcert.jks</value>
24+
<description>
25+
Java Keystore files
26+
</description>
27+
</property>
28+
<property>
29+
<name>xasecure.policymgr.clientssl.truststore</name>
30+
<value>cacerts-xasecure.jks</value>
31+
<description>
32+
java truststore file
33+
</description>
34+
</property>
35+
<property>
36+
<name>xasecure.policymgr.clientssl.keystore.credential.file</name>
37+
<value>jceks://file/tmp/keystore-hadoopdev-ssl.jceks</value>
38+
<description>
39+
java keystore credential file
40+
</description>
41+
</property>
42+
<property>
43+
<name>xasecure.policymgr.clientssl.truststore.credential.file</name>
44+
<value>jceks://file/tmp/truststore-hadoopdev-ssl.jceks</value>
45+
<description>
46+
java truststore credential file
47+
</description>
48+
</property>
49+
</configuration>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
19+
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
20+
<property>
21+
<name>xasecure.audit.is.enabled</name>
22+
<value>true</value>
23+
</property>
24+
25+
<!-- Log4j audit provider configuration -->
26+
<property>
27+
<name>xasecure.audit.destination.log4j</name>
28+
<value>false</value>
29+
</property>
30+
31+
32+
<!-- Solr audit provider configuration -->
33+
<property>
34+
<name>xasecure.audit.destination.solr</name>
35+
<value>true</value>
36+
</property>
37+
38+
<property>
39+
<name>xasecure.audit.destination.solr.urls</name>
40+
<value>http://ranger-solr.rangernw:8983/solr/ranger_audits</value>
41+
</property>
42+
43+
<property>
44+
<name>xasecure.audit.destination.solr.user</name>
45+
<value>NONE</value>
46+
</property>
47+
48+
<property>
49+
<name>xasecure.audit.destination.solr.password</name>
50+
<value>NONE</value>
51+
</property>
52+
53+
<property>
54+
<name>xasecure.audit.destination.solr.batch.filespool.dir</name>
55+
<value>/var/log/hive/audit/solr/spool</value>
56+
</property>
57+
58+
<property>
59+
<name>xasecure.audit.destination.solr.force.use.inmemory.jaas.config</name>
60+
<value>false</value>
61+
</property>
62+
<property>
63+
<name>xasecure.audit.jaas.Client.loginModuleName</name>
64+
<value>com.sun.security.auth.module.Krb5LoginModule</value>
65+
</property>
66+
<property>
67+
<name>xasecure.audit.jaas.Client.loginModuleControlFlag</name>
68+
<value>required</value>
69+
</property>
70+
<property>
71+
<name>xasecure.audit.jaas.Client.option.useKeyTab</name>
72+
<value>true</value>
73+
</property>
74+
<property>
75+
<name>xasecure.audit.jaas.Client.option.storeKey</name>
76+
<value>true</value>
77+
</property>
78+
<property>
79+
<name>xasecure.audit.jaas.Client.option.useTicketCache</name>
80+
<value>false</value>
81+
</property>
82+
<property>
83+
<name>xasecure.audit.jaas.Client.option.serviceName</name>
84+
<value>trino</value>
85+
</property>
86+
<property>
87+
<name>xasecure.audit.jaas.Client.option.keyTab</name>
88+
<value>/usr/lib/trino/plugin/ranger/trino.keytab</value>
89+
</property>
90+
<property>
91+
<name>xasecure.audit.jaas.Client.option.principal</name>
92+
<value>trino/ranger-trino.rangernw@EXAMPLE.COM</value>
93+
</property>
94+
</configuration>
95+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<configuration>
19+
<property>
20+
<name>ranger.plugin.trino.service.name</name>
21+
<value>dev_trino</value>
22+
<description>
23+
Name of the Ranger service containing policies for this Trino instance
24+
</description>
25+
</property>
26+
27+
<property>
28+
<name>ranger.plugin.trino.policy.source.impl</name>
29+
<value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
30+
<description>
31+
Class to retrieve policies from the source
32+
</description>
33+
</property>
34+
35+
<property>
36+
<name>ranger.plugin.trino.policy.rest.url</name>
37+
<value>http://ranger:6080</value>
38+
<description>
39+
URL to Ranger Admin
40+
</description>
41+
</property>
42+
43+
<property>
44+
<name>ranger.plugin.trino.policy.rest.ssl.config.file</name>
45+
<value>/etc/hadoop/conf/ranger-policymgr-ssl.xml</value>
46+
<description>
47+
Path to the file containing SSL details to contact Ranger Admin
48+
</description>
49+
</property>
50+
51+
<property>
52+
<name>ranger.plugin.trino.policy.pollIntervalMs</name>
53+
<value>30000</value>
54+
<description>
55+
How often to poll for changes in policies?
56+
</description>
57+
</property>
58+
59+
<property>
60+
<name>ranger.plugin.trino.policy.rest.client.connection.timeoutMs</name>
61+
<value>30000</value>
62+
<description>
63+
RangerRestClient Connection Timeout in Milli Seconds
64+
</description>
65+
</property>
66+
67+
<property>
68+
<name>ranger.plugin.trino.policy.rest.client.read.timeoutMs</name>
69+
<value>30000</value>
70+
<description>
71+
RangerRestClient read Timeout in Milli Seconds
72+
</description>
73+
</property>
74+
75+
<property>
76+
<name>ranger.plugin.trino.policy.cache.dir</name>
77+
<value>/tmp</value>
78+
</property>
79+
80+
<property>
81+
<name>ranger.plugin.trino.use.rangerGroups</name>
82+
<value>true</value>
83+
</property>
84+
85+
<property>
86+
<name>ranger.plugin.trino.use.only.rangerGroups</name>
87+
<value>true</value>
88+
</property>
89+
</configuration>

dev-support/ranger-docker/docker-compose.ranger-trino.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ services:
44
context: .
55
dockerfile: Dockerfile.ranger-trino
66
args:
7-
- TRINO_PLUGIN_VERSION=${TRINO_PLUGIN_VERSION}
87
- TRINO_VERSION=${TRINO_VERSION}
98
image: ranger-trino
10-
hostname: ranger-trino
9+
hostname: trino
1110
container_name: ranger-trino
1211
stdin_open: true
1312
tty: true
@@ -19,7 +18,6 @@ services:
1918
ranger:
2019
condition: service_started
2120
environment:
22-
- TRINO_PLUGIN_VERSION
2321
- TRINO_VERSION
2422

2523
networks:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<property>
4+
<name>fs.defaultFS</name>
5+
<value>hdfs://ranger-hadoop.rangernw:9000</value>
6+
</property>
7+
</configuration>

0 commit comments

Comments
 (0)