From fe815c3137ad8514b57eee24ac699dd9e1170e21 Mon Sep 17 00:00:00 2001 From: Tanmay Satam Date: Wed, 6 Mar 2024 17:23:39 -0500 Subject: [PATCH 1/3] Add build container for az aro extension --- Dockerfile.aro-azext | 7 +++++++ Makefile | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 Dockerfile.aro-azext diff --git a/Dockerfile.aro-azext b/Dockerfile.aro-azext new file mode 100644 index 00000000000..bf295bd96d9 --- /dev/null +++ b/Dockerfile.aro-azext @@ -0,0 +1,7 @@ +FROM mcr.microsoft.com/azure-cli:2.58.0 + +RUN pip install pytest +COPY /python /data/ + +WORKDIR /data/az/aro +CMD ["/bin/sh", "-c", "pytest --ignore=azext_aro/tests/latest/integration; python3 setup.py bdist_wheel"] diff --git a/Makefile b/Makefile index 2c31d5cdeaa..8921df91482 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,11 @@ az: pyenv python3 ./setup.py bdist_wheel || true && \ rm -f ~/.azure/commandIndex.json # https://github.com/Azure/azure-cli/issues/14997 +azext-aro: + docker build . -f Dockerfile.aro-azext --no-cache=$(NO_CACHE) -t aro-azext:latest + mkdir -p ./python/az/aro/dist + docker run -v ./python/az/aro/dist/:/data/az/aro/dist:z aro-azext:latest + clean: rm -rf python/az/aro/{aro.egg-info,build,dist} aro find python -type f -name '*.pyc' -delete From 5d1874850b74cec35fb75265030adcf3b918c6c3 Mon Sep 17 00:00:00 2001 From: Tanmay Satam Date: Wed, 6 Mar 2024 17:45:37 -0500 Subject: [PATCH 2/3] Perform all steps in container build --- Dockerfile.aro-azext | 3 ++- Makefile | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile.aro-azext b/Dockerfile.aro-azext index bf295bd96d9..dce5c4ac4c1 100644 --- a/Dockerfile.aro-azext +++ b/Dockerfile.aro-azext @@ -4,4 +4,5 @@ RUN pip install pytest COPY /python /data/ WORKDIR /data/az/aro -CMD ["/bin/sh", "-c", "pytest --ignore=azext_aro/tests/latest/integration; python3 setup.py bdist_wheel"] +RUN pytest --ignore=azext_aro/tests/latest/integration +RUN python3 setup.py bdist_wheel diff --git a/Makefile b/Makefile index 8921df91482..b4a6118d508 100644 --- a/Makefile +++ b/Makefile @@ -69,8 +69,6 @@ az: pyenv azext-aro: docker build . -f Dockerfile.aro-azext --no-cache=$(NO_CACHE) -t aro-azext:latest - mkdir -p ./python/az/aro/dist - docker run -v ./python/az/aro/dist/:/data/az/aro/dist:z aro-azext:latest clean: rm -rf python/az/aro/{aro.egg-info,build,dist} aro From 0ea1d01595d9e0b3a3d43ec6e22383d74a107801 Mon Sep 17 00:00:00 2001 From: Tanmay Satam Date: Wed, 6 Mar 2024 17:57:07 -0500 Subject: [PATCH 3/3] Rename azext-aro container for consistency with other CI containerfiles --- Dockerfile.aro-azext => Dockerfile.ci-azext-aro | 0 Makefile | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename Dockerfile.aro-azext => Dockerfile.ci-azext-aro (100%) diff --git a/Dockerfile.aro-azext b/Dockerfile.ci-azext-aro similarity index 100% rename from Dockerfile.aro-azext rename to Dockerfile.ci-azext-aro diff --git a/Makefile b/Makefile index b4a6118d508..11e8159e23c 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ az: pyenv rm -f ~/.azure/commandIndex.json # https://github.com/Azure/azure-cli/issues/14997 azext-aro: - docker build . -f Dockerfile.aro-azext --no-cache=$(NO_CACHE) -t aro-azext:latest + docker build --platform=linux/amd64 . -f Dockerfile.ci-azext-aro --no-cache=$(NO_CACHE) -t azext-aro:latest clean: rm -rf python/az/aro/{aro.egg-info,build,dist} aro @@ -273,4 +273,4 @@ vendor: install-go-tools: go install ${GOTESTSUM} -.PHONY: admin.kubeconfig aks.kubeconfig aro az ci-portal clean client deploy dev-config.yaml discoverycache generate image-aro-multistage image-fluentbit image-proxy lint-go runlocal-rp proxy publish-image-aro-multistage publish-image-fluentbit publish-image-proxy secrets secrets-update e2e.test tunnel test-e2e test-go test-python vendor build-all validate-go unit-test-go coverage-go validate-fips install-go-tools \ No newline at end of file +.PHONY: admin.kubeconfig aks.kubeconfig aro az azext-aro ci-portal clean client deploy dev-config.yaml discoverycache generate image-aro-multistage image-fluentbit image-proxy lint-go runlocal-rp proxy publish-image-aro-multistage publish-image-fluentbit publish-image-proxy secrets secrets-update e2e.test tunnel test-e2e test-go test-python vendor build-all validate-go unit-test-go coverage-go validate-fips install-go-tools \ No newline at end of file