Skip to content
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

Check if runtime toolsets exist before restoring #13359

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented May 1, 2023

Check if runtime toolsets specfied in global.json under tools/runtimes node exist before attempting to restore those. This check removes unnecessary wait time and reduces the console "noise".

Resolves #13128

{
  "sdk": {
    "version": "8.0.100-preview.4.23212.7"
  },
  "tools": {
    "dotnet": "8.0.100-preview.4.23212.7",
    "runtimes": {
      "dotnet/x64": [
        "3.1.32",
        "6.0.13",
        "7.0.2"
      ],
      "aspnetcore/x64": [
        "3.1.32",
        "6.0.13",
        "7.0.2"
      ]
    }
  }
}

After

Windows

Fresh repo

GET https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
  Attempting to install 'sdk v8.0.100-preview.4.23212.7' from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: Extracting the archive.
dotnet-install: Adding to current process PATH: ....
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Extracting the archive.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 6.0.13
dotnet-install: Installation finished
  Attempting to install runtime toolset 'dotnet/x64 v7.0.2' from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Extracting the archive.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 7.0.2
dotnet-install: Installation finished
GET https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
  Attempting to install runtime toolset 'dotnet/x86 v3.1.32' from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Extracting the archive.
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 3.1.32
dotnet-install: Installation finished
  Attempting to install runtime toolset 'aspnetcore/x64 v3.1.32' from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Extracting the archive.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 3.1.32
dotnet-install: Installation finished
  Attempting to install runtime toolset 'aspnetcore/x64 v6.0.13' from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Extracting the archive.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 6.0.13
dotnet-install: Installation finished
  Attempting to install runtime toolset 'aspnetcore/x64 v7.0.2' from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Extracting the archive.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 7.0.2
dotnet-install: Installation finished
  Determining projects to restore...
  All projects are up-to-date for restore.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:16.21

Restored repo

  Determining projects to restore...
  
  Restore was successful.
  All projects are up-to-date for restore.
  Runtime toolset 'dotnet/x64 v3.1.32' already installed.
  Runtime toolset 'dotnet/x64 v6.0.13' already installed.
  Runtime toolset 'dotnet/x64 v7.0.2' already installed.
  Runtime toolset 'dotnet/x86 v3.1.32' already installed.
  Runtime toolset 'aspnetcore/x64 v3.1.32' already installed.
  Runtime toolset 'aspnetcore/x64 v6.0.13' already installed.
  Runtime toolset 'aspnetcore/x64 v7.0.2' already installed.
  Determining projects to restore...
  All projects are up-to-date for restore.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:10.21

Linux

Fresh repo

Downloading 'https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh'
  Attempting to install runtime toolset 'sdk v8.0.100-preview.4.23212.7' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100-preview.4.23212.7/dotnet-sdk-8.0.100-preview.4.23212.7-linux-x64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100-preview.4.23212.7/dotnet-sdk-8.0.100-preview.4.23212.7-linux-x64.tar.gz' is not available.
dotnet-install: Attempting to download using primary link https://dotnetbuilds.azureedge.net/public/Sdk/8.0.100-preview.4.23212.7/dotnet-sdk-8.0.100-preview.4.23212.7-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetbuilds.azureedge.net/public/Sdk/8.0.100-preview.4.23212.7/dotnet-sdk-8.0.100-preview.4.23212.7-linux-x64.tar.gz
dotnet-install: Installed version is 8.0.100-preview.4.23212.7
dotnet-install: Adding to current process PATH: ....
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Determining projects to restore...
  
  Restore was successful.
  All projects are up-to-date for restore.
  Attempting to install runtime toolset 'dotnet/x64 v3.1.32' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Runtime/3.1.32/dotnet-runtime-3.1.32-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Runtime/3.1.32/dotnet-runtime-3.1.32-linux-x64.tar.gz
dotnet-install: Installed version is 3.1.32
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Attempting to install runtime toolset 'dotnet/x64 v6.0.13' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Runtime/6.0.13/dotnet-runtime-6.0.13-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Runtime/6.0.13/dotnet-runtime-6.0.13-linux-x64.tar.gz
dotnet-install: Installed version is 6.0.13
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Attempting to install runtime toolset 'dotnet/x64 v7.0.2' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Runtime/7.0.2/dotnet-runtime-7.0.2-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Runtime/7.0.2/dotnet-runtime-7.0.2-linux-x64.tar.gz
dotnet-install: Installed version is 7.0.2
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Attempting to install runtime toolset 'aspnetcore/x64 v3.1.32' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/3.1.32/aspnetcore-runtime-3.1.32-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/3.1.32/aspnetcore-runtime-3.1.32-linux-x64.tar.gz
dotnet-install: Installed version is 3.1.32
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Attempting to install runtime toolset 'aspnetcore/x64 v6.0.13' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.13/aspnetcore-runtime-6.0.13-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.13/aspnetcore-runtime-6.0.13-linux-x64.tar.gz
dotnet-install: Installed version is 6.0.13
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Attempting to install runtime toolset 'aspnetcore/x64 v7.0.2' from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/7.0.2/aspnetcore-runtime-7.0.2-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/7.0.2/aspnetcore-runtime-7.0.2-linux-x64.tar.gz
dotnet-install: Installed version is 7.0.2
dotnet-install: Adding to current process PATH: ...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
  Determining projects to restore...
  All projects are up-to-date for restore.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:08.08

Restored repo

  Determining projects to restore...
  
  Restore was successful.
  All projects are up-to-date for restore.
  Runtime toolset 'dotnet/x64 v3.1.32' already installed.
  Runtime toolset 'dotnet/x64 v6.0.13' already installed.
  Runtime toolset 'dotnet/x64 v7.0.2' already installed.
  Runtime toolset 'aspnetcore/x64 v3.1.32' already installed.
  Runtime toolset 'aspnetcore/x64 v6.0.13' already installed.
  Runtime toolset 'aspnetcore/x64 v7.0.2' already installed.
  Determining projects to restore...
  All projects are up-to-date for restore.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:12.37

Note, I'm badly waiting for dotnet/install-scripts#356 to be made public as it would reduce this console noise even further. /cc: @baronfel

Check if runtime toolsets specfied in global.json under tools/runtimes
node exist before attempting to restore those. This check removes
unnecessary wait time and reduces the console "noise".

Resolves #13128
@RussKie RussKie self-assigned this May 1, 2023
@RussKie
Copy link
Member Author

RussKie commented May 2, 2023

Folks, how can I test this change (apart from manually copying the changes)? I published the artifacts to "general testing" but I see only the Arcade SDKs...

@RussKie
Copy link
Member Author

RussKie commented May 5, 2023

FWIW, I've been running this change locally across several repos (manually modifying tools.ps1), and it's been a real time saver.

@markwilkie
Copy link
Member

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving sdk install performance
3 participants