From a3a25e9e2e6e9ff970142e25f311529731ad699a Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Fri, 11 Oct 2019 11:38:47 +0800 Subject: [PATCH] Run spark k8s test with minikube --- .zuul.yaml | 15 +++++++++++ .zuul/playbooks/spark-k8s-test/run.yaml | 33 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .zuul.yaml create mode 100644 .zuul/playbooks/spark-k8s-test/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000000000..4aaf8fc584387 --- /dev/null +++ b/.zuul.yaml @@ -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' diff --git a/.zuul/playbooks/spark-k8s-test/run.yaml b/.zuul/playbooks/spark-k8s-test/run.yaml new file mode 100644 index 0000000000000..4b0d5a3917f13 --- /dev/null +++ b/.zuul/playbooks/spark-k8s-test/run.yaml @@ -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 }}'