From 1a7df460e950d48868e32c5a57f3522fef170763 Mon Sep 17 00:00:00 2001 From: Tanmay Satam Date: Fri, 7 Jun 2024 18:54:46 -0400 Subject: [PATCH] Minimal Python container to build `az aro` extension (#3490) * Add build container for az aro extension --- Dockerfile.ci-azext-aro | 12 ++++++++++++ Makefile | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 Dockerfile.ci-azext-aro diff --git a/Dockerfile.ci-azext-aro b/Dockerfile.ci-azext-aro new file mode 100644 index 000000000..758686c3f --- /dev/null +++ b/Dockerfile.ci-azext-aro @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/azure-cli:2.61.0 AS builder + +RUN pip install pytest +COPY /python /data/ + +WORKDIR /data/az/aro +RUN pytest --ignore=azext_aro/tests/latest/integration +RUN python3 setup.py bdist_wheel + +FROM mcr.microsoft.com/azure-cli:2.61.0-cbl-mariner2.0 AS final +COPY --from=builder /data/az/aro/dist /opt/az +RUN az extension add --yes --source /opt/az/aro-*-py2.py3-none-any.whl diff --git a/Makefile b/Makefile index e95f032f6..032896fca 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,10 @@ az: pyenv python3 ./setup.py bdist_wheel || true && \ rm -f ~/.azure/commandIndex.json # https://github.com/Azure/azure-cli/issues/14997 +.PHONY: azext-aro +azext-aro: + 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 find python -type f -name '*.pyc' -delete