Skip to content

Commit

Permalink
Add Docker build and push workflows for History Server, Notebook, and…
Browse files Browse the repository at this point in the history
… Spark
  • Loading branch information
xuwenyihust committed Apr 27, 2024
1 parent dab3898 commit 3637b5b
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 36 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-docker-history-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Docker - History Server

on:
push:
paths:
- 'docker/history-server/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Docker Build & Push
run: |
timestamp=$(date +"%Y%m%d%H%M%S")
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/history-server:$timestamp -f docker/history-server/Dockerfile ./docker/history-server
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/history-server:$timestamp ${{ secrets.DOCKERHUB_USERNAME }}/history-server:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/history-server:$timestamp
docker push ${{ secrets.DOCKERHUB_USERNAME }}/history-server:latest
27 changes: 27 additions & 0 deletions .github/workflows/build-docker-notebook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Docker - Notebook

on:
push:
paths:
- 'docker/notebook/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Docker Build & Push
run: |
timestamp=$(date +"%Y%m%d%H%M%S")
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/notebook:$timestamp -f docker/notebook/Dockerfile ./docker/notebook
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/notebook:$timestamp ${{ secrets.DOCKERHUB_USERNAME }}/notebook:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/notebook:$timestamp
docker push ${{ secrets.DOCKERHUB_USERNAME }}/notebook:latest
28 changes: 28 additions & 0 deletions .github/workflows/build-docker-spark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Docker - Spark

on:
push:
paths:
- 'docker/spark/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Docker Build & Push
run: |
timestamp=$(date +"%Y%m%d%H%M%S")
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/spark:$timestamp -f docker/spark/Dockerfile ./docker/spark
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/spark:$timestamp ${{ secrets.DOCKERHUB_USERNAME }}/spark:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/spark:$timestamp
docker push ${{ secrets.DOCKERHUB_USERNAME }}/spark:latest
33 changes: 0 additions & 33 deletions .github/workflows/build-docker.yml

This file was deleted.

6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
jupyter:
image: wenyixu101/all-spark-notebook:latest
notebook:
image: wenyixu101/notebook:latest
container_name: notebook
ports:
- "8888:8888"
Expand All @@ -16,7 +16,7 @@ services:
memory: 1g

spark-master:
image: wenyixu101/spark:3.5.0-python3.11
image: wenyixu101/spark:latest
container_name: spark-master
ports:
- "4040:4040"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3637b5b

Please sign in to comment.