|
| 1 | +<!-- |
| 2 | + - Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + - contributor license agreements. See the NOTICE file distributed with |
| 4 | + - this work for additional information regarding copyright ownership. |
| 5 | + - The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + - (the "License"); you may not use this file except in compliance with |
| 7 | + - the License. You may obtain a copy of the License at |
| 8 | + - |
| 9 | + - http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + - |
| 11 | + - Unless required by applicable law or agreed to in writing, software |
| 12 | + - distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + - See the License for the specific language governing permissions and |
| 15 | + - limitations under the License. |
| 16 | + --> |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +# Building Kyuubi Spark AuthZ Plugin |
| 21 | + |
| 22 | +<img src="https://svn.apache.org/repos/asf/comdev/project-logos/originals/kyuubi-1.svg" alt="Kyuubi logo" width="50%" align="right" /> |
| 23 | + |
| 24 | +## Build with Apache Maven |
| 25 | + |
| 26 | +Kyuubi Spark AuthZ Plugin is built using [Apache Maven](http://maven.apache.org). |
| 27 | +To build it, `cd` to the root direct of kyuubi project and run: |
| 28 | + |
| 29 | +```shell |
| 30 | +build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DskipTests |
| 31 | +``` |
| 32 | + |
| 33 | +After a while, if everything goes well, you will get the plugin finally in two parts: |
| 34 | + |
| 35 | +- The main plugin jar, which is under `./extensions/spark/kyuubi-spark-authz/target/kyuubi-spark-authz_${scala.binary.version}-${project.version}.jar` |
| 36 | +- The least transitive dependencies needed, which are under `./extensions/spark/kyuubi-spark-authz/target/scala-${scala.binary.version}/jars` |
| 37 | + |
| 38 | +### Build against Different Apache Spark Versions |
| 39 | + |
| 40 | +The maven option `spark.version` is used for specifying Spark version to compile with and generate corresponding transitive dependencies. |
| 41 | +By default, it is always built with the latest `spark.version` defined in kyuubi project main pom file. |
| 42 | +Sometimes, it may be incompatible with other Spark distributions, then you may need to build the plugin on your own targeting the Spark version you use. |
| 43 | + |
| 44 | +For example, |
| 45 | + |
| 46 | +```shell |
| 47 | +build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DskipTests -Dspark.version=3.0.2 |
| 48 | +``` |
| 49 | + |
| 50 | +The available `spark.version`s are shown in the following table. |
| 51 | + |
| 52 | +| Spark Version | Supported | Remark | |
| 53 | +|:-----------------:|:-----------:|:--------------------------------------------------------------------------------------------------------------------------------:| |
| 54 | +| master | √ | - | |
| 55 | +| 3.3.x | √ | - | |
| 56 | +| 3.2.x | √ | - | |
| 57 | +| 3.1.x | √ | - | |
| 58 | +| 3.0.x | √ | - | |
| 59 | +| 2.4.x | √ | - | |
| 60 | +| 2.3.x and earlier | × | [PR 2367](https://github.com/apache/incubator-kyuubi/pull/2367) is used to track how we work with older releases with scala 2.11 | |
| 61 | + |
| 62 | +Currently, Spark released with Scala 2.12 are supported. |
| 63 | + |
| 64 | +### Build against Different Apache Ranger Versions |
| 65 | + |
| 66 | +The maven option `ranger.version` is used for specifying Ranger version to compile with and generate corresponding transitive dependencies. |
| 67 | +By default, it is always built with the latest `ranger.version` defined in kyuubi project main pom file. |
| 68 | +Sometimes, it may be incompatible with other Ranger Admins, then you may need to build the plugin on your own targeting the Ranger Admin version you connect with. |
| 69 | + |
| 70 | +```shell |
| 71 | +build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DskipTests -Dranger.version=0.7.0 |
| 72 | +``` |
| 73 | + |
| 74 | +The available `ranger.version`s are shown in the following table. |
| 75 | + |
| 76 | +| Ranger Version | Supported | Remark | |
| 77 | +|:--------------:|:-----------:|:------:| |
| 78 | +| 2.2.x | √ | - | |
| 79 | +| 2.1.x | √ | - | |
| 80 | +| 2.0.x | √ | - | |
| 81 | +| 1.2.x | √ | - | |
| 82 | +| 1.1.x | √ | - | |
| 83 | +| 1.0.x | √ | - | |
| 84 | +| 0.7.x | √ | - | |
| 85 | +| 0.6.x | √ | - | |
| 86 | + |
| 87 | +Currently, all ranger releases are supported. |
| 88 | + |
| 89 | +## Test with ScalaTest Maven plugin |
| 90 | +If you omit `-DskipTests` option in the command above, you will also get all unit tests run. |
| 91 | + |
| 92 | +```shell |
| 93 | +build/mvn clean package -pl :kyuubi-spark-authz_2.12 |
| 94 | +``` |
| 95 | + |
| 96 | +If any bug occurs and you want to debug the plugin yourself, you can configure `-DdebugForkedProcess=true` and `-DdebuggerPort=5005`(optional). |
| 97 | + |
| 98 | +```shell |
| 99 | +build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DdebugForkedProcess=true |
| 100 | +``` |
| 101 | + |
| 102 | +The tests will suspend at startup and wait for a remote debugger to attach to the configured port. |
| 103 | + |
| 104 | +We will appreciate if you can share the bug or the fix to the Kyuubi community. |
0 commit comments