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

ci: always pull docker image from remote to prevent out of sync tags #12351

Merged
merged 3 commits into from Mar 31, 2022

Conversation

Neudrino
Copy link
Contributor

@Neudrino Neudrino commented Mar 30, 2022

Summary

Github action runners are not managed by Magma and might be reused several times. The docker documentation seems to suggest, that if a image is already present in the local docker registry, it will not be re-fetched from the remote unless explicitly told so. See the option --pull with default missing in the docker documentation. This can lead to stale images being used.

To mitigate the issue we need to force pull the first time we use an image within the workflow.
Keep in mind that we do not want to force pull in every following action as this would bring the risk to use different images in one workflow run, when a image tag is updated during that workflow run.

The addnab/docker-run-action required an update to version v3 for this to work.

Test Plan

  • CI
  • future observation for unexpected behaviour in CI

Additional Information

  • Thanks to @nstng for finding this and vivid discussion!

... to prevent out of sync tags

Signed-off-by: Fritz Lehnert <13189449+Neudrino@users.noreply.github.com>
@Neudrino Neudrino requested review from a team and nstng March 30, 2022 11:55
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines. label Mar 30, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added the component: ci All updates on CI (Jenkins/CircleCi/Github Action) label Mar 30, 2022
Signed-off-by: Fritz Lehnert <13189449+Neudrino@users.noreply.github.com>
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines. and removed size/XS Denotes a PR that changes 0-9 lines. labels Mar 30, 2022
@electronjoe
Copy link
Member

Looks like the OWNERS masks are confusing this GitHub workflow for a bazel BUILD file? Hence the review is only approvers-bazel.

@Neudrino Neudrino added the bazel changes for the Bazelification effort label Mar 30, 2022
…ulling

Signed-off-by: Fritz Lehnert <13189449+Neudrino@users.noreply.github.com>
@Neudrino Neudrino force-pushed the ci/always-pull-docker-image-on-run branch from 5eb376d to c99eb89 Compare March 30, 2022 14:58
.github/workflows/bazel.yml Show resolved Hide resolved
@nstng
Copy link
Contributor

nstng commented Mar 30, 2022

Tested extensively on #12271. Image was updated correctly 👍 . We should track somewhere that this should be changed for all workflows that use the latest devcontainer image.

@nstng
Copy link
Contributor

nstng commented Mar 30, 2022

Looks like the OWNERS masks are confusing this GitHub workflow for a bazel BUILD file? Hence the review is only approvers-bazel.

This file was added on purpose to approvers-bazel because it only contains Bazel related builds.

@Neudrino Neudrino requested a review from nstng March 30, 2022 15:44
@nstng nstng merged commit 8ed530c into magma:master Mar 31, 2022
@Neudrino Neudrino deleted the ci/always-pull-docker-image-on-run branch March 31, 2022 13:43
emakeev pushed a commit to emakeev/magma that referenced this pull request Aug 5, 2022
…agma#12351)

* ci: always pull docker image from remote

... to prevent out of sync tags

Signed-off-by: Fritz Lehnert <13189449+Neudrino@users.noreply.github.com>

* ci: update docker action to v3

Signed-off-by: Fritz Lehnert <13189449+Neudrino@users.noreply.github.com>

* ci: ensure the devcontainer latest tag is up to date locally before pulling

Signed-off-by: Fritz Lehnert <13189449+Neudrino@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel changes for the Bazelification effort component: ci All updates on CI (Jenkins/CircleCi/Github Action) size/S Denotes a PR that changes 10-29 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants