Skip to content

[windows] warmup "az devops" for the first run #8410

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

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

ilia-shipitsin
Copy link
Contributor

as Jesse Houwing has found "az devops" warms up during first run which takes ~40 sec.

warm up is done by running "az devops --help" with config redirected to persistent "C:" location, also keyring installation requires "fake" login

original PR: #8294

Description

warming up "az devops" first invocation.
due to security reasons we cannot accept original PR: #8294

Related issue:

#8296

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

as Jesse Houwing has found "az devops" warms up during first
run which takes ~40 sec.

warm up is done by running "az devops <subsystem> --help" with
config redirected to persistent "C:\" location, also keyring
installation requires "fake" login

original PR: actions#8294

Co-authored-by: Jesse Houwing <jesse.houwing@gmail.com>
@jessehouwing
Copy link
Contributor

Yay! Thanks for the mention!

@mikhailkoliada
Copy link
Contributor

/azp run windows2019,windows2022

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Alexey-Ayupov
Copy link
Contributor

/azp run windows2019,windows2022

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@ligz08
Copy link

ligz08 commented Apr 8, 2025

It's 2025 and I might be running into the same problem again -- first az command takes nearly 1 minute in Azure Pipelines pwsh task.

Agent info:

Operating System
Microsoft Windows Server 2022
10.0.20348
Datacenter
Runner Image
Image: windows-2022
Version: 20250224.5.0
Included Software: https://github.com/actions/runner-images/blob/win22/20250224.5/images/windows/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20250224.5

Logs from az devops configure --defaults organization=$(System.CollectionUri) project=$(System.TeamProject) --debug command:

Starting: verifyArtifact
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Linux, macOS, or Windows
Version      : 2.247.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
========================== Starting Command Output ===========================
"C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_work\_temp\482e1085-0587-470a-ab26-31c4360f3659.ps1'"
DEBUG: cli.knack.cli: Command arguments: ['devops', 'configure', '--defaults', 'organization=***', 'project=***', '--debug']
DEBUG: cli.knack.cli: __init__ debug log:
Cannot enable color.
DEBUG: cli.knack.cli: Event: Cli.PreExecute []
DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x000001395B5131A0>, <function OutputProducer.on_global_arguments at 0x000001395B6BC040>, <function CLIQuery.on_global_arguments at 0x000001395B6DD440>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
DEBUG: cli.azure.cli.core: Command index version or cloud profile is invalid or doesn't match the current command.
DEBUG: cli.azure.cli.core: Command index has been invalidated.
DEBUG: cli.azure.cli.core: No module found from index for '['devops', 'configure', '--defaults', 'organization=https://msasg.visualstudio.com/', 'project=llu', '--debug']'
DEBUG: cli.azure.cli.core: Loading all modules and extensions
DEBUG: cli.azure.cli.core: Discovered command modules: ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'compute_recommender', 'computefleet', 'config', 'configure', 'consumption', 'container', 'containerapp', 'cosmosdb', 'databoxedge', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'identity', 'interactive', 'iot', 'keyvault', 'lab', 'managedservices', 'maps', 'marketplaceordering', 'monitor', 'mysql', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'resource', 'role', 'search', 'security', 'servicebus', 'serviceconnector', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'synapse', 'util', 'vm']
DEBUG: cli.azure.cli.core: Loading command modules:
DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands
DEBUG: cli.azure.cli.core: acr                       5.705        36       149
DEBUG: cli.azure.cli.core: acs                       0.971        14        77
DEBUG: cli.azure.cli.core: advisor                   0.054         3         6
DEBUG: cli.azure.cli.core: ams                       0.110        22       100
DEBUG: cli.azure.cli.core: apim                      0.162        14        69
DEBUG: cli.azure.cli.core: appconfig                 0.121         9        47
DEBUG: cli.azure.cli.core: appservice                0.677        79       270
DEBUG: cli.azure.cli.core: aro                       0.395         1        10
DEBUG: cli.azure.cli.core: backup                    0.089        16        60
DEBUG: cli.azure.cli.core: batch                     0.681        32        96
DEBUG: cli.azure.cli.core: batchai                   0.109        10        30
DEBUG: cli.azure.cli.core: billing                   0.560        19        53
DEBUG: cli.azure.cli.core: botservice                0.122        12        42
DEBUG: cli.azure.cli.core: cdn                       5.702         8        50
DEBUG: cli.azure.cli.core: cloud                     0.069         1         7
DEBUG: cli.azure.cli.core: cognitiveservices         0.092        10        33
DEBUG: cli.azure.cli.core: compute_recommender       0.099         1         1
DEBUG: cli.azure.cli.core: computefleet              0.210         1         1
DEBUG: cli.azure.cli.core: config                    0.081         2         7
DEBUG: cli.azure.cli.core: configure                 0.071         2         5
DEBUG: cli.azure.cli.core: consumption               0.728         8         9
DEBUG: cli.azure.cli.core: container                 0.351         2        17
DEBUG: cli.azure.cli.core: containerapp              3.884        37       123
DEBUG: cli.azure.cli.core: cosmosdb                  0.344        58       199
DEBUG: cli.azure.cli.core: databoxedge               0.280         5        28
DEBUG: cli.azure.cli.core: dls                       0.088         6        36
DEBUG: cli.azure.cli.core: dms                       0.065         3        22
DEBUG: cli.azure.cli.core: eventgrid                 0.104        25        96
DEBUG: cli.azure.cli.core: eventhubs                 0.507        14        21
DEBUG: cli.azure.cli.core: extension                 0.021         1         7
DEBUG: cli.azure.cli.core: feedback                  0.017         1         2
DEBUG: cli.azure.cli.core: find                      0.046         1         1
DEBUG: cli.azure.cli.core: hdinsight                 0.179         9        42
DEBUG: cli.azure.cli.core: identity                  0.076         2        11
DEBUG: cli.azure.cli.core: interactive               0.030         1         1
DEBUG: cli.azure.cli.core: iot                       3.497        19        82
DEBUG: cli.azure.cli.core: keyvault                  0.236        20       113
DEBUG: cli.azure.cli.core: lab                       1.246         9        30
DEBUG: cli.azure.cli.core: managedservices           0.358         3         8
DEBUG: cli.azure.cli.core: maps                      0.095         5        13
DEBUG: cli.azure.cli.core: marketplaceordering       0.182         1         2
DEBUG: cli.azure.cli.core: monitor                   6.062        18        61
DEBUG: cli.azure.cli.core: mysql                     2.015        16        56
DEBUG: cli.azure.cli.core: netappfiles               1.620         8        17
DEBUG: cli.azure.cli.core: network                   0.915       104       346
DEBUG: cli.azure.cli.core: policyinsights            0.456         9        17
DEBUG: cli.azure.cli.core: privatedns                0.714        14        60
DEBUG: cli.azure.cli.core: profile                   0.063         2         8
DEBUG: cli.azure.cli.core: rdbms                     2.018        51       212
DEBUG: cli.azure.cli.core: redis                     0.060         7        38
DEBUG: cli.azure.cli.core: relay                     0.795         7         8
DEBUG: cli.azure.cli.core: resource                  0.290        52       232
DEBUG: cli.azure.cli.core: role                      0.042        17        62
DEBUG: cli.azure.cli.core: search                    0.271         7        19
DEBUG: cli.azure.cli.core: security                  0.282        48        98
DEBUG: cli.azure.cli.core: servicebus                0.284        13        17
DEBUG: cli.azure.cli.core: serviceconnector          0.320        20       315
DEBUG: cli.azure.cli.core: servicefabric             0.377        27        80
DEBUG: cli.azure.cli.core: signalr                   0.093        10        42
DEBUG: cli.azure.cli.core: sql                       0.199        56       215
DEBUG: cli.azure.cli.core: sqlvm                     0.496         4        20
DEBUG: cli.azure.cli.core: storage                   0.487        59       274
DEBUG: cli.azure.cli.core: synapse                   0.232        54       246
DEBUG: cli.azure.cli.core: util                      0.083         3         7
DEBUG: cli.azure.cli.core: vm                        1.235        58       266
DEBUG: cli.azure.cli.core: Total (65)               47.823      1186      4692
DEBUG: cli.azure.cli.core: Loading extensions:
DEBUG: cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
DEBUG: cli.azure.cli.core: azure-devops              3.152        60       192  C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops
DEBUG: cli.azure.cli.core: Total (1)                 3.152        60       192  
DEBUG: cli.azure.cli.core: Loaded 1232 groups, 4884 commands.
DEBUG: cli.azure.cli.core: Updated command index in 0.003 seconds.
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x000001395D9A5E40>]

Problem appears to be "No module found from index for ['devops', ...]", so Azure CLI did a full reloading of all command modules which took nearly 1 minute.

Is this the same problem addressed here in this PR?

@ligz08
Copy link

ligz08 commented Apr 11, 2025

Please ignore my previous post. I found it to be an issue with my runner image's $env:AZURE_CONFIG_DIR\commandIndex.json containing "version": "2.71.0", inconsistent with the actually installed Azure CLI 2.69.0, thus az <subcommand> would reload modules & extensions. I don't know for sure if the inconsistency originates from the publicly released Image Version: 20250224.5.1 or internal customization added by my organization, but either way has nothing to do with the warmup scripts here.

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.

5 participants