Skip to content

Commit bef85a1

Browse files
committed
testing kubernetes deployment for spark
1 parent 0cdfa22 commit bef85a1

12 files changed

+119
-19
lines changed

Diff for: .github/workflows/tithia-jupyter-docker-build.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Push Tithia Jupyter Docker Image to GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/tithia-jupyter-docker-build.yml'
9+
- 'docker/tithia-jupyter/**'
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to GitHub Container Registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GHCR_TOKEN }}
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Build and push Docker image
30+
uses: docker/build-push-action@v6
31+
with:
32+
context: ./docker
33+
file: ./docker/Dockerfile
34+
push: true
35+
tags: |
36+
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-jupyter:latest
37+
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-jupyter:0.${{ github.run_number }}

Diff for: .github/workflows/docker-build.yml renamed to .github/workflows/tithia-spark-docker-build

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Build and Push Docker Image to GHCR
1+
name: Build and Push Tithia Spark Docker Image to GHCR
22

33
on:
44
push:
55
branches:
66
- main
77
paths:
8-
- '.github/workflows/docker-build.yml'
9-
- 'docker/**'
8+
- '.github/workflows/tithia-spark-docker-build.yml'
9+
- 'docker/tithia-spark/**'
1010

1111
jobs:
1212
build-and-push:
@@ -33,5 +33,5 @@ jobs:
3333
file: ./docker/Dockerfile
3434
push: true
3535
tags: |
36-
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
37-
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:0.${{ github.run_number }}
36+
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-spark:latest
37+
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-spark:3.5.2-0.${{ github.run_number }}

Diff for: README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,8 @@ helm upgrade jupyterhub jupyterhub/jupyterhub --install --cleanup-on-fail -n jup
259259
k apply -f jupyterhub/certificate.yaml
260260

261261
k apply -f jupyterhub/ingress.yaml
262-
```
262+
```
263+
264+
### Spark
265+
266+
kubectl create configmap spark-config --from-file=spark-defaults.conf --from-file=spark-env.sh -n spark

Diff for: docker/docker-compose.yaml

-10
This file was deleted.
File renamed without changes.
File renamed without changes.

Diff for: docker/requirements.txt renamed to docker/tithia-jupyter/requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ keplergl==0.3.2
55
rasterio==1.4.2
66
pydeck==0.9.1
77
apache-sedona==1.6.1
8-
jupyterlab-s3-browser==0.12.0
9-
sparkmagic==0.22.0
8+
jupyterlab-s3-browser==0.12.0

Diff for: docker/tithia-spark/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM apache/spark:3.5.2
2+
3+
RUN wget -P /opt/spark/jars https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-aws/3.3.4/hadoop-aws-3.3.4.jar
4+
RUN wget -P /opt/spark/jars https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-bundle/1.12.777/aws-java-sdk-bundle-1.12.777.jar

Diff for: kube/jupyterhub/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ singleuser:
366366
blockWithIptables: true
367367
ip: 169.254.169.254
368368
networkPolicy:
369-
enabled: true
369+
enabled: false
370370
ingress: []
371371
egress: []
372372
egressAllowRules:

Diff for: kube/spark/deployment-master.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: spark-master
5+
namespace: spark
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: spark
11+
role: master
12+
template:
13+
metadata:
14+
labels:
15+
app: spark
16+
role: master
17+
spec:
18+
containers:
19+
- name: spark-master
20+
image: apache/spark:3.5.2
21+
command: ["/bin/bash", "-c", "/opt/spark/bin/spark-class org.apache.spark.deploy.master.Master"]
22+
ports:
23+
- containerPort: 7077 # Spark Master port
24+
- containerPort: 8080 # Spark Web UI

Diff for: kube/spark/deployment-workers.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: spark-worker
5+
namespace: spark
6+
spec:
7+
replicas: 2 # Number of Spark Worker replicas
8+
selector:
9+
matchLabels:
10+
app: spark
11+
role: worker
12+
template:
13+
metadata:
14+
labels:
15+
app: spark
16+
role: worker
17+
spec:
18+
containers:
19+
- name: spark-worker
20+
image: apache/spark:3.5.2
21+
command: ["/bin/bash", "-c", "/opt/spark/bin/spark-class org.apache.spark.deploy.worker.Worker spark://spark-master:7077"]
22+
ports:
23+
- containerPort: 8081 # Spark Worker Web UI

Diff for: kube/spark/service-master.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: spark-master
5+
namespace: spark
6+
spec:
7+
selector:
8+
app: spark
9+
role: master
10+
ports:
11+
- protocol: TCP
12+
port: 7077
13+
targetPort: 7077
14+
name: spark
15+
- protocol: TCP
16+
port: 8080
17+
targetPort: 8080
18+
name: web
19+
type: ClusterIP

0 commit comments

Comments
 (0)