diff --git a/.travis.yml b/.travis.yml index 4e12c971..ba27dc42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,7 @@ addons: update: true install: + - sudo apt-get install -y conntrack - if [ "$TRAVIS_BUILD_DIR" != "$GOPATH/src/github.com/openebs/upgrade" ]; then mkdir -p $GOPATH/src/github.com/openebs/; mv $TRAVIS_BUILD_DIR $GOPATH/src/github.com/openebs; @@ -56,10 +57,10 @@ before_script: # TODO add golangci yaml config - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0 - if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.18.1/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/; - curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.8.1/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/; + curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.12.3/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.16.0; + sudo minikube start --vm-driver=none --kubernetes-version=v1.18.0; sudo chown -R travis /home/travis/.minikube/; 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; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 25cc605d..866beecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## [v2.0.0](https://github.com/openebs/upgrade/tree/v2.0.0) (2020-08-15) + +**Merged pull requests:** + +- fix\(migration\): fix striped raid group config while migrating [\#39](https://github.com/openebs/upgrade/pull/39) ([shubham14bajpai](https://github.com/shubham14bajpai)) + +## [v2.0.0-RC2](https://github.com/openebs/upgrade/tree/v2.0.0-RC2) (2020-08-14) + +**Merged pull requests:** + +- chore\(vendor\): update latest openebs/api vendor files [\#37](https://github.com/openebs/upgrade/pull/37) ([shubham14bajpai](https://github.com/shubham14bajpai)) +- chore\(vendor\): update latest openebs/api vendor files [\#34](https://github.com/openebs/upgrade/pull/34) ([shubham14bajpai](https://github.com/shubham14bajpai)) + +## [v2.0.0-RC1](https://github.com/openebs/upgrade/tree/v2.0.0-RC1) (2020-08-05) + +**Merged pull requests:** + +- chore\(migrate\): add travis sanity test [\#29](https://github.com/openebs/upgrade/pull/29) ([shubham14bajpai](https://github.com/shubham14bajpai)) +- chore\(docs\): add example yamls and docs for cstor upgrades/migration [\#7](https://github.com/openebs/upgrade/pull/7) ([shubham14bajpai](https://github.com/shubham14bajpai)) + +## [v1.12.1](https://github.com/openebs/upgrade/tree/v1.12.1) (2020-07-30) + +**Merged pull requests:** + +- fix\(version\): fix version checks of resources [\#28](https://github.com/openebs/upgrade/pull/28) ([shubham14bajpai](https://github.com/shubham14bajpai)) + + ## [v1.12.0](https://github.com/openebs/upgrade/tree/v1.12.0) (2020-07-12) **Merged pull requests:** diff --git a/ci/migrate/sanity.sh b/ci/migrate/sanity.sh index 1e899b74..8d3b1d8a 100755 --- a/ci/migrate/sanity.sh +++ b/ci/migrate/sanity.sh @@ -7,6 +7,11 @@ make migrate-image.amd64 # setup openebs & cstor v1 for migration ./ci/migrate/setup.sh || exit 1 # run migration tests -./ci/migrate/test.sh || exit 1 +./ci/migrate/test.sh +if [[ $? != 0 ]]; then + kubectl logs --tail=50 -l job-name=migrate-pool -n openebs + kubectl logs --tail=50 -l job-name=migrate-volume -n openebs + exit 1 +fi rm ./ci/migrate/volume.yaml ./ci/migrate/application.yaml \ No newline at end of file diff --git a/ci/migrate/setup.sh b/ci/migrate/setup.sh index 3824eb6c..25c9e51c 100755 --- a/ci/migrate/setup.sh +++ b/ci/migrate/setup.sh @@ -27,7 +27,6 @@ kubectl wait --for=condition=Ready pod -l lkey=lvalue --timeout=600s echo "Install cstor & csi operators" -kubectl apply -f https://raw.githubusercontent.com/openebs/charts/gh-pages/csi-operator-ubuntu-18.04.yaml \ - -f https://raw.githubusercontent.com/openebs/charts/gh-pages/cstor-operator.yaml +kubectl apply -f https://raw.githubusercontent.com/openebs/charts/gh-pages/cstor-operator.yaml sleep 5 kubectl wait --for=condition=available --timeout=600s deployment/cspc-operator -n openebs \ No newline at end of file diff --git a/ci/migrate/test.sh b/ci/migrate/test.sh index b94a8012..7a8047e3 100755 --- a/ci/migrate/test.sh +++ b/ci/migrate/test.sh @@ -13,7 +13,7 @@ echo "Migrating pool to cspc" kubectl apply -f ./ci/migrate/pool.yaml sleep 5 -kubectl wait --for=condition=complete job/migrate-pool -n openebs --timeout=800s +kubectl wait --for=condition=complete job/migrate-pool -n openebs --timeout=550s kubectl logs --tail=50 -l job-name=migrate-pool -n openebs echo "Migrating extetnal volume to csi volume" @@ -22,7 +22,7 @@ pvname=$(kubectl get pvc testclaim-busybox-0 -o jsonpath="{.spec.volumeName}") sed "s/PVNAME/$pvname/" ./ci/migrate/volume.tmp.yaml > ./ci/migrate/volume.yaml kubectl apply -f ./ci/migrate/volume.yaml sleep 5 -kubectl wait --for=condition=complete job/migrate-volume -n openebs --timeout=800s +kubectl wait --for=condition=complete job/migrate-volume -n openebs --timeout=550s kubectl logs --tail=50 -l job-name=migrate-volume -n openebs echo "Scaling up application after migration" diff --git a/ci/migrate/volume.tmp.yaml b/ci/migrate/volume.tmp.yaml index a7999c29..194ecebc 100644 --- a/ci/migrate/volume.tmp.yaml +++ b/ci/migrate/volume.tmp.yaml @@ -6,7 +6,7 @@ metadata: name: migrate-volume namespace: openebs spec: - backoffLimit: 4 + backoffLimit: 0 template: spec: #VERIFY the value of serviceAccountName is pointing to service account diff --git a/ci/upgrade/pool.tmp.yaml b/ci/upgrade/pool.tmp.yaml index d5fbb444..59a6d4f3 100644 --- a/ci/upgrade/pool.tmp.yaml +++ b/ci/upgrade/pool.tmp.yaml @@ -16,7 +16,7 @@ metadata: # The above command should return status of the openebs-apiserver. namespace: openebs spec: - backoffLimit: 4 + backoffLimit: 0 template: spec: # VERIFY the value of serviceAccountName is pointing to service account diff --git a/ci/upgrade/pool.yaml b/ci/upgrade/pool.yaml deleted file mode 100644 index c75b9398..00000000 --- a/ci/upgrade/pool.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# This is an example YAML for upgrading cstor CSPC. -# Some of the values below needs to be changed to -# match your openebs installation. The fields are -# indicated with VERIFY ---- -apiVersion: batch/v1 -kind: Job -metadata: - # VERIFY that you have provided a unique name for this upgrade job. - # The name can be any valid K8s string for name. - name: upgrade-pool - - # VERIFY the value of namespace is same as the namespace where openebs components - # are installed. You can verify using the command: - # `kubectl get pods -n -l openebs.io/component-name=maya-apiserver` - # The above command should return status of the openebs-apiserver. - namespace: openebs -spec: - backoffLimit: 4 - template: - spec: - # VERIFY the value of serviceAccountName is pointing to service account - # created within openebs namespace. Use the non-default account. - # by running `kubectl get sa -n ` - serviceAccountName: openebs-maya-operator - containers: - - name: upgrade - args: - - "cstor-cspc" - - # --from-version is the current version of the pool - - "--from-version=1.10.0" - - # --to-version is the version desired upgrade version - - "--to-version=1.12.0-RC1" - # if required the image prefix of the pool deployments can be - # changed using the flag below, defaults to whatever was present on old - # deployments. - #- "--to-version-image-prefix=openebs/" - # if required the image tags for pool deployments can be changed - # to a custom image tag using the flag below, - # defaults to the --to-version mentioned above. - - "--to-version-image-tag=1.12.0-RC1" - - # VERIFY that you have provided the correct list of CSPC Names - - "cspc-stripe" - - # Following are optional parameters - # Log Level - - "--v=4" - # DO NOT CHANGE BELOW PARAMETERS - env: - - name: OPENEBS_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - tty: true - - # the image version should be same as the --to-version mentioned above - # in the args of the job - image: openebs/upgrade-amd64:ci - imagePullPolicy: IfNotPresent - restartPolicy: OnFailure ---- - diff --git a/ci/upgrade/sanity.sh b/ci/upgrade/sanity.sh index 6efeb7c4..4cbb2309 100755 --- a/ci/upgrade/sanity.sh +++ b/ci/upgrade/sanity.sh @@ -38,6 +38,11 @@ export TEST_VERSION=${TEST_VERSION#v} # setup openebs & cstor v1 for migration ./ci/upgrade/setup.sh || exit 1 # run migration tests -./ci/upgrade/test.sh || exit 1 +./ci/upgrade/test.sh +if [[ $? != 0 ]]; then + kubectl logs --tail=50 -l job-name=upgrade-pool -n openebs + kubectl logs --tail=50 -l job-name=upgrade-volume -n openebs + exit 1 +fi rm ./ci/upgrade/volume.yaml ./ci/upgrade/application.yaml \ No newline at end of file diff --git a/ci/upgrade/setup.sh b/ci/upgrade/setup.sh index dfeaddd2..ac204b70 100755 --- a/ci/upgrade/setup.sh +++ b/ci/upgrade/setup.sh @@ -15,7 +15,7 @@ sleep 100 echo "Wait for cspc-operator to start" -kubectl wait --for=condition=available --timeout=600s deployment/cspc-operator -n openebs +kubectl wait --for=condition=available --timeout=300s deployment/cspc-operator -n openebs echo "Create application with cStor volume on CSPC" @@ -24,7 +24,7 @@ bdname=$(kubectl -n openebs get blockdevices -o jsonpath='{.items[*].metadata.na sed "s|CSPCBD|$bdname|g" ./ci/upgrade/application.tmp.yaml | sed "s|NODENAME|$nodename|g" > ./ci/upgrade/application.yaml kubectl apply -f ./ci/upgrade/application.yaml sleep 10 -kubectl wait --for=condition=available --timeout=600s deployment/percona +kubectl wait --for=condition=available --timeout=300s deployment/percona echo "Upgrade control plane to latest version" @@ -33,4 +33,4 @@ sed "s|testimage|$TEST_IMAGE_TAG|g" ./ci/upgrade/cstor-operator.tmp.yaml | sed " kubectl apply -f https://raw.githubusercontent.com/openebs/cstor-operators/master/deploy/csi-operator.yaml \ -f ./ci/upgrade/cstor-operator.yaml sleep 10 -kubectl wait --for=condition=available --timeout=600s deployment/cspc-operator -n openebs +kubectl wait --for=condition=available --timeout=300s deployment/cspc-operator -n openebs diff --git a/ci/upgrade/test.sh b/ci/upgrade/test.sh index 941a56d6..1099bd56 100755 --- a/ci/upgrade/test.sh +++ b/ci/upgrade/test.sh @@ -9,7 +9,7 @@ echo "Upgrading CSPC pool" sed "s|testimage|$TEST_IMAGE_TAG|g" ./ci/upgrade/pool.tmp.yaml | sed "s|testversion|$TEST_VERSION|g" > ./ci/upgrade/pool.yaml kubectl apply -f ./ci/upgrade/pool.yaml sleep 5 -kubectl wait --for=condition=complete job/upgrade-pool -n openebs --timeout=800s +kubectl wait --for=condition=complete job/upgrade-pool -n openebs --timeout=550s kubectl logs --tail=50 -l job-name=upgrade-pool -n openebs echo "Upgrading CSI volume" @@ -18,5 +18,5 @@ pvname=$(kubectl get pvc demo-csi-vol-claim -o jsonpath="{.spec.volumeName}") sed "s|PVNAME|$pvname|g" ./ci/upgrade/volume.tmp.yaml | sed "s|testimage|$TEST_IMAGE_TAG|g" | sed "s|testversion|$TEST_VERSION|g" > ./ci/upgrade/volume.yaml kubectl apply -f ./ci/upgrade/volume.yaml sleep 5 -kubectl wait --for=condition=complete job/upgrade-volume -n openebs --timeout=800s +kubectl wait --for=condition=complete job/upgrade-volume -n openebs --timeout=550s kubectl logs --tail=50 -l job-name=upgrade-volume -n openebs diff --git a/ci/upgrade/volume.tmp.yaml b/ci/upgrade/volume.tmp.yaml index 436bc71e..59c1788a 100644 --- a/ci/upgrade/volume.tmp.yaml +++ b/ci/upgrade/volume.tmp.yaml @@ -16,7 +16,7 @@ metadata: # The above command should return status of the openebs-apiserver. namespace: openebs spec: - backoffLimit: 4 + backoffLimit: 0 template: spec: # VERIFY the value of serviceAccountName is pointing to service account