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

Question: Example of adding additional tools to agent VM image? #85

Open
mfaulcon opened this issue Jul 8, 2024 · 2 comments
Open

Question: Example of adding additional tools to agent VM image? #85

mfaulcon opened this issue Jul 8, 2024 · 2 comments

Comments

@mfaulcon
Copy link

mfaulcon commented Jul 8, 2024

By any chance, is there a working example of how to add additional tools to the agent VM image prior to adding it to the gallery? We need to add a few non-standard tools to the toolset to support our builds, and while I have a working pipeline to automatically build and deploy images to the gallery, I have not been successful in figuring out how to add the additional tools.

@YannickRe
Copy link
Owner

I do not have any working examples nor guidance, as I have never done this on my end.
I'll leave it open for others to respond and share, otherwise: if you figure it out, I'd be very grateful if you'd write it down and share it with us.

@Tjeerd-menno
Copy link

Tjeerd-menno commented Aug 23, 2024

Not a real example but this is how you can do exactly that.

  1. Fork the https://github.com/actions/runner-images repository
  2. Add a dedicated Install-XXX.ps1 and/or Install-XXX.sh script to the "images/<OS_Type>/scripts/build" folder which performs the install of the tool.
  3. Add a call to the newly added script to the relevant Packer template files (*.pkr.hcl) in the "templates" folder.

When writing your install script, you can use the helper functions under "images/<OS_Type>/scripts/helpers". The existing scripts for the various tools (each tool has a dedicated script) provide loads of examples.

If you don't want to use a fork and keep the pipeline running based on the original Git repository you could simply copy the install script into the "images/<OS_Type>/scripts/build" folder and inject the extra call to the script in the template after the repository clone task in the pipeline template in this repository (buildagent-generation-template.yml)

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

No branches or pull requests

3 participants