Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run spark k8s test with minikube #31

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- project:
name: theopenlab/spark
check:
jobs:
- spark-k8s-test

- job:
name: spark-k8s-test
parent: init-test
description: |
Run integration tests of spark of master against v1.13.3 k8s cluster deployed by v0.34.1 minikube
run: .zuul/playbooks/spark-k8s-test/run.yaml
timeout: 18000
vars:
k8s_log_dir: '{{ ansible_user_dir }}/workspace/logs/kubernetes'
33 changes: 33 additions & 0 deletions .zuul/playbooks/spark-k8s-test/run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
- hosts: all
become: yes
roles:
- install-openjdk
- role: install-docker
docker_version: 19.03
- create-single-k8s-cluster-with-minikube
tasks:
- name: Run integration tests of Spark with k8s cluster manager
shell: |
sleep 36000
set -ex

sed -i -e '/127.0.0.1/ s/\(localhost\)/'$(hostname)' \1/' /etc/hosts

# Create required account in k8s
export KUBECONFIG=/etc/kubernetes/admin.conf
kubectl create serviceaccount spark
kubectl create clusterrolebinding spark-role --clusterrole=edit --serviceaccount=default:spark --namespace=default

# NOTE: the distribution step may fail due to dependencies downloading failure, so we support retry
for i in $(seq 1 3); do ./dev/make-distribution.sh --tgz -Pkubernetes && s=0 && break || s=$? && sleep 5; done; (exit $s)

pushd resource-managers/kubernetes/integration-tests
dev/dev-run-integration-tests.sh --deploy-mode cloud \
--spark-master k8s://$(kubectl config view -o jsonpath='{.clusters[0].cluster.server}') \
--spark-tgz $(realpath ../../../spark-*.tgz) --namespace default --service-account spark \
--exclude-tags minikube
popd
args:
executable: /bin/bash
chdir: '{{ zuul.project.src_dir }}'
environment: '{{ global_env }}'