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

Inconsistent login speed / slow login #449

Closed
lanni-energinet opened this issue May 22, 2024 · 6 comments · Fixed by #450
Closed

Inconsistent login speed / slow login #449

lanni-energinet opened this issue May 22, 2024 · 6 comments · Fixed by #450
Assignees
Labels
product enhancement New feature or request

Comments

@lanni-energinet
Copy link

lanni-energinet commented May 22, 2024

We are facing issues with azure/login being slow
Duration is from ~13 seconds to ~1½ minutes, we are using large runners (ubuntu-latest)

One of the most consistent findings is the command which takes about 11s
/usr/bin/az --version

let output: string = "";
const execOptions: any = {
    listeners: {
        stdout: (data: Buffer) => {
            output += data.toString();
        }
    }
};

await this.executeAzCliCommand(["--version"], true, execOptions);
core.debug(`Azure CLI version used:\n${output}`);

We have been unable to reproduce the error outside of our existing workflows. but even considering that - it seems a bit redundant to execute a command and then disregard the output based on loglevel

Would it make sense to wrap the quoted code in a conditional block based on core.isDebug()

Details below

Usage in workflow:

- name: Az CLI login
uses: azure/login@v2
with:
  client-id: ${{ inputs.azure_spn_id }}
  tenant-id: ${{ inputs.azure_tenant_id }}
  subscription-id: ${{ inputs.azure_subscription_id }}

Output from our log (With debug enabled)

2024-05-22T08:31:07.0288811Z ##[group]Run azure/login@v2
2024-05-22T08:31:07.0289280Z with:
... snip ...
2024-05-22T08:31:07.0293203Z env:
... snip ...
2024-05-22T08:31:07.0299672Z ##[endgroup]
2024-05-22T08:31:07.0688122Z ::add-mask::***
2024-05-22T08:31:07.0698936Z Running Azure CLI Login.
2024-05-22T08:31:07.0721267Z ##[debug]Azure CLI path: /usr/bin/az
2024-05-22T08:31:18.4592979Z ##[debug]Azure CLI version used:
2024-05-22T08:31:18.4593850Z ##[debug]azure-cli                         2.60.0 *
... snip ...
2024-05-22T08:31:18.4608366Z ##[debug]
2024-05-22T08:31:18.4611258Z [command]/usr/bin/az cloud set -n azurecloud
2024-05-22T08:31:49.5759670Z Done setting cloud: "azurecloud"
@lanni-energinet lanni-energinet added the need-to-triage Requires investigation label May 22, 2024
@lanni-energinet lanni-energinet changed the title Running /usr/bin/az --version slows down our pipeline Inconsistent login speed / slow login May 22, 2024
@MoChilia MoChilia added product enhancement New feature or request and removed need-to-triage Requires investigation labels May 27, 2024
@MoChilia
Copy link
Member

Hi @lanni-energinet, thanks for bringing this to our attention! We can definitely enhance this.

I've found related issues, as noted in Azure/azure-cli#27796 (comment). The az --version performs an update check, which can be slow with a poor network connection. On the other hand, az version doesn't make any network requests and is faster. I will change az --version to az version to improve the speed of azure/login.

@lanni-energinet
Copy link
Author

@MoChilia.

Thats great. Less IO is better.

Thank you for looking into this

@MoChilia MoChilia linked a pull request May 27, 2024 that will close this issue
@lanni-energinet
Copy link
Author

@MoChilia Can you speculate on when this issue is released?

@onionhammer
Copy link

It is very very slow. It shouldnt take 1 minute to run this, but its consistently inconsistent.

@lanni-energinet
Copy link
Author

@onionhammer

Please upvote this issue actions/runner-images#10110 as this heavily impacts the speed of az-login (If it is the first step that interacts with az-cli)

@lanni-energinet
Copy link
Author

lanni-energinet commented Aug 21, 2024

@YanaXu / @MoChilia

Could you please release a new version.

Our organization is wasting time and money on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@onionhammer @MoChilia @lanni-energinet and others