Skip to content

Commit

Permalink
RANGER-3182: Rename Presto to Trino
Browse files Browse the repository at this point in the history
Trino uses Jdk11. To build the plugin on JDK11 .This commit includes
patch from RANGER-2317 and apache#71
  • Loading branch information
aakashnand authored and root committed Mar 20, 2021
1 parent 5ec9fbd commit a916d0c
Show file tree
Hide file tree
Showing 39 changed files with 541 additions and 508 deletions.
22 changes: 21 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ Apache Ranger is currently NOT setup to use pull requests to take in the changes
Please use the apache review board to submit your code changes for review and commit. https://reviews.apache.org
Also create a jira to go along with the review and mention it in the review board review. https://issues.apache.org/jira/browse/RANGER

Updated Build Process
====================
Note:

As this repo was changed from original fork to build 'ranger-<version>-trino-plugin.tar.gz' which depends on JDK11. You might encounter error in the build process for 'hive-agent' module. Ranger uses hive version 3.1.2 which still requires JDK8 while building so to avoid this error please use this instruction. You can use original build process on JDK8 to seperately build the 'ranger-<version>hive-plugin.tar.gz'.

Additionally please refer this JIRA ticket
https://issues.apache.org/jira/browse/RANGER-3182

1. Check out the code from GIT repository

2. On the root folder, please execute the following Maven command:

$ mvn clean compile package assembly:assembly install -pl '!hive-agent'

3. After the above build command execution, you should see the following TAR files in the target folder:


ranger-<version>-trino-plugin.tar.gz
along with other plugins.

Build Process
=============

Expand Down Expand Up @@ -102,4 +123,3 @@ Installation Process

If the install.sh file does not exists,
Execute ./enable-<component>-plugin.sh

8 changes: 4 additions & 4 deletions agents-common/scripts/enable-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ elif [ "${HCOMPONENT_NAME}" = "kylin" ]; then
HCOMPONENT_LIB_DIR=${HCOMPONENT_INSTALL_DIR}/tomcat/webapps/kylin/WEB-INF/lib
elif [ "${HCOMPONENT_NAME}" = "elasticsearch" ]; then
HCOMPONENT_LIB_DIR=${HCOMPONENT_INSTALL_DIR}/plugins
elif [ "${HCOMPONENT_NAME}" = "presto" ]; then
elif [ "${HCOMPONENT_NAME}" = "trino" ]; then
HCOMPONENT_LIB_DIR=${HCOMPONENT_INSTALL_DIR}/plugin/ranger
if [ ! -d "${HCOMPONENT_LIB_DIR}" ]; then
echo "INFO: Creating ${HCOMPONENT_LIB_DIR}"
Expand Down Expand Up @@ -246,7 +246,7 @@ elif [ "${HCOMPONENT_NAME}" = "elasticsearch" ]; then
echo "INFO: Changing ownership of $HCOMPONENT_CONF_DIR to $CFG_OWNER_INF"
chown $CFG_OWNER_INF $HCOMPONENT_CONF_DIR
fi
elif [ "${HCOMPONENT_NAME}" = "presto" ]; then
elif [ "${HCOMPONENT_NAME}" = "trino" ]; then
HCOMPONENT_CONF_DIR=${HCOMPONENT_INSTALL_DIR}/etc
fi

Expand Down Expand Up @@ -781,7 +781,7 @@ then
fi
fi

if [ "${HCOMPONENT_NAME}" = "presto" ]
if [ "${HCOMPONENT_NAME}" = "trino" ]
then
if [ "${action}" = "enable" ]
then
Expand All @@ -804,7 +804,7 @@ then
echo "Add or Update properties file: [${fn}] ... "
addOrUpdatePropertyToFile access-control.name $controlName ${fn}
echo "Linking config files"
cd ${HCOMPONENT_LIB_DIR}/ranger-presto-plugin-impl/
cd ${HCOMPONENT_LIB_DIR}/ranger-trino-plugin-impl/
ln -sf ${HCOMPONENT_CONF_DIR} conf
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class EmbeddedServiceDefsUtil {


// following servicedef list should be reviewed/updated whenever a new embedded service-def is added
public static final String DEFAULT_BOOTSTRAP_SERVICEDEF_LIST = "tag,hdfs,hbase,hive,kms,knox,storm,yarn,kafka,solr,atlas,nifi,nifi-registry,sqoop,kylin,elasticsearch,presto,ozone,kudu,schema-registry";
public static final String DEFAULT_BOOTSTRAP_SERVICEDEF_LIST = "tag,hdfs,hbase,hive,kms,knox,storm,yarn,kafka,solr,atlas,nifi,nifi-registry,sqoop,kylin,elasticsearch,trino,ozone,kudu,schema-registry";
private static final String PROPERTY_SUPPORTED_SERVICE_DEFS = "ranger.supportedcomponents";
private Set<String> supportedServiceDefs;
public static final String EMBEDDED_SERVICEDEF_TAG_NAME = "tag";
Expand All @@ -71,7 +71,7 @@ public class EmbeddedServiceDefsUtil {
public static final String EMBEDDED_SERVICEDEF_KYLIN_NAME = "kylin";
public static final String EMBEDDED_SERVICEDEF_ABFS_NAME = "abfs";
public static final String EMBEDDED_SERVICEDEF_ELASTICSEARCH_NAME = "elasticsearch";
public static final String EMBEDDED_SERVICEDEF_PRESTO_NAME = "presto";
public static final String EMBEDDED_SERVICEDEF_TRINO_NAME = "trino";
public static final String EMBEDDED_SERVICEDEF_OZONE_NAME = "ozone";
public static final String EMBEDDED_SERVICEDEF_KUDU_NAME = "kudu";

Expand All @@ -89,7 +89,7 @@ public class EmbeddedServiceDefsUtil {
public static final String SCHEMA_REGISTRY_IMPL_CLASS_NAME = "org.apache.ranger.services.schemaregistry.RangerServiceSchemaRegistry";
public static final String NIFI_IMPL_CLASS_NAME = "org.apache.ranger.services.nifi.RangerServiceNiFi";
public static final String ATLAS_IMPL_CLASS_NAME = "org.apache.ranger.services.atlas.RangerServiceAtlas";
public static final String PRESTO_IMPL_CLASS_NAME = "org.apache.ranger.services.presto.RangerServicePresto";
public static final String TRINO_IMPL_CLASS_NAME = "org.apache.ranger.services.trino.RangerServiceTrino";
public static final String OZONE_IMPL_CLASS_NAME = "org.apache.ranger.services.ozone.RangerServiceOzone";
public static final String KUDU_IMPL_CLASS_NAME = "org.apache.ranger.services.kudu.RangerServiceKudu";

Expand All @@ -114,7 +114,7 @@ public class EmbeddedServiceDefsUtil {
private RangerServiceDef kylinServiceDef;
private RangerServiceDef abfsServiceDef;
private RangerServiceDef elasticsearchServiceDef;
private RangerServiceDef prestoServiceDef;
private RangerServiceDef trinoServiceDef;
private RangerServiceDef ozoneServiceDef;
private RangerServiceDef kuduServiceDef;

Expand Down Expand Up @@ -164,7 +164,7 @@ public void init(ServiceStore store) {
kylinServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_KYLIN_NAME);
abfsServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_ABFS_NAME);
elasticsearchServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_ELASTICSEARCH_NAME);
prestoServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_PRESTO_NAME);
trinoServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_TRINO_NAME);
ozoneServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_OZONE_NAME);
kuduServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_KUDU_NAME);

Expand Down Expand Up @@ -246,7 +246,7 @@ public long getElasticsearchServiceDefId() {

public long getAbfsServiceDefId() { return getId(abfsServiceDef); }

public long getPrestoServiceDefId() { return getId(prestoServiceDef); }
public long getTrinoServiceDefId() { return getId(trinoServiceDef); }

public long getOzoneServiceDefId() { return getId(ozoneServiceDef); }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": 17,
"name": "presto",
"displayName": "presto",
"implClass": "org.apache.ranger.services.presto.RangerServicePresto",
"label": "Presto",
"description": "Presto",
"name": "trino",
"displayName": "trino",
"implClass": "org.apache.ranger.services.trino.RangerServiceTrino",
"label": "Trino",
"description": "Trino",
"guid": "379a9fe5-1b6e-4091-a584-4890e245e6c1",
"resources": [
{
Expand All @@ -26,8 +26,8 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "Presto Catalog",
"description": "Presto Catalog"
"label": "Trino Catalog",
"description": "Trino Catalog"
},
{
"itemId": 2,
Expand All @@ -48,8 +48,8 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "Presto Schema",
"description": "Presto Schema"
"label": "Trino Schema",
"description": "Trino Schema"
},
{
"itemId": 3,
Expand All @@ -70,8 +70,8 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "Presto Table",
"description": "Presto Table"
"label": "Trino Table",
"description": "Trino Table"
},
{
"itemId": 4,
Expand All @@ -91,12 +91,12 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "Presto Column",
"description": "Presto Column"
"label": "Trino Column",
"description": "Trino Column"
},
{
"itemId": 5,
"name": "prestouser",
"name": "trinouser",
"type": "string",
"level": 10,
"parent": "",
Expand All @@ -112,8 +112,8 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "Presto User",
"description": "Presto User",
"label": "Trino User",
"description": "Trino User",
"accessTypeRestrictions": ["impersonate"]
},
{
Expand All @@ -135,7 +135,7 @@
"validationMessage": "",
"uiHint": "",
"label": "System Property",
"description": "Presto System Property",
"description": "Trino System Property",
"accessTypeRestrictions": ["alter"]
},
{
Expand All @@ -157,7 +157,7 @@
"validationMessage": "",
"uiHint": "",
"label": "Catalog Session Property",
"description": "Presto Catalog Session Property",
"description": "Trino Catalog Session Property",
"accessTypeRestrictions": ["alter"]
},
{
Expand All @@ -178,8 +178,8 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"label": "Presto Function",
"description": "Presto Function",
"label": "Trino Function",
"description": "Trino Function",
"accessTypeRestrictions": ["execute", "grant"]
},
{
Expand Down Expand Up @@ -315,7 +315,7 @@
"validationRegEx": "",
"validationMessage": "",
"uiHint": "",
"defaultValue": "io.prestosql.jdbc.PrestoDriver"
"defaultValue": "io.trino.jdbc.TrinoDriver"
},
{
"itemId": 4,
Expand Down
8 changes: 4 additions & 4 deletions distro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<descriptor>src/main/assembly/plugin-kylin.xml</descriptor>
<descriptor>src/main/assembly/plugin-elasticsearch.xml</descriptor>
<descriptor>src/main/assembly/plugin-schema-registry.xml</descriptor>
<descriptor>src/main/assembly/plugin-presto.xml</descriptor>
<descriptor>src/main/assembly/plugin-trino.xml</descriptor>
</descriptors>
</configuration>
</execution>
Expand Down Expand Up @@ -525,7 +525,7 @@
</build>
</profile>
<profile>
<id>ranger-presto-plugin</id>
<id>ranger-trino-plugin</id>
<build>
<plugins>
<plugin>
Expand All @@ -544,7 +544,7 @@
<configuration>
<skipAssembly>false</skipAssembly>
<descriptors>
<descriptor>src/main/assembly/plugin-presto.xml</descriptor>
<descriptor>src/main/assembly/plugin-trino.xml</descriptor>
</descriptors>
</configuration>
</execution>
Expand Down Expand Up @@ -629,7 +629,7 @@
<descriptor>src/main/assembly/plugin-kylin.xml</descriptor>
<descriptor>src/main/assembly/plugin-elasticsearch.xml</descriptor>
<descriptor>src/main/assembly/plugin-schema-registry.xml</descriptor>
<descriptor>src/main/assembly/plugin-presto.xml</descriptor>
<descriptor>src/main/assembly/plugin-trino.xml</descriptor>
</descriptors>
</configuration>
</execution>
Expand Down
10 changes: 5 additions & 5 deletions distro/src/main/assembly/admin-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -462,18 +462,18 @@
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.apache.ranger:ranger-presto-plugin</include>
<include>org.apache.ranger:ranger-trino-plugin</include>
</includes>
<binaries>
<outputDirectory>ews/webapp/WEB-INF/classes/ranger-plugins/presto</outputDirectory>
<outputDirectory>ews/webapp/WEB-INF/classes/ranger-plugins/trino</outputDirectory>
<includeDependencies>true</includeDependencies>
<unpack>false</unpack>
<directoryMode>755</directoryMode>
<fileMode>644</fileMode>
<includes>
<include>org.apache.ranger:ranger-presto-plugin</include>
<include>io.prestosql:presto-spi:jar:${presto.version}</include>
<include>io.prestosql:presto-jdbc:jar:${presto.version}</include>
<include>org.apache.ranger:ranger-trino-plugin</include>
<include>io.trino:trino-spi:jar:${trino.version}</include>
<include>io.trino:trino-jdbc:jar:${trino.version}</include>
</includes>
</binaries>
</moduleSet>
Expand Down
Loading

0 comments on commit a916d0c

Please sign in to comment.