simhadri-g commented on code in PR #4614: URL: https://github.com/apache/hive/pull/4614#discussion_r1302567253
########## packaging/src/docker/Dockerfile: ########## @@ -14,14 +14,31 @@ # See the License for the specific language governing permissions and # limitations under the License. # +ARG BUILD_ENV + FROM ubuntu as unarchive +ONBUILD COPY hadoop-*.tar.gz /opt +ONBUILD COPY apache-hive-*-bin.tar.gz /opt +ONBUILD COPY apache-tez-*-bin.tar.gz /opt + +FROM ubuntu as archive +ARG HADOOP_VERSION +ARG HIVE_VERSION +ARG TEZ_VERSION +ONBUILD RUN apt-get update && apt-get -y install wget +ONBUILD RUN wget https://archive.apache.org/dist/tez/$TEZ_VERSION/apache-tez-$TEZ_VERSION-bin.tar.gz && \ + wget https://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz && \ + wget https://archive.apache.org/dist/hive/hive-$HIVE_VERSION/apache-hive-$HIVE_VERSION-bin.tar.gz Review Comment: updated the PR to build from source when a new tag is created. ########## .github/workflows/docker-GA-images.yml: ########## @@ -0,0 +1,58 @@ +name: Build and Publish docker images for Hive GA + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + + - + name: 'Set up JDK 8' + uses: actions/setup-java@v1 + with: + java-version: 8 + + - + name: Hive version + run: echo "HIVE_VERSION=$(mvn -f "pom.xml" -q help:evaluate -Dexpression=project.version -DforceStdout)" | awk -F-SNAPSHOT '{print $1}' >> $GITHUB_ENV + + + - name: Tag + run: echo "tag=${{ env.HIVE_VERSION }}" | awk '{print tolower($0)}' >> $GITHUB_ENV + + - + name: Hadoop version + run: echo "HADOOP_VERSION=$(mvn -f "pom.xml" -q help:evaluate -Dexpression=hadoop.version -DforceStdout)" >> $GITHUB_ENV + - + name: Tez version + run: echo "TEZ_VERSION=$(mvn -f "pom.xml" -q help:evaluate -Dexpression=tez.version -DforceStdout)" >> $GITHUB_ENV + + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push Hive Image to docker hub + uses: docker/build-push-action@v4 + with: + context: ./packaging/src/docker/ + file: ./packaging/src/docker/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USER }}/hive:${{ env.tag }} Review Comment: Done, tested it here: https://hub.docker.com/repository/docker/simhadri064/hive/tags?page=1&ordering=last_updated Both images- (linux/arm64 and linux/amd64) are being pushed. ########## packaging/src/docker/Dockerfile: ########## @@ -14,14 +14,31 @@ # See the License for the specific language governing permissions and # limitations under the License. # +ARG BUILD_ENV + FROM ubuntu as unarchive +ONBUILD COPY hadoop-*.tar.gz /opt +ONBUILD COPY apache-hive-*-bin.tar.gz /opt +ONBUILD COPY apache-tez-*-bin.tar.gz /opt + +FROM ubuntu as archive +ARG HADOOP_VERSION +ARG HIVE_VERSION +ARG TEZ_VERSION +ONBUILD RUN apt-get update && apt-get -y install wget +ONBUILD RUN wget https://archive.apache.org/dist/tez/$TEZ_VERSION/apache-tez-$TEZ_VERSION-bin.tar.gz && \ + wget https://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz && \ + wget https://archive.apache.org/dist/hive/hive-$HIVE_VERSION/apache-hive-$HIVE_VERSION-bin.tar.gz Review Comment: The idea was to trigger the workflow only after the tarballs were available. ########## .github/workflows/docker-GA-images.yml: ########## @@ -0,0 +1,140 @@ +name: Build and Publish docker images for Hive GA + +on: + create: + workflow_dispatch: + inputs: + hiveVersion: + description: 'Hive version' + required: true + default: '4.0.0-beta-1' Review Comment: Hi Naveen, The versions are not hard coded. In the latest patch the Github action is divide to two parts: 1. Build from exiting binaries for old releases. (BuildFromArchive) 2. Build from source on tag creation for new release. (BuildFromSource) The first part - BuildFromArchive - This is used to publish docker images for older hive releases - As a result we will need to mention the version - This is manually triggered where the pmc/commiter adds the version details of older release. The default versions are auto filed here, as seen below: <img width="432" alt="image" src="https://github.com/apache/hive/assets/26441677/5d93188d-1dc5-42d4-bce0-8120ca0d2088"> For the second part - BuildFromSource : - This automatically runs on tag creation for new release as mentioned by @zabetak in earlier comment. - The versions are pulled from pom.xml - https://github.com/apache/hive/pull/4614/files#diff-bb7abe44cdb30c1fcfba5d917bd117ec8279289df5fddf7b48fa64841aac6e82R93 I had missed updating the description in the PR. Updated it now. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org