-
Notifications
You must be signed in to change notification settings - Fork 26
Skip builder image build when it is unmodified #1284
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
Conversation
Skipping CI for Draft Pull Request. |
|
22b1969
to
0213d8b
Compare
COLLECTOR_BUILDER_TAG="${DEFAULT_BUILDER_TAG}" | ||
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then | ||
COLLECTOR_BUILDER_TAG="${{ inputs.collector-tag }}" | ||
fi | ||
|
||
echo "COLLECTOR_BUILDER_TAG=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_ENV" | ||
echo "collector-builder-tag=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the builder does not need to be rebuilt, how is the collector-build-tag
going to be provided to the collector build ?
Maybe it is empty and then takes the default from Makefile-constants.mk ?
If this is true, maybe it would make sense to not set its value for the "default" case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll test it, but when skipping I think the output turns into an empty string and our makefiles turn an empty COLLECTOR_BUILDER_TAG
env variable to the default (cache
):
collector/Makefile-constants.mk
Lines 2 to 4 in d6cd0ff
ifeq ($(COLLECTOR_BUILDER_TAG),) | |
COLLECTOR_BUILDER_TAG=cache | |
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, in the latest CI run, that is what happened:
https://github.com/stackrox/collector/actions/runs/5856587306/job/15876735578?pr=1284
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that skipping setting of the value when we are in the default case would be coherent (have the default value's "value" in one place). But, hey, it works !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to save so much time and resources !
Apart from the nitpick comment for the default value of the builder tag, this look's good to me 👍
Description
Skip the builder image build when no changes would make modifications to the actual image (i.e.: no change to third_party libraries and the builder directory itself).
Checklist
Testing Performed
build-builder-image
should force build the builder.third_party
orbuilder
directories should build the builder. (CI run)third_party
orbuilder
directories should skip building the builder. (CI run)