### _Why are the changes needed?_ This PR aims to shade the kyuubi spark authz plugin to simplify the user's use. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [x] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No Closes #5427 from Yikf/shade-authz. Closes #5427 d2f7ea8d1 [yikaifei] fix 695133de4 [Kent Yao] Update docs/security/authorization/spark/install.md f3a653133 [Kent Yao] Update docs/security/authorization/spark/build.md 963cab372 [yikaifei] bundle 2068c98fc [yikaifei] relocation 6c6e50ea7 [yikaifei] Shade spark authz plugin Lead-authored-by: yikaifei <yikaifei@apache.org> Co-authored-by: Kent Yao <yao@apache.org> Signed-off-by: yikaifei <yikaifei@apache.org>
6.6 KiB
Building Kyuubi Spark AuthZ Plugin
Build with Apache Maven
Kyuubi Spark AuthZ Plugin is built using Apache Maven.
To build it, cd to the root direct of kyuubi project and run:
build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DskipTests
After a while, if everything goes well, you will get the plugin finally in two parts:
- The main plugin jar, which is under
./extensions/spark/kyuubi-spark-authz/target/kyuubi-spark-authz_${scala.binary.version}-${project.version}.jar - The least transitive dependencies needed, which are under
./extensions/spark/kyuubi-spark-authz/target/scala-${scala.binary.version}/jars
Build shaded jar with Apache Maven
Apache Kyuubi also provides the shaded jar for the Spark AuthZ plugin, You can run the AuthZ plugin using just a shaded jar without the additional dependency of jars,
To build it, cd to the root direct of kyuubi project and run:
build/mvn clean package -pl :kyuubi-spark-authz-shaded_2.12 -DskipTests -am
After a while, if everything goes well, you will get the plugin finally:
- The shaded AuthZ plugin jar, which is under
./extensions/spark/kyuubi-spark-authz-shaded/target/kyuubi-spark-authz-shaded_${scala.binary.version}-${project.version}.jar
Build against Different Apache Spark Versions
The maven option spark.version is used for specifying Spark version to compile with and generate corresponding transitive dependencies.
By default, it is always built with the latest spark.version defined in kyuubi project main pom file.
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.
For example,
build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DskipTests -Dspark.version=3.0.2
The available spark.versions are shown in the following table.
| Spark Version | Supported | Remark |
|---|---|---|
| master | √ | - |
| 3.3.x | √ | - |
| 3.2.x | √ | - |
| 3.1.x | √ | - |
| 3.0.x | x | EOL since v1.9.0 |
| 2.4.x and earlier | × | PR 2367 is used to track how we work with older releases with scala 2.11 |
Currently, Spark released with Scala 2.12 are supported.
Build against Different Apache Ranger Versions
The maven option ranger.version is used for specifying Ranger version to compile with and generate corresponding transitive dependencies.
By default, it is always built with the latest ranger.version defined in kyuubi project main pom file.
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.
build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DskipTests -Dranger.version=0.7.0
The available ranger.versions are shown in the following table.
| Ranger Version | Supported | Remark |
|---|---|---|
| 2.4.x | √ | - |
| 2.3.x | √ | - |
| 2.2.x | √ | - |
| 2.1.x | √ | - |
| 2.0.x | √ | - |
| 1.2.x | √ | - |
| 1.1.x | √ | - |
| 1.0.x | √ | - |
| 0.7.x | √ | - |
| 0.6.x | X | KYUUBI-4672 reported unresolved failures. |
Currently, all ranger releases are supported.
Test with ScalaTest Maven plugin
If you omit -DskipTests option in the command above, you will also get all unit tests run.
build/mvn clean package -pl :kyuubi-spark-authz_2.12
If any bug occurs and you want to debug the plugin yourself, you can configure -DdebugForkedProcess=true and -DdebuggerPort=5005(optional).
build/mvn clean package -pl :kyuubi-spark-authz_2.12 -DdebugForkedProcess=true
The tests will suspend at startup and wait for a remote debugger to attach to the configured port.
We will appreciate if you can share the bug or the fix to the Kyuubi community.