Skip to content

Commit 92bf69f

Browse files
authored
[#6651] improvement(docker-image): Update docker Hive CI image to 0.1.18 (#6652)
### What changes were proposed in this pull request? - Change the docker Hive CI image from 0.1.17 to 0.1.18 - Add some change log. ### Why are the changes needed? To support more feat. for more please see #6612 Fix: #6651 ### Does this PR introduce _any_ user-facing change? N/A. ### How was this patch tested? Existing UTs
1 parent 5d0f1a7 commit 92bf69f

File tree

5 files changed

+87
-5
lines changed

5 files changed

+87
-5
lines changed

.github/workflows/docker-image.yml

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ on:
3232
description: 'Publish Docker token'
3333
required: true
3434
type: string
35+
pat:
36+
description: 'GitHub private access token'
37+
required: true
38+
type: string
39+
3540
publish-latest-tag:
3641
description: 'Whether to update the latest tag. This operation is only applicable to official releases and should not be used for Release Candidate (RC).'
3742
required: false
@@ -132,6 +137,8 @@ jobs:
132137
full_tag_name="${{ github.event.inputs.version }}"
133138
fi
134139
140+
export PRIVATE_ACCESS_TOKEN=${{ github.event.inputs.pat }}
141+
135142
if [[ "${publish_latest}" == "true" ]]; then
136143
echo "Publish tag ${full_tag_name}, and update latest too."
137144
./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${full_tag_name} --latest

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ allprojects {
174174
param.environment("PROJECT_VERSION", project.version)
175175

176176
// Gravitino CI Docker image
177-
param.environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:hive-0.1.17")
177+
param.environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:hive-0.1.18")
178178
param.environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:kerberos-hive-0.1.5")
179179
param.environment("GRAVITINO_CI_DORIS_DOCKER_IMAGE", "apache/gravitino-ci:doris-0.1.5")
180180
param.environment("GRAVITINO_CI_TRINO_DOCKER_IMAGE", "apache/gravitino-ci:trino-0.1.6")

dev/docker/hive/download-release.sh

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# The first parameter is the version of the release, e.g. 2.4.0
19+
# The second parameter is the name of the asset file, e.g. ranger-2.4.0-admin.tar.gz
20+
# The third parameter is the location and name of the output file, e.g. /tmp/ranger-2.4.0-admin.tar.gz
21+
22+
set -ex
23+
24+
if [ $# -ne 3 ]; then
25+
echo "Usage: $0 <version> <asset-file> <output-file>"
26+
exit 1
27+
fi
28+
29+
30+
TOKEN=${PRIVATE_ACCESS_TOKEN}
31+
REPO="datastrato/ranger"
32+
FILE=$2 # the name of your release asset file, e.g. build.tar.gz
33+
VERSION=$1 # tag name or the word "latest"
34+
GITHUB="https://api.github.com"
35+
36+
alias err_echo='>&2 echo'
37+
38+
function gh_curl() {
39+
curl -H "Authorization: token $TOKEN" \
40+
-H "Accept: application/vnd.github.v3.raw" \
41+
$@
42+
}
43+
44+
if [ "$VERSION" = "latest" ]; then
45+
# Github should return the latest release first.
46+
parser=".[0].assets | map(select(.name == \"$FILE\"))[0].id"
47+
else
48+
parser=". | map(select(.tag_name == \"$VERSION\"))[0].assets | map(select(.name == \"$FILE\"))[0].id"
49+
fi;
50+
51+
asset_id=`gh_curl -s $GITHUB/repos/$REPO/releases | jq "$parser"`
52+
if [ "$asset_id" = "null" ]; then
53+
err_echo "ERROR: version not found $VERSION"
54+
exit 1
55+
fi;
56+
57+
echo $2
58+
59+
curl -sL --header "Authorization: token $TOKEN" --header 'Accept: application/octet-stream' https://$TOKEN:@api.github.com/repos/$REPO/releases/assets/$asset_id -o $3

dev/docker/hive/hive-dependency.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ ZOOKEEPER_PACKAGE_NAME="zookeeper-${ZOOKEEPER_VERSION}.tar.gz"
5454
ZOOKEEPER_DOWNLOAD_URL="https://archive.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/${ZOOKEEPER_PACKAGE_NAME}"
5555

5656
RANGER_HIVE_PACKAGE_NAME="ranger-${RANGER_VERSION}-hive-plugin.tar.gz"
57-
RANGER_HIVE_DOWNLOAD_URL=https://github.com/datastrato/apache-ranger/releases/download/release-ranger-${RANGER_VERSION}/ranger-${RANGER_VERSION}-hive-plugin.tar.gz
57+
RANGER_HIVE_DOWNLOAD_URL=https://github.com/datastrato/ranger/releases/download/v${RANGER_VERSION}/ranger-${RANGER_VERSION}-hive-plugin.tar.gz
5858

5959
RANGER_HDFS_PACKAGE_NAME="ranger-${RANGER_VERSION}-hdfs-plugin.tar.gz"
60-
RANGER_HDFS_DOWNLOAD_URL=https://github.com/datastrato/apache-ranger/releases/download/release-ranger-${RANGER_VERSION}/ranger-${RANGER_VERSION}-hdfs-plugin.tar.gz
60+
RANGER_HDFS_DOWNLOAD_URL=https://github.com/datastrato/ranger/releases/download/v${RANGER_VERSION}/ranger-${RANGER_VERSION}-hdfs-plugin.tar.gz
6161

6262
# Prepare download packages
6363
if [[ ! -d "${hive_dir}/packages" ]]; then
@@ -89,11 +89,21 @@ if [ ! -f "${hive_dir}/packages/${ZOOKEEPER_PACKAGE_NAME}" ]; then
8989
fi
9090

9191
if [ ! -f "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ]; then
92-
curl -L -s -o "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}" ${RANGER_HDFS_DOWNLOAD_URL}
92+
bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HDFS_PACKAGE_NAME} "${hive_dir}/packages/${RANGER_HDFS_PACKAGE_NAME}"
93+
fi
94+
95+
if [[ $? -ne 0 ]]; then
96+
echo "Failed to download Ranger HDFS plugin package"
97+
exit 1
9398
fi
9499

95100
if [ ! -f "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ]; then
96-
curl -L -s -o "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}" ${RANGER_HIVE_DOWNLOAD_URL}
101+
bash ${hive_dir}/download-release.sh "v${RANGER_VERSION}" ${RANGER_HIVE_PACKAGE_NAME} "${hive_dir}/packages/${RANGER_HIVE_PACKAGE_NAME}"
102+
fi
103+
104+
if [[ $? -ne 0 ]]; then
105+
echo "Failed to download Ranger Hive plugin package"
106+
exit 1
97107
fi
98108

99109
if [ ! -f "${hive_dir}/packages/${HADOOP2_GCS_PACKAGE_NAME}" ]; then

docs/docker-image-details.md

+6
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ You can use this kind of image to test the catalog of Apache Hive.
185185

186186
Changelog
187187

188+
189+
- apache/gravitino-ci:hive-0.1.18
190+
- Support UTF-8 encoding for the `hive-site.xml` file and Hive Metastore.
191+
For more information, please see [PR](https://github.com/apache/gravitino/pull/6625)
192+
- Change ranger-hive-plugin and ranger-hdfs-plugin download URL.
193+
188194
- apache/gravitino-ci:hive-0.1.17
189195
- Add support for JDBC SQL standard authorization
190196
- Add JDBC SQL standard authorization related configuration in the `hive-site-for-sql-base-auth.xml` and `hiveserver2-site-for-sql-base-auth.xml`

0 commit comments

Comments
 (0)