Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gracewehner committed Jan 24, 2024
1 parent 80886bf commit 662c17f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
17 changes: 6 additions & 11 deletions .pipelines/azure-pipeline-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ jobs:

- bash: |
mkdir -p $(Build.ArtifactStagingDirectory)/linux
docker version
# Necessary due to necessary due to https://stackoverflow.com/questions/60080264/docker-cannot-build-multi-platform-images-with-docker-buildx
sudo apt-get update && sudo apt-get -y install qemu binfmt-support qemu-user-static
Expand All @@ -347,7 +346,7 @@ jobs:
docker buildx create --name dockerbuilder
docker buildx use dockerbuilder
docker buildx build . --file ./build/linux/Dockerfile -t $(LINUX_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json --push --cache-to type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:prometheuscollector,mode=max --cache-from type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:prometheuscollector
docker buildx build . --platform=linux/amd64,linux/arm64 --file ./build/linux/Dockerfile -t $(LINUX_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/linux/metadata.json --push --cache-to type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:prometheuscollector,mode=max --cache-from type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:prometheuscollector
docker pull $(LINUX_FULL_IMAGE_NAME)
workingDirectory: $(Build.SourcesDirectory)/otelcollector/
displayName: "Build: build and push image to dev ACR"
Expand Down Expand Up @@ -499,7 +498,7 @@ jobs:
docker buildx create --name dockerbuilder
docker buildx use dockerbuilder
docker login containerinsightsprod.azurecr.io -u $(ACR_USERNAME) -p $(ACR_PASSWORD)
docker buildx build . --platform=linux/amd64,linux/arm64 --file Dockerfile -t $(TARGET_ALLOCATOR_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/targetallocator/metadata.json --push --cache-to type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:targetallocator,mode=max --cache-from type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:targetallocator
docker buildx build . --platform=linux/amd64,linux/arm64 --file Dockerfile -t $(TARGET_ALLOCATOR_FULL_IMAGE_NAME) --metadata-file $(Build.ArtifactStagingDirectory)/targetallocator/metadata.json --push --cache-to type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:targetallocator,mode=max --cache-from type=registry,ref=$(ACR_REGISTRY)$(ACR_REPOSITORY)/cache:targetallocator
docker pull $(TARGET_ALLOCATOR_FULL_IMAGE_NAME)
MEDIA_TYPE=$(docker manifest inspect -v $(TARGET_ALLOCATOR_FULL_IMAGE_NAME) | jq '.Descriptor.mediaType')
DIGEST=$(docker manifest inspect -v $(TARGET_ALLOCATOR_FULL_IMAGE_NAME) | jq '.Descriptor.digest')
Expand Down Expand Up @@ -573,7 +572,6 @@ jobs:
sudo apt-get update && sudo apt-get -y install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx version
docker buildx create --name dockerbuilder
docker buildx use dockerbuilder
docker login containerinsightsprod.azurecr.io -u $(ACR_USERNAME) -p $(ACR_PASSWORD)
Expand Down Expand Up @@ -636,7 +634,6 @@ jobs:
displayName: "Build: windows 2019 prometheus-collector image"
pool:
name: Azure-Pipelines-Windows-CI-Test-EO
timeoutInMinutes: 120
dependsOn:
- Image_Tags_and_Ev2_Artifacts
variables:
Expand All @@ -655,8 +652,7 @@ jobs:
displayName: "Build: build otelcollector, promconfigvalidator, and fluent-bit plugin"
- powershell: |
docker version
docker build . --isolation=hyperv --file ./build/windows/Dockerfile -t $(WINDOWS_FULL_IMAGE_NAME)-$(WINDOWS_2019_BASE_IMAGE_VERSION) --build-arg WINDOWS_VERSION=$(WINDOWS_2019_BASE_IMAGE_VERSION) --build-arg BUILDKIT_INLINE_CACHE=1
docker build . --isolation=hyperv --file ./build/windows/Dockerfile -t $(WINDOWS_FULL_IMAGE_NAME)-$(WINDOWS_2019_BASE_IMAGE_VERSION) --build-arg WINDOWS_VERSION=$(WINDOWS_2019_BASE_IMAGE_VERSION)
workingDirectory: $(Build.SourcesDirectory)/otelcollector/
displayName: "Build: build WS2019 image"
retryCountOnTaskFailure: 2
Expand All @@ -670,7 +666,6 @@ jobs:
displayName: "Build: windows 2022 prometheus-collector image"
pool:
name: Azure-Pipelines-Windows-CI-Test-EO
timeoutInMinutes: 120
dependsOn:
- Image_Tags_and_Ev2_Artifacts
variables:
Expand All @@ -689,7 +684,7 @@ jobs:
displayName: "Build: build otelcollector, promconfigvalidator, and fluent-bit plugin"
- powershell: |
docker build . --isolation=hyperv --file ./build/windows/Dockerfile -t $(WINDOWS_FULL_IMAGE_NAME)-$(WINDOWS_2022_BASE_IMAGE_VERSION) --build-arg WINDOWS_VERSION=$(WINDOWS_2022_BASE_IMAGE_VERSION) --build-arg BUILDKIT_INLINE_CACHE=1
docker build . --isolation=hyperv --file ./build/windows/Dockerfile -t $(WINDOWS_FULL_IMAGE_NAME)-$(WINDOWS_2022_BASE_IMAGE_VERSION) --build-arg WINDOWS_VERSION=$(WINDOWS_2022_BASE_IMAGE_VERSION)
workingDirectory: $(Build.SourcesDirectory)/otelcollector/
displayName: "Build: build WS2022 image"
retryCountOnTaskFailure: 2
Expand All @@ -703,7 +698,6 @@ jobs:
displayName: "Build: windows multi-arch prometheus-collector image"
pool:
name: Azure-Pipelines-Windows-CI-Test-EO
timeoutInMinutes: 120
dependsOn:
- Image_Tags_and_Ev2_Artifacts
- Windows2019_Prometheus_Collector
Expand Down Expand Up @@ -991,7 +985,8 @@ jobs:
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
state=$(az k8s-extension show --name azuremonitor-metrics --cluster-name ci-dev-arc-wcus --resource-group ci-dev-arc-wcus --cluster-type connectedClusters | jq -r '.provisioningState')
if [ $state = "Succeeded" ]
# We want to wait in case the status is 'Creating' or 'Updating' because of another PR merged shortly before the current one.
if [ "$state" = "Succeeded" ] || [ "$state" = "Failed" ]
then
echo "Cluster is ready to install extension"
exit 0
Expand Down
11 changes: 7 additions & 4 deletions otelcollector/build/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ RUN powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; iex (
# Fluentd depends on cool.io whose fat gem is only available for Ruby < 2.5, so need to specify --platform ruby when install Ruby > 2.5 and install msys2 to get dev tools
RUN choco install -y ruby --version 2.6.5.1 --params "'/InstallDir:C:\ruby26'" \
&& choco install -y msys2 --version 20211130.0.0 --params "'/NoPath /NoUpdate /InstallDir:C:\ruby26\msys64'" \
&& choco install -y vim \
&& refreshenv \
&& choco install -y vim

# gangams - optional MSYS2 update via ridk failing in merged docker file so skipping that since we dont need optional update
RUN refreshenv \
&& ridk install 3 \
&& echo gem: --no-document >> C:\ProgramData\gemrc \
&& gem install cool.io -v 1.5.4 --platform ruby \
Expand All @@ -54,9 +56,10 @@ RUN choco install -y ruby --version 2.6.5.1 --params "'/InstallDir:C:\ruby26'" \
&& gem install tomlrb -v 1.3.0 \
&& gem install deep_merge -v 1.2.1\
&& gem install colorize\
&& gem sources --clear-all \
&& gem sources --clear-all

# Remove gem cache and chocolatey
&& powershell -Command "Remove-Item -Force C:\ruby26\lib\ruby\gems\2.6.0\cache\*.gem; Remove-Item -Recurse -Force 'C:\ProgramData\chocolatey'"
RUN powershell -Command "Remove-Item -Force C:\ruby26\lib\ruby\gems\2.6.0\cache\*.gem; Remove-Item -Recurse -Force 'C:\ProgramData\chocolatey'"

SHELL ["powershell"]
RUN ./opt/scripts/setup.ps1
Expand Down

0 comments on commit 662c17f

Please sign in to comment.