-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-11454. Ranger integration for Docker Compose environment #8575
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
Merged
+192
−2
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5d53489
HDDS-11454. Ranger integration for Docker dev environment
adoroszlai 4dee960
replace sed with perl for portability
adoroszlai 6db2e0e
make scripts executable
adoroszlai 3eb78bb
Merge remote-tracking branch 'origin/master' into HDDS-11454
adoroszlai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # 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. | ||
|
|
||
| # Apache Ranger | ||
| # | ||
| # This requires Apache Ranger source to be available in $RANGER_SOURCE_DIR. | ||
|
|
||
| services: | ||
| ranger-db: | ||
| image: ${RANGER_DB_IMAGE}:${RANGER_DB_IMAGE_VERSION} | ||
| hostname: ranger-db | ||
| dns_search: . | ||
| environment: | ||
| POSTGRES_PASSWORD: "rangerR0cks!" | ||
| volumes: | ||
| - ${RANGER_SOURCE_DIR}/dev-support/ranger-docker/config/init_postgres.sh:/docker-entrypoint-initdb.d/init_postgres.sh | ||
| healthcheck: | ||
| test: 'su -c "pg_isready -q" postgres' | ||
| interval: 10s | ||
| timeout: 2s | ||
| retries: 30 | ||
|
|
||
| ranger: | ||
| image: ${RANGER_IMAGE}:${RANGER_IMAGE_VERSION} | ||
| hostname: ranger | ||
| dns_search: . | ||
| ports: | ||
| - 6080:6080 | ||
| depends_on: | ||
| ranger-db: | ||
| condition: service_healthy | ||
| environment: | ||
| RANGER_DB_TYPE: postgres | ||
| RANGER_VERSION: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
hadoop-ozone/dist/src/main/compose/ozonesecure-ha/ranger.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # 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. | ||
|
|
||
| x-om-ranger-config: | ||
| &om-ranger-config | ||
| environment: | ||
| OZONE_MANAGER_CLASSPATH: "/opt/ranger/ozone-plugin/lib/libext/*:/opt/ozone/conf" | ||
| OZONE-SITE.XML_ozone.acl.authorizer.class: "org.apache.ranger.authorization.ozone.authorizer.RangerOzoneAuthorizer" | ||
| OZONE-SITE.XML_ozone.om.multitenancy.enabled: "true" | ||
| OZONE-SITE.XML_ozone.om.ranger.https-address: "http://ranger:6080" | ||
| OZONE-SITE.XML_ozone.om.ranger.https.admin.api.user: "admin" | ||
| OZONE-SITE.XML_ozone.om.ranger.https.admin.api.passwd: "rangerR0cks!" | ||
| OZONE-SITE.XML_ozone.om.ranger.service: "dev_ozone" | ||
| OZONE-SITE.XML_ozone.om.tenant.dev.skip.ranger: "false" | ||
| RANGER-OZONE-SECURITY.XML_ranger.plugin.ozone.policy.rest.url: "http://ranger:6080" | ||
| RANGER-OZONE-SECURITY.XML_ranger.plugin.ozone.policyengine.option.disable.policy.refresher: "true" | ||
| RANGER-OZONE-SECURITY.XML_ranger.plugin.ozone.service.name: "dev_ozone" | ||
| volumes: | ||
| - ../..:/opt/hadoop | ||
| - ../_keytabs:/etc/security/keytabs | ||
| - ./krb5.conf:/etc/krb5.conf | ||
| - ${RANGER_OZONE_PLUGIN_DIR}:/opt/ranger/ozone-plugin | ||
| tmpfs: | ||
| - /opt/ozone/conf | ||
| command: bash -c "sudo --preserve-env /opt/ranger/ozone-plugin/enable-ozone-plugin.sh && /opt/hadoop/bin/ozone om" | ||
|
|
||
| services: | ||
| om1: | ||
| <<: *om-ranger-config | ||
| om2: | ||
| <<: *om-ranger-config | ||
| om3: | ||
| <<: *om-ranger-config | ||
| ranger: | ||
| networks: | ||
| ozone_net: | ||
| ipv4_address: 172.25.0.200 | ||
| ranger-db: | ||
| networks: | ||
| ozone_net: | ||
| ipv4_address: 172.25.0.201 |
59 changes: 59 additions & 0 deletions
59
hadoop-ozone/dist/src/main/compose/ozonesecure-ha/test-ranger.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/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 | ||
|
|
||
| COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
| export COMPOSE_DIR | ||
|
|
||
| : "${RANGER_VERSION:=2.6.0}" | ||
| : "${DOWNLOAD_DIR:=${TEMP_DIR:-/tmp}}" | ||
|
|
||
| # shellcheck source=/dev/null | ||
| source "$COMPOSE_DIR/../testlib.sh" | ||
|
|
||
| export COMPOSE_FILE=docker-compose.yaml:ranger.yaml:../common/ranger.yaml | ||
| export OM_SERVICE_ID="omservice" | ||
| export SCM=scm1.org | ||
| export SECURITY_ENABLED=true | ||
|
|
||
| curl -LO https://downloads.apache.org/ranger/KEYS | ||
| gpg --import KEYS | ||
|
|
||
| download_and_verify_apache_release "ranger/${RANGER_VERSION}/apache-ranger-${RANGER_VERSION}.tar.gz" | ||
| tar -C "${DOWNLOAD_DIR}" -x -z -f "${DOWNLOAD_DIR}/apache-ranger-${RANGER_VERSION}.tar.gz" | ||
| export RANGER_SOURCE_DIR="${DOWNLOAD_DIR}/apache-ranger-${RANGER_VERSION}" | ||
| chmod -R a+rX "${RANGER_SOURCE_DIR}" | ||
| chmod a+x "${RANGER_SOURCE_DIR}"/dev-support/ranger-docker/config/*.sh | ||
|
|
||
| download_and_verify_apache_release "ranger/${RANGER_VERSION}/plugins/ozone/ranger-${RANGER_VERSION}-ozone-plugin.tar.gz" | ||
| tar -C "${DOWNLOAD_DIR}" -x -z -f "${DOWNLOAD_DIR}/ranger-${RANGER_VERSION}-ozone-plugin.tar.gz" | ||
| export RANGER_OZONE_PLUGIN_DIR="${DOWNLOAD_DIR}/ranger-${RANGER_VERSION}-ozone-plugin" | ||
| chmod -R a+rX "${RANGER_OZONE_PLUGIN_DIR}" | ||
| chmod a+x "${RANGER_OZONE_PLUGIN_DIR}"/*.sh | ||
|
|
||
| # customizations before install | ||
| perl -wpl -i \ | ||
| -e 's@^POLICY_MGR_URL=.*@POLICY_MGR_URL=http://ranger:6080@;' \ | ||
| -e 's@^REPOSITORY_NAME=.*@REPOSITORY_NAME=dev_ozone@;' \ | ||
| -e 's@^CUSTOM_USER=ozone@CUSTOM_USER=hadoop@;' \ | ||
| "${RANGER_OZONE_PLUGIN_DIR}/install.properties" | ||
|
|
||
| start_docker_env | ||
| wait_for_port ranger 6080 120 | ||
|
|
||
| # execute_robot_test scm security/ozone-secure-tenant.robot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm assuming
ranger-solrandranger-zkare not required for integration tests,Solris the default audit destination forRanger. Functionally the tests would pass but with no audit destination configured, audit related errors will be seen in ranger logs.