From fdf6996a714eb563d8a2abeb15a41be9650557d0 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 7 Apr 2020 18:16:39 +0100 Subject: [PATCH 01/30] fix status command --- cmd/skupper/skupper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/skupper/skupper.go b/cmd/skupper/skupper.go index 48f1b05..a49bfef 100644 --- a/cmd/skupper/skupper.go +++ b/cmd/skupper/skupper.go @@ -24,6 +24,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/discovery" @@ -2695,6 +2696,7 @@ func initKubeConfig(options *KubeOptions) *KubeDetails { restconfig.ContentConfig.GroupVersion = &schema.GroupVersion{Version:"v1"} restconfig.APIPath = "/api" + restconfig.NegotiatedSerializer = serializer.WithoutConversionCodecFactory{CodecFactory: scheme.Codecs} details.RestConfig = restconfig details.Standard, err = kubernetes.NewForConfig(restconfig) if err != nil { From 2e3d58c02e0e6b4906c18c77e383edd418dd18b5 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 17:21:31 -0300 Subject: [PATCH 02/30] hello world minikube --- .circleci/config.yml | 60 ++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d65a23c..ff8d274 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,7 @@ version: 2 +orbs: + minikube: ccpgames/minikube@0.0.1 + yaml-templates: branch_filters: &branch_filters filters: @@ -45,38 +48,41 @@ workflows: jobs: - build-linux-386: <<: *release_filters - - build-linux-amd64: - <<: *branch_filters + #- build-linux-amd64: + #<<: *branch_filters - build-darwin-386: <<: *release_filters - - build-darwin-amd64: - <<: *branch_filters + #- build-darwin-amd64: + #<<: *branch_filters - build-windows-386: <<: *release_filters - build-windows-amd64: <<: *branch_filters - - build-linux-arm: - <<: *release_filters - - build-linux-arm64: - <<: *release_filters + #- build-linux-arm: + #<<: *release_filters + #- build-linux-arm64: + #<<: *release_filters - test: <<: *branch_filters - - smoke_test: + #- smoke_test: + #<<: *branch_filters + - http_example_test: <<: *branch_filters - publish-github-release: <<: *release_filters requires: - - build-linux-386 - - build-linux-amd64 - - build-darwin-386 - - build-darwin-amd64 - - build-windows-386 - - build-windows-amd64 - - build-linux-arm - - build-linux-arm64 - - test - - smoke_test + #- build-linux-386 + #- build-linux-amd64 + #- build-darwin-386 + #- build-darwin-amd64 + #- build-windows-386 + #- build-windows-amd64 + #- build-linux-arm + #- build-linux-arm64 + #- test + #- smoke_test + - http_example_test jobs: build-linux-amd64: &go_build @@ -197,6 +203,22 @@ jobs: name: Run Tests command: ./skupper_smoke #set kubeconfig as parameter if needed + http_example_test: + machine: true + environment: &environment + steps: + - run: + name: export + command: | + echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV #not needed? + source $BASH_ENV + - checkout + - minikube/initialize + #clone the example + - run: + name: cluster info + command: kubectl cluster-info + publish-github-release: docker: - image: cibuilds/github:0.10 From 0331cfcdaad22fe996b691f355ab63a73fa9b785 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 17:43:39 -0300 Subject: [PATCH 03/30] circle-ci: version 2.1 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff8d274..39f340b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,4 @@ -version: 2 +version: 2.1 orbs: minikube: ccpgames/minikube@0.0.1 From 1b0e3f7445a84246eac772800f5e5ed8f753958e Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 17:52:04 -0300 Subject: [PATCH 04/30] just triggering --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 39f340b..76c1ada 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,6 +82,7 @@ workflows: #- build-linux-arm64 #- test #- smoke_test + # - http_example_test jobs: From 138a91fdfddda241657252cacfe0614a28d81fb1 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 17:58:50 -0300 Subject: [PATCH 05/30] justa a change --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 76c1ada..dd12b16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,6 +83,7 @@ workflows: #- test #- smoke_test # + # - http_example_test jobs: From f8dee0e93843dcfe63cbc4a43bdf2437bf65168a Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 18:07:05 -0300 Subject: [PATCH 06/30] default executor? --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd12b16..53e8d72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -206,8 +206,8 @@ jobs: command: ./skupper_smoke #set kubeconfig as parameter if needed http_example_test: - machine: true - environment: &environment + executor: minikube/default + #environment: &environment steps: - run: name: export From 74d2c252e8c672c57c528b493455f4dfd0d23105 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 22:25:26 -0300 Subject: [PATCH 07/30] trying another executor --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53e8d72..17235e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -206,7 +206,9 @@ jobs: command: ./skupper_smoke #set kubeconfig as parameter if needed http_example_test: - executor: minikube/default + #executor: minikube/default + machine: true + image: ubuntu-1604:201903-01 #environment: &environment steps: - run: From 3e7ff24d87a9437493984c602e3aa3a4291e5060 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 22:27:10 -0300 Subject: [PATCH 08/30] bugfix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 17235e6..ab6b2d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -207,7 +207,7 @@ jobs: http_example_test: #executor: minikube/default - machine: true + machine: image: ubuntu-1604:201903-01 #environment: &environment steps: From 3abb9df1f4feef6696a9c498b6925e9c1021800b Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 22:48:26 -0300 Subject: [PATCH 09/30] just a test --- .circleci/config.yml | 278 ++++++++----------------------------------- 1 file changed, 50 insertions(+), 228 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab6b2d7..dab5768 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,247 +1,69 @@ -version: 2.1 -orbs: - minikube: ccpgames/minikube@0.0.1 - -yaml-templates: - branch_filters: &branch_filters - filters: - branches: - only: /.*/ - tags: - only: /[0-9].*/ - - release_filters: &release_filters - filters: - branches: - ignore: /.*/ - tags: - only: /[0-9].*/ - - restore_go_cache: &restore_go_cache - restore_cache: - keys: - - go-mod-v1-{{.Environment.GOOS}}-{{.Environment.GOARCH}}-{{ checksum "go.sum" }} - go_mod_download: &go_mod_download - run: - name: Download Go Modules - command: go mod download - save_go_cache: &save_go_cache - save_cache: - key: go-mod-v1-{{.Environment.GOOS}}-{{.Environment.GOARCH}}-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - compile_go_executable: &compile_go_executable - run: - name: Compile Go Executable - command: | - VERSION="${CIRCLE_TAG:-ci-${CIRCLE_BUILD_NUM}}" - echo go build -ldflags "-X main.version=${VERSION}" -o dist/${PLATFORM:-${GOOS}-${GOARCH}}/skupper${EXESUFFIX} ./cmd/skupper - go build -ldflags "-X main.version=${VERSION}" -o dist/${PLATFORM:-${GOOS}-${GOARCH}}/skupper${EXESUFFIX} ./cmd/skupper - store_dist: &store_dist - persist_to_workspace: - root: . - paths: - - dist -workflows: - version: 2 - build-workflow: - jobs: - - build-linux-386: - <<: *release_filters - #- build-linux-amd64: - #<<: *branch_filters - - build-darwin-386: - <<: *release_filters - #- build-darwin-amd64: - #<<: *branch_filters - - build-windows-386: - <<: *release_filters - - build-windows-amd64: - <<: *branch_filters - #- build-linux-arm: - #<<: *release_filters - #- build-linux-arm64: - #<<: *release_filters - - test: - <<: *branch_filters - #- smoke_test: - #<<: *branch_filters - - http_example_test: - <<: *branch_filters - - - publish-github-release: - <<: *release_filters - requires: - #- build-linux-386 - #- build-linux-amd64 - #- build-darwin-386 - #- build-darwin-amd64 - #- build-windows-386 - #- build-windows-amd64 - #- build-linux-arm - #- build-linux-arm64 - #- test - #- smoke_test - # - # - - http_example_test +version: 2 jobs: - build-linux-amd64: &go_build - docker: - - image: circleci/golang:1.13 - environment: &environment - GOOS: linux - GOARCH: amd64 - PLATFORM: linux-amd64 - steps: - - checkout - - <<: *restore_go_cache - - <<: *go_mod_download - - <<: *save_go_cache - - <<: *compile_go_executable - - <<: *store_dist - - build-linux-386: - <<: *go_build - environment: - GOOS: linux - GOARCH: 386 - PLATFORM: linux-i386 - - build-windows-386: - <<: *go_build - environment: - GOOS: windows - GOARCH: 386 - PLATFORM: windows-i386 - EXESUFFIX: ".exe" - - build-windows-amd64: - <<: *go_build - environment: - GOOS: windows - GOARCH: amd64 - PLATFORM: windows-amd64 - EXESUFFIX: ".exe" - - build-darwin-386: - <<: *go_build - environment: - GOOS: darwin - GOARCH: 386 - PLATFORM: mac-i386 - - build-darwin-amd64: - <<: *go_build - environment: - GOOS: darwin - GOARCH: amd64 - PLATFORM: mac-amd64 - - build-linux-arm: - <<: *go_build - environment: - GOOS: linux - GOARCH: arm - PLATFORM: linux-arm32 - - build-linux-arm64: - <<: *go_build + build: + machine: + image: circleci/classic:201808-01 environment: - GOOS: linux - GOARCH: arm64 - PLATFORM: linux-arm64 - - test: - <<: *go_build + K8S_VERSION: v1.10.0 + KUBECONFIG: /home/circleci/.kube/config + MINIKUBE_VERSION: v0.30.0 + MINIKUBE_WANTUPDATENOTIFICATION: false + MINIKUBE_WANTREPORTERRORPROMPT: false + MINIKUBE_HOME: /home/circleci + CHANGE_MINIKUBE_NONE_USER: true steps: - checkout - - <<: *restore_go_cache - - <<: *go_mod_download - - <<: *save_go_cache - run: - name: Run Tests - command: go test ./... - - smoke_test: - machine: true - environment: &environment - steps: - - run: - name: export + name: setup kubectl command: | - echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV - echo 'export GOROOT=/usr/local/go' >> $BASH_ENV - echo 'export GOPATH=$HOME/Projects/Proj1' >> $BASH_ENV - echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV - source $BASH_ENV - - checkout + curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ + mkdir -p ${HOME}/.kube + touch ${HOME}/.kube/config - run: - name: install go 1.13 + name: setup minikube command: | - wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz - sudo tar -xvf go1.13.3.linux-amd64.tar.gz - sudo rm -rf /usr/local/go && sudo mv go /usr/local + curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ - run: - name: print go version - command: go version + name: setup helm + command: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash - run: - name: get kind - command: env GO111MODULE=off go get sigs.k8s.io/kind - - run: - name: compile - command: make - - run: - name: Create kind cluster - command: kind create cluster --wait 30m #bla + name: start minikube + command: | + sudo -E minikube start --vm-driver=none --cpus 2 --memory 2048 --kubernetes-version=${K8S_VERSION} &> $HOME/minikube.log 2>&1 < /dev/null - run: - name: Install kubectl - command: curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.17.4/bin/linux/amd64/kubectl && mkdir -p ~/bin && mv kubectl ~/bin/ && chmod +x ~/bin/kubectl + name: wait for minikube + command: | + 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 - run: - name: print cluster info - command: kubectl cluster-info + name: fix RBAC + command: | + # make default account cluster-admin + kubectl create clusterrolebinding add-on-cluster-admin --clusterrole cluster-admin --serviceaccount=kube-system:default - run: - name: Run Tests - command: ./skupper_smoke #set kubeconfig as parameter if needed - - http_example_test: - #executor: minikube/default - machine: - image: ubuntu-1604:201903-01 - #environment: &environment - steps: + name: dump cluster-info + command: | + kubectl cluster-info + kubectl get po --all-namespaces - run: - name: export + name: install helm in cluster command: | - echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV #not needed? - source $BASH_ENV - - checkout - - minikube/initialize - #clone the example + kubectl -n kube-system create sa tiller + kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller + helm init --wait --service-account tiller - run: - name: cluster info - command: kubectl cluster-info - - publish-github-release: - docker: - - image: cibuilds/github:0.10 - steps: - - attach_workspace: - at: . + name: deploy sample nginx + command: kubectl run circleci-example --image=nginx - run: - name: "Create a Draft Release on GitHub" + name: dump pods & services command: | - VERSION="$CIRCLE_TAG" - BASEDIR=`pwd` - mkdir "${BASEDIR}/archives" - for p in `ls dist` ; do - cd "$BASEDIR/dist/$p" - if [[ $p == windows* ]] ; then - zip -q "${BASEDIR}/archives/skupper-cli-${VERSION}-$p.zip" * - else - tar -zcf "${BASEDIR}/archives/skupper-cli-${VERSION}-$p.tgz" * - fi - done - cd ${BASEDIR} - ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace -prerelease -draft ${VERSION} "${BASEDIR}/archives" + # wait for all pods to start + sleep 30 + # dump pods + kubectl get po --all-namespaces | grep -vE '(kube-sys|docker)' + echo + # dump services + kubectl get svc --all-namespaces | grep -vE '(kube-sys|docker)' From 812509e979ad1817175bff670f418b151e28ae1c Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 22:58:31 -0300 Subject: [PATCH 10/30] other test --- .circleci/config.yml | 285 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 235 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dab5768..92acd08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,69 +1,254 @@ -version: 2 +version: 2.1 +orbs: + minikube: ccpgames/minikube@0.0.1 + +yaml-templates: + branch_filters: &branch_filters + filters: + branches: + only: /.*/ + tags: + only: /[0-9].*/ + + release_filters: &release_filters + filters: + branches: + ignore: /.*/ + tags: + only: /[0-9].*/ + + restore_go_cache: &restore_go_cache + restore_cache: + keys: + - go-mod-v1-{{.Environment.GOOS}}-{{.Environment.GOARCH}}-{{ checksum "go.sum" }} + go_mod_download: &go_mod_download + run: + name: Download Go Modules + command: go mod download + save_go_cache: &save_go_cache + save_cache: + key: go-mod-v1-{{.Environment.GOOS}}-{{.Environment.GOARCH}}-{{ checksum "go.sum" }} + paths: + - "/go/pkg/mod" + compile_go_executable: &compile_go_executable + run: + name: Compile Go Executable + command: | + VERSION="${CIRCLE_TAG:-ci-${CIRCLE_BUILD_NUM}}" + echo go build -ldflags "-X main.version=${VERSION}" -o dist/${PLATFORM:-${GOOS}-${GOARCH}}/skupper${EXESUFFIX} ./cmd/skupper + go build -ldflags "-X main.version=${VERSION}" -o dist/${PLATFORM:-${GOOS}-${GOARCH}}/skupper${EXESUFFIX} ./cmd/skupper + store_dist: &store_dist + persist_to_workspace: + root: . + paths: + - dist +workflows: + version: 2.1 + build-workflow: + jobs: + - build-linux-386: + <<: *release_filters + #- build-linux-amd64: + #<<: *branch_filters + - build-darwin-386: + <<: *release_filters + #- build-darwin-amd64: + #<<: *branch_filters + - build-windows-386: + <<: *release_filters + - build-windows-amd64: + <<: *branch_filters + #- build-linux-arm: + #<<: *release_filters + #- build-linux-arm64: + #<<: *release_filters + - test: + <<: *branch_filters + #- smoke_test: + #<<: *branch_filters + - http_example_test: + <<: *branch_filters + + - publish-github-release: + <<: *release_filters + requires: + #- build-linux-386 + #- build-linux-amd64 + #- build-darwin-386 + #- build-darwin-amd64 + #- build-windows-386 + #- build-windows-amd64 + #- build-linux-arm + #- build-linux-arm64 + #- test + #- smoke_test + # + # + - http_example_test jobs: - build: - machine: - image: circleci/classic:201808-01 + build-linux-amd64: &go_build + docker: + - image: circleci/golang:1.13 + environment: &environment + GOOS: linux + GOARCH: amd64 + PLATFORM: linux-amd64 + steps: + - checkout + - <<: *restore_go_cache + - <<: *go_mod_download + - <<: *save_go_cache + - <<: *compile_go_executable + - <<: *store_dist + + build-linux-386: + <<: *go_build environment: - K8S_VERSION: v1.10.0 - KUBECONFIG: /home/circleci/.kube/config - MINIKUBE_VERSION: v0.30.0 - MINIKUBE_WANTUPDATENOTIFICATION: false - MINIKUBE_WANTREPORTERRORPROMPT: false - MINIKUBE_HOME: /home/circleci - CHANGE_MINIKUBE_NONE_USER: true + GOOS: linux + GOARCH: 386 + PLATFORM: linux-i386 + + build-windows-386: + <<: *go_build + environment: + GOOS: windows + GOARCH: 386 + PLATFORM: windows-i386 + EXESUFFIX: ".exe" + + build-windows-amd64: + <<: *go_build + environment: + GOOS: windows + GOARCH: amd64 + PLATFORM: windows-amd64 + EXESUFFIX: ".exe" + + build-darwin-386: + <<: *go_build + environment: + GOOS: darwin + GOARCH: 386 + PLATFORM: mac-i386 + + build-darwin-amd64: + <<: *go_build + environment: + GOOS: darwin + GOARCH: amd64 + PLATFORM: mac-amd64 + + build-linux-arm: + <<: *go_build + environment: + GOOS: linux + GOARCH: arm + PLATFORM: linux-arm32 + + build-linux-arm64: + <<: *go_build + environment: + GOOS: linux + GOARCH: arm64 + PLATFORM: linux-arm64 + + test: + <<: *go_build steps: - checkout + - <<: *restore_go_cache + - <<: *go_mod_download + - <<: *save_go_cache + - run: + name: Run Tests + command: go test ./... + + smoke_test: + machine: true + environment: &environment + steps: - run: - name: setup kubectl + name: export command: | - curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ - mkdir -p ${HOME}/.kube - touch ${HOME}/.kube/config + echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV + echo 'export GOROOT=/usr/local/go' >> $BASH_ENV + echo 'export GOPATH=$HOME/Projects/Proj1' >> $BASH_ENV + echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV + source $BASH_ENV + - checkout - run: - name: setup minikube + name: install go 1.13 command: | - curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/${MINIKUBE_VERSION}/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ + wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz + sudo tar -xvf go1.13.3.linux-amd64.tar.gz + sudo rm -rf /usr/local/go && sudo mv go /usr/local - run: - name: setup helm - command: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash + name: print go version + command: go version - run: - name: start minikube - command: | - sudo -E minikube start --vm-driver=none --cpus 2 --memory 2048 --kubernetes-version=${K8S_VERSION} &> $HOME/minikube.log 2>&1 < /dev/null + name: get kind + command: env GO111MODULE=off go get sigs.k8s.io/kind - run: - name: wait for minikube - command: | - 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 + name: compile + command: make - run: - name: fix RBAC - command: | - # make default account cluster-admin - kubectl create clusterrolebinding add-on-cluster-admin --clusterrole cluster-admin --serviceaccount=kube-system:default + name: Create kind cluster + command: kind create cluster --wait 30m #bla - run: - name: dump cluster-info - command: | - kubectl cluster-info - kubectl get po --all-namespaces + name: Install kubectl + command: curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.17.4/bin/linux/amd64/kubectl && mkdir -p ~/bin && mv kubectl ~/bin/ && chmod +x ~/bin/kubectl + - run: + name: print cluster info + command: kubectl cluster-info + - run: + name: Run Tests + command: ./skupper_smoke #set kubeconfig as parameter if needed + + http_example_test: + #executor: minikube/default + machine: true + #image: ubuntu-1604:201903-01 + environment: + K8S_VERSION: v1.10.0 + KUBECONFIG: /home/circleci/.kube/config + MINIKUBE_VERSION: v0.30.0 + MINIKUBE_WANTUPDATENOTIFICATION: false + MINIKUBE_WANTREPORTERRORPROMPT: false + MINIKUBE_HOME: /home/circleci + CHANGE_MINIKUBE_NONE_USER: true + steps: - run: - name: install helm in cluster + name: export command: | - kubectl -n kube-system create sa tiller - kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller - helm init --wait --service-account tiller + echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV #not needed? + source $BASH_ENV + - checkout + - minikube/initialize + #clone the example - run: - name: deploy sample nginx - command: kubectl run circleci-example --image=nginx + name: cluster info + command: kubectl cluster-info + + publish-github-release: + docker: + - image: cibuilds/github:0.10 + steps: + - attach_workspace: + at: . - run: - name: dump pods & services + name: "Create a Draft Release on GitHub" command: | - # wait for all pods to start - sleep 30 - # dump pods - kubectl get po --all-namespaces | grep -vE '(kube-sys|docker)' - echo - # dump services - kubectl get svc --all-namespaces | grep -vE '(kube-sys|docker)' + VERSION="$CIRCLE_TAG" + BASEDIR=`pwd` + mkdir "${BASEDIR}/archives" + for p in `ls dist` ; do + cd "$BASEDIR/dist/$p" + if [[ $p == windows* ]] ; then + zip -q "${BASEDIR}/archives/skupper-cli-${VERSION}-$p.zip" * + else + tar -zcf "${BASEDIR}/archives/skupper-cli-${VERSION}-$p.tgz" * + fi + done + cd ${BASEDIR} + ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace -prerelease -draft ${VERSION} "${BASEDIR}/archives" From 795d89336387e3ce01e104f6df5ce1a2afc26348 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 23:02:33 -0300 Subject: [PATCH 11/30] testing other image --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92acd08..0942a22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -207,8 +207,8 @@ jobs: http_example_test: #executor: minikube/default - machine: true - #image: ubuntu-1604:201903-01 + machine: #true + image: ubuntu-1604:201903-01 environment: K8S_VERSION: v1.10.0 KUBECONFIG: /home/circleci/.kube/config From 3d5da0c56cfb45e098c7e314781e776ee641af40 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Wed, 15 Apr 2020 23:04:14 -0300 Subject: [PATCH 12/30] ottther image --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0942a22..3477202 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -208,7 +208,8 @@ jobs: http_example_test: #executor: minikube/default machine: #true - image: ubuntu-1604:201903-01 + #image: ubuntu-1604:201903-01 + image: circleci/classic:201808-01 environment: K8S_VERSION: v1.10.0 KUBECONFIG: /home/circleci/.kube/config From 27f71945add6dde0212eea06af6e05a2d94cd1ab Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Thu, 16 Apr 2020 13:49:49 -0300 Subject: [PATCH 13/30] latest minikube? --- .circleci/config.yml | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3477202..51d4ad2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,33 @@ version: 2.1 orbs: - minikube: ccpgames/minikube@0.0.1 + docker: circleci/docker@1.0.1 + kube-orb: circleci/kubernetes + +commands: + minikube-install: + description: Installs the minikube executable onto the system. + parameters: + version: + default: v0.30.0 + type: string + steps: + - run: + command: >- + curl -Lo minikube + https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && + chmod +x minikube && sudo + mv minikube /usr/local/bin/ + name: Install Minikube Executable + + minikube-start: + description: Starts the minikube service. + steps: + - run: + command: >- + sudo -E minikube start --vm-driver=none --cpus 2 --memory 2048 + --kubernetes-version=<< parameters.version >> &> $HOME/minikube.log 2>&1 + < /dev/null + name: Start Minikube Cluster yaml-templates: branch_filters: &branch_filters @@ -208,12 +235,12 @@ jobs: http_example_test: #executor: minikube/default machine: #true - #image: ubuntu-1604:201903-01 - image: circleci/classic:201808-01 + image: ubuntu-1604:201903-01 + #image: circleci/classic:201808-01 environment: - K8S_VERSION: v1.10.0 + K8S_VERSION: v1.15.3 KUBECONFIG: /home/circleci/.kube/config - MINIKUBE_VERSION: v0.30.0 + MINIKUBE_VERSION: v1.3.1 MINIKUBE_WANTUPDATENOTIFICATION: false MINIKUBE_WANTREPORTERRORPROMPT: false MINIKUBE_HOME: /home/circleci @@ -225,7 +252,11 @@ jobs: echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV #not needed? source $BASH_ENV - checkout - - minikube/initialize + - docker/install-docker + - kube-orb/install-kubectl + - minikube-install + - minikube-start + #clone the example - run: name: cluster info From f4cd6da01b4deee15c1ee703b4d0e530a23c9bb0 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Thu, 16 Apr 2020 13:51:36 -0300 Subject: [PATCH 14/30] added missing orb version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 51d4ad2..c4c2886 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: docker: circleci/docker@1.0.1 - kube-orb: circleci/kubernetes + kube-orb: circleci/kubernetes@0.11.0 commands: minikube-install: From d300e85281ddeb17308f466e3f4cc258e41d9629 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Thu, 16 Apr 2020 13:54:08 -0300 Subject: [PATCH 15/30] just using default version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4c2886..aa4633e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ commands: - run: command: >- sudo -E minikube start --vm-driver=none --cpus 2 --memory 2048 - --kubernetes-version=<< parameters.version >> &> $HOME/minikube.log 2>&1 + &> $HOME/minikube.log 2>&1 < /dev/null name: Start Minikube Cluster From 66d00dc3b9375a21e4bfc36249322ac07dd2d11e Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Thu, 16 Apr 2020 14:38:08 -0300 Subject: [PATCH 16/30] CHANGE_MINIKUBE_NONE_USER + conntrack --- .circleci/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa4633e..5ee217b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,9 +19,18 @@ commands: mv minikube /usr/local/bin/ name: Install Minikube Executable + install-conntrack: + description: Starts the minikube service. + steps: + - run: + command: >- + sudo apt-get update -y && sudo apt-get install -y conntrack + name: Install conntrack + minikube-start: description: Starts the minikube service. steps: + - install-conntrack - run: command: >- sudo -E minikube start --vm-driver=none --cpus 2 --memory 2048 @@ -29,6 +38,7 @@ commands: < /dev/null name: Start Minikube Cluster + yaml-templates: branch_filters: &branch_filters filters: @@ -250,6 +260,7 @@ jobs: name: export command: | echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV #not needed? + echo 'CHANGE_MINIKUBE_NONE_USER=true' >> $BASH_ENV #not needed? source $BASH_ENV - checkout - docker/install-docker From d9313233d6695565f21fd5bd59c5ac7033a37cba Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Thu, 16 Apr 2020 14:55:10 -0300 Subject: [PATCH 17/30] testing http_echo example using orbs --- .circleci/config.yml | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ee217b..eed9b83 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,6 +2,7 @@ version: 2.1 orbs: docker: circleci/docker@1.0.1 kube-orb: circleci/kubernetes@0.11.0 + go: circleci/go@1.1.1 commands: minikube-install: @@ -38,6 +39,16 @@ commands: < /dev/null name: Start Minikube Cluster + kind-start: + description: install kind cluster + steps: + - run: + name: get kind + command: env GO111MODULE=off go get sigs.k8s.io/kind + - run: + name: Create kind cluster + command: kind create cluster --wait 30m #bla + yaml-templates: branch_filters: &branch_filters @@ -101,10 +112,10 @@ workflows: #<<: *release_filters - test: <<: *branch_filters - #- smoke_test: - #<<: *branch_filters - - http_example_test: + - smoke_test: <<: *branch_filters + #- http_example_test: + #<<: *branch_filters - publish-github-release: <<: *release_filters @@ -118,10 +129,10 @@ workflows: #- build-linux-arm #- build-linux-arm64 #- test - #- smoke_test + - smoke_test # # - - http_example_test + #- http_example_test jobs: build-linux-amd64: &go_build @@ -214,27 +225,15 @@ jobs: echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV source $BASH_ENV - checkout - - run: - name: install go 1.13 - command: | - wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz - sudo tar -xvf go1.13.3.linux-amd64.tar.gz - sudo rm -rf /usr/local/go && sudo mv go /usr/local + - go/install + - kind-start + - kube-orb/install-kubectl - run: name: print go version command: go version - - run: - name: get kind - command: env GO111MODULE=off go get sigs.k8s.io/kind - run: name: compile command: make - - run: - name: Create kind cluster - command: kind create cluster --wait 30m #bla - - run: - name: Install kubectl - command: curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.17.4/bin/linux/amd64/kubectl && mkdir -p ~/bin && mv kubectl ~/bin/ && chmod +x ~/bin/kubectl - run: name: print cluster info command: kubectl cluster-info From 4f075aec9714eb94405d0d6ee9fac3eb333132b5 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Thu, 16 Apr 2020 15:06:31 -0300 Subject: [PATCH 18/30] removing any previous go installation --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index eed9b83..c4f58ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -225,6 +225,9 @@ jobs: echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV source $BASH_ENV - checkout + - run: + name: cleanup previous go installation + command: sudo rm -rf /usr/local/go - go/install - kind-start - kube-orb/install-kubectl From 3a3e094ca7059161814afc70f099f1baa4563714 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 16:59:07 -0300 Subject: [PATCH 19/30] e2e refactor first try --- .circleci/config.yml | 129 ++++++++++++------------------------------- 1 file changed, 34 insertions(+), 95 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4f58ac..5ce22b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,11 @@ orbs: kube-orb: circleci/kubernetes@0.11.0 go: circleci/go@1.1.1 +#executors: + #e2e_tets_executor: + #machine: #true + #image: ubuntu-1604:201903-01 + commands: minikube-install: description: Installs the minikube executable onto the system. @@ -20,34 +25,38 @@ commands: mv minikube /usr/local/bin/ name: Install Minikube Executable - install-conntrack: - description: Starts the minikube service. - steps: - - run: - command: >- - sudo apt-get update -y && sudo apt-get install -y conntrack - name: Install conntrack - minikube-start: description: Starts the minikube service. steps: - install-conntrack - run: command: >- - sudo -E minikube start --vm-driver=none --cpus 2 --memory 2048 + sudo -E minikube start --vm-driver=docker --cpus 2 --memory 2048 &> $HOME/minikube.log 2>&1 < /dev/null name: Start Minikube Cluster kind-start: description: install kind cluster + parameters: + LoadBalancer: + #required + type: boolean steps: - run: name: get kind command: env GO111MODULE=off go get sigs.k8s.io/kind - run: name: Create kind cluster - command: kind create cluster --wait 30m #bla + command: kind create cluster --wait 30m + + run_e2e_tests: + description: run all e2e tests inside the current KUBECONFIG configured cluster + #In this step is where we execute shipshape, ginkgo, kubetest or whatever. + steps: + - run: + name: Run Tests + command: ./skupper_smoke #set kubeconfig as parameter if needed yaml-templates: @@ -65,7 +74,7 @@ yaml-templates: tags: only: /[0-9].*/ - restore_go_cache: &restore_go_cache + restore_go_cach: &restore_go_cache restore_cache: keys: - go-mod-v1-{{.Environment.GOOS}}-{{.Environment.GOARCH}}-{{ checksum "go.sum" }} @@ -92,6 +101,7 @@ yaml-templates: - dist workflows: version: 2.1 + #create the "test workflow" build-workflow: jobs: - build-linux-386: @@ -112,27 +122,11 @@ workflows: #<<: *release_filters - test: <<: *branch_filters - - smoke_test: - <<: *branch_filters - #- http_example_test: - #<<: *branch_filters - - publish-github-release: - <<: *release_filters - requires: - #- build-linux-386 - #- build-linux-amd64 - #- build-darwin-386 - #- build-darwin-amd64 - #- build-windows-386 - #- build-windows-amd64 - #- build-linux-arm - #- build-linux-arm64 - #- test - - smoke_test - # - # - #- http_example_test + e2e_workflow: + jobs: + - e2e_tests: + <<: *branch_filters jobs: build-linux-amd64: &go_build @@ -212,88 +206,33 @@ jobs: name: Run Tests command: go test ./... - smoke_test: + #we will assume any smoke tests setups and teardown letting the cluster in the + #same state it was before running the tests + e2e_tests: machine: true environment: &environment steps: - run: - name: export + #TODO add a comment saying why is this needed. + name: Export environment variables persistent in execution shell command: | echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV echo 'export GOROOT=/usr/local/go' >> $BASH_ENV - echo 'export GOPATH=$HOME/Projects/Proj1' >> $BASH_ENV + echo 'export GOPATH=$HOME/go' >> $BASH_ENV echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV source $BASH_ENV - checkout - run: name: cleanup previous go installation command: sudo rm -rf /usr/local/go + - docker/install-docker - go/install - - kind-start - kube-orb/install-kubectl - - run: - name: print go version - command: go version + - kind-start - run: name: compile command: make - run: name: print cluster info command: kubectl cluster-info - - run: - name: Run Tests - command: ./skupper_smoke #set kubeconfig as parameter if needed - - http_example_test: - #executor: minikube/default - machine: #true - image: ubuntu-1604:201903-01 - #image: circleci/classic:201808-01 - environment: - K8S_VERSION: v1.15.3 - KUBECONFIG: /home/circleci/.kube/config - MINIKUBE_VERSION: v1.3.1 - MINIKUBE_WANTUPDATENOTIFICATION: false - MINIKUBE_WANTREPORTERRORPROMPT: false - MINIKUBE_HOME: /home/circleci - CHANGE_MINIKUBE_NONE_USER: true - steps: - - run: - name: export - command: | - echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV #not needed? - echo 'CHANGE_MINIKUBE_NONE_USER=true' >> $BASH_ENV #not needed? - source $BASH_ENV - - checkout - - docker/install-docker - - kube-orb/install-kubectl - - minikube-install - - minikube-start - - #clone the example - - run: - name: cluster info - command: kubectl cluster-info - - publish-github-release: - docker: - - image: cibuilds/github:0.10 - steps: - - attach_workspace: - at: . - - run: - name: "Create a Draft Release on GitHub" - command: | - VERSION="$CIRCLE_TAG" - BASEDIR=`pwd` - mkdir "${BASEDIR}/archives" - for p in `ls dist` ; do - cd "$BASEDIR/dist/$p" - if [[ $p == windows* ]] ; then - zip -q "${BASEDIR}/archives/skupper-cli-${VERSION}-$p.zip" * - else - tar -zcf "${BASEDIR}/archives/skupper-cli-${VERSION}-$p.tgz" * - fi - done - cd ${BASEDIR} - ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace -prerelease -draft ${VERSION} "${BASEDIR}/archives" + - run_e2e_tests From a088c01db5ccbbd7588257db8c509ba74c669693 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:06:40 -0300 Subject: [PATCH 20/30] removed parameter --- .circleci/config.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ce22b1..ba34b38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,13 @@ orbs: #e2e_tets_executor: #machine: #true #image: ubuntu-1604:201903-01 + #parameters: + #LoadBalancer: + ##required + #type: boolean + #steps: + #- kube-orb/install-kubectl + commands: minikube-install: @@ -35,13 +42,10 @@ commands: &> $HOME/minikube.log 2>&1 < /dev/null name: Start Minikube Cluster + #minikube-start-load-balancer: #minikube tunnel in background kind-start: description: install kind cluster - parameters: - LoadBalancer: - #required - type: boolean steps: - run: name: get kind From e5b5765d1bb5be6d07d02bbd9decca54670615e8 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:18:46 -0300 Subject: [PATCH 21/30] executor experiment --- .circleci/config.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba34b38..f15cd2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,16 +4,16 @@ orbs: kube-orb: circleci/kubernetes@0.11.0 go: circleci/go@1.1.1 -#executors: - #e2e_tets_executor: - #machine: #true +executors: + e2e_tets_executor: + machine: true #image: ubuntu-1604:201903-01 #parameters: #LoadBalancer: ##required #type: boolean - #steps: - #- kube-orb/install-kubectl + steps: + - kube-orb/install-kubectl commands: @@ -213,7 +213,8 @@ jobs: #we will assume any smoke tests setups and teardown letting the cluster in the #same state it was before running the tests e2e_tests: - machine: true + #machine: true + executor: e2e_tets_executor environment: &environment steps: - run: From 64c6e3ebe4f92088c96ea67c451b941d23ea1e9c Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:24:00 -0300 Subject: [PATCH 22/30] bugfix? --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f15cd2f..b87a8f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,8 @@ orbs: executors: e2e_tets_executor: - machine: true + machine: + image: circleci/classic:latest #image: ubuntu-1604:201903-01 #parameters: #LoadBalancer: From f514a518ea46e71b6136135b193890c14672a446 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:26:29 -0300 Subject: [PATCH 23/30] bugfix? --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b87a8f7..a3a6705 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,8 +13,8 @@ executors: #LoadBalancer: ##required #type: boolean - steps: - - kube-orb/install-kubectl + #steps: + #- kube-orb/install-kubectl commands: From b7ad2f058d83f75d66a88a5a7064b62e985c8916 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:32:18 -0300 Subject: [PATCH 24/30] now with minikube --- .circleci/config.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a3a6705..f2a49fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ executors: e2e_tets_executor: machine: image: circleci/classic:latest - #image: ubuntu-1604:201903-01 + #image: ubuntu-1604:201903-01 #newer image available #parameters: #LoadBalancer: ##required @@ -36,14 +36,21 @@ commands: minikube-start: description: Starts the minikube service. steps: - - install-conntrack + #- install-conntrack - run: command: >- sudo -E minikube start --vm-driver=docker --cpus 2 --memory 2048 &> $HOME/minikube.log 2>&1 < /dev/null name: Start Minikube Cluster - #minikube-start-load-balancer: #minikube tunnel in background + + minikube-start-load-balancer: + description: Starts the minikube tunnel + steps: + - run: + command: >- + sudo minikube tunnel & + name: Start Minikube Tunnel kind-start: description: install kind cluster @@ -234,7 +241,10 @@ jobs: - docker/install-docker - go/install - kube-orb/install-kubectl - - kind-start + #- kind-start + - minikube-install + - minikube-start + - minikube-LoadBalancer - run: name: compile command: make From d12d362923f671116c7804dedadd5b9f2e0ab09d Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:33:53 -0300 Subject: [PATCH 25/30] bugfix in command name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2a49fb..b37708a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -244,7 +244,7 @@ jobs: #- kind-start - minikube-install - minikube-start - - minikube-LoadBalancer + - minikube-start-load-balancer - run: name: compile command: make From b48ddc7cfb436ed6327c41bf5a01215067f184d9 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:35:35 -0300 Subject: [PATCH 26/30] show the error --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b37708a..64e2e73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,8 +40,6 @@ commands: - run: command: >- sudo -E minikube start --vm-driver=docker --cpus 2 --memory 2048 - &> $HOME/minikube.log 2>&1 - < /dev/null name: Start Minikube Cluster minikube-start-load-balancer: From 38781f1c0a94e4cd84851acfcbf1b2b0019c8795 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:41:28 -0300 Subject: [PATCH 27/30] other try --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64e2e73..e989ad5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,8 +219,8 @@ jobs: #we will assume any smoke tests setups and teardown letting the cluster in the #same state it was before running the tests e2e_tests: - #machine: true - executor: e2e_tets_executor + machine: true + #executor: e2e_tets_executor environment: &environment steps: - run: @@ -236,7 +236,7 @@ jobs: - run: name: cleanup previous go installation command: sudo rm -rf /usr/local/go - - docker/install-docker + #- docker/install-docker - go/install - kube-orb/install-kubectl #- kind-start From 1afdfe15ac9672cb5acceea17504608730cdc632 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 17:55:34 -0300 Subject: [PATCH 28/30] no sudo for docker driver --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e989ad5..35ffe44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,7 @@ commands: #- install-conntrack - run: command: >- - sudo -E minikube start --vm-driver=docker --cpus 2 --memory 2048 + minikube start --vm-driver=docker --cpus 2 --memory 2048 name: Start Minikube Cluster minikube-start-load-balancer: From 83b28c9d38ff2cfea93329ac30b5f5445f64dba8 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 22:47:16 -0300 Subject: [PATCH 29/30] running kind and minikube cluster? --- .circleci/config.yml | 90 ++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35ffe44..efe3431 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,14 +8,6 @@ executors: e2e_tets_executor: machine: image: circleci/classic:latest - #image: ubuntu-1604:201903-01 #newer image available - #parameters: - #LoadBalancer: - ##required - #type: boolean - #steps: - #- kube-orb/install-kubectl - commands: minikube-install: @@ -36,7 +28,6 @@ commands: minikube-start: description: Starts the minikube service. steps: - #- install-conntrack - run: command: >- minikube start --vm-driver=docker --cpus 2 --memory 2048 @@ -60,13 +51,40 @@ commands: name: Create kind cluster command: kind create cluster --wait 30m + prepare_for_local_cluster_e2e: + description: install right versions of go, docker, kubectl, and also build + steps: + - run: + #TODO add a comment saying why is this needed. + name: Export environment variables persistent in execution shell + command: | + echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV + echo 'export GOROOT=/usr/local/go' >> $BASH_ENV + echo 'export GOPATH=$HOME/go' >> $BASH_ENV + echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV + source $BASH_ENV + - checkout + - run: + name: cleanup previous go installation + command: sudo rm -rf /usr/local/go + - docker/install-docker + - go/install + - kube-orb/install-kubectl + - run: make + + #we will assume any smoke tests setups and teardown letting the cluster in the + #same state it was before running the tests run_e2e_tests: description: run all e2e tests inside the current KUBECONFIG configured cluster #In this step is where we execute shipshape, ginkgo, kubetest or whatever. + parameters: + args: + default: "" + type: string steps: - run: name: Run Tests - command: ./skupper_smoke #set kubeconfig as parameter if needed + command: ./skupper_smoke #not supported for now << parameters.args >> yaml-templates: @@ -133,10 +151,15 @@ workflows: - test: <<: *branch_filters - e2e_workflow: - jobs: - - e2e_tests: + - minikube_local_cluster_e2e_tests: <<: *branch_filters + pre-steps: + - prepare_for_local_cluster_e2e + + - kind_local_cluster_e2e_tests: + <<: *branch_filters + pre-steps: + - prepare_for_local_cluster_e2e jobs: build-linux-amd64: &go_build @@ -216,37 +239,22 @@ jobs: name: Run Tests command: go test ./... - #we will assume any smoke tests setups and teardown letting the cluster in the - #same state it was before running the tests - e2e_tests: - machine: true - #executor: e2e_tets_executor + minikube_local_cluster_e2e_tests: + executor: e2e_tets_executor environment: &environment steps: - - run: - #TODO add a comment saying why is this needed. - name: Export environment variables persistent in execution shell - command: | - echo 'export KUBECONFIG=/home/circleci/.kube/config' >> $BASH_ENV - echo 'export GOROOT=/usr/local/go' >> $BASH_ENV - echo 'export GOPATH=$HOME/go' >> $BASH_ENV - echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> $BASH_ENV - source $BASH_ENV - - checkout - - run: - name: cleanup previous go installation - command: sudo rm -rf /usr/local/go - #- docker/install-docker - - go/install - - kube-orb/install-kubectl - #- kind-start - minikube-install - minikube-start - minikube-start-load-balancer - - run: - name: compile - command: make - - run: - name: print cluster info - command: kubectl cluster-info + - run: kubectl cluster-info - run_e2e_tests + args: "" #no cluster local since minikube has load balancer + + kind_local_cluster_e2e_tests: + executor: e2e_tets_executor + environment: &environment + steps: + - kind-start + - run: kubectl cluster-info + - run_e2e_tests: + args: "--cluster-local" #cluster local since kind has no load balancer From a2f09e4da6860b1148af5af5fae60f9bac5b49e7 Mon Sep 17 00:00:00 2001 From: Nicolas Brignone Date: Tue, 21 Apr 2020 22:49:43 -0300 Subject: [PATCH 30/30] bugfix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index efe3431..7e9c71b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -247,7 +247,7 @@ jobs: - minikube-start - minikube-start-load-balancer - run: kubectl cluster-info - - run_e2e_tests + - run_e2e_tests: args: "" #no cluster local since minikube has load balancer kind_local_cluster_e2e_tests: