Skip to content

Commit ea4b774

Browse files
committed
Adding Datafusion Ray tests on an Kind cluster using the Helm chart
1 parent b84bb6d commit ea4b774

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

.github/workflows/k8s.yml

+63-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
push:
2121
pull_request:
2222

23+
env:
24+
RAY_HELM_VERSION: 1.1.0
25+
PYTHON_VERSION: 3.9
26+
IMAGE_REPOSITORY: ghcr.io/apache/datafusion-ray
27+
2328
jobs:
2429
build:
2530
runs-on: ubuntu-latest
@@ -32,14 +37,15 @@ jobs:
3237
uses: docker/metadata-action@v5
3338
with:
3439
images: |
35-
ghcr.io/apache/datafusion-ray
40+
${{ env.IMAGE_REPOSITORY }}
3641
tags: |
3742
type=ref,event=branch
3843
type=ref,event=pr
3944
type=semver,pattern={{version}}
4045
type=semver,pattern={{major}}.{{minor}}
4146
type=semver,pattern={{major}}
4247
type=sha
48+
4349
- name: Set up Docker Buildx
4450
uses: docker/setup-buildx-action@v3
4551

@@ -59,3 +65,59 @@ jobs:
5965
tags: ${{ steps.meta.outputs.tags }}
6066
labels: ${{ steps.meta.outputs.labels }}
6167
push: ${{ startsWith(github.ref, 'refs/tags/') }}
68+
load: true
69+
70+
- name: Kind Cluster
71+
uses: helm/[email protected]
72+
with:
73+
config: ./k8s/kind-config.yaml
74+
75+
- name: Free Disk Space (Ubuntu)
76+
uses: jlumbroso/free-disk-space@main
77+
with:
78+
# this might remove tools that are actually needed,
79+
# when set to "true" but frees about 6 GB
80+
tool-cache: true
81+
docker-images: false
82+
83+
- name: Extract short SHA
84+
run: |
85+
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
86+
echo "IMAGE_TAG=sha-${SHORT_SHA}" >> "$GITHUB_ENV"
87+
echo "Extracted short SHA tag: sha-${SHORT_SHA}"
88+
89+
- name: Load Docker image into Kind cluster
90+
run: |
91+
kind load docker-image ${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }} -n chart-testing
92+
93+
- name: Install Helm
94+
uses: azure/[email protected]
95+
with:
96+
version: "3.16.0"
97+
98+
- name: Deploy helm chart
99+
run: |
100+
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
101+
helm install kuberay-operator kuberay/kuberay-operator --version ${{ env.RAY_HELM_VERSION }}
102+
helm install raycluster kuberay/ray-cluster --version ${{ env.RAY_HELM_VERSION }} \
103+
--set image.repository=${{ env.IMAGE_REPOSITORY }} \
104+
--set image.tag=${{ env.IMAGE_TAG }} \
105+
--set imagePullPolicy=Always
106+
echo "Deployed Ray cluster with image repository: ${{ env.IMAGE_REPOSITORY }} and tag: ${{ env.IMAGE_TAG }}"
107+
108+
- name: Set up Python
109+
uses: actions/setup-python@v3
110+
with:
111+
python-version: ${{ env.PYTHON_VERSION }}
112+
113+
- name: Install python dependencies
114+
run: |
115+
python -m pip install --upgrade pip
116+
pip install -r requirements-in.txt
117+
118+
- name: Submit an example ray Job
119+
run: |
120+
kubectl port-forward service/raycluster-kuberay-head-svc 8265:8265 &
121+
export RAY_ADDRESS="http://127.0.0.1:8265"
122+
pip install "ray[default]"
123+
ray job submit --working-dir ./examples/ -- python3 tips.py

k8s/kind-config.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
kind: Cluster
2+
apiVersion: kind.x-k8s.io/v1alpha4
3+
nodes:
4+
- role: control-plane
5+
extraMounts:
6+
- hostPath: /tmp/kind-node-disk
7+
containerPath: /var/lib/containerd
8+
- role: worker
9+
extraMounts:
10+
- hostPath: /tmp/kind-node-disk1
11+
containerPath: /var/lib/containerd
12+
- role: worker
13+
extraMounts:
14+
- hostPath: /tmp/kind-node-disk2
15+
containerPath: /var/lib/containerd
16+
- role: worker
17+
extraMounts:
18+
- hostPath: /tmp/kind-node-disk3
19+
containerPath: /var/lib/containerd

0 commit comments

Comments
 (0)