dotnet / docker-tools

This is a repo to house some common tools for our various docker repos.
MIT License
116 stars 45 forks source link

EOL annotation race condition #1417

Open mthalman opened 3 weeks ago

mthalman commented 3 weeks ago

When EOL annotation support is added to the dotnet-buildtools-prereqs-docker repo, it can result in a race condition when determining which images should be annotated, potentially resulting in supported images being EOL-annotated.

This repo is unique in this aspect because of its use of multiple pipelines that all write to the same image info file. When there are multiple pipelines running concurrently, there can be the following race condition scenario:

  1. Debian pipeline starts
  2. Fedora pipeline starts
  3. Debian pipeline pushes new images to ACR (but hasn't yet updated image info file)
  4. Fedora pipeline pushes new images to ACR
  5. Fedora pipeline updates image info file
  6. Fedora pipeline queries to find images that need to be annotated. It finds the Debian images and sees they are not in the image info file.
  7. Fedora pipeline sets EOL annotations, which includes newly published Debian images

Possible solutions:

lbussell commented 2 weeks ago

[Triage] We should investigate if option 2 (going back to a single pipeline) is feasible without wasting a huge amount of compute (via any Azure DevOps features, etc.)

Another way to go back to a single build pipeline could be to compute which images will be cached/built ahead of build matrix generation, so that we avoid spinning up too much compute for each individual build leg.

mthalman commented 2 weeks ago

Another way to go back to a single build pipeline could be to compute which images will be cached/built ahead of build matrix generation, so that we avoid spinning up too much compute for each individual build leg.

I'm going with this approach.