Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
17e4833
add bebugging
zanejohnson-azure Dec 4, 2025
0586eec
debug
zanejohnson-azure Dec 4, 2025
e891088
fix ifs spliting
zanejohnson-azure Dec 5, 2025
a2e61c9
more parsing fix
zanejohnson-azure Dec 5, 2025
c0b44d5
fix image verfication container name
zanejohnson-azure Dec 5, 2025
039301f
use short wait time temporarily
zanejohnson-azure Dec 5, 2025
33f8b32
simplify
zanejohnson-azure Dec 5, 2025
4fb699d
refactor
zanejohnson-azure Dec 5, 2025
354b53c
post check improve
zanejohnson-azure Dec 5, 2025
744de21
refactor pod verify script
zanejohnson-azure Dec 5, 2025
c0d8d72
move func
zanejohnson-azure Dec 5, 2025
ffb397f
fix
zanejohnson-azure Dec 5, 2025
8995052
debug
zanejohnson-azure Dec 5, 2025
71e9d64
add debug
zanejohnson-azure Dec 5, 2025
8b4c392
add debug
zanejohnson-azure Dec 5, 2025
231ff81
more debug
zanejohnson-azure Dec 5, 2025
20c9267
more debugging
zanejohnson-azure Dec 5, 2025
623099f
more debug
zanejohnson-azure Dec 5, 2025
b397fc0
refactor..
zanejohnson-azure Dec 5, 2025
6f0f063
add comments
zanejohnson-azure Dec 5, 2025
f2f8839
move container start time capture
zanejohnson-azure Dec 5, 2025
6d513d2
add delay
zanejohnson-azure Dec 5, 2025
db6732e
wait time 15 mins
zanejohnson-azure Dec 5, 2025
93057f7
minor fix
zanejohnson-azure Dec 5, 2025
01783ab
remove doc
zanejohnson-azure Dec 6, 2025
6a09f91
minor
zanejohnson-azure Dec 6, 2025
eb7c9a9
pull from ci_prod
zanejohnson-azure Dec 6, 2025
abb61eb
rebase
zanejohnson-azure Dec 6, 2025
5c2b3e3
wait 5 minutes
zanejohnson-azure Dec 6, 2025
bf5126b
remove container start time check wait
zanejohnson-azure Dec 6, 2025
97d2d8c
20 min wait time
zanejohnson-azure Dec 6, 2025
b0ea65e
echo utc timing
zanejohnson-azure Dec 6, 2025
8bcad01
fix trigger condition
zanejohnson-azure Dec 8, 2025
d137960
trigger when PR branch contains run-e2e
zanejohnson-azure Dec 8, 2025
8c7d4cb
fix trigger
zanejohnson-azure Dec 8, 2025
8a1bc5a
rename stage name
zanejohnson-azure Dec 9, 2025
96ef037
push image to acr during pr for particiluar branch
zanejohnson-azure Dec 12, 2025
c3a811c
pin fluentd version
zanejohnson-azure Dec 12, 2025
ca3cb54
pin cool.io to 1.9.0
zanejohnson-azure Dec 13, 2025
bea2808
remove cool.io install
zanejohnson-azure Dec 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 112 additions & 1 deletion .pipelines/azure_pipeline_mergedbranches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ extends:
customBuildTags:
- ES365AIMigrationTooling
stages:
# This stage will be skipped when LinuxImageOverride and WindowsImageOverride are both set
# This feature allows bypassing the build stage when using pre-built images for testing, which saves time and resources.
- stage: stage
displayName: 'Build and Publish Container Images'
condition: |
or(
eq(variables['LinuxImageOverride'], ''),
eq(variables['WindowsImageOverride'], '')
)
jobs:
- job: common
pool:
Expand Down Expand Up @@ -185,7 +193,17 @@ extends:
docker pull mcr.microsoft.com/azuremonitor/containerinsights/cidev/prometheus-collector/images:buildx-stable-1
docker buildx create --name dockerbuilder --driver docker-container --driver-opt image=mcr.microsoft.com/azuremonitor/containerinsights/cidev/prometheus-collector/images:buildx-stable-1 --use
docker buildx inspect --bootstrap
# Determine if we should push to ACR
# Push when: NOT a PR, OR when PR is from specific branches (zane/ci-agent-auto-deploy or branches containing 'run-e2e')
SHOULD_PUSH="false"
if [ "$(Build.Reason)" != "PullRequest" ]; then
SHOULD_PUSH="true"
elif [[ "$(System.PullRequest.SourceBranch)" == "zane/ci-agent-auto-deploy" ]] || [[ "$(System.PullRequest.SourceBranch)" == *"run-e2e"* ]]; then
SHOULD_PUSH="true"
echo "PR from branch $(System.PullRequest.SourceBranch) - will push image to ACR for E2E testing"
fi

if [ "$SHOULD_PUSH" == "true" ]; then
docker buildx build --platform $(BUILD_PLATFORMS) --tag ${{ variables.repoImageName }}:$(linuxImagetag) -f kubernetes/linux/Dockerfile.multiarch --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json --build-arg IMAGE_TAG=$(linuxTelemetryTag) --build-arg GOLANG_BASE_IMAGE=$(GOLANG_BASE_IMAGE) --build-arg CI_BASE_IMAGE=$(CI_BASE_IMAGE) --push --provenance=false .
echo "##vso[task.logissue type=warning]Linux image built with tag: ${{ variables.repoImageName }}:$(linuxImagetag)"
docker pull ${{ variables.repoImageName }}:$(linuxImagetag)
Expand Down Expand Up @@ -543,7 +561,16 @@ extends:
inputs:
targetType: 'inline'
script: |
# Push when: NOT a PR, OR when PR is from specific branches (zane/ci-agent-auto-deploy or branches containing 'run-e2e')
$shouldPush = $false
if ("$(Build.Reason)" -ne "PullRequest") {
$shouldPush = $true
} elseif ("$(System.PullRequest.SourceBranch)" -eq "zane/ci-agent-auto-deploy" -or "$(System.PullRequest.SourceBranch)" -like "*run-e2e*") {
$shouldPush = $true
Write-Host "PR from branch $(System.PullRequest.SourceBranch) - will push image to ACR for E2E testing"
}

if ($shouldPush) {
docker push ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2019BaseImageVersion)
}
- task: CodeQL3000Finalize@0
Expand Down Expand Up @@ -751,7 +778,16 @@ extends:
inputs:
targetType: 'inline'
script: |
# Push when: NOT a PR, OR when PR is from specific branches (zane/ci-agent-auto-deploy or branches containing 'run-e2e')
$shouldPush = $false
if ("$(Build.Reason)" -ne "PullRequest") {
$shouldPush = $true
} elseif ("$(System.PullRequest.SourceBranch)" -eq "zane/ci-agent-auto-deploy" -or "$(System.PullRequest.SourceBranch)" -like "*run-e2e*") {
$shouldPush = $true
Write-Host "PR from branch $(System.PullRequest.SourceBranch) - will push image to ACR for E2E testing"
}

if ($shouldPush) {
docker push ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2022BaseImageVersion)
}
- task: CodeQL3000Finalize@0
Expand Down Expand Up @@ -792,7 +828,16 @@ extends:
az account set -s ${{ variables.subscription }}
az acr login -n ${{ variables.containerRegistry }}
@{"image.name"="${{ variables.repoImageName }}:$(windowsImageTag)"} | ConvertTo-Json -Compress | Out-File -Encoding ascii $(Build.ArtifactStagingDirectory)/windows/metadata.json
# Push when: NOT a PR, OR when PR is from specific branches (zane/ci-agent-auto-deploy or branches containing 'run-e2e')
$shouldPush = $false
if ("$(Build.Reason)" -ne "PullRequest") {
$shouldPush = $true
} elseif ("$(System.PullRequest.SourceBranch)" -eq "zane/ci-agent-auto-deploy" -or "$(System.PullRequest.SourceBranch)" -like "*run-e2e*") {
$shouldPush = $true
Write-Host "PR from branch $(System.PullRequest.SourceBranch) - will push multi-arch image to ACR for E2E testing"
}

if ($shouldPush) {
docker manifest create ${{ variables.repoImageName }}:$(windowsImageTag) ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2019BaseImageVersion) ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2022BaseImageVersion)
docker manifest push ${{ variables.repoImageName }}:$(windowsImageTag)
Write-Host "##vso[task.logissue type=warning]Windows image built with tag: ${{ variables.repoImageName }}:$(windowsImageTag)"
Expand Down Expand Up @@ -880,4 +925,70 @@ extends:
ScanType: CustomScan
FileDirPath: '$(Build.ArtifactStagingDirectory)'
DisableRemediation: false
AcceptableOutdatedSignatureInHours: 72
AcceptableOutdatedSignatureInHours: 72

- stage: Deploy_and_Test_Images_In_Dev_Clusters
displayName: Deploy and Test Images in Dev Clusters
lockBehavior: sequential
dependsOn:
- stage
# Deploy runs when Build succeeds OR when Build is skipped with valid overrides
# This stage runs when:
# 1. Direct push to ci_prod or zane/ci-agent-auto-deploy or branches containing 'run-e2e'
# 2. PR from zane/ci-agent-auto-deploy branch OR PR from branch containing 'run-e2e'
condition: |
and(
or(
eq(variables['Build.SourceBranch'], 'refs/heads/ci_prod'),
eq(variables['Build.SourceBranch'], 'refs/heads/zane/ci-agent-auto-deploy'),
contains(variables['Build.SourceBranch'], 'run-e2e'),
and(
eq(variables['Build.Reason'], 'PullRequest'),
or(
eq(variables['System.PullRequest.SourceBranch'], 'zane/ci-agent-auto-deploy'),
contains(variables['System.PullRequest.SourceBranch'], 'run-e2e')
)
)
),
or(
eq(dependencies.stage.result, 'Succeeded'),
and(
eq(dependencies.stage.result, 'Skipped'),
ne(variables['LinuxImageOverride'], ''),
ne(variables['WindowsImageOverride'], '')
)
)
)
variables:
# Use images built from previous build stage by default
# To override: Set pipeline variables 'LinuxImageOverride' and 'WindowsImageOverride' when queuing
linuxImageTagUnderTest: $[coalesce(variables['LinuxImageOverride'], stageDependencies.stage.common.outputs['setup.linuxImagetag'])]
windowsImageTagUnderTest: $[coalesce(variables['WindowsImageOverride'], stageDependencies.stage.common.outputs['setup.windowsImageTag'])]
jobs:
# TODO: gradually add more clusters from test automation framework when the tests are stable
# TODO: TeamsWebhookUri to be added
# Cluster 1: zane-test Cluster
- template: /.pipelines/e2e-test/azure-template-deploy-and-test-ci-image-in-aks-cluster.yml@self
parameters:
clusterName: 'zane-test'
resourceGroup: 'zane-test'
azureSubscription: 'ContainerInsights_Build_Subscription_CI'
environmentName: 'CI-Agent-Dev'
linuxImageTag: $(linuxImageTagUnderTest)
windowsImageTag: $(windowsImageTagUnderTest)
azureClientId: $(AksZaneTestClientId)
azureTenantId: $(AzureZaneTestTenantId)
teamsWebhookUri: $(TeamsWebhookUri)

# Cluster 2: zane-test2 Cluster
- template: /.pipelines/e2e-test/azure-template-deploy-and-test-ci-image-in-aks-cluster.yml@self
parameters:
clusterName: 'zane-test2'
resourceGroup: 'zane-test'
azureSubscription: 'ContainerInsights_Build_Subscription_CI'
environmentName: 'CI-Agent-Dev2'
linuxImageTag: $(linuxImageTagUnderTest)
windowsImageTag: $(windowsImageTagUnderTest)
azureClientId: $(AksZaneTest2ClientId)
azureTenantId: $(AzureZaneTestTenantId)
teamsWebhookUri: $(TeamsWebhookUri)
Loading
Loading