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

Use digest instead of tag so VM uses right image. #3206

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

jdangerx
Copy link
Member

@jdangerx jdangerx commented Jan 3, 2024

Overview

Follow-up to #3195 ; Related to #3140 .

We were getting inconsistent behavior pulling the latest image for a certain tag off of Dockerhub - often we would get an out-of-date image running on the VM.

While investigating Google Batch, I found that this was due to Dockerhub not updating its tag references quickly enough. However, we can just refer to the actual image digest we just built, which is unambiguously the correct image.

Given how small this change is, I decided to pull this logic over to the non-Batch world as well, so we don't have to wait for me to get all the Batch stuff working.

Testing

I short-circuited gcp_pudl_etl.sh and had it echo a short message to the logs.

Then:

  1. change the line
  2. push
  3. run build-deploy-pudl.yml
  4. observe that the output includes the changed line!

Then, I went back to how it works on main/dev now - using the branch name as the image tag, instead of the image digest. Repeating the flow above updated the changed line on the first iteration, but subsequent changes were not picked up.

So I'm convinced that this should alleviate our "VM doesn't pick up the latest image version" woes.

To-do list

@jdangerx jdangerx changed the base branch from main to dev January 3, 2024 21:36
@jdangerx jdangerx marked this pull request as ready for review January 3, 2024 22:04
Copy link
Member Author

@jdangerx jdangerx left a comment

Choose a reason for hiding this comment

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

When this gets merged we should probably merge it all the way down to main.

Copy link
Member

@bendnorman bendnorman left a comment

Choose a reason for hiding this comment

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

Great! Using the digest seems like a better way to ensure we're pulling the correct image.

Seems weird that there is a delay between the image getting uploaded and the digest updating. I'm assuming there are plenty of systems that pull images as soon as they are uploaded.

@zaneselvans zaneselvans added the nightly-builds Anything having to do with nightly builds or continuous deployment. label Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2f67c05) 92.6% compared to head (46594a7) 92.6%.
Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##             dev   #3206     +/-   ##
=======================================
- Coverage   92.6%   92.6%   -0.0%     
=======================================
  Files        140     140             
  Lines      12841   12841             
=======================================
- Hits       11894   11892      -2     
- Misses       947     949      +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zaneselvans
Copy link
Member

I think @jdangerx has gone AFK for the night and it would be great to get this integrated with the other nightly build stuff that was merged today so I'm going to push the button.

@zaneselvans zaneselvans merged commit 618c20c into dev Jan 4, 2024
30 of 31 checks passed
@zaneselvans zaneselvans deleted the use-docker-image-digest branch January 4, 2024 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nightly-builds Anything having to do with nightly builds or continuous deployment.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants