-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-134-add-index-volume
* master: Run tests on GKE (#140) Document update: README.md (#133) Add service account role definitions [skip ci] (#136)
- Loading branch information
Showing
3 changed files
with
123 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,92 @@ | ||
sudo: required | ||
# We need the systemd for the kubeadm and it's default from 16.04+ | ||
dist: xenial | ||
|
||
language: go | ||
go_import_path: github.com/pravega/pravega-operator | ||
go: | ||
- '1.11' | ||
- '1.11' | ||
|
||
env: | ||
global: | ||
- KUBERNETES_CONFIG_FILE=$HOME/.kube/config | ||
- CHANGE_MINIKUBE_NONE_USER=true | ||
- MINIKUBE_VERSION=v0.33.1 | ||
- OPERATOR_SDK_VERSION=v0.4.0 | ||
- HELM_VERSION=v2.12.0 | ||
- DEP_VERSION=v0.5.0 | ||
- secure: "X4zdixrmuh/D4WwJ6btu0fJROq7fTPO5n4/jeyoxTQvrpwikycwf3ZpXS94u43rHx1ovc8vweVIc4Kur7MFAJDmFpPz5adjD7cCjqaRHo+Sw4a/gdNKizFEmZEBFlelynJ+cYekfF3rIFRws+u/8yWUQnSPl4495Qq1NKjrDTqoB6ZrQDxYdIPPpLAit+Aj9a2zQ4xPHyOv02SmfgL22wQhOx8SF78VNmqVah6klC8j3tAemHJQSBmUQ2fPVBpqAy3YsI7mpF9aSdBOzr7Dk1/cajOx4M5WrAxDPZ7+fSKD97SjICKqtM6MuX63O6Tg86zzdoEdvTWvwBwjWpbI3iCytJOCD8vT1QBPd9bLwZI7K5dElrW990HGrBBS4GmKTFykEE6PCNvxDHu1pG4N0vmLhZ3Hh4evZxA8xSnHRyYTLOaDkSe/vurlmsRJiW0GOEa6Fyz+xrD5y4l5MDkPVvaEPzWFZQf8v+l3OvvDvmHmqup4ADXE/XBYbVraTn8wPcQnvk5ueCvJWBOd/E4keGFsGbqDxQpvQRG/8aHWv32lj2HHK6/qbihXvTfJfRbrWli2BV0LMBL/OBIiuL1JeXycYZG3AtbnwgJVXPzs8kpwrmxkRYvbb3Kc9HXu9x+ajeWDYb978Rq6/0DfXhKFIiLrgUOxR2SK6eHDTcfUY+us=" | ||
matrix: | ||
- KUBERNETES_VERSION=v1.12.0 | ||
|
||
services: | ||
- docker | ||
stages: | ||
- check | ||
- unit | ||
- e2e | ||
- deploy | ||
|
||
install: | ||
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ | ||
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/$MINIKUBE_VERSION/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ | ||
- curl -Lo dep https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/ | ||
- curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk-$OPERATOR_SDK_VERSION-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/ | ||
- curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz && tar xfz helm.tar.gz && sudo mv linux-amd64/{helm,tiller} /usr/local/bin/ | ||
# nfs-common is required to mount NFS-based Pravega Tier 2 storage | ||
# socat is required by Helm to do port-forwarding | ||
- sudo apt-get install -y nfs-common socat | ||
jobs: | ||
include: | ||
- stage: check | ||
name: Gofmt and License checks | ||
script: | ||
- make check | ||
|
||
before_script: | ||
# Make root mounted as rshared to fix kube-dns issues | ||
- sudo mount --make-rshared / | ||
# Start MiniKube | ||
- sudo minikube start --vm-driver=none --bootstrapper=kubeadm --kubernetes-version=$KUBERNETES_VERSION | ||
# Fix the kubectl context, as it's often stale | ||
- minikube update-context | ||
# Wait for Kubernetes to be up and ready | ||
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done | ||
# Show cluster information | ||
- kubectl cluster-info | ||
- kubectl -n kube-system get pod -o wide | ||
# Install Helm Tiller | ||
- kubectl create serviceaccount --namespace kube-system tiller | ||
- kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | ||
- helm init --service-account tiller --wait | ||
# Install NFS provisioner | ||
- helm install stable/nfs-server-provisioner | ||
- kubectl -n default create -f test/e2e/resources/tier2.yaml | ||
- JSONPATH='{.status.phase}'; until kubectl get pvc pravega-tier2 -o jsonpath="$JSONPATH" 2>&1 | grep -q "Bound"; do sleep 1; done | ||
# Install ZooKeeper | ||
- kubectl -n default create -f test/e2e/resources/zookeeper.yaml | ||
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get pods -l kind=ZookeeperMember -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done | ||
# Show Pravega dependencies | ||
- kubectl -n default get pod,pvc,svc -o wide | ||
- stage: unit | ||
name: Unit tests | ||
script: | ||
- make test-unit | ||
|
||
script: | ||
- make dep | ||
- make check | ||
- make test | ||
- make build | ||
- make clean | ||
- stage: e2e | ||
name: End-to-end tests | ||
if: type = pull_request OR branch = master | ||
services: | ||
- docker | ||
env: | ||
- KUBECTL_VERSION=v1.12.0 | ||
- OPERATOR_SDK_VERSION=v0.4.0 | ||
- HELM_VERSION=v2.12.0 | ||
- DEP_VERSION=v0.5.0 | ||
- CLOUDSDK_CORE_DISABLE_PROMPTS=1 | ||
- GOOGLE_APPLICATION_CREDENTIALS="$HOME/gcloud-service-key.json" | ||
- GOOGLE_SERVICE_ACCOUNT=pravega-travis-service-account@pravega-dev.iam.gserviceaccount.com | ||
- PROJECT_NAME=pravega-dev | ||
- CLUSTER_NAME="pravega-operator-travis-$(date +'%Y%m%d%H%M%S')" | ||
- CLUSTER_ZONE=us-central1-c | ||
- CLUSTER_SIZE=5 | ||
- CLUSTER_NODE_TYPE=n1-standard-2 | ||
install: | ||
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; curl https://sdk.cloud.google.com | bash; fi | ||
- source $HOME/google-cloud-sdk/path.bash.inc | ||
- gcloud --quiet version | ||
- gcloud --quiet components update | ||
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ | ||
- curl -Lo dep https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/ | ||
- curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk-$OPERATOR_SDK_VERSION-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/ | ||
- curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz && tar xfz helm.tar.gz && sudo mv linux-amd64/{helm,tiller} /usr/local/bin/ | ||
before_script: | ||
- echo $GCLOUD_SERVICE_KEY | base64 --decode -i > $HOME/gcloud-service-key.json | ||
- gcloud auth activate-service-account --key-file $HOME/gcloud-service-key.json | ||
- gcloud --quiet config set project $PROJECT_NAME | ||
- gcloud --quiet config set container/use_application_default_credentials True | ||
- gcloud --quiet container clusters create $CLUSTER_NAME --num-nodes=$CLUSTER_SIZE --zone=$CLUSTER_ZONE --machine-type=$CLUSTER_NODE_TYPE | ||
- gcloud --quiet container clusters get-credentials $CLUSTER_NAME --zone=$CLUSTER_ZONE | ||
- kubectl config view | ||
- kubectl config current-context | ||
- kubectl get nodes -o wide | ||
- kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$GOOGLE_SERVICE_ACCOUNT | ||
# Install Helm Tiller | ||
- kubectl create serviceaccount --namespace kube-system tiller | ||
- kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | ||
- helm init --service-account tiller --wait | ||
# Install NFS provisioner | ||
- helm install stable/nfs-server-provisioner | ||
- kubectl -n default create -f test/e2e/resources/tier2.yaml | ||
- JSONPATH='{.status.phase}'; until kubectl get pvc pravega-tier2 -o jsonpath="$JSONPATH" 2>&1 | grep -q "Bound"; do sleep 1; done | ||
# Install ZooKeeper | ||
- kubectl -n default create -f test/e2e/resources/zookeeper.yaml | ||
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get pods -l kind=ZookeeperMember -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done | ||
# Show Pravega dependencies | ||
- kubectl -n default get pod,pvc,svc -o wide | ||
script: | ||
- make test-e2e | ||
after_script: | ||
- gcloud --quiet container clusters delete $CLUSTER_NAME --zone $CLUSTER_ZONE | ||
|
||
deploy: | ||
provider: script | ||
script: make push | ||
on: | ||
branch: master | ||
tags: true | ||
- stage: deploy | ||
name: Push Docker image | ||
if: branch = master AND tag IS present | ||
services: | ||
- docker | ||
script: | ||
- make push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters