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

Adds option to download caches using AzCopy #493

Closed
wants to merge 4 commits into from

Conversation

dhadka
Copy link
Member

@dhadka dhadka commented Jun 4, 2020

Adds option to download caches using AzCopy. This improves download speed and helps reduce flakiness. AzCopy downloads the file in 4 MB chunks, so it has more granular control over retries and parallelism.

This download option is selected when

  1. The cache URL is from Azure blob storage
  2. The DISABLE_AZCOPY env var is not set (used to test the http-client download path)
  3. azcopy is available on the runner

For hosted runners, azcopy is available on Ubuntu and Mac, but not Windows. On Ubuntu, we use the azcopy10 alias since azcopy refers to a much earlier version (7.x.x).

Stats

The table below shows the average time to download a 1 GB file from an EastUS storage account to a VM hosted in EastUS2 or WestUS:

Client           EastUS2 VM          WestUS VM
---------------  ------------------  ----------------
http-client      43.6 s              141 s
azcopy           7.5 s               22.4 s

TODO

@@ -113,3 +113,28 @@ export async function isGnuTarInstalled(): Promise<boolean> {
const versionOutput = await getVersion('tar')
return versionOutput.toLowerCase().includes('gnu tar')
}

export async function getAzCopyCommand(): Promise<string | undefined> {
// Always prefer the azcopy10 alias first, which is the correct version on Ubuntu.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by correct version? What happens if we just do the version 10 or newer check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

azcopy on Ubuntu is version 7.x.x, which uses a completely different CLI. So we need to use the azcopy10 alias on Ubuntu to get to version 10.

This is different on a Mac, where azcopy is v10. Windows currently does not have AzCopy installed, but I already filed an issue to fix that.

I'm not sure why it's setup this way, but this logic is needed to ensure we get the correct version on Ubuntu.

@dhadka
Copy link
Member Author

dhadka commented Jul 13, 2020

Closing, PR to use the NodeJS library for Azure storage used instead of AzCopy.

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.

None yet

2 participants