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

fix: redundant CLI downloads [HEAD-450][HEAD-504][HEAD-505] #163

Merged
merged 13 commits into from
Jul 20, 2023

Conversation

asaf92
Copy link

@asaf92 asaf92 commented Jul 18, 2023

No description provided.

@asaf92 asaf92 requested a review from a team as a code owner July 18, 2023 12:12
@CLAassistant
Copy link

CLAassistant commented Jul 18, 2023

CLA assistant check
All committers have signed the CLA.

@asaf92 asaf92 enabled auto-merge (squash) July 19, 2023 09:24
@asaf92 asaf92 changed the title fix: redundant CLI downloads fix: redundant CLI downloads [HEAD-450][HEAD-504][HEAD-505] Jul 19, 2023
@jessehouwing
Copy link
Contributor

Have you folks looked into the official tool installer and the tool caching directory for the Azure Pipelines Agent?

@asaf92
Copy link
Author

asaf92 commented Jul 20, 2023

@jessehouwing

Have you folks looked into the official tool installer and the tool caching directory for the Azure Pipelines Agent?

I'm not familiar with neither, but it sounds like there's a way to save us some cloud costs so I'm interested!
I assume pipeline caching can be a solution for the CLI downloads, but what's the "official tool installer"?

@jessehouwing
Copy link
Contributor

jessehouwing commented Jul 20, 2023

Tool lib is here:

https://github.com/microsoft/azure-pipelines-tool-lib

It provides a set of standard APIs and a naming convention to store tools on the agent in a way that allows multiple jobs to use them, but also shields multiple agents installed on the same machine from eachother.

The tools are installed in the agent's _tools folder by version by default and you'd normally add the tool path to the shell's path. Alternatively you can set a hidden variable with the path to the tool.

Example here:

https://github.com/microsoft/azure-devops-extension-tasks/tree/main/BuildTasks/TfxInstaller/v4

In this case the tool installer was broken out into a separate task, but you can merge the 2 together.

The tool installer can maybe be extended with the caching features native to Azure DevOps to store a copy of the tool in the Organization's cache to speed up downloads and reduce bandwidth. Let me check with the Azure Pipelines Team to see if this option exists.

The agent has a build-in caching plugin, but I'm unsure how to leverage this from a custom task outside of the built-in Cache@2 tasks. Extending the Snyk docs on how to configure caching to speed up hosted builds is probably useful anyway.

@bastiandoetsch
Copy link
Contributor

Do we actually use GZIP compression on the downloads here? Would be good, too :).

Copy link
Contributor

@PeterSchafer PeterSchafer left a comment

Choose a reason for hiding this comment

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

Let's see if these changes fix the immediate issues we are seeing and add an improvement task for using the proposed tooling support.

Thanks a lot @jessehouwing for bringing this to our attention!

@asaf92 asaf92 merged commit f3125e8 into develop Jul 20, 2023
@jessehouwing
Copy link
Contributor

@PeterSchafer

I also added 2 PRs some time back to improve the representation of the extension on the marketplace.

I think they may have gotten lost in the team transfer.

@snyksec
Copy link

snyksec commented Aug 3, 2023

🎉 This PR is included in version 1.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

j-luong pushed a commit that referenced this pull request Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants