Skip to content
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

[#951] build(operator): Add the HADOOP_VERSION for Docker image. #1027

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions deploy/kubernetes/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ARG BASE_IMAGE=uniffle-base:latest
FROM ${BASE_IMAGE}

ARG HADOOP_VERSION
ARG HADOOP_SHORT_VERSION
ARG RSS_VERSION
ARG AUTHOR=unknown
ARG GIT_BRANCH=unknown
Expand All @@ -33,11 +34,11 @@ RUN mkdir -p /data/rssadmin/
RUN chown -R rssadmin:rssadmin /data
USER rssadmin

COPY rss-${RSS_VERSION}.tgz /data/rssadmin
RUN tar -xvf /data/rssadmin/rss-${RSS_VERSION}.tgz -C /data/rssadmin
RUN mv /data/rssadmin/rss-${RSS_VERSION} /data/rssadmin/rss
COPY rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz /data/rssadmin
RUN tar -xvf /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz -C /data/rssadmin
RUN mv /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION} /data/rssadmin/rss
RUN rm /data/rssadmin/rss/bin/rss-env.sh
RUN rm -rf /data/rssadmin/rss-${RSS_VERSION}.tgz
RUN rm -rf /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz

COPY rss-env.sh /data/rssadmin/rss/bin

Expand Down
4 changes: 3 additions & 1 deletion deploy/kubernetes/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function exit_with_usage() {

REGISTRY="docker.io/library"
HADOOP_VERSION=2.8.5
HADOOP_SHORT_VERSION=$(echo $HADOOP_VERSION | awk -F "." '{print $1"."$2}')
AUTHOR=$(whoami)
# If you are based in China, you could pass --apache-mirror <a_mirror_url> when building this.
APACHE_MIRROR="https://dlcdn.apache.org"
Expand Down Expand Up @@ -109,7 +110,7 @@ fi
RSS_DIR=../../..
cd $RSS_DIR || exit
RSS_VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | grep -v "WARNING" | tail -n 1)
RSS_FILE=rss-${RSS_VERSION}.tgz
RSS_FILE=rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz
echo "RSS_VERSION: $RSS_VERSION"
echo "RSS_FILE: $RSS_FILE"
if [ ! -e "$RSS_FILE" ]; \
Expand All @@ -127,6 +128,7 @@ echo "building image: $IMAGE"
docker build --network=host -t "$IMAGE" \
--build-arg RSS_VERSION="$RSS_VERSION" \
--build-arg HADOOP_VERSION="$HADOOP_VERSION" \
--build-arg HADOOP_SHORT_VERSION="$HADOOP_SHORT_VERSION" \
--build-arg AUTHOR="$AUTHOR" \
--build-arg GIT_COMMIT="$GIT_COMMIT" \
--build-arg GIT_BRANCH="$GIT_BRANCH" \
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<configuration>
<workingDirectory>${basedir}/docker</workingDirectory>
<executable>${basedir}/docker/build.sh</executable>
<commandlineArgs>--push-image false --hadoop-version 2.10.2</commandlineArgs>
<commandlineArgs>--push-image false --hadoop-version ${hadoop.version}</commandlineArgs>
<skip>${skipBuildImage}</skip>
</configuration>
</execution>
Expand Down