-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache & reuse previously downloaded SDK #15
Comments
The need tracked in this issue should be evaluated against other re-engineering requirements. Moving to the re-engineering project. |
Hi, The scripts are being put into "maintenance mode". This means that the scripts and their ecosystem (i.e. website and feeds) will continue to be monitored, but no new features will be delivered. We are still committed to maintaining the scripts’ high availability and we will quickly respond to any incidents. As part of this effort, we are closing the issues that aren't planned to be delivered. Unfortunately, this issue is one of those that didn't make the cut, and therefore will be closed. Thanks |
Ouch!! I was looking for this feature to be implemented so you could mount a volume in Docker containers with previously downloaded dotnet bundles :( |
Context: dotnet/install-scripts#15 Context: https://dot.net/v1/dotnet-install.sh Context: https://dot.net/v1/dotnet-install.ps1 We've been installing dotnet versions using the Unix shell and Windows powershell scripts, which work fine. However, they do not cache the downloaded archive and therefore we end up re-downloading the same archive over and over again on CI servers as well as locally. Additionally, if one finds themselves without internet connection, there's no way to install the required version of dotnet. The installation scripts don't provide a way to cache the payloads and they appear to be in maintenance mode, so there's rather no chance to add caching support to them. Instead of relying on the scripts, we can do the downloading and installation ourselves, which lets us take the first step towards fully "offline" builds (and smaller downloads on CI servers). With this commit, we will cache both the scripts and the payloads and we will perform the installation ourselves. Scripts are still used to obtain the download URL(s) for dotnet and as a fallback should our attempt to download dotnet archives fail.
Context: dotnet/install-scripts#15 Context: https://dot.net/v1/dotnet-install.sh Context: https://dot.net/v1/dotnet-install.ps1 We've been installing dotnet versions using the Unix shell and Windows powershell scripts, which work fine. However, they do not cache the downloaded archive and therefore we end up re-downloading the same archive over and over again on CI servers as well as locally. Additionally, if one finds themselves without internet connection, there's no way to install the required version of dotnet. The installation scripts don't provide a way to cache the payloads and they appear to be in maintenance mode, so there's rather no chance to add caching support to them. Instead of relying on the scripts, we can do the downloading and installation ourselves, which lets us take the first step towards fully "offline" builds (and smaller downloads on CI servers). With this commit, we will cache both the scripts and the payloads and we will perform the installation ourselves. Scripts are still used to obtain the download URL(s) for dotnet and as a fallback should our attempt to download dotnet archives fail.
Context: dotnet/install-scripts#15 Context: https://dot.net/v1/dotnet-install.sh Context: https://dot.net/v1/dotnet-install.ps1 We've been installing dotnet versions using the [`dotnet-install`][0] scripts for Unix & Windows. However, they do not cache the downloaded archive, and therefore we end up re-downloading the same archive over and over again. Additionally, if one finds themselves without an internet connection, there's no way to easily install the required version of dotnet. The installation scripts don't provide a way to cache the payloads and they appear to be in maintenance mode (dotnet/install-scripts#15), so there doesn't appear to be a chance to add caching support to them. Fortunately, we can "ask" the scripts what they're downloading: % curl -o dotnet-install.sh 'https://dot.net/v1/dotnet-install.sh' % ./dotnet-install.sh --version 7.0.100-preview.5.22273.1 --verbose --dry-run \ | grep 'dotnet-install: URL' This returns a list of URLs, which may or may not exist: dotnet-install: URL #0 - primary: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-preview.5.22273.1/dotnet-sdk-7.0.100-preview.5.22273.1-osx-x64.tar.gz dotnet-install: URL #1 - legacy: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-preview.5.22273.1/dotnet-dev-osx-x64.7.0.100-preview.5.22273.1.tar.gz dotnet-install: URL #2 - primary: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.100-preview.5.22273.1/dotnet-sdk-7.0.100-preview.5.22273.1-osx-x64.tar.gz dotnet-install: URL #3 - legacy: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.100-preview.5.22273.1/dotnet-dev-osx-x64.7.0.100-preview.5.22273.1.tar.gz We now parse this output, extract the URLs, then download and cache the URL contents into `$(AndroidToolchainCacheDirectory)`. When we need to install .NET, we just extract the cached archive into the appropriate directory. If no `dotnet-install: URL…` messages are generated, then we run the `dotnet-install` script as we previously did. This process lets us take a first step towards fully "offline" builds, along with smaller downloads on CI servers. [0]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
Context: dotnet/install-scripts#15 Context: https://dot.net/v1/dotnet-install.sh Context: https://dot.net/v1/dotnet-install.ps1 We've been installing dotnet versions using the [`dotnet-install`][0] scripts for Unix & Windows. However, they do not cache the downloaded archive, and therefore we end up re-downloading the same archive over and over again. Additionally, if one finds themselves without an internet connection, there's no way to easily install the required version of dotnet. The installation scripts don't provide a way to cache the payloads and they appear to be in maintenance mode (dotnet/install-scripts#15), so there doesn't appear to be a chance to add caching support to them. Fortunately, we can "ask" the scripts what they're downloading: % curl -o dotnet-install.sh 'https://dot.net/v1/dotnet-install.sh' % ./dotnet-install.sh --version 7.0.100-preview.5.22273.1 --verbose --dry-run \ | grep 'dotnet-install: URL' This returns a list of URLs, which may or may not exist: dotnet-install: URL #0 - primary: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-preview.5.22273.1/dotnet-sdk-7.0.100-preview.5.22273.1-osx-x64.tar.gz dotnet-install: URL #1 - legacy: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.100-preview.5.22273.1/dotnet-dev-osx-x64.7.0.100-preview.5.22273.1.tar.gz dotnet-install: URL #2 - primary: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.100-preview.5.22273.1/dotnet-sdk-7.0.100-preview.5.22273.1-osx-x64.tar.gz dotnet-install: URL #3 - legacy: https://dotnetbuilds.azureedge.net/public/Sdk/7.0.100-preview.5.22273.1/dotnet-dev-osx-x64.7.0.100-preview.5.22273.1.tar.gz We now parse this output, extract the URLs, then download and cache the URL contents into `$(AndroidToolchainCacheDirectory)`. When we need to install .NET, we just extract the cached archive into the appropriate directory. If no `dotnet-install: URL…` messages are generated, then we run the `dotnet-install` script as we previously did. This process lets us take a first step towards fully "offline" builds, along with smaller downloads on CI servers. [0]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
This is an enhancement request for
install-script.ps1/.sh
.Can we get a new parameter to request that this script only download the selected SDK if it can't find a find previously downloaded SDK in the temp directory (or wherever it places the SDK archive upon download)?
I know a lot build machines these days start with a fresh image but that isn't the case for our build machines. There really is no need to re-download a several hundred MB file just to overwrite the very same file. Seems like this could also save bandwidth on Microsoft's Azure servers.
The text was updated successfully, but these errors were encountered: