zabetak commented on code in PR #6953:
URL: https://github.com/apache/hive/pull/6953#discussion_r4554010503


##########
.github/workflows/precommit-image.yml:
##########
@@ -0,0 +1,85 @@
+# 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.
+
+# Builds the precommit image (dev-support/docker/precommit) and smoke tests 
it. On master it
+# publishes the image as apache/hive-ci-runner, the image the Jenkinsfile runs 
in.
+name: Precommit image
+
+on:
+  pull_request:
+    paths:
+      - 'dev-support/docker/precommit/**'
+      - '.github/workflows/precommit-image.yml'
+  push:
+    branches:
+      - master
+    paths:
+      - 'dev-support/docker/precommit/**'
+      - '.github/workflows/precommit-image.yml'
+  workflow_dispatch:
+    inputs:
+      tag:
+        description: 'Tag to publish; use a custom one (e.g. HIVE-12345) to 
try an image with the IMAGE parameter of the precommit job'
+        required: true
+        default: 'latest'
+
+permissions:
+  contents: read
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    env:
+      IMAGE: ${{ github.repository_owner }}/hive-ci-runner:${{ 
github.event.inputs.tag || 'latest' }}
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v6
+        with:
+          persist-credentials: false
+
+      - name: Set up QEMU
+        uses: 
docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
+
+      - name: Set up Docker Buildx
+        uses: 
docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
+
+      - name: Build the image
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
+        with:
+          context: ./dev-support/docker/precommit/
+          load: true
+          tags: hive-precommit:test
+
+      - name: Smoke test the image
+        run: |
+          docker images hive-precommit:test
+          dev-support/docker/precommit/smoke-test.sh hive-precommit:test
+
+      - name: Login to Docker Hub
+        if: github.event_name != 'pull_request' && github.repository == 
'apache/hive'

Review Comment:
   I can set the `DOCKERHUB_*` secrets on my own fork (e.g., 
https://github.com/zabetak/hive) and the workflow could theoretically push to 
`https://hub.docker.com/u/zabetak` as it happens on 
`.github/workflows/hive-postgres-tpcds-metastore.yml`. Anyways its not a big 
deal I am fine even if we don't allow runs from forks. Just wanted to mention 
that is feasible and not problematic if we don't point to the apache namespace.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to