fix: make BUILD_BRANCH as a dynamic argument for the Dockerfile inste… #4716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Previously, when we run
main_hotfix
CI build to create an image.One of our users noticed that image still has previous version inside.
After quick investigation, I found the root cause:
harmony/scripts/docker/Dockerfile
Lines 21 to 24 in b3aebb6
We have hard-coded
main
branch inside the Dockerfile.What I've done to fix this:
BUILD_BRANCH
with defaultmain
github.ref_name
from Github actions default-environment-variables list which will give the short ref name of the branch or tag that triggered the workflow run and propagated as BUILD_BRANCH to the docker file.Details below:
Test
I've tested locally the default and custom build argument propagation:
Default:
End to end testing on my fork
Idea was to remove everything in CI around the changed github action and test the integration of
ARG BUILD_BRANCH
andgithub.ref_name
- and value was passed though to the docker itself == test passed ✔️ :https://github.com/mur-me/harmony/actions/runs/10092656255/job/27906739083#step:5:458
Unit Test Coverage
Test/Run Logs
Operational Checklist
Does this PR introduce backward-incompatible changes to the on-disk data structure and/or the over-the-wire protocol?. (If no, skip to question 8.)
YES|NO
Describe the migration plan.. For each flag epoch, describe what changes take place at the flag epoch, the anticipated interactions between upgraded/non-upgraded nodes, and any special operational considerations for the migration.
Describe how the plan was tested.
How much minimum baking period after the last flag epoch should we allow on Pangaea before promotion onto mainnet?
What are the planned flag epoch numbers and their ETAs on Pangaea?
What are the planned flag epoch numbers and their ETAs on mainnet?
Note that this must be enough to cover baking period on Pangaea.
What should node operators know about this planned change?
Does this PR introduce backward-incompatible changes NOT related to on-disk data structure and/or over-the-wire protocol? (If no, continue to question 11.)
YES|NO
Does the existing
node.sh
continue to work with this change?What should node operators know about this change?
Does this PR introduce significant changes to the operational requirements of the node software, such as >20% increase in CPU, memory, and/or disk usage?
TODO