acr-builder icon indicating copy to clipboard operation
acr-builder copied to clipboard

Acr Tasks fails to download source tarball from Github

Open yuehaoliang opened this issue 2 years ago • 1 comments

Describe the bug ACR Tasks should support using a tarball from a remote webserver, but there is an edge case if the remote server is GitHub. The Tasks service interprets the context as a GitHub repository instead of a tarball.

To Reproduce Steps to reproduce the behavior:

az acr task create -t nvidia/k8s-device-plugin:{{.Run.ID}} -n $MyTask -r $MyRegistry -g $MyResourceGroup -c https://github.com/NVIDIA/k8s-device-plugin/archive/refs/tags/v0.14.3.tar.gz -f deployments/container/Dockerfile.ubuntu --arg GOLANG_VERSION=1.20.5

Expected behavior Successfully find, download, and extract the tarball.

Additional context In the backend code, BaseBuildScheduler.BuildSourceLocationUrl() simply checks whether the URL authority contains Github. If it does, it appends .git to the URL, and ACB will handle the URL as a GitSourceControlURL. A potential fix could involve additionally checking whether the URL is a tarball.

yuehaoliang avatar Jan 15 '24 07:01 yuehaoliang

Azure/azure-cli#28190

yuehaoliang avatar Jan 18 '24 02:01 yuehaoliang