Yikun commented on code in PR #37005:
URL: https://github.com/apache/spark/pull/37005#discussion_r916579584


##########
.github/workflows/build_and_test.yml:
##########
@@ -251,13 +251,73 @@ jobs:
         name: unit-tests-log-${{ matrix.modules }}-${{ matrix.comment }}-${{ 
matrix.java }}-${{ matrix.hadoop }}-${{ matrix.hive }}
         path: "**/target/unit-tests.log"
 
-  pyspark:
+  infra-image:
     needs: precondition
-    if: fromJson(needs.precondition.outputs.required).pyspark == 'true'
+    # Currently, only enable docker build from cache for `master` branch jobs
+    if: fromJson(needs.precondition.outputs.required).pyspark == 'true' && ${{ 
inputs.branch }} == 'master'
+    runs-on: ubuntu-latest
+    outputs:
+      image_url: ${{ steps.infra-image-outputs.outputs.image_url }}
+    steps:
+      - name: Generate image name and url
+        id: infra-image-outputs
+        run: |
+          # Convert to lowercase to meet docker repo name requirement
+          REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' 
'[:lower:]')
+          IMG_NAME="apache-spark-ci-image:${{ inputs.branch }}-${{ 
github.run_id }}"
+          IMG_URL="ghcr.io/$REPO_OWNER/$IMG_NAME"
+          echo ::set-output name=image_url::$IMG_URL
+      - name: Login to GitHub Container Registry
+        uses: docker/login-action@v2
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+      - name: Checkout Spark repository
+        uses: actions/checkout@v2
+        # In order to fetch changed files
+        with:
+          fetch-depth: 0
+          repository: apache/spark
+          ref: ${{ inputs.branch }}
+      - name: Sync the current branch with the latest in Apache Spark

Review Comment:
   If a PR changes the dockerfile and merged, this will help user update the 
dockerfile...so, I think it's needed?



##########
.github/workflows/build_and_test.yml:
##########
@@ -251,13 +251,73 @@ jobs:
         name: unit-tests-log-${{ matrix.modules }}-${{ matrix.comment }}-${{ 
matrix.java }}-${{ matrix.hadoop }}-${{ matrix.hive }}
         path: "**/target/unit-tests.log"
 
-  pyspark:
+  infra-image:
     needs: precondition
-    if: fromJson(needs.precondition.outputs.required).pyspark == 'true'
+    # Currently, only enable docker build from cache for `master` branch jobs
+    if: fromJson(needs.precondition.outputs.required).pyspark == 'true' && ${{ 
inputs.branch }} == 'master'
+    runs-on: ubuntu-latest
+    outputs:
+      image_url: ${{ steps.infra-image-outputs.outputs.image_url }}
+    steps:
+      - name: Generate image name and url
+        id: infra-image-outputs
+        run: |
+          # Convert to lowercase to meet docker repo name requirement
+          REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' 
'[:lower:]')
+          IMG_NAME="apache-spark-ci-image:${{ inputs.branch }}-${{ 
github.run_id }}"
+          IMG_URL="ghcr.io/$REPO_OWNER/$IMG_NAME"
+          echo ::set-output name=image_url::$IMG_URL
+      - name: Login to GitHub Container Registry
+        uses: docker/login-action@v2
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+      - name: Checkout Spark repository
+        uses: actions/checkout@v2
+        # In order to fetch changed files
+        with:
+          fetch-depth: 0
+          repository: apache/spark
+          ref: ${{ inputs.branch }}
+      - name: Sync the current branch with the latest in Apache Spark

Review Comment:
   If a PR changes the dockerfile and merged, this will help user update the 
dockerfile...so, I think it's necessary?



-- 
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