From 1c6c77a7f19b4add384b4ff27e040519c7b021c0 Mon Sep 17 00:00:00 2001 From: Gibson Chikafa Date: Thu, 17 Oct 2024 11:35:38 +0200 Subject: [PATCH] Fix Jenkinsfile to also build webhook and controller images --- Jenkinsfile | 17 ++++++++++++++--- deploy/kubernetes/docker/Dockerfile | 9 ++++++--- deploy/kubernetes/docker/build.sh | 4 ++-- version.txt | 2 +- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5775c95e54..299bb33434 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,9 @@ pipeline { environment { VERSION = readFile "${env.WORKSPACE}/version.txt" BUILD_BRANCH = readFile "${env.WORKSPACE}/build_branch.txt" + DOCKER_REGISTRY = "docker.hops.works" + CONTROLLER_IMAGE = "${DOCKER_REGISTRY}/hopsworks/rss-controller:${VERSION}" + WEBHOOK_IMAGE = "${DOCKER_REGISTRY}/hopsworks/rss-webhook:${VERSION}" } stages { stage("checkout") { @@ -26,18 +29,26 @@ pipeline { sh """ set -ex echo "Building RSS version ${VERSION} on branch ${BUILD_BRANCH}" - docker login -u ${NEXUS_CREDS_USR} -p ${NEXUS_CREDS_PSW} docker.hops.works + docker login -u ${NEXUS_CREDS_USR} -p ${NEXUS_CREDS_PSW} $DOCKER_REGISTRY ./build_distribution.sh --spark3-profile spark3 --hadoop-profile hadoop3.2 --without-dashboard cd deploy/kubernetes/docker || exit - ./build.sh --hadoop-version 3.2.0.14-EE-RC0 --registry docker.hops.works --nexus-user $NEXUS_CREDS_USR --nexus-password $NEXUS_CREDS_PSW + ./build.sh --hadoop-version 3.2.0.15-EE-SNAPSHOT --registry $DOCKER_REGISTRY --nexus-user $NEXUS_CREDS_USR --nexus-password $NEXUS_CREDS_PSW cd ../../.. mkdir -p /opt/repository/master/rss/${VERSION}/ cp client-spark/spark3-shaded/target/rss-client-spark3-shaded-${VERSION}.jar /opt/repository/master/rss/${VERSION}/ + + # build the controller and webhook images + cd deploy/kubernetes/operator || exit 1 + docker build . --progress=plain -t $CONTROLLER_IMAGE --build-arg MODULE=controller -f hack/Dockerfile + docker build . --progress=plain -t $WEBHOOK_IMAGE --build-arg MODULE=webhook -f hack/Dockerfile + # push the controller and webhook images + docker push $CONTROLLER_IMAGE + docker push $WEBHOOK_IMAGE """ } } } } -} +} \ No newline at end of file diff --git a/deploy/kubernetes/docker/Dockerfile b/deploy/kubernetes/docker/Dockerfile index acda83924e..d9770a8709 100644 --- a/deploy/kubernetes/docker/Dockerfile +++ b/deploy/kubernetes/docker/Dockerfile @@ -18,6 +18,7 @@ LABEL git-commit=${GIT_COMMIT} RUN useradd -ms /bin/bash rssadmin RUN mkdir -p /data/rssadmin/ RUN chown -R rssadmin:rssadmin /data +RUN chmod -R 777 /data USER rssadmin COPY rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz /data/rssadmin @@ -26,9 +27,12 @@ RUN mv /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION} /data/rss RUN rm /data/rssadmin/rss/bin/rss-env.sh RUN rm -rf /data/rssadmin/rss-${RSS_VERSION}-hadoop${HADOOP_SHORT_VERSION}.tgz -COPY rss-env.sh /data/rssadmin/rss/bin -COPY start.sh /data/rssadmin/rss/bin +RUN chmod -R 777 /data/rssadmin/rss + +COPY --chmod=755 rss-env.sh /data/rssadmin/rss/bin + +COPY --chmod=755 start.sh /data/rssadmin/rss/bin COPY $HADOOP_FILE /data/rssadmin RUN mkdir -p /data/rssadmin/hops-${HADOOP_VERSION} @@ -38,7 +42,6 @@ RUN rm -rf /data/rssadmin/$HADOOP_FILE COPY hadoopconfig/ /data/rssadmin/hadoop/etc/hadoop ENV RSS_VERSION ${RSS_VERSION} -ENV HADOOP_VERSION ${HADOOP_VERSION} WORKDIR /data/rssadmin CMD ["bash", "/data/rssadmin/rss/bin/start.sh"] diff --git a/deploy/kubernetes/docker/build.sh b/deploy/kubernetes/docker/build.sh index 09ef3ee00b..6e62f2bb4a 100755 --- a/deploy/kubernetes/docker/build.sh +++ b/deploy/kubernetes/docker/build.sh @@ -36,7 +36,7 @@ function exit_with_usage() { } REGISTRY="docker.io/library" -HADOOP_VERSION=3.2.0.13-SNAPSHOT +HADOOP_VERSION=3.2.0.15-EE-SNAPSHOT AUTHOR=$(whoami) # If you are based in China, you could pass --apache-mirror when building this. APACHE_MIRROR="https://dlcdn.apache.org" @@ -140,7 +140,7 @@ GIT_COMMIT=$(git describe --dirty --always --tags | sed 's/-/./g') IMAGE_VERSION=$(cat $RSS_DIR/version.txt | awk '{$1=$1; print}' | sed '/^$/d') IMAGE=$REGISTRY/rss-server:$IMAGE_VERSION echo "image version: ${IMAGE_VERSION}" -IMAGE=$REGISTRY/rss:$IMAGE_VERSION +IMAGE=$REGISTRY/hopsworks/rss:$IMAGE_VERSION echo "building image: $IMAGE" DOCKER_BUILDKIT=1 docker build --network=host -t "$IMAGE" \ diff --git a/version.txt b/version.txt index 899f24fc75..f514a2f0bd 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.9.0 \ No newline at end of file +0.9.1 \ No newline at end of file