You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by GitBox <gi...@apache.org> on 2018/08/01 21:30:54 UTC
[GitHub] r39132 closed pull request #3676: [AIRFLOW-2829] Brush up the CI
script for minikube
r39132 closed pull request #3676: [AIRFLOW-2829] Brush up the CI script for minikube
URL: https://github.com/apache/incubator-airflow/pull/3676
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/scripts/ci/kubernetes/minikube/start_minikube.sh b/scripts/ci/kubernetes/minikube/start_minikube.sh
index 5171a26313..c9388e08ff 100755
--- a/scripts/ci/kubernetes/minikube/start_minikube.sh
+++ b/scripts/ci/kubernetes/minikube/start_minikube.sh
@@ -24,19 +24,19 @@ _MY_SCRIPT="${BASH_SOURCE[0]}"
_MY_DIR=$(cd "$(dirname "$_MY_SCRIPT")" && pwd)
# Avoids 1.7.x because of https://github.com/kubernetes/minikube/issues/2240
_KUBERNETES_VERSION="${KUBERNETES_VERSION}"
+_MINIKUBE_VERSION="${MINIKUBE_VERSION:-v0.26.0}"
-echo "setting up kubernetes ${_KUBERNETES_VERSION}"
+echo "setting up kubernetes ${_KUBERNETES_VERSION}, using minikube ${_MINIKUBE_VERSION}"
-_MINIKUBE_VERSION="v0.26.0"
-_HELM_VERSION=v2.8.1
-_VM_DRIVER=none
+_VM_DRIVER="${VM_DRIVER:-none}"
USE_MINIKUBE_DRIVER_NONE=true
_UNAME_OUT=$(uname -s)
case "${_UNAME_OUT}" in
Linux*) _MY_OS=linux;;
Darwin*) _MY_OS=darwin;;
- *) _MY_OS="UNKNOWN:${unameOut}"
+ *) echo "${_UNAME_OUT} is unsupported."
+ exit 1;;
esac
echo "Local OS is ${_MY_OS}"
@@ -58,27 +58,25 @@ if [[ ! -x /usr/local/bin/kubectl ]]; then
curl -Lo bin/kubectl \
https://storage.googleapis.com/kubernetes-release/release/${_KUBERNETES_VERSION}/bin/${_MY_OS}/amd64/kubectl
chmod +x bin/kubectl
+ sudo mv bin/kubectl /usr/local/bin/kubectl
fi
if [[ ! -x /usr/local/bin/minikube ]]; then
echo Downloading minikube.
curl -Lo bin/minikube \
https://storage.googleapis.com/minikube/releases/${_MINIKUBE_VERSION}/minikube-${_MY_OS}-amd64
chmod +x bin/minikube
+ sudo mv bin/minikube /usr/local/bin/minikube
fi
-sudo mv bin/minikube /usr/local/bin/minikube
-sudo mv bin/kubectl /usr/local/bin/kubectl
-
export PATH="${_MY_DIR}/bin:$PATH"
if [[ "${USE_MINIKUBE_DRIVER_NONE:-}" = "true" ]]; then
# Run minikube with none driver.
# See https://blog.travis-ci.com/2017-10-26-running-kubernetes-on-travis-ci-with-minikube
- _VM_DRIVER="--vm-driver=none"
+ _VM_DRIVER=none
if [[ ! -x /usr/local/bin/nsenter ]]; then
# From https://engineering.bitnami.com/articles/implementing-kubernetes-integration-tests-in-travis.html
# Travis ubuntu trusty env doesn't have nsenter, needed for --vm-driver=none
- which nsenter >/dev/null && return 0
echo "INFO: Building 'nsenter' ..."
cat <<-EOF | docker run -i --rm -v "$(pwd):/build" ubuntu:14.04 >& nsenter.build.log
apt-get update
@@ -93,7 +91,7 @@ EOF
if [ ! -f ./nsenter ]; then
echo "ERROR: nsenter build failed, log:"
cat nsenter.build.log
- return 1
+ exit 1
fi
echo "INFO: nsenter build OK"
sudo mv ./nsenter /usr/local/bin
@@ -102,10 +100,10 @@ fi
echo "your path is ${PATH}"
-_MINIKUBE="sudo PATH=$PATH minikube"
+_MINIKUBE="sudo -E PATH=$PATH minikube"
$_MINIKUBE config set bootstrapper localkube
-$_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} --vm-driver=none
+$_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} --vm-driver=${_VM_DRIVER}
$_MINIKUBE update-context
# Wait for Kubernetes to be up and ready.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services