From 8a8577bfa343d054ae4a1edc293913245b573d36 Mon Sep 17 00:00:00 2001 From: yuqi Date: Mon, 10 Mar 2025 11:53:45 +0800 Subject: [PATCH 01/13] Update docker Hive CI image. --- build.gradle.kts | 2 +- docs/docker-image-details.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c0d27f38eec..a9254fe8681 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -174,7 +174,7 @@ allprojects { param.environment("PROJECT_VERSION", project.version) // Gravitino CI Docker image - param.environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:hive-0.1.17") + param.environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:hive-0.1.18") param.environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:kerberos-hive-0.1.5") param.environment("GRAVITINO_CI_DORIS_DOCKER_IMAGE", "apache/gravitino-ci:doris-0.1.5") param.environment("GRAVITINO_CI_TRINO_DOCKER_IMAGE", "apache/gravitino-ci:trino-0.1.6") diff --git a/docs/docker-image-details.md b/docs/docker-image-details.md index a137923a694..f1a6f36da28 100644 --- a/docs/docker-image-details.md +++ b/docs/docker-image-details.md @@ -185,6 +185,10 @@ You can use this kind of image to test the catalog of Apache Hive. Changelog + +- apache/gravitino-ci:hive-0.1.18 + - Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore. for more information, please see [PR](https://github.com/apache/gravitino/pull/6625) + - apache/gravitino-ci:hive-0.1.17 - Add support for JDBC SQL standard authorization - Add JDBC SQL standard authorization related configuration in the `hive-site-for-sql-base-auth.xml` and `hiveserver2-site-for-sql-base-auth.xml` From 445bc7c71e79867f328ddb867abec88c14667850 Mon Sep 17 00:00:00 2001 From: yuqi Date: Mon, 10 Mar 2025 18:01:49 +0800 Subject: [PATCH 02/13] Resolve --- docs/docker-image-details.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker-image-details.md b/docs/docker-image-details.md index f1a6f36da28..a180d02779e 100644 --- a/docs/docker-image-details.md +++ b/docs/docker-image-details.md @@ -187,7 +187,7 @@ Changelog - apache/gravitino-ci:hive-0.1.18 - - Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore. for more information, please see [PR](https://github.com/apache/gravitino/pull/6625) + - Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore. For more information, please see [PR](https://github.com/apache/gravitino/pull/6625) - apache/gravitino-ci:hive-0.1.17 - Add support for JDBC SQL standard authorization From 17f68d01bd0396323f829325551521aba7dbb8af Mon Sep 17 00:00:00 2001 From: yuqi Date: Tue, 11 Mar 2025 18:02:18 +0800 Subject: [PATCH 03/13] fix --- .github/workflows/docker-image.yml | 7 +++++++ dev/docker/hive/hive-dependency.sh | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 31fb940740b..03bd77946c2 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,6 +32,11 @@ on: description: 'Publish Docker token' required: true type: string + pat: + description: 'GitHub private access token' + required: true + type: string + publish-latest-tag: description: 'Whether to update the latest tag. This operation is only applicable to official releases and should not be used for Release Candidate (RC).' required: false @@ -132,6 +137,8 @@ jobs: full_tag_name="${{ github.event.inputs.version }}" fi + export PRIVATE_ACCESS_TOKEN=${{ github.event.inputs.pat }} + if [[ "${publish_latest}" == "true" ]]; then echo "Publish tag ${full_tag_name}, and update latest too." ./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${full_tag_name} --latest diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index e93361c3c9f..a4aa865b8c5 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -88,12 +88,14 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then curl -L -s -o "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ${ZOOKEEPER_DOWNLOAD_URL} fi +echo "Download Ranger plugin packages, ${PRIVATE_ACCESS_TOKEN:0:20}" + if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then - curl -L -s -o "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ${RANGER_HDFS_DOWNLOAD_URL} + curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ${RANGER_HDFS_DOWNLOAD_URL} fi if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then - curl -L -s -o "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ${RANGER_HIVE_DOWNLOAD_URL} + curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ${RANGER_HIVE_DOWNLOAD_URL} fi if [ ! -f "${hive_dir}/packages/${HADOOP2_GCS_PACKAGE_NAME}" ]; then From b032aa69b1ff8d577129b4cc114ce5922b1c0179 Mon Sep 17 00:00:00 2001 From: yuqi Date: Tue, 11 Mar 2025 18:08:12 +0800 Subject: [PATCH 04/13] fix --- dev/docker/hive/hive-dependency.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index a4aa865b8c5..b0860454b95 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -54,10 +54,10 @@ ZOOKEEPER_PACKAGE_NAME="zookeeper-${ZOOKEEPER_VERSION}.tar.gz" ZOOKEEPER_DOWNLOAD_URL="https://archive.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/${ZOOKEEPER_PACKAGE_NAME}" RANGER_HIVE_PACKAGE_NAME="ranger-${RANGER_VERSION}-hive-plugin.tar.gz" -RANGER_HIVE_DOWNLOAD_URL=https://github.com/datastrato/apache-ranger/releases/download/release-ranger-${RANGER_VERSION}/ranger-${RANGER_VERSION}-hive-plugin.tar.gz +RANGER_HIVE_DOWNLOAD_URL=https://github.com/datastrato/ranger/releases/download/v${RANGER_VERSION}/ranger-${RANGER_VERSION}-hive-plugin.tar.gz RANGER_HDFS_PACKAGE_NAME="ranger-${RANGER_VERSION}-hdfs-plugin.tar.gz" -RANGER_HDFS_DOWNLOAD_URL=https://github.com/datastrato/apache-ranger/releases/download/release-ranger-${RANGER_VERSION}/ranger-${RANGER_VERSION}-hdfs-plugin.tar.gz +RANGER_HDFS_DOWNLOAD_URL=https://github.com/datastrato/ranger/releases/download/v${RANGER_VERSION}/ranger-${RANGER_VERSION}-hdfs-plugin.tar.gz # Prepare download packages if [[ ! -d "${hive_dir}/packages" ]]; then @@ -94,10 +94,22 @@ if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ${RANGER_HDFS_DOWNLOAD_URL} fi +if [[ $? -ne 0 ]]; then + echo "Failed to download Ranger HDFS plugin package" + exit 1 +fi + + if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ${RANGER_HIVE_DOWNLOAD_URL} fi +if [[ $? -ne 0 ]]; then + echo "Failed to download Ranger Hive plugin package" + exit 1 +fi + + if [ ! -f "${hive_dir}/packages/${HADOOP2_GCS_PACKAGE_NAME}" ]; then curl -L -s -o "${hive_dir}/packages/${HADOOP2_GCS_PACKAGE_NAME}" ${HADOOP2_GCS_DOWNLOAD_URL} fi From 32adfe7b9438ffee2f6bbdaac11d9d222672bfb0 Mon Sep 17 00:00:00 2001 From: yuqi Date: Tue, 11 Mar 2025 19:34:36 +0800 Subject: [PATCH 05/13] fix --- dev/docker/hive/hive-dependency.sh | 4 ---- docs/docker-image-details.md | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index b0860454b95..04d66b7fa81 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -88,8 +88,6 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then curl -L -s -o "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ${ZOOKEEPER_DOWNLOAD_URL} fi -echo "Download Ranger plugin packages, ${PRIVATE_ACCESS_TOKEN:0:20}" - if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ${RANGER_HDFS_DOWNLOAD_URL} fi @@ -99,7 +97,6 @@ if [[ $? -ne 0 ]]; then exit 1 fi - if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ${RANGER_HIVE_DOWNLOAD_URL} fi @@ -109,7 +106,6 @@ if [[ $? -ne 0 ]]; then exit 1 fi - if [ ! -f "${hive_dir}/packages/${HADOOP2_GCS_PACKAGE_NAME}" ]; then curl -L -s -o "${hive_dir}/packages/${HADOOP2_GCS_PACKAGE_NAME}" ${HADOOP2_GCS_DOWNLOAD_URL} fi diff --git a/docs/docker-image-details.md b/docs/docker-image-details.md index a180d02779e..6493e9e4ce1 100644 --- a/docs/docker-image-details.md +++ b/docs/docker-image-details.md @@ -188,6 +188,7 @@ Changelog - apache/gravitino-ci:hive-0.1.18 - Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore. For more information, please see [PR](https://github.com/apache/gravitino/pull/6625) + - Change ranger-hive-plugin and ranger-hdfs-plugin download URL. - apache/gravitino-ci:hive-0.1.17 - Add support for JDBC SQL standard authorization From b134f9504e26fc5951eb75a2519d70fa4daf1390 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 08:25:39 +0800 Subject: [PATCH 06/13] fix --- dev/docker/hive/download-release.sh | 56 +++++++++++++++++++++++++++++ dev/docker/hive/hive-dependency.sh | 4 +-- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100755 dev/docker/hive/download-release.sh diff --git a/dev/docker/hive/download-release.sh b/dev/docker/hive/download-release.sh new file mode 100755 index 00000000000..de49dff3ada --- /dev/null +++ b/dev/docker/hive/download-release.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# +# gh-dl-release! It works! +# +# This script downloads an asset from latest or specific Github release of a +# private repo. Feel free to extract more of the variables into command line +# parameters. +# +# PREREQUISITES +# +# curl, wget, jq +# +# USAGE +# +# Set all the variables inside the script, make sure you chmod +x it, then +# to download specific version to my_app.tar.gz: +# +# gh-dl-release 2.1.1 my_app.tar.gz +# +# to download latest version: +# +# gh-dl-release latest latest.tar.gz +# +# If your version/tag doesn't match, the script will exit with error. +set -ex + +TOKEN=${PRIVATE_ACCESS_TOKEN} +REPO="datastrato/ranger" +FILE=$2 #"ranger-2.4.0-admin.tar.gz" # the name of your release asset file, e.g. build.tar.gz +VERSION=$1 # tag name or the word "latest" +GITHUB="https://api.github.com" + +alias errcho='>&2 echo' + +function gh_curl() { + curl -H "Authorization: token $TOKEN" \ + -H "Accept: application/vnd.github.v3.raw" \ + $@ +} + +if [ "$VERSION" = "latest" ]; then + # Github should return the latest release first. + parser=".[0].assets | map(select(.name == \"$FILE\"))[0].id" +else + parser=". | map(select(.tag_name == \"$VERSION\"))[0].assets | map(select(.name == \"$FILE\"))[0].id" +fi; + +asset_id=`gh_curl -s $GITHUB/repos/$REPO/releases | jq "$parser"` +if [ "$asset_id" = "null" ]; then + errcho "ERROR: version not found $VERSION" + exit 1 +fi; + +echo $2 + +curl -sL --header "Authorization: token $TOKEN" --header 'Accept: application/octet-stream' https://$TOKEN:@api.github.com/repos/$REPO/releases/assets/$asset_id -o $2 diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index 04d66b7fa81..f202a825d5c 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -89,7 +89,7 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then - curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ${RANGER_HDFS_DOWNLOAD_URL} + bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} fi if [[ $? -ne 0 ]]; then @@ -98,7 +98,7 @@ if [[ $? -ne 0 ]]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then - curl -H "Authorization: token ${PRIVATE_ACCESS_TOKEN}" -L -s -o "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ${RANGER_HIVE_DOWNLOAD_URL} + bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} fi if [[ $? -ne 0 ]]; then From c644e0561bccef17574b2dbb39e9c96110794dd1 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 08:42:01 +0800 Subject: [PATCH 07/13] fix --- dev/docker/hive/download-release.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dev/docker/hive/download-release.sh b/dev/docker/hive/download-release.sh index de49dff3ada..15c09ae2bdc 100755 --- a/dev/docker/hive/download-release.sh +++ b/dev/docker/hive/download-release.sh @@ -1,4 +1,20 @@ #!/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. + # # gh-dl-release! It works! # From 4d1641b14ad4636f725d183059e3ee4c4302b89f Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 09:04:22 +0800 Subject: [PATCH 08/13] fix --- dev/docker/hive/hive-dependency.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index f202a825d5c..2ee2b9fa62c 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -89,7 +89,7 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then - bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} + bash ${hive_dir}/hive/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} fi if [[ $? -ne 0 ]]; then @@ -98,7 +98,7 @@ if [[ $? -ne 0 ]]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then - bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} + bash ${hive_dir}/hive/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} fi if [[ $? -ne 0 ]]; then From f63b6ba93fc89f43ffef6df188d8cdaf797fea02 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 09:11:11 +0800 Subject: [PATCH 09/13] fix --- dev/docker/hive/hive-dependency.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index 2ee2b9fa62c..f202a825d5c 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -89,7 +89,7 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then - bash ${hive_dir}/hive/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} + bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} fi if [[ $? -ne 0 ]]; then @@ -98,7 +98,7 @@ if [[ $? -ne 0 ]]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then - bash ${hive_dir}/hive/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} + bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} fi if [[ $? -ne 0 ]]; then From b05b8cd657c5c263845a9f4794dadd7477987690 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 09:28:32 +0800 Subject: [PATCH 10/13] fix --- dev/docker/hive/download-release.sh | 2 +- dev/docker/hive/hive-dependency.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/docker/hive/download-release.sh b/dev/docker/hive/download-release.sh index 15c09ae2bdc..dacbc64d59c 100755 --- a/dev/docker/hive/download-release.sh +++ b/dev/docker/hive/download-release.sh @@ -69,4 +69,4 @@ fi; echo $2 -curl -sL --header "Authorization: token $TOKEN" --header 'Accept: application/octet-stream' https://$TOKEN:@api.github.com/repos/$REPO/releases/assets/$asset_id -o $2 +curl -sL --header "Authorization: token $TOKEN" --header 'Accept: application/octet-stream' https://$TOKEN:@api.github.com/repos/$REPO/releases/assets/$asset_id -o $3 diff --git a/dev/docker/hive/hive-dependency.sh b/dev/docker/hive/hive-dependency.sh index f202a825d5c..ff138c51712 100755 --- a/dev/docker/hive/hive-dependency.sh +++ b/dev/docker/hive/hive-dependency.sh @@ -89,7 +89,7 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then - bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} + bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" fi if [[ $? -ne 0 ]]; then @@ -98,7 +98,7 @@ if [[ $? -ne 0 ]]; then fi if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then - bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} + bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" fi if [[ $? -ne 0 ]]; then From fffeca043ee447050e0c93f0278d48b544a4f832 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 10:48:16 +0800 Subject: [PATCH 11/13] resolve the comments --- dev/docker/hive/download-release.sh | 35 +++++++++-------------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/dev/docker/hive/download-release.sh b/dev/docker/hive/download-release.sh index dacbc64d59c..05889f90cf1 100755 --- a/dev/docker/hive/download-release.sh +++ b/dev/docker/hive/download-release.sh @@ -15,34 +15,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -# gh-dl-release! It works! -# -# This script downloads an asset from latest or specific Github release of a -# private repo. Feel free to extract more of the variables into command line -# parameters. -# -# PREREQUISITES -# -# curl, wget, jq -# -# USAGE -# -# Set all the variables inside the script, make sure you chmod +x it, then -# to download specific version to my_app.tar.gz: -# -# gh-dl-release 2.1.1 my_app.tar.gz -# -# to download latest version: -# -# gh-dl-release latest latest.tar.gz -# -# If your version/tag doesn't match, the script will exit with error. +# The first parameter is the version of the release, e.g. 2.4.0 +# The second parameter is the name of the asset file, e.g. ranger-2.4.0-admin.tar.gz +# The third parameter is the location and name of the output file, e.g. /tmp/ranger-2.4.0-admin.tar.gz + set -ex +if [ $# -ne 3 ]; then + echo "Usage: $0 " + exit 1 +fi + + TOKEN=${PRIVATE_ACCESS_TOKEN} REPO="datastrato/ranger" -FILE=$2 #"ranger-2.4.0-admin.tar.gz" # the name of your release asset file, e.g. build.tar.gz +FILE=$2 # the name of your release asset file, e.g. build.tar.gz VERSION=$1 # tag name or the word "latest" GITHUB="https://api.github.com" From 3e8b55206ef20b004448de560ffdffb72f8ea8e6 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 10:51:25 +0800 Subject: [PATCH 12/13] resolve the comments again --- docs/docker-image-details.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/docker-image-details.md b/docs/docker-image-details.md index 6493e9e4ce1..6540b87365c 100644 --- a/docs/docker-image-details.md +++ b/docs/docker-image-details.md @@ -187,7 +187,8 @@ Changelog - apache/gravitino-ci:hive-0.1.18 - - Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore. For more information, please see [PR](https://github.com/apache/gravitino/pull/6625) + - Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore. + For more information, please see [PR](https://github.com/apache/gravitino/pull/6625) - Change ranger-hive-plugin and ranger-hdfs-plugin download URL. - apache/gravitino-ci:hive-0.1.17 From 53c0f97eebb792865d6fa93d0516b89199be2e89 Mon Sep 17 00:00:00 2001 From: yuqi Date: Wed, 12 Mar 2025 15:08:21 +0800 Subject: [PATCH 13/13] Change the alias name. --- dev/docker/hive/download-release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/docker/hive/download-release.sh b/dev/docker/hive/download-release.sh index 05889f90cf1..bf03d3c35b1 100755 --- a/dev/docker/hive/download-release.sh +++ b/dev/docker/hive/download-release.sh @@ -33,7 +33,7 @@ FILE=$2 # the name of your release asset file, e.g. bui VERSION=$1 # tag name or the word "latest" GITHUB="https://api.github.com" -alias errcho='>&2 echo' +alias err_echo='>&2 echo' function gh_curl() { curl -H "Authorization: token $TOKEN" \ @@ -50,7 +50,7 @@ fi; asset_id=`gh_curl -s $GITHUB/repos/$REPO/releases | jq "$parser"` if [ "$asset_id" = "null" ]; then - errcho "ERROR: version not found $VERSION" + err_echo "ERROR: version not found $VERSION" exit 1 fi;