-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Provide CLI commands for investigating the contents and available workload set versions #42367
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
Comments
Thanks for writing this! I'd suggest considering |
Looks great. Just a few thoughts on my end:
|
Progress on #42367 This adds three new parameters to the dotnet workload list command: version, --take, and --format. If version is specified, it will print the most recent `--take` workload sets (within the feature band; default (or if you specify a value < 1) is 5) and output them in --format (which can be json or csv; default (unspecified or other) is to put each version on its own line). ```terminal > dotnet workload search version 9.0.105 9.0.104 9.0.103 9.0.102 9.0.101 ``` ```terminal > dotnet workload search version --format json --take 2 [{ "workloadVersion": "9.0.105"},{ "workloadVersion": "9.0.104" }] ``` ### Converting the json output to lines/other formats #### sh (with jq) ```bash > dotnet workload search version --format json --take 2 | jq 'map(.workloadVersion) | .[]' 9.0.105 9.0.104 ``` #### Powershell core ```powershell > dotnet workload search version --format json --take 2 | ConvertFrom-Json | ForEach-Object { Write-Host $_.workloadVersion } 9.0.105 9.0.104 ```
Per conversation earlier today, we agreed to the package@version syntax and we'll start with just the workload and matching manifest. We decided to just use the existing --version or workloadVersion in the global.json for this and look for the @ symbol. We have three options for fetching this from nuget:
We agreed to proceed with one since the number of workload sets should be relatively |
Uh oh!
There was an error while loading. Please reload this page.
Now that we have workload sets, users have three questions about them that we can't easily answer:
We will provide CLI commands that enable users to learn the answers to all of those questions.
What workload set versions are available?
Workload sets are shipped as a specific NuGet package and are selected by users by version, either implicitly or explicitly. We should provide a command to list the top N versions of the workload set package available on the selected feeds so that users know what versions are available.
dotnet workload search versions
Microsoft.NET.Workloads.{SDKFeatureBand}
of the currently-used SDK--take
command to limit the number of versions returned (based on prior art fromdotnet package search --take
, I'm not personally a fan of this and would consider--count
).--format <table|json>
option and will emit the results as either a JSON array of strings or a terminal-formatted table using our existing helpersdotnet workload install --version
anddotnet workload update --version
for workload setsWhat's in workload set XYZ?
Users want to know what versions of the workloads are bundled in each workload set for a number of reasons. We'll tackle this in two parts:
dotnet workload search sets <workload set version>
--format <table|json>
option that will emit the results as either a JSON array of objects describing each workload in the workload set, or as a table using our existing helpersAs an example of what this could look like, let's take the existing output from
dotnet workload list
, which lists the versions of workloads that are installed locally. This output is from my local Windows desktop, which is not configured to use workload sets:The major difference that the proposed "what's in workload set X" command would have compared to this is:
What workload contains version X of component or workload Y?
AKA a reverse-lookup, inverting the previous command. Once we have the data to power the above command, we should be able to use it to look up the matching workload set version for a given workload version (e.g. Aspire 8.0.1).
dotnet workload search sets --component <component ID and version>
, where<component ID and version>
is a structure like<component@version>
- for example[email protected]
.dotnet workload search sets --component [email protected] --component [email protected]
--component
option easily as welldotnet workload search sets [email protected] [email protected]
dotnet workload search versions [email protected]
This question is the least fleshed-out but we hope this gives enough of an idea to have a discussion.
Automatically install a workload set that contains a given workload version
Building on the previous 3 commands, users should be able to do something like
dotnet workload install [email protected] [email protected]
and the tooling should find the workload set (or sets) that contains both of those and install that workload set. Potentially prompting the user to make a choice if multiple valid sets are found.If multiple workloads are specified, the workload set used must satisfy all of them.
We should explicitly show in the
usage
section of the CLI help that there are two modes of thedotnet workload install
command - one for workload sets and one for workloads - this will require customizing the help layout, and that's something we've wanted in several other scenarios.Open questions
sets
but @dsplaisted's suggestion ofversions
is also very reasonable and has the upside of not introducing the workload sets concept to the CLI grammar or to users.<id>::<version>
The text was updated successfully, but these errors were encountered: