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
Dbld image caching #2858
Dbld image caching #2858
Conversation
Build SUCCESS |
This is a rebase issue, I will fix it up.
…On Thu, Aug 8, 2019, 09:50 furiel ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dbld/rules
<#2858 (comment)>:
> @@ -136,11 +136,6 @@ image: image-$(DEFAULT_IMAGE)
image-%:
cd $(DBLD_DIR)/images/ && $(DOCKER) build --network=host -t balabit/syslog-ng-$* -f $*.dockerfile .
-pull-images: $(foreach image,$(BUILDER_IMAGES), pull-image-$(image))
-pull-image: pull-image-$(DEFAULT_IMAGE)
These targets seemed useful. Is it necessary to remove them?
Maybe this is a rebase problem. For example, I miss setting
--build-arg=OS_PLATFORM in this patch, on the other hand this change is not
necessary.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2858>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFOK5VJ3MABKFLTGDC45RTQDPF55ANCNFSM4IJDIB5A>
.
|
Hello,
|
4779dac
to
a13fc25
Compare
I have fixed the rebase issue, and will continue with the remaining open comments next. |
Build FAILURE |
a13fc25
to
b2b3f68
Compare
Build SUCCESS |
b2b3f68
to
b0fe9ba
Compare
Build SUCCESS |
…n images Instead of having this to be an individual/different setting in each of the dockerfiles. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
This patch adds dockerhub hooks to create the same labels on dockerhub as in a local build. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
This target will check if a good-enough dbld image is available locally or not. It does this by: 1) checking if any image is available locally or not 2) if there's no image we do a docker pull 3) we validate if the one we pulled/was available matches our dbld files 4) if not, we trigger a local rebuild Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
b0fe9ba
to
78a050b
Compare
The point is to use this on jenkins slaves to conditionally rebuild the image, but only if needed. With those our This is what
With those you can be sure that a dbld image is available by the time the target finishes, and in ideal conditions this would only take less than a second. Ideal conditions in the order of "ideality":
So worst case is that we pull AND rebuild. This could be improved by first checking that the version on dockerhub is suitable before doing the pull, but I haven't implemented that. |
Build SUCCESS |
On Thu, Aug 22, 2019, 11:27 László Szemere ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dbld/rules
<#2858 (comment)>:
> @@ -134,12 +134,19 @@ shell-%: setup
images: $(foreach image,$(IMAGES), image-$(image))
image: image-$(DEFAULT_IMAGE)
image-%:
- cd $(DBLD_DIR)/images/ && $(DOCKER) build --network=host -t balabit/syslog-ng-$* -f $*.dockerfile .
+ cd $(DBLD_DIR)/images/ && $(DOCKER) build --build-arg=OS_PLATFORM=$* --build-arg=COMMIT=$$(git rev-parse --short HEAD) --network=host -t balabit/syslog-ng-$* -f $*.dockerfile .
+
+check-image-%:
+ @image_commit=$$(docker inspect --format '{{ index .Config.Labels "COMMIT"}}' balabit/syslog-ng-$*); \
+ dbld_changed=$$(git diff $${image_commit:-NO_COMMIT_LABEL_IN_DBLD_IMAGE} -- dbld | wc -l); \
First things first. I do not have a proposal yet, and I don't know a
better solution. Sorry for that.
My concerns/how do I see it:
With image caching we introduced the plain old caching problem. We don't
know what time we should refresh the cache.
- Currently we do not follow / mark the versions of the upstream
dependencies.
- Using COMMIT instead of DBLD_COMMIT "just" increase the refreshing
frequency, but still don't make any logical connection with the content of
the image. (i.e.: a simple date check will do the same)
Totally agree with Bazsi's 1. point.
I think there's a lot of temporal state encapsulated in an image. Which
means that one dbld revision is not the same as another one depending on
the time the image was generated (because apt/pip/obs/etc changes)
Only my conclusion differs. In theory: Two docker image should be
identical if DBLD_COMMIT hasn't change, regardless of the master commit.
And neither one of them is suitable to track the "temporal state" changes.
Our current set of requirements don't need precise tracking of
dependencies, as our build products don't include those (well except the
docker image that is). As our users install the deb/rpm on their systems,
their specific dependencies may be different from what we built syslog-ng
with.
And this is not a problem as long as those dependencies keep binary
compatibility, which they do in a specific distro version.
So again, with dbld and with the packages it generates, we don't really
care the exact dependency version as long as the runtime package of those
dependencies are available and they keep binary compatibility.
This may become different with production docker images and with installers
that bundle dependencies. But I argue they should use a different logic for
building and those are in an entirely different layer on top of what the
syslog-ng OSE source tarball provides.
—
… You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2858>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFOK5SAUMNEXGMDYT3K2V3QFZLWTANCNFSM4IJDIB5A>
.
|
I think I have answered all open concerns, so this should be ready to go in. I have two branches building on top of this one, so it'd be great if we could expedite this. thanks. |
Any updates on when this could go in? I have works in progress in other branches but dont want to submit them until the dbld blockage clears up. |
Thank you!
…On Wed, Sep 18, 2019, 13:14 László Várady ***@***.***> wrote:
Merged #2858 <#2858> into master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2858>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFOK5XSJAWM5MKI46FGI53QKIETFANCNFSM4IJDIB5A>
.
|
This branch annotates dbld images with the commit ID they were built with and do this both
for locally generated images (e.g. ./dbld/rules image-) and dockerhub generated ones.
It also adds a check-image- target that rebuilds the image conditionally, e.g. in case the dbld subdirectory has changed since the local copy. This can be used to significantly improve
CI performance if the previous image is still locally available.