Skip to content

Commit

Permalink
ci: adds e2e test for containerd on windows (#612)
Browse files Browse the repository at this point in the history
* ci: adds e2e test for containerd on windows

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: fixes syntax

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: fixes template param

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: debug

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: debug

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: debug

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: debug

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: debug

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: tr

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: sets env var

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: fix syntax

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test:revert change

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: revert runtime

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: manual export

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: os params

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: fixes syntax

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: fixes os type

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: enables containerd tests

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: fixes windows nodepool

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: adds debug logs

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: debug

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: enables az aks-preview

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: removes debug statement

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: exports OS_TYPE

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: removes dead code

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* test: removes osType param

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: removes osTypes

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* chore: removes comments

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

* ci: seperates aks and aks-engine jobs

Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

Co-authored-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
nilekhc and aramase committed Aug 31, 2021
1 parent 09703cc commit 954fd06
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .pipelines/e2e-job-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
parameters:
clusterTypes:
- "aks"
osTypes:
- "linux"
- "windows-docker"
- "windows-containerd"
- template: templates/e2e-test-azure.yaml
parameters:
clusterTypes:
- "aks-engine"
osTypes:
- "linux"
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/aks-engine-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:
condition: and(succeeded(), eq(variables['CLUSTER_TYPE'], 'aks-engine'))
- script: |
envsubst < test/e2e/cluster_configs/$(CLUSTER_CONFIG).json > cluster.json
envsubst < test/e2e/cluster_configs/$(OS_TYPE).json > cluster.json
displayName: "Build AKS-Engine API Model"
condition: and(succeeded(), eq(variables['CLUSTER_TYPE'], 'aks-engine'))
Expand Down
21 changes: 12 additions & 9 deletions .pipelines/templates/aks-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ parameters:
- name: testWithGPU
type: boolean
default: false
- name: containerRuntime
type: string

steps:
- script: |
Expand Down Expand Up @@ -37,8 +39,8 @@ steps:
condition: and(succeeded(), eq(variables['CLUSTER_TYPE'], 'aks'))
- ${{ if eq(parameters.testClusterUpgrade, true) }}:
#Overrride AKS_INSTALL_VERSION if testing with k8s upgrade
#If we are running test with cluster upgrade, start with minimum possible non preview version.
# Overrride AKS_INSTALL_VERSION if testing with k8s upgrade
# If we are running test with cluster upgrade, start with minimum possible non preview version.
- script: |
aksVersion=$(az aks get-versions -l $(AZURE_LOCATION) --query "min(orchestrators[?isPreview==null].orchestratorVersion)" -otsv)
echo "AKS Install version - $aksVersion"
Expand Down Expand Up @@ -74,13 +76,14 @@ steps:
echo "##vso[task.setvariable variable=MASTERIP]${MASTERIP}"
echo "##vso[task.setvariable variable=MASTERINTERNALIP]${MASTERIP}"
if [[ $CLUSTER_CONFIG == "windows" ]]; then
az aks nodepool add \
-g ${AZURE_CLUSTER_NAME} \
--cluster-name ${AZURE_CLUSTER_NAME} \
--os-type Windows \
--name win \
--node-count 1
if [[ "$(OS_TYPE)" == "windows" ]]; then
if [[ ${{ parameters.containerRuntime }} == "containerd" ]]; then
az extension add --name aks-preview
az extension update --name aks-preview
EXTRA_ARGS="--aks-custom-headers WindowsContainerRuntime=containerd"
fi
az aks nodepool add -g ${AZURE_CLUSTER_NAME} --cluster-name ${AZURE_CLUSTER_NAME} --os-type Windows --name win --node-count 1 ${EXTRA_ARGS:-} > /dev/null
fi
# store kubeconfig
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
- script: |
# Generate image version
if [[ -n "${CLUSTER_CONFIG:-}" ]]; then
IMAGE_VERSION="$(git describe --tags --always --dirty)-$(CLUSTER_TYPE)-$(CLUSTER_CONFIG)"
IMAGE_VERSION="$(git describe --tags --always --dirty)-$(CLUSTER_TYPE)-$(OS_TYPE)"
else
IMAGE_VERSION="$(git describe --tags --always --dirty)-$(CLUSTER_TYPE)-load"
fi
Expand Down
15 changes: 11 additions & 4 deletions .pipelines/templates/e2e-test-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ jobs:
- task: GoTool@0
inputs:
version: 1.16

- script: |
OS_TYPE=$(echo ${{ osType }} | cut -d '-' -f1 | tr -d '[:space:]')
echo "OS type - $OS_TYPE"
echo "##vso[task.setvariable variable=OS_TYPE]$OS_TYPE"
CONTAINER_RUNTIME=$(echo ${{ osType }} | cut -d '-' -f2 | tr -d '[:space:]')
echo "Container Runtime - $CONTAINER_RUNTIME"
echo "##vso[task.setvariable variable=CONTAINER_RUNTIME]$CONTAINER_RUNTIME"
displayName: 'Determine os type and container runtime'
- script: |
# Download kubectl
Expand All @@ -46,6 +56,7 @@ jobs:
parameters:
testClusterUpgrade: ${{ parameters.testClusterUpgrade }}
testWithGPU: ${{ parameters.testWithGPU }}
containerRuntime: $(CONTAINER_RUNTIME)

- ${{ if eq(clusterType, 'aks-engine') }}:
- template: aks-engine-setup.yaml
Expand All @@ -58,7 +69,6 @@ jobs:
- template: e2e-test.yaml
parameters:
testName: "Run e2e test with Released Version"
osType: ${{ osType }}
testClusterUpgrade: ${{ parameters.testClusterUpgrade }}
resetImageVersion: true
isBackwardCompatibilityTest: true
Expand All @@ -68,7 +78,6 @@ jobs:
- template: e2e-test.yaml
parameters:
testName: "Run e2e test with New Version"
osType: ${{ osType }}
testClusterUpgrade: ${{ parameters.testClusterUpgrade }}
isBackwardCompatibilityTest: true
setRegistry: true
Expand All @@ -80,7 +89,6 @@ jobs:
- template: e2e-test.yaml
parameters:
testName: "Run e2e test with New Version"
osType: ${{ osType }}
testClusterUpgrade: ${{ parameters.testClusterUpgrade }}
setRegistry: true

Expand All @@ -89,7 +97,6 @@ jobs:
- template: e2e-test.yaml
parameters:
testName: "Run e2e test with New Version"
osType: ${{ osType }}
testClusterUpgrade: ${{ parameters.testClusterUpgrade }}
setRegistry: true

Expand Down
9 changes: 5 additions & 4 deletions .pipelines/templates/e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
parameters:
- name: testName
type: string
- name: osType
type: string
- name: testReleasedVersion
type: boolean
default: false
Expand All @@ -21,6 +19,11 @@ parameters:

steps:
- script: |
# Set TEST_WiNDOWS=true to run the test on Windows
if [ "$(OS_TYPE)" == "windows" ] ; then
export TEST_WINDOWS=true
fi
if [ "${{ parameters.setRegistry }}" == True ] ; then
export REGISTRY="${REGISTRY:-$(REGISTRY_NAME).azurecr.io/k8s/csi/secrets-store}"
fi
Expand Down Expand Up @@ -49,5 +52,3 @@ steps:
CONFIG_IMAGE_VERSION: ""
${{ if parameters.isBackwardCompatibilityTest }}:
IS_BACKWARD_COMPATIBILITY_TEST: ${{ parameters.isBackwardCompatibilityTest }}
${{ if eq(parameters.osType, 'windows') }}:
TEST_WINDOWS: true

0 comments on commit 954fd06

Please sign in to comment.