From 4ee9934fb8c2454c66f225128ec59ec95492041b Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 17 Jan 2020 19:22:52 +0000 Subject: [PATCH 1/5] test dirty npm --- .pipelines/e2e-step-template.yaml | 10 +++++----- .pipelines/pipeline.yaml | 8 ++++++++ test/e2e/kubernetes/cniLinux1604.json | 14 +++++++++++++- test/e2e/kubernetes/cniLinux1804.json | 14 +++++++++++++- test/e2e/kubernetes/cniWindows1809.json | 14 +++++++++++++- test/e2e/kubernetes/cniWindows1903.json | 14 +++++++++++++- 6 files changed, 65 insertions(+), 9 deletions(-) diff --git a/.pipelines/e2e-step-template.yaml b/.pipelines/e2e-step-template.yaml index 6c8c929cde..36d4db016b 100644 --- a/.pipelines/e2e-step-template.yaml +++ b/.pipelines/e2e-step-template.yaml @@ -66,12 +66,12 @@ steps: export CNI_URL=https://$(ARTIFACT_STORAGE).blob.core.windows.net/acn-$(CommitHash)/azure-vnet-cni-${{ parameters.clusterDefinitionCniBuildOS }}-amd64-$(Tag)${{ parameters.clusterDefinitionCniBuildExt }} export CNI_TYPE=${{ parameters.clusterDefinitionCniTypeKey }} echo CNI type is $CNI_TYPE - #sed -i "s|\"$CNI_TYPE\":\".*\"|\"$CNI_TYPE\":$CNI_URL|g" '${{ parameters.clusterDefinition }}' - # sed -i "s|\"$CNI_TYPE\":\".*\"|\"$CNI_TYPE\":$CNI_URL|g" '${{ parameters.clusterDefinition }}' - cat '${{ parameters.clusterDefinition }}' | jq --arg cnikey $CNI_TYPE --arg cniurl $CNI_URL '.properties.orchestratorProfile.kubernetesConfig[$cnikey]= $cniurl' > '${{ parameters.clusterDefinition }}'.tmp # - # sed -i "s|\"azureCNIVersion\":\".*\"|\"azureCNIVersion\":\"$(Tag)\"|g" '${{ parameters.clusterDefinition }}' - #sed -i "s|\"azureCNIVersion\":\".*\"|\"azureCNIVersion\":\"$(Tag)\"|g" '${{ parameters.clusterDefinition }}' + cat '${{ parameters.clusterDefinition }}' | jq --arg cnikey $CNI_TYPE --arg cniurl $CNI_URL '.properties.orchestratorProfile.kubernetesConfig[$cnikey]= $cniurl' > '${{ parameters.clusterDefinition }}'.tmp cat '${{ parameters.clusterDefinition }}'.tmp | jq --arg tag $(Tag) '.properties.orchestratorProfile.kubernetesConfig.azureCNIVersion = $tag' > '${{ parameters.clusterDefinition }}' + + '${{ parameters.clusterDefinition }}' | jq --arg npmimage containernetworking/azure-npm:$(DockerTag) '.properties.orchestratorProfile.kubernetesConfig.addons[0].containers[0].image = $npmimage' > '${{ parameters.clusterDefinition }}'.tmp + mv '${{ parameters.clusterDefinition }}'.tmp '${{ parameters.clusterDefinition }}' + echo "Running E2E tests against a cluster built with the following API model:" cat '${{ parameters.clusterDefinition }}' cp ${{ parameters.clusterDefinition }} clusterDefinition.json diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 5d4fe31f6a..0411b1543b 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -59,6 +59,7 @@ stages: echo "##vso[task.setvariable variable=Tag;isOutput=true]$(git describe --tags --always --dirty)" echo "Set tag to $(git describe --tags --always --dirty)" fi + echo "##vso[task.setvariable variable=DockerTag;isOutput=true]$(git describe --tags --always --dirty)" #Tag created in Makefile workingDirectory: "$(modulePath)" name: "EnvironmentalVariables" displayName: "Set build environmental variables" @@ -86,10 +87,17 @@ stages: make all-binaries VERSION=$(EnvironmentalVariables.Tag) export GOOS=windows make all-binaries VERSION=$(EnvironmentalVariables.Tag) + + docker login -u '$DOCKER_USERNAME' -p 'DOCKER_PASSWORD' + make azure-npm-image + docker tag containernetworking.azurecr.io/public/containernetworking/azure-npm:$(DockerTag) containernetworking/azure-npm:$(DockerTag) + docker push containernetworking/azure-npm:$(DockerTag) + cd output sudo find . -mindepth 2 -type f -regextype posix-extended ! -iregex '.*\.(zip|tgz)$' -delete sudo find . -mindepth 2 -type f -print -exec mv {} . \; sudo rm -R -- */ + workingDirectory: "$(modulePath)" name: "Build" displayName: "Build" diff --git a/test/e2e/kubernetes/cniLinux1604.json b/test/e2e/kubernetes/cniLinux1604.json index 1e9da55b37..04c7619e29 100644 --- a/test/e2e/kubernetes/cniLinux1604.json +++ b/test/e2e/kubernetes/cniLinux1604.json @@ -12,7 +12,19 @@ "apiServerConfig": { "--tls-min-version": "VersionTLS12", "--tls-cipher-suites": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - } + }, + "addons": [ + { + "name": "azure-npm-daemonset", + "enabled": true, + "containers": [ + { + "name": "azure-npm-daemonset", + "image": "" + } + ] + } + ] } }, "masterProfile": { diff --git a/test/e2e/kubernetes/cniLinux1804.json b/test/e2e/kubernetes/cniLinux1804.json index 4f89417aa1..472eee6409 100644 --- a/test/e2e/kubernetes/cniLinux1804.json +++ b/test/e2e/kubernetes/cniLinux1804.json @@ -12,7 +12,19 @@ "apiServerConfig": { "--tls-min-version": "VersionTLS12", "--tls-cipher-suites": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - } + }, + "addons": [ + { + "name": "azure-npm-daemonset", + "enabled": true, + "containers": [ + { + "name": "azure-npm-daemonset", + "image": "" + } + ] + } + ] } }, "masterProfile": { diff --git a/test/e2e/kubernetes/cniWindows1809.json b/test/e2e/kubernetes/cniWindows1809.json index c8fa2db943..9a00e07cc1 100644 --- a/test/e2e/kubernetes/cniWindows1809.json +++ b/test/e2e/kubernetes/cniWindows1809.json @@ -12,7 +12,19 @@ "apiServerConfig": { "--tls-min-version": "VersionTLS12", "--tls-cipher-suites": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - } + }, + "addons": [ + { + "name": "azure-npm-daemonset", + "enabled": true, + "containers": [ + { + "name": "azure-npm-daemonset", + "image": "" + } + ] + } + ] } }, "masterProfile": { diff --git a/test/e2e/kubernetes/cniWindows1903.json b/test/e2e/kubernetes/cniWindows1903.json index 23716d725a..f87d03273d 100644 --- a/test/e2e/kubernetes/cniWindows1903.json +++ b/test/e2e/kubernetes/cniWindows1903.json @@ -12,7 +12,19 @@ "apiServerConfig": { "--tls-min-version": "VersionTLS12", "--tls-cipher-suites": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - } + }, + "addons": [ + { + "name": "azure-npm-daemonset", + "enabled": true, + "containers": [ + { + "name": "azure-npm-daemonset", + "image": "" + } + ] + } + ] } }, "masterProfile": { From a04ceaffa0c8f59b1a1bee308a0aa32ef5c2779c Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 17 Jan 2020 19:33:16 +0000 Subject: [PATCH 2/5] test dirty npm --- .pipelines/Dockerfile | 1 + .pipelines/e2e-job-template.yaml | 2 +- .pipelines/e2e-step-template.yaml | 6 ++---- .pipelines/pipeline.yaml | 31 ++++++++++++------------------- Makefile | 1 + 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.pipelines/Dockerfile b/.pipelines/Dockerfile index a5f06e74eb..24935d49c9 100644 --- a/.pipelines/Dockerfile +++ b/.pipelines/Dockerfile @@ -4,6 +4,7 @@ RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsof RUN sudo dpkg -i packages-microsoft-prod.deb RUN add-apt-repository ppa:longsleep/golang-backports RUN curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh RUN apt-get install -y git golang-go=2:1.13~1longsleep1+xenial iptables ipset iproute2 ebtables python-pip gcc zip dotnet-sdk-2.2 azure-cli RUN sudo pip install coverage RUN if [ -f Gopkg.toml ]; then curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh ; fi diff --git a/.pipelines/e2e-job-template.yaml b/.pipelines/e2e-job-template.yaml index bd3b325d33..a18a472d23 100644 --- a/.pipelines/e2e-job-template.yaml +++ b/.pipelines/e2e-job-template.yaml @@ -1,6 +1,6 @@ parameters: name: "" - pipelineBuildImage: "containernetworking/pipeline-ci:1.0.4" + pipelineBuildImage: "containernetworking/pipeline-ci:1.0.6" clusterDefinition: "" clusterDefinitionCniTypeKey: "" clusterDefinitionCniBuildOS: "" diff --git a/.pipelines/e2e-step-template.yaml b/.pipelines/e2e-step-template.yaml index 36d4db016b..9726b7c608 100644 --- a/.pipelines/e2e-step-template.yaml +++ b/.pipelines/e2e-step-template.yaml @@ -66,12 +66,10 @@ steps: export CNI_URL=https://$(ARTIFACT_STORAGE).blob.core.windows.net/acn-$(CommitHash)/azure-vnet-cni-${{ parameters.clusterDefinitionCniBuildOS }}-amd64-$(Tag)${{ parameters.clusterDefinitionCniBuildExt }} export CNI_TYPE=${{ parameters.clusterDefinitionCniTypeKey }} echo CNI type is $CNI_TYPE - cat '${{ parameters.clusterDefinition }}' | jq --arg cnikey $CNI_TYPE --arg cniurl $CNI_URL '.properties.orchestratorProfile.kubernetesConfig[$cnikey]= $cniurl' > '${{ parameters.clusterDefinition }}'.tmp + cat '${{ parameters.clusterDefinition }}' | jq --arg cnikey $CNI_TYPE --arg cniurl $CNI_URL '.properties.orchestratorProfile.kubernetesConfig[$cnikey]= $cniurl' > '${{ parameters.clusterDefinition }}'.tmp # cat '${{ parameters.clusterDefinition }}'.tmp | jq --arg tag $(Tag) '.properties.orchestratorProfile.kubernetesConfig.azureCNIVersion = $tag' > '${{ parameters.clusterDefinition }}' - - '${{ parameters.clusterDefinition }}' | jq --arg npmimage containernetworking/azure-npm:$(DockerTag) '.properties.orchestratorProfile.kubernetesConfig.addons[0].containers[0].image = $npmimage' > '${{ parameters.clusterDefinition }}'.tmp + cat '${{ parameters.clusterDefinition }}' | jq --arg npmimage containernetworking/azure-npm:$(Tag) '.properties.orchestratorProfile.kubernetesConfig.addons[0].containers[0].image = $npmimage' > '${{ parameters.clusterDefinition }}'.tmp mv '${{ parameters.clusterDefinition }}'.tmp '${{ parameters.clusterDefinition }}' - echo "Running E2E tests against a cluster built with the following API model:" cat '${{ parameters.clusterDefinition }}' cp ${{ parameters.clusterDefinition }} clusterDefinition.json diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 0411b1543b..ef596228ef 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -17,7 +17,7 @@ stages: demands: agent.os -equals Linux container: - image: containernetworking/pipeline-ci:1.0.4 + image: containernetworking/pipeline-ci:1.0.6 options: "--privileged" # Go setup for the vmImage: @@ -59,7 +59,6 @@ stages: echo "##vso[task.setvariable variable=Tag;isOutput=true]$(git describe --tags --always --dirty)" echo "Set tag to $(git describe --tags --always --dirty)" fi - echo "##vso[task.setvariable variable=DockerTag;isOutput=true]$(git describe --tags --always --dirty)" #Tag created in Makefile workingDirectory: "$(modulePath)" name: "EnvironmentalVariables" displayName: "Set build environmental variables" @@ -67,9 +66,6 @@ stages: - script: | go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - fi go get github.com/docker/libnetwork/driverapi go get github.com/gorilla/mux go get github.com/jstemmer/go-junit-report @@ -83,21 +79,18 @@ stages: - script: | echo Building in $(pwd) echo Build tag is $(EnvironmentalVariables.Tag) - export GOOS=linux - make all-binaries VERSION=$(EnvironmentalVariables.Tag) export GOOS=windows make all-binaries VERSION=$(EnvironmentalVariables.Tag) - - docker login -u '$DOCKER_USERNAME' -p 'DOCKER_PASSWORD' - make azure-npm-image - docker tag containernetworking.azurecr.io/public/containernetworking/azure-npm:$(DockerTag) containernetworking/azure-npm:$(DockerTag) - docker push containernetworking/azure-npm:$(DockerTag) - + export GOOS=linux + make all-binaries VERSION=$(EnvironmentalVariables.Tag) + sudo make azure-npm-image VERSION=$(EnvironmentalVariables.Tag) + echo '$(DOCKER_PASSWORD)' | docker login -u '$(DOCKER_USERNAME)' --password-stdin + docker tag containernetworking.azurecr.io/public/containernetworking/azure-npm:$(EnvironmentalVariables.Tag) containernetworking/azure-npm:$(EnvironmentalVariables.Tag) + docker push containernetworking/azure-npm:$(EnvironmentalVariables.Tag) cd output sudo find . -mindepth 2 -type f -regextype posix-extended ! -iregex '.*\.(zip|tgz)$' -delete sudo find . -mindepth 2 -type f -print -exec mv {} . \; sudo rm -R -- */ - workingDirectory: "$(modulePath)" name: "Build" displayName: "Build" @@ -166,7 +159,7 @@ stages: - template: e2e-job-template.yaml parameters: name: "ubuntu_16_04_linux_e2e" - pipelineBuildImage: "containernetworking/pipeline-ci:1.0.5" + pipelineBuildImage: "containernetworking/pipeline-ci:1.0.6" clusterDefinition: "cniLinux1604.json" clusterDefinitionCniTypeKey: "azureCNIURLLinux" clusterDefinitionCniBuildOS: "linux" @@ -175,7 +168,7 @@ stages: - template: e2e-job-template.yaml parameters: name: "ubuntu_18_04_linux_e2e" - pipelineBuildImage: "containernetworking/pipeline-ci:1.0.5" + pipelineBuildImage: "containernetworking/pipeline-ci:1.0.6" clusterDefinition: "cniLinux1804.json" clusterDefinitionCniTypeKey: "azureCNIURLLinux" clusterDefinitionCniBuildOS: "linux" @@ -184,7 +177,7 @@ stages: - template: e2e-job-template.yaml parameters: name: "windows_18_09_e2e" - pipelineBuildImage: "containernetworking/pipeline-ci:1.0.5" + pipelineBuildImage: "containernetworking/pipeline-ci:1.0.6" clusterDefinition: "cniWindows1809.json" clusterDefinitionCniTypeKey: "azureCNIURLWindows" clusterDefinitionCniBuildOS: "windows" @@ -193,7 +186,7 @@ stages: - template: e2e-job-template.yaml parameters: name: "windows_19_03_e2e" - pipelineBuildImage: "containernetworking/pipeline-ci:1.0.5" + pipelineBuildImage: "containernetworking/pipeline-ci:1.0.6" clusterDefinition: "cniWindows1903.json" clusterDefinitionCniTypeKey: "azureCNIURLWindows" clusterDefinitionCniBuildOS: "windows" @@ -207,7 +200,7 @@ stages: name: Networking-ContainerNetworking demands: agent.os -equals Linux container: - image: containernetworking/pipeline-ci:1.0.4 + image: containernetworking/pipeline-ci:1.0.6 variables: Tag: $[ dependencies.unit_tests.outputs['EnvironmentalVariables.Tag'] ] condition: always() diff --git a/Makefile b/Makefile index 7cc6701158..0d9911a2f4 100644 --- a/Makefile +++ b/Makefile @@ -149,6 +149,7 @@ ifeq ($(GOOS),linux) all-images: azure-npm-image azure-vnet-telemetry-image else all-images: + azure-npm-image @echo "Nothing to build. Skip." endif From 18f1de46863f3ec42d218766cf016fb583a1c115 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 7 Feb 2020 19:42:58 +0000 Subject: [PATCH 3/5] remove debug line in makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 0d9911a2f4..7cc6701158 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,6 @@ ifeq ($(GOOS),linux) all-images: azure-npm-image azure-vnet-telemetry-image else all-images: - azure-npm-image @echo "Nothing to build. Skip." endif From 797df43ecb4dab09e0de6e2552bf9c96f7f4b83e Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 7 Feb 2020 23:49:04 +0000 Subject: [PATCH 4/5] update kubernetes test versions --- test/e2e/kubernetes/cniLinux1604.json | 2 +- test/e2e/kubernetes/cniLinux1804.json | 2 +- test/e2e/kubernetes/cniWindows1809.json | 2 +- test/e2e/kubernetes/cniWindows1903.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/kubernetes/cniLinux1604.json b/test/e2e/kubernetes/cniLinux1604.json index 04c7619e29..46d7783e72 100644 --- a/test/e2e/kubernetes/cniLinux1604.json +++ b/test/e2e/kubernetes/cniLinux1604.json @@ -3,7 +3,7 @@ "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", - "orchestratorRelease": "1.14", + "orchestratorRelease": "1.16", "kubernetesConfig": { "networkPlugin": "azure", "networkPolicy": "azure", diff --git a/test/e2e/kubernetes/cniLinux1804.json b/test/e2e/kubernetes/cniLinux1804.json index 472eee6409..096dacefcb 100644 --- a/test/e2e/kubernetes/cniLinux1804.json +++ b/test/e2e/kubernetes/cniLinux1804.json @@ -3,7 +3,7 @@ "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", - "orchestratorRelease": "1.14", + "orchestratorRelease": "1.16", "kubernetesConfig": { "networkPlugin": "azure", "networkPolicy": "azure", diff --git a/test/e2e/kubernetes/cniWindows1809.json b/test/e2e/kubernetes/cniWindows1809.json index 9a00e07cc1..54961543e0 100644 --- a/test/e2e/kubernetes/cniWindows1809.json +++ b/test/e2e/kubernetes/cniWindows1809.json @@ -3,7 +3,7 @@ "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", - "orchestratorRelease": "1.14", + "orchestratorRelease": "1.16", "kubernetesConfig": { "networkPlugin": "azure", "networkPolicy": "azure", diff --git a/test/e2e/kubernetes/cniWindows1903.json b/test/e2e/kubernetes/cniWindows1903.json index f87d03273d..25ed53f82f 100644 --- a/test/e2e/kubernetes/cniWindows1903.json +++ b/test/e2e/kubernetes/cniWindows1903.json @@ -3,7 +3,7 @@ "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes", - "orchestratorRelease": "1.14", + "orchestratorRelease": "1.16", "kubernetesConfig": { "networkPlugin": "azure", "networkPolicy": "azure", From eec7304e85a7ffbf484387d02b6818c6eeebe7f4 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Sat, 8 Feb 2020 01:19:25 +0000 Subject: [PATCH 5/5] update kubernetes test versions --- test/e2e/kubernetes/cniWindows1809.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/kubernetes/cniWindows1809.json b/test/e2e/kubernetes/cniWindows1809.json index 54961543e0..d26f277da0 100644 --- a/test/e2e/kubernetes/cniWindows1809.json +++ b/test/e2e/kubernetes/cniWindows1809.json @@ -52,9 +52,9 @@ "enableAutomaticUpdates": false, "sshEnabled": true, "windowsPublisher": "MicrosoftWindowsServer", - "windowsOffer": "WindowsServer", + "windowsOffer": "WindowsServerSemiAnnual", "windowsSku": "Datacenter-Core-1809-with-Containers-smalldisk", - "imageVersion": "1809.0.20190603" + "imageVersion": "1809.0.20190826" }, "linuxProfile": { "adminUsername": "azureuser",