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

Dbld image caching #2858

Merged
merged 4 commits into from Sep 18, 2019
Merged

Dbld image caching #2858

merged 4 commits into from Sep 18, 2019

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Aug 3, 2019

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.

@bazsi bazsi mentioned this pull request Aug 3, 2019
@kira-syslogng
Copy link
Contributor

Build SUCCESS

dbld/rules Outdated Show resolved Hide resolved
dbld/rules Show resolved Hide resolved
@bazsi
Copy link
Collaborator Author

bazsi commented Aug 8, 2019 via email

@szemere
Copy link
Collaborator

szemere commented Aug 12, 2019

Hello,

  1. I have found the missing --build-arg in: 20e13cfcaf8c376cb261869f576f56941ba02958
  2. Could you please provide some example of how to use this new target? (I get various errors - most probably because none of my images are labelled.)

@bazsi
Copy link
Collaborator Author

bazsi commented Aug 13, 2019

I have fixed the rebase issue, and will continue with the remaining open comments next.

@kira-syslogng
Copy link
Contributor

Build FAILURE

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@kira-syslogng
Copy link
Contributor

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>
@bazsi
Copy link
Collaborator Author

bazsi commented Aug 22, 2019

2. Could you please provide some example of how to use this new target? (I get various errors - most probably because none of my images are labelled.)

The point is to use this on jenkins slaves to conditionally rebuild the image, but only if needed. With those our distro packages build should be much faster.

This is what ./dbld/rules cache-image-ubuntu-xenial would do:

  1. check if we have any build image for ubuntu-xenial locally
  2. if there's nothing, it would perform a docker pull from dockerhub
  3. check if the local version is "suitable" for building the current source tree (the "suitability" question is what we've discussed in the previous comments).
  4. if it is suitable, do nothing, if it's not rebuild it.

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":

  1. local image exists and is suitable (e.g. no dbld changes)
  2. docker pull gets us a good enough version, thus no need to rebuild
  3. we originally had a local image, but it is not suitable, so we need to rebuild
  4. we didn't have an image, so we pulled one, but is not suitable and we also need to rebuild

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.

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@bazsi
Copy link
Collaborator Author

bazsi commented Aug 22, 2019 via email

@bazsi
Copy link
Collaborator Author

bazsi commented Aug 29, 2019

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.

@bazsi
Copy link
Collaborator Author

bazsi commented Sep 16, 2019

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.

@MrAnno MrAnno self-requested a review September 16, 2019 13:22
@MrAnno MrAnno merged commit b96dd21 into syslog-ng:master Sep 18, 2019
@bazsi
Copy link
Collaborator Author

bazsi commented Sep 18, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants