-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-11454. Ozone Ranger Integration in docker #8037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kumaab for the patch.
Unfortunately CI requires amd64 images.
dependency failed to start: container ranger-postgres exited (255)
exec /usr/local/bin/docker-entrypoint.sh: exec format error
We can still commit it with the test disabled.
hadoop-ozone/dist/src/main/compose/ozone/docker-compose.ranger.yaml
Outdated
Show resolved
Hide resolved
hadoop-ozone/dist/src/main/compose/ozone/ranger-plugin-setup.sh
Outdated
Show resolved
Hide resolved
hadoop-ozone/dist/src/main/compose/ozone/ranger-plugin-setup.sh
Outdated
Show resolved
Hide resolved
| OZONE_RUNNER_VERSION=${docker.ozone-runner.version} | ||
| OZONE_RUNNER_IMAGE=apache/ozone-runner | ||
| OZONE_OPTS= | ||
| RANGER_VERSION=2.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this to use the property ranger.version in HDDS-12461.
|
It looks to me It looks to be interpreting some variables in $ pwd
/Users/smeng/repo/ozone-pr/hadoop-ozone/dist/target/ozone-2.0.0-SNAPSHOT
$ rg "/Users/smeng/repo/ozone-pr/hadoop-ozone/dist"
compose/ozone/ranger-plugin/enable-ozone-plugin.sh
24: if [ -f "/Users/smeng/repo/ozone-pr/hadoop-ozone/dist/pom.xml" ]
26: propertyValue=`grep "^${propertyName}[ \t]*=" /Users/smeng/repo/ozone-pr/hadoop-ozone/dist/pom.xml | awk -F= '{ sub("^[ \t]*", "", $2); sub("[ \t]*$", "", $2); print $2 }'`
64:if [ "/Users/smeng/repo/ozone-pr/hadoop-ozone/dist" = "." ]
67:elif [ "/Users/smeng/repo/ozone-pr/hadoop-ozone/dist" = ".." ]
113:PROJ_INSTALL_DIR=`(cd /Users/smeng/repo/ozone-pr/hadoop-ozone/dist ; pwd)`(This causes the OM initial Ranger plugin setup upon startup to fail. Which causes NPE in Take line 24 for example, in the source code it should be: if [ -f "${file}" ]My question: Why would this bash script file even be changed during My steps for verification:
./ranger-plugin-setup.sh
docker compose -f docker-compose.yaml -f docker-compose.ranger.yaml up -d
|
Nice catch @smengcl. This is intentional, but sometimes surprising. We use ozone/hadoop-ozone/dist/pom.xml Lines 154 to 172 in e805c15
BTW, some of these files look like are copied from Ranger as is. In the long run we should get them from Ranger, instead of duplicating them in Ozone. That would also avoid this problem. |
|
Thanks @smengcl and @adoroszlai for the above analysis. |
Thanks @adoroszlai for confirming my suspicion. It is indeed unfortunate that ref: https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html Another possible workaround would be to specifically exclude this file from diff --git i/hadoop-ozone/dist/pom.xml w/hadoop-ozone/dist/pom.xml
index d02d5f8d48..a06f4441b3 100644
--- i/hadoop-ozone/dist/pom.xml
+++ w/hadoop-ozone/dist/pom.xml
@@ -165,8 +165,18 @@
<resources>
<resource>
<directory>src/main/compose</directory>
+ <excludes>
+ <exclude>ozone/ranger-plugin/enable-ozone-plugin.sh</exclude>
+ </excludes>
<filtering>true</filtering>
</resource>
+ <resource>
+ <directory>src/main/compose</directory>
+ <includes>
+ <include>ozone/ranger-plugin/enable-ozone-plugin.sh</include>
+ </includes>
+ <filtering>false</filtering>
+ </resource>
</resources>
</configuration>
</execution>I saw other folks doing this as well, e.g. : |
|
Good point @smengcl, probably better to add exclusion for all files coming from Ranger. This will make it easier to update them later e.g. from Ranger 2.7 or 3.0. (Until we use it from Ranger directly.) |
What changes were proposed in this pull request?
compose/ozonesubpath. (Support incompose/ozonesecureto follow soon)org.apache.ranger.authorization.ozone.authorizer.RangerOzoneAuthorizerWhat is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11454
How was this patch tested?
In docker containers on local machine with published binaries for ozone using version 1.4.1 and ranger version 2.6.0
The changes in the PR were copied over to
ozone-1.4.1/compose/ozone/and the following commands were run:The following were verified:
ozone-om-1container, plugin installation is skipped!etc/ranger/dev_ozone/policycachehadoopandomuser, attaching audits seen in Ranger UI:ozone-om-1container../test-ranger.shpasses with exit code 0.