Azure / acr-builder

Azure Container Registry Build Runner
MIT License
38 stars 35 forks source link

Acr Tasks fails to download source tarball from Github #671

Open yuehaoliang opened 9 months ago

yuehaoliang commented 9 months ago

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 commented 9 months ago

Azure/azure-cli#28190