You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2025/03/10 07:18:19 UTC
Re: [PR] HDDS-11454. Ozone Ranger Integration in docker [ozone]
adoroszlai commented on code in PR #8037:
URL: https://github.com/apache/ozone/pull/8037#discussion_r1986706627
##########
hadoop-ozone/dist/src/main/compose/ozone/ranger-plugin-setup.sh:
##########
@@ -0,0 +1,51 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source .env
+
+downloadIfNotPresent() {
+ local fileName=$1
+ local urlBase=$2
+
+ if [ ! -f "./../../share/${fileName}" ]
+ then
+ echo "downloading ${urlBase}/${fileName}.."
+
+ curl -L ${urlBase}/${fileName} --output ./../../share/${fileName}
Review Comment:
To handle URL with `?`:
```suggestion
curl -L "${urlBase}/${fileName}" --output ./../../share/${fileName}
```
##########
hadoop-ozone/dist/src/main/compose/ozone/docker-compose.ranger.yaml:
##########
@@ -0,0 +1,92 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+services:
+ om:
+ volumes:
+ - ../..:/opt/hadoop
+ - ./../../share/ranger-${RANGER_VERSION}-ozone-plugin:/opt/hadoop/ranger-ozone-plugin
+ env_file:
+ - docker-config
+ - ranger-plugin/ranger-config
+ environment:
+ - ENSURE_OM_INITIALIZED=/data/metadata/om/current/VERSION
+ - OZONE-SITE.XML_ozone.server.default.replication=${OZONE_REPLICATION_FACTOR:-1}
+ - OZONE_MANAGER_CLASSPATH=/opt/hadoop/ranger-ozone-plugin/lib/libext/*:/opt/hadoop/ranger-ozone-plugin/conf
+ networks:
+ - ozone
+ command: bash -c "/opt/hadoop/ranger-ozone-plugin/ranger-plugin-install.sh && /opt/hadoop/bin/ozone om"
+ ranger:
+ image: apache/ranger:${RANGER_VERSION}
+ container_name: ranger
+ hostname: ranger.example.com
+ stdin_open: true
+ tty: true
+ networks:
+ - ozone
+ ports:
+ - "6080:6080"
+ depends_on:
+ ranger-zk:
+ condition: service_started
+ ranger-db:
+ condition: service_healthy
+ ranger-solr:
+ condition: service_started
+ environment:
+ - RANGER_VERSION=${RANGER_VERSION}
+ - RANGER_DB_TYPE=postgres
+ - DEBUG_ADMIN=${DEBUG_ADMIN:-false}
+ command:
+ - /home/ranger/scripts/ranger.sh
+
+ ranger-zk:
+ image: apache/ranger-zk:${RANGER_VERSION}
+ container_name: ranger-zk
+ hostname: ranger-zk.example.com
+ networks:
+ - ozone
+ ports:
+ - "2181:2181"
+
+ ranger-solr:
+ image: apache/ranger-solr:${RANGER_VERSION}
+ container_name: ranger-solr
+ hostname: ranger-solr.example.com
+ networks:
+ - ozone
+ ports:
+ - "8983:8983"
+ command:
+ - solr-precreate
+ - ranger_audits
+ - /opt/solr/server/solr/configsets/ranger_audits/
+
+ ranger-db:
+ image: apache/ranger-db:${RANGER_VERSION}
+ container_name: ranger-postgres
+ hostname: ranger-db.example.com
+ networks:
+ - ozone
+ healthcheck:
+ test: 'su -c "pg_isready -q" postgres'
+ interval: 10s
+ timeout: 2s
+ retries: 30
+
+networks:
+ ozone:
+ name: ozone_nw
Review Comment:
Referencing this network in `docker-compose.yaml` when not running with `docker-compose.ranger.yaml` causes the following error:
```
service "om" refers to undefined network ozone: invalid compose project
```
https://github.com/apache/ozone/actions/runs/13756531509/job/38465186827?pr=8037#step:7:23
Most existing compose files rely on the default network, so I think this should be removed.
##########
hadoop-ozone/dist/src/main/compose/ozone/ranger-plugin-setup.sh:
##########
@@ -0,0 +1,51 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source .env
+
+downloadIfNotPresent() {
+ local fileName=$1
+ local urlBase=$2
+
+ if [ ! -f "./../../share/${fileName}" ]
+ then
+ echo "downloading ${urlBase}/${fileName}.."
+
+ curl -L ${urlBase}/${fileName} --output ./../../share/${fileName}
+ else
+ echo "file already in cache: ${fileName}"
+ fi
+}
+
+downloadIfNotPresent ranger-${RANGER_VERSION}-ozone-plugin.tar.gz https://dist.apache.org/repos/dist/release/ranger/${RANGER_VERSION}/plugins/ozone
Review Comment:
We should use mirrors where possible:
```suggestion
downloadIfNotPresent ranger-${RANGER_VERSION}-ozone-plugin.tar.gz "https://www.apache.org/dyn/closer.lua?action=download&filename=ranger/${RANGER_VERSION}/plugins/ozone"
```
##########
hadoop-ozone/dist/src/main/compose/ozone/test-ranger.sh:
##########
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#suite:misc
Review Comment:
Adding the script to the `failing` suite makes CI skip it. This way we can commit the patch before amd64 images are available, and let developers using Mac try it locally.
```suggestion
#suite:failing
```
Alternatively we can rename the script to `disabled-test-ranger.sh`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org