Skip to content

Commit

Permalink
RANGER-3801: update docker download-archives.sh to download all by de…
Browse files Browse the repository at this point in the history
…fault

* Download all archives when no arg is passed
* Update README.md
  • Loading branch information
kumaab authored Oct 6, 2024
1 parent a4f8cfb commit 28c61f5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
6 changes: 6 additions & 0 deletions dev-support/ranger-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ docker-compose -f docker-compose.ranger.yml -f docker-compose.ranger-${RANGER_DB
~~~
Similarly, check the `depends` section of the `docker-compose.ranger-service.yaml` file and add docker-compose files for these services when trying to bring up the `service` container.

#### Bring up all containers
~~~
./scripts/ozone-plugin-docker-setup.sh
docker compose -f docker-compose.ranger-${RANGER_DB_TYPE}.yml -f docker-compose.ranger.yml -f docker-compose.ranger-usersync.yml -f docker-compose.ranger-tagsync.yml -f docker-compose.ranger-kms.yml -f docker-compose.ranger-hadoop.yml -f docker-compose.ranger-hbase.yml -f docker-compose.ranger-kafka.yml -f docker-compose.ranger-hive.yml -f docker-compose.ranger-knox.yml -f docker-compose.ranger-ozone.yml up -d
~~~
#### To rebuild specific images and start containers with the new image:
~~~
docker-compose -f docker-compose.ranger.yml -f docker-compose.ranger-usersync.yml -f docker-compose.ranger-tagsync.yml -f docker-compose.ranger-kms.yml -f docker-compose.ranger-hadoop.yml -f docker-compose.ranger-hbase.yml -f docker-compose.ranger-kafka.yml -f docker-compose.ranger-hive.yml -f docker-compose.ranger-trino.yml -f docker-compose.ranger-knox.yml up -d --no-deps --force-recreate --build <service-1> <service-2>
Expand Down
49 changes: 32 additions & 17 deletions dev-support/ranger-docker/download-archives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,46 @@ downloadIfNotPresent postgresql-42.2.16.jre7.jar "https://search.mave
downloadIfNotPresent mysql-connector-java-8.0.28.jar "https://search.maven.org/remotecontent?filepath=mysql/mysql-connector-java/8.0.28"
downloadIfNotPresent log4jdbc-1.2.jar https://repo1.maven.org/maven2/com/googlecode/log4jdbc/log4jdbc/1.2

for arg in "$@"; do
if [[ $arg == 'hadoop' ]]
then
if [[ $# -eq 0 ]]
then
downloadIfNotPresent hadoop-${HADOOP_VERSION}.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}
elif [[ $arg == 'hbase' ]]
then
downloadIfNotPresent hbase-${HBASE_VERSION}-bin.tar.gz https://archive.apache.org/dist/hbase/${HBASE_VERSION}
elif [[ $arg == 'hive' ]]
then
downloadIfNotPresent apache-hive-${HIVE_VERSION}-bin.tar.gz https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}
downloadIfNotPresent hadoop-${HIVE_HADOOP_VERSION}.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-${HIVE_HADOOP_VERSION}
elif [[ $arg == 'kafka' ]]
then
downloadIfNotPresent kafka_2.12-${KAFKA_VERSION}.tgz https://archive.apache.org/dist/kafka/${KAFKA_VERSION}
elif [[ $arg == 'knox' ]]
then
downloadIfNotPresent knox-${KNOX_VERSION}.tar.gz https://archive.apache.org/dist/knox/${KNOX_VERSION}
elif [[ $arg == 'ozone' ]]
then
downloadIfNotPresent ozone-${OZONE_VERSION}.tar.gz https://archive.apache.org/dist/ozone/${OZONE_VERSION}
if [ ! -d downloads/ozone-${OZONE_VERSION} ]
then
tar xvfz downloads/ozone-${OZONE_VERSION}.tar.gz --directory=downloads/
fi
else
echo "Passed argument $arg is invalid!"
fi
done
else
for arg in "$@"; do
if [[ $arg == 'hadoop' ]]
then
downloadIfNotPresent hadoop-${HADOOP_VERSION}.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}
elif [[ $arg == 'hbase' ]]
then
downloadIfNotPresent hbase-${HBASE_VERSION}-bin.tar.gz https://archive.apache.org/dist/hbase/${HBASE_VERSION}
elif [[ $arg == 'hive' ]]
then
downloadIfNotPresent apache-hive-${HIVE_VERSION}-bin.tar.gz https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}
downloadIfNotPresent hadoop-${HIVE_HADOOP_VERSION}.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-${HIVE_HADOOP_VERSION}
elif [[ $arg == 'kafka' ]]
then
downloadIfNotPresent kafka_2.12-${KAFKA_VERSION}.tgz https://archive.apache.org/dist/kafka/${KAFKA_VERSION}
elif [[ $arg == 'knox' ]]
then
downloadIfNotPresent knox-${KNOX_VERSION}.tar.gz https://archive.apache.org/dist/knox/${KNOX_VERSION}
elif [[ $arg == 'ozone' ]]
then
downloadIfNotPresent ozone-${OZONE_VERSION}.tar.gz https://archive.apache.org/dist/ozone/${OZONE_VERSION}
if [ ! -d downloads/ozone-${OZONE_VERSION} ]
then
tar xvfz downloads/ozone-${OZONE_VERSION}.tar.gz --directory=downloads/
fi
else
echo "Passed argument $arg is invalid!"
fi
done
fi

0 comments on commit 28c61f5

Please sign in to comment.