Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Fix docker image build workflow
  • Loading branch information
Yikun committed Oct 11, 2022
commit 91ad0ea78cb11ef76665ca87eb8ccc8cebe1638e
7 changes: 5 additions & 2 deletions .github/workflows/build_3.3.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
name: "Build and Test (3.3.0)"

on:
pull_request:
pull_request_target:
branches:
- 'master'
paths:
- '3.3.0/'
- '3.3.0/**'
- '.github/workflows/build_3.3.0.yaml'
- '.github/workflows/main.yml'

jobs:
run-build:
permissions:
packages: write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed ? This workflow just delegates to main.yml where this is also specified.
It does not do any harm either!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed see also: apache/spark#38145

name: Run
secrets: inherit
uses: ./.github/workflows/main.yml
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ on:
jobs:
main:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
spark_version:
Expand Down Expand Up @@ -70,7 +72,9 @@ jobs:
- name: Generate tags
run: |
TAG=scala${{ matrix.scala_version }}-java${{ matrix.java_version }}-${{ matrix.image_suffix }}

# The pull_request_target job:
# 1. Use the `apache` in apache repo (push/pr).
# 2. Use the fork repo owner in fork repo PR.
REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
TEST_REPO=ghcr.io/$REPO_OWNER/spark-docker
IMAGE_NAME=spark
Expand Down Expand Up @@ -98,7 +102,7 @@ jobs:
with:
context: ${{ env.IMAGE_PATH }}
push: true
tags: ${{ env.TEST_REPO }}:${{ env.UNIQUE_IMAGE_TAG }}
tags: ${{ env.TEST_REPO }}/${{ env.IMAGE_NAME }}:${{ env.UNIQUE_IMAGE_TAG }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm, this might has some issue when multiple concurrency jobs push the same tag. Of course, we could use action concurrency or add some random hash tag to protect.

But after some consideration, I guess what we need to do just remove push in this PR

push: true

And change it to local build in minikube docker (don't do a real push) when we adding K8s test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is replaced by #7

platforms: linux/amd64,linux/arm64

- name: Image digest
Expand Down