From c7b96f74da262682fdcaed2b7a038589ccdd3c98 Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Sat, 4 Apr 2020 17:57:54 +0530 Subject: [PATCH] feat(build): enable arm64 auto build enable arm64 auto build Signed-off-by: Akhil Mohan --- .travis.yml | 40 +++++++++++++++++++++++------------- buildscripts/travis-build.sh | 6 +++++- ci/build-maya.sh | 2 +- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87ae569c54..58b271594f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,13 @@ cache: go: - 1.12.16 +jobs: + include: + - os: linux + arch: amd64 + - os: linux + arch: arm64 + addons: apt: update: true @@ -31,15 +38,16 @@ install: - make format before_script: # Download kubectl, which is a requirement for using minikube. - - curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ - # Download minikube. - - curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ - - mkdir -p $HOME/.kube $HOME/.minikube - - touch $KUBECONFIG - - sudo minikube start --vm-driver=none --kubernetes-version=v1.13.0 - - "sudo chown -R travis: /home/travis/.minikube/" + - if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then + curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/; + curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/; + mkdir -p $HOME/.kube $HOME/.minikube; + touch $KUBECONFIG; + sudo minikube start --vm-driver=none --kubernetes-version=v1.13.0; + 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; + sudo chown -R travis:travis /home/travis/.minikube/; + fi # 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 # Download and initialize helm. #- ./ci/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.30.2/nsenter /usr/bin #- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh @@ -47,13 +55,17 @@ before_script: #- ./get_helm.sh #- helm init script: - - kubectl cluster-info - # Verify kube-addon-manager. - # kube-addon-manager is responsible for managing other kubernetes components, such as kube-dns, dashboard, storage-provisioner.. - - JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lcomponent=kube-addon-manager -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-addon-manager to be available"; kubectl get pods --all-namespaces; done - - kubectl get deployment + - if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then + kubectl cluster-info; + JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lcomponent=kube-addon-manager -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-addon-manager to be available"; kubectl get pods --all-namespaces; done; + kubectl get deployment; + fi + # Verify kube-addon-manager. + # kube-addon-manager is responsible for managing other kubernetes components, such as kube-dns, dashboard, storage-provisioner.. - ./buildscripts/travis-build.sh - - ./ci/travis-ci.sh + - if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then + ./ci/travis-ci.sh; + fi after_success: - make deploy-images - bash <(curl -s https://codecov.io/bash) diff --git a/buildscripts/travis-build.sh b/buildscripts/travis-build.sh index df555e7007..9e4cd5cd55 100755 --- a/buildscripts/travis-build.sh +++ b/buildscripts/travis-build.sh @@ -63,7 +63,11 @@ printf "\n" ./buildscripts/test-cov.sh rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi -make all +if [ "$TRAVIS_CPU_ARCH" == "arm64" ]; then + make all.arm64 +else + make all +fi rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi if [ $SRC_REPO != $DST_REPO ]; diff --git a/ci/build-maya.sh b/ci/build-maya.sh index ac9577583f..4f20a9a4d6 100755 --- a/ci/build-maya.sh +++ b/ci/build-maya.sh @@ -18,7 +18,7 @@ if [ ${CI_TAG} != "ci" ]; then sudo docker tag openebs/provisioner-localpv:ci openebs/provisioner-localpv:${CI_TAG} fi -#Tag the images with quay.io, since the operator can either have quay or docker images +#Tag the images with quay.io, since the operator can eitest-scther have quay or docker images sudo docker tag openebs/m-apiserver:ci quay.io/openebs/m-apiserver:${CI_TAG} sudo docker tag openebs/m-exporter:ci quay.io/openebs/m-exporter:${CI_TAG} sudo docker tag openebs/cstor-pool-mgmt:ci quay.io/openebs/cstor-pool-mgmt:${CI_TAG}