runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

Update configure-apt-mock.sh to enable parallelism

Open fahhem opened this issue 11 months ago • 9 comments

Description

This adds a few errors that happen when another update/install process is running in parallel. apt-get update doesn't handle race conditions well, and apt-get install has one as well.

This is pre-cursor to another change that enables parallelism in the packer templates to run the install-*.sh scripts parallel, as I mentioned in https://github.com/actions/runner-images/discussions/2320

On its own, this change does nothing, except maybe slightly increase reliability of image building.

Check list

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

fahhem avatar Jan 25 '25 07:01 fahhem

I have more extensive changes coming to actually enable parallelism. This PR is now weeks old, which doesn't bode well for the rest of my changes. Is there any interest from the actual team?

fahhem avatar Feb 06 '25 18:02 fahhem

Thank you @xximwon , but I need someone "with write access" to approve this PR.

fahhem avatar Feb 13 '25 05:02 fahhem

ping @subir0071 , looks like CI passed, mind approving/merging it?

fahhem avatar Jun 21 '25 22:06 fahhem

Hi @fahhem , Kindly rebase your Pr, thanks

vidyasagarnimmagaddi avatar Jun 24 '25 07:06 vidyasagarnimmagaddi

@vidyasagarnimmagaddi rebased, but nothing changed in the rebase so the diffs are the same.

fahhem avatar Jun 24 '25 23:06 fahhem

@vidyasagarnimmagaddi thank you, looks like CI still passes!

fahhem avatar Jun 29 '25 02:06 fahhem

@fahhem - Could you please check my comment and provide your response?

subir0071 avatar Jun 30 '25 17:06 subir0071

@subir0071 I'm sorry, but I can't find your comment? I don't see anything in my emails either

fahhem avatar Jul 01 '25 06:07 fahhem

This pull request enhances error handling in the configure-apt-mock.sh script by adding additional checks for specific race conditions during apt operations. These changes aim to improve the reliability of the script when encountering transient errors.

Improvements to error handling:

  • images/ubuntu/scripts/build/configure-apt-mock.sh: Added checks for race conditions involving lock files and cache renaming during apt operations. These include:
    • Detecting errors related to /var/lib/apt/lists/lock to ensure retries when apt update does not complete.
    • Handling errors related to renaming /var/cache/apt/pkgcache.bin and /var/cache/apt/srcpkgcache.bin to address incomplete apt-get operations.

cceneag avatar Jul 13 '25 20:07 cceneag