Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving pipeline bugs for windows ama url variable #1215

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 14 additions & 2 deletions .pipelines/azure_pipeline_mergedbranches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ jobs:

cd $(Build.SourcesDirectory)/deployment/arc-k8s-extension-release-v2/ServiceGroupRoot/Scripts
tar -czvf ../artifacts.tar.gz arcExtensionRelease.sh

windowsAMAUrl=""
if [ -z "$WINDOWS_AMA_URL" ]
then
echo "\$WINDOWS_AMA_URL variable is not set"
else
windowsAMAUrl=$WINDOWS_AMA_URL
echo "\$WINDOWS_AMA_URL is $WINDOWS_AMA_URL"
fi
echo "##vso[task.setvariable variable=windowsAMAUrl;isOutput=true]$windowsAMAUrl"
name: setup

- task: CopyFiles@2
Expand Down Expand Up @@ -280,6 +290,7 @@ jobs:
windows2019BaseImageVersion: ltsc2019
Codeql.Enabled: true
Codeql.BuildIdentifier: 'windowsbuild'
windowsAMAUrl: $[ dependencies.common.outputs['setup.windowsAMAUrl'] ]
steps:
- task: PowerShell@2
inputs:
Expand Down Expand Up @@ -311,7 +322,7 @@ jobs:
az account set -s ${{ variables.subscription }}
az acr login -n ${{ variables.containerRegistry }}

docker build --isolation=hyperv --tag ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2019BaseImageVersion)-unsigned --build-arg WINDOWS_VERSION=$(windows2019BaseImageVersion) --build-arg IMAGE_TAG=$(windowsTelemetryTag) --build-arg WINDOWS_AMA_URL=$(WINDOWS_AMA_URL) .
docker build --isolation=hyperv --tag ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2019BaseImageVersion)-unsigned --build-arg WINDOWS_VERSION=$(windows2019BaseImageVersion) --build-arg IMAGE_TAG=$(windowsTelemetryTag) --build-arg WINDOWS_AMA_URL=$(windowsAMAUrl) .

- task: PowerShell@2
displayName: Extract files to sign
Expand Down Expand Up @@ -488,6 +499,7 @@ jobs:
windowsTelemetryTag: $[ dependencies.common.outputs['setup.windowsTelemetryTag'] ]
windows2022BaseImageVersion: ltsc2022
Codeql.SkipTaskAutoInjection: true
windowsAMAUrl: $[ dependencies.common.outputs['setup.windowsAMAUrl'] ]
steps:
- task: PowerShell@2
inputs:
Expand Down Expand Up @@ -520,7 +532,7 @@ jobs:
az account set -s ${{ variables.subscription }}
az acr login -n ${{ variables.containerRegistry }}

docker build --isolation=hyperv --tag ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2022BaseImageVersion)-unsigned --build-arg WINDOWS_VERSION=$(windows2022BaseImageVersion) --build-arg IMAGE_TAG=$(windowsTelemetryTag) --build-arg WINDOWS_AMA_URL=$(WINDOWS_AMA_URL) .
docker build --isolation=hyperv --tag ${{ variables.repoImageName }}:$(windowsImageTag)-$(windows2022BaseImageVersion)-unsigned --build-arg WINDOWS_VERSION=$(windows2022BaseImageVersion) --build-arg IMAGE_TAG=$(windowsTelemetryTag) --build-arg WINDOWS_AMA_URL=$(windowsAMAUrl) .

- task: PowerShell@2
displayName: Extract files to sign
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Supported values of windows version are ltsc2019 or ltsc2022 which are being passed by the build script or build pipeline
ARG WINDOWS_VERSION=
ARG WINDOWS_AMA_URL=
FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION}
LABEL maintainer="OMSContainers@microsoft.com"
LABEL vendor=Microsoft\ Corp \
Expand Down Expand Up @@ -40,7 +39,8 @@ RUN powershell -Command "Remove-Item -Force C:\ruby31\lib\ruby\gems\3.1.0\cache\
SHELL ["powershell"]

ENV tmpdir /opt/amalogswindows/scripts/powershell
ENV WINDOWS_AMA_URL ${WINDOWS_AMA_URL}
ARG WINDOWS_AMA_URL=
ENV WINDOWS_AMA_URL_NEW ${WINDOWS_AMA_URL}
ENV COMPlus_ThreadPool_UnfairSemaphoreSpinLimit 0

WORKDIR /opt/amalogswindows/scripts/powershell
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/windows/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Write-Host ('Extracting Certificate Generator Package')
Expand-Archive -Path /opt/amalogswindows/certificategenerator.zip -Destination /opt/amalogswindows/certgenerator/ -Force
Write-Host ('Finished Extracting Certificate Generator Package')

$windowsazuremonitoragent = [System.Environment]::GetEnvironmentVariable('WINDOWS_AMA_URL')
$windowsazuremonitoragent = [System.Environment]::GetEnvironmentVariable("WINDOWS_AMA_URL_NEW", "process")
if ([string]::IsNullOrEmpty($windowsazuremonitoragent)) {
Write-Host ('Environment variable WINDOWS_AMA_URL is not set. Using default value')
$windowsazuremonitoragent = "https://github.com/microsoft/Docker-Provider/releases/download/windows-ama-bits/GenevaMonitoringAgent.46.9.43.zip"
Expand Down
Loading