-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pipeline testing for azure-ipam/cni-dropgz submodules (#1636)
* add new ipam/dropgz e2e test stage * set test image * set paths in pipeline.yaml * set path trigger in ipam-dropgz-job template * set path as param for ipam-dropgze2e * testing path trigger with branch * create submodule pipeline * add log in /azure-ipam to test piepline trigger * remove build for cni-dropgz image in submodule pipeline * create separate swift + cilium ipam/dropgz test stages * remove commented test bits * remove commented lines from setup_test.go * update paths/triggers and set template parameters * change cleanup dependsOn * test parameter call * export parameter * skip setting testDropgz instead of setting false * removing ipam-dropgz templates and focus submod UT on azure-ipam * remove parsing gatewayIP from azure-ipam unit tests * update make target test-azure-ipam * update make target * only publish test results * omit npm build * keep npm build and simplify unit testing stage * adjust cluster naming to avoid resource overlap in pipelines
- Loading branch information
Showing
11 changed files
with
322 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
pr: | ||
branches: | ||
include: | ||
- master | ||
paths: | ||
include: | ||
- "zapai/*" | ||
- "azure-ipam/*" | ||
- "dropgz/*" | ||
exclude: | ||
- "*" | ||
|
||
trigger: | ||
paths: | ||
include: | ||
- "zapai/*" | ||
- "azure-ipam/*" | ||
- "dropgz/*" | ||
exclude: | ||
- "*" | ||
tags: | ||
include: | ||
- "zapai/*" | ||
- "azure-ipam/*" | ||
- "dropgz/*" | ||
exclude: | ||
- "*" | ||
|
||
stages: | ||
- stage: setup | ||
displayName: ACN | ||
jobs: | ||
- job: env | ||
displayName: Setup | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
steps: | ||
- script: | | ||
BUILD_NUMBER=$(Build.BuildNumber) | ||
echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})" | ||
echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)" | ||
echo "##vso[task.setvariable variable=cniVersion;isOutput=true]$(make cni-version)" | ||
echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)" | ||
cat /etc/os-release | ||
uname -a | ||
sudo chown -R $(whoami):$(whoami) . | ||
go version | ||
go env | ||
which go | ||
echo $PATH | ||
name: "EnvironmentalVariables" | ||
displayName: "Set environmental variables" | ||
condition: always() | ||
- stage: test | ||
displayName: Test ACN | ||
dependsOn: | ||
- setup | ||
jobs: | ||
- job: test | ||
displayName: Run Tests | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
steps: | ||
- script: | | ||
make tools | ||
sudo -E env "PATH=$PATH" make test-azure-ipam; | ||
retryCountOnTaskFailure: 3 | ||
name: "Test" | ||
displayName: "Run Tests" | ||
- stage: binaries | ||
displayName: Build Binaries | ||
dependsOn: | ||
- setup | ||
- test | ||
jobs: | ||
- job: build | ||
displayName: Build Binaries | ||
variables: | ||
STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
steps: | ||
- script: | | ||
make all-binaries-platforms | ||
name: "BuildAllPlatformBinaries" | ||
displayName: "Build all platform binaries" | ||
- script: | | ||
mkdir -p ./output/bins | ||
cd ./output | ||
find . -name '*.tgz' -print -exec mv -t ./bins/ {} + | ||
find . -name '*.zip' -print -exec mv -t ./bins/ {} + | ||
shopt -s extglob | ||
rm -rf !("bins") | ||
name: "PrepareArtifacts" | ||
displayName: "Prepare Artifacts" | ||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: "output" | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
condition: succeeded() | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
artifactName: "output" | ||
pathtoPublish: "$(Build.ArtifactStagingDirectory)" | ||
condition: succeeded() | ||
|
||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
inlineScript: | | ||
echo Creating storage container with name acn-$(STORAGE_ID) and account name $(STORAGE_ACCOUNT_NAME) | ||
az storage container create -n acn-$(STORAGE_ID) --account-name $(STORAGE_ACCOUNT_NAME) --public-access container | ||
az storage blob upload-batch -d acn-$(STORAGE_ID) -s ./output/bins/ --account-name $(STORAGE_ACCOUNT_NAME) | ||
displayName: Create artifact storage container | ||
condition: succeeded() | ||
|
||
- publish: ./test/apimodels/ | ||
artifact: clusterdefinitions | ||
|
||
- stage: containerize | ||
displayName: Build Images | ||
dependsOn: | ||
- setup | ||
- test | ||
jobs: | ||
- job: containerize_linux_amd64 | ||
displayName: Build Images | ||
pool: | ||
name: "$(BUILD_POOL_NAME_LINUX_AMD64)" | ||
strategy: | ||
matrix: | ||
acncli_linux_amd64: | ||
arch: amd64 | ||
os: linux | ||
name: acncli | ||
cni_dropgz_test_linux_amd64: | ||
arch: amd64 | ||
os: linux | ||
name: cni-dropgz-test | ||
cns_linux_amd64: | ||
arch: amd64 | ||
os: linux | ||
name: cns | ||
npm_linux_amd64: | ||
arch: amd64 | ||
os: linux | ||
name: npm | ||
steps: | ||
- template: containers/container-template.yaml | ||
parameters: | ||
name: $(name) | ||
os: $(os) | ||
arch: $(arch) | ||
- job: containerize_linux_arm64 | ||
displayName: Build Images | ||
variables: | ||
TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] | ||
pool: | ||
name: "$(BUILD_POOL_NAME_LINUX_ARM64)" | ||
strategy: | ||
matrix: | ||
acncli_linux_arm64: | ||
arch: arm64 | ||
os: linux | ||
name: acncli | ||
cni_dropgz_test_linux_arm64: | ||
arch: arm64 | ||
os: linux | ||
name: cni-dropgz-test | ||
cns_linux_arm64: | ||
arch: arm64 | ||
os: linux | ||
name: cns | ||
npm_linux_arm64: | ||
arch: arm64 | ||
os: linux | ||
name: npm | ||
steps: | ||
- template: containers/container-template.yaml | ||
parameters: | ||
name: $(name) | ||
os: $(os) | ||
arch: $(arch) | ||
- job: containerize_windows_amd64 | ||
timeoutInMinutes: 120 | ||
displayName: Build Images | ||
variables: | ||
TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] | ||
pool: | ||
name: "$(BUILD_POOL_NAME_WINDOWS_AMD64)" | ||
strategy: | ||
matrix: | ||
cns_windows_amd64: | ||
arch: amd64 | ||
name: cns | ||
npm_windows_amd64: | ||
arch: amd64 | ||
name: npm | ||
steps: | ||
- template: containers/container-template-windows.yaml | ||
parameters: | ||
name: $(name) | ||
arch: $(arch) | ||
tag: $(TAG) | ||
|
||
- stage: publish | ||
displayName: Publish Multiarch Manifests | ||
dependsOn: | ||
- containerize | ||
jobs: | ||
- job: manifest | ||
displayName: Compile Manifests | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
strategy: | ||
matrix: | ||
acncli: | ||
name: acncli | ||
platforms: linux/amd64 linux/arm64 | ||
cni_dropgz_test: | ||
name: cni-dropgz-test | ||
platforms: linux/amd64 linux/arm64 | ||
cns: | ||
name: cns | ||
platforms: linux/amd64 linux/arm64 windows/amd64 | ||
npm: | ||
name: npm | ||
platforms: linux/amd64 linux/arm64 windows/amd64 | ||
steps: | ||
- template: containers/manifest-template.yaml | ||
parameters: | ||
name: $(name) | ||
platforms: $(platforms) | ||
|
||
- template: singletenancy/cilium/cilium-e2e-job-template.yaml | ||
parameters: | ||
name: "cilium_e2e" | ||
displayName: Cilium | ||
pipelineBuildImage: "$(BUILD_IMAGE)" | ||
testDropgz: true | ||
clusterName: "submodules-ciliume2e" | ||
|
||
- template: singletenancy/aks-swift/e2e-job-template.yaml | ||
parameters: | ||
name: "aks_swift_e2e" | ||
displayName: AKS Swift | ||
pipelineBuildImage: "$(BUILD_IMAGE)" | ||
testDropgz: true | ||
clusterName: "submodules-swifte2e" | ||
|
||
- stage: cleanup | ||
displayName: Cleanup | ||
dependsOn: | ||
- cilium_e2e | ||
- aks_swift_e2e | ||
jobs: | ||
- job: delete_remote_artifacts | ||
displayName: Delete remote artifacts | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
demands: agent.os -equals Linux | ||
steps: | ||
- checkout: none | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
inlineScript: | | ||
BUILD_NUMBER=$(Build.BuildNumber) | ||
BUILD_NUMBER=${BUILD_NUMBER//./-} | ||
echo Deleting storage container with name acn-$BUILD_NUMBER and account name $(STORAGE_ACCOUNT_NAME) | ||
az storage container delete -n acn-$BUILD_NUMBER --account-name $(STORAGE_ACCOUNT_NAME) | ||
displayName: Cleanup remote Azure storage container |
Oops, something went wrong.