Skip to content

Commit

Permalink
Add dependency on submit for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
GezimSejdiu committed Oct 27, 2021
1 parent 3dbcadc commit 5b2c1d4
Showing 1 changed file with 51 additions and 8 deletions.
59 changes: 51 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
tags: bde2020/spark-base:${{env.DOCKER_IMAGE_TAG}}
push: ${{ github.event_name != 'pull_request' }}

master_worker_submit:
master_worker:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
base: [master, worker, submit]
image: [master, worker]

needs: 'base'
steps:
Expand Down Expand Up @@ -75,13 +75,56 @@ jobs:
[ "$IMAGE_TAG" == "master" ] && IMAGE_TAG=latest
echo "DOCKER_IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build and push Spark maser, worker and submit image
- name: Build and push Spark maser and worker image
id: docker_build_maser_worker_submit_image
uses: docker/build-push-action@v2
with:
context: ${{ matrix.base }}
file: ${{ matrix.base }}/Dockerfile
tags: bde2020/spark-${{ matrix.base }}:${{env.DOCKER_IMAGE_TAG}}
context: ${{ matrix.image }}
file: ${{ matrix.image }}/Dockerfile
tags: bde2020/spark-${{ matrix.image }}:${{env.DOCKER_IMAGE_TAG}}
push: ${{ github.event_name != 'pull_request' }}

submit:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
image: [submit]

needs: 'base'
steps:

- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v5

- name: Sets env vars for image_tag
run: |
IMAGE_TAG=${{ steps.branch-name.outputs.current_branch }}
[ "$IMAGE_TAG" == "master" ] && IMAGE_TAG=latest
echo "DOCKER_IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build and push Spark submit image
id: docker_build_maser_worker_submit_image
uses: docker/build-push-action@v2
with:
context: ${{ matrix.image }}
file: ${{ matrix.image }}/Dockerfile
tags: bde2020/spark-${{ matrix.image }}:${{env.DOCKER_IMAGE_TAG}}
push: ${{ github.event_name != 'pull_request' }}

template:
Expand All @@ -92,7 +135,7 @@ jobs:
matrix:
template: [java, scala, python]

needs: 'base'
needs: 'submit'
steps:

- name: Check Out Repo
Expand Down Expand Up @@ -125,4 +168,4 @@ jobs:
context: template/${{ matrix.template }}
file: template/${{ matrix.template }}/Dockerfile
tags: bde2020/spark-${{ matrix.template }}-template:${{env.DOCKER_IMAGE_TAG}}
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }}

0 comments on commit 5b2c1d4

Please sign in to comment.