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

Make docker build task incremental #49613

Merged
merged 2 commits into from
Nov 27, 2019
Merged

Make docker build task incremental #49613

merged 2 commits into from
Nov 27, 2019

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Nov 27, 2019

This commits sets an output marker file for the docker build tasks so
that it can be tracked as up to date. It also fixes the docker build
context task to omit the build date as in input property which always
left the task as out of date.

Closes #49359

This commits sets an output marker file for the docker build tasks so
that it can be tracked as up to date. It also fixes the docker build
context task to omit the build date as in input property which always
left the task as out of date.

relates elastic#49359
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

+1000, I love this PR!

One suggestion - can we also set the export tasks outputs? E.g.

diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle
index 975c32860e1..da940f17b0f 100644
--- a/distribution/docker/build.gradle
+++ b/distribution/docker/build.gradle
@@ -214,6 +214,7 @@ subprojects { Project subProject ->

     final Task exportDockerImageTask = task(exportTaskName, type: LoggedExec) {
       executable 'docker'
+      outputs.file(tarFile)
       args "save",
         "-o",
         tarFile,

@rjernst rjernst merged commit ffaf836 into elastic:master Nov 27, 2019
@rjernst rjernst deleted the docker2 branch November 27, 2019 19:19
rjernst added a commit that referenced this pull request Nov 28, 2019
This commits sets an output marker file for the docker build tasks so
that it can be tracked as up to date. It also fixes the docker build
context task to omit the build date as in input property which always
left the task as out of date.

relates #49359
@mark-vieira
Copy link
Contributor

This change does indeed make the build tasks UP-TO-DATE when they've been built, but we aren't tracking any inputs here. For example, after I run assemble, if I change the Dockerfile, things are still UP-TO-DATE, which is clearly incorrect. We should be tracking the Dockerfile, as well as anything else we include in the image as inputs to this task otherwise folks are liable to get unreliable behavior.

rjernst added a commit to rjernst/elasticsearch that referenced this pull request Dec 4, 2019
The docker build task depends on the docker context being built, but it
was not explicitly setup as an input. This commit adds the task as an
input to the docker build.

relates elastic#49613
rjernst added a commit that referenced this pull request Dec 4, 2019
The docker build task depends on the docker context being built, but it
was not explicitly setup as an input. This commit adds the task as an
input to the docker build.

relates #49613
rjernst added a commit that referenced this pull request Dec 4, 2019
The docker build task depends on the docker context being built, but it
was not explicitly setup as an input. This commit adds the task as an
input to the docker build.

relates #49613
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
The docker build task depends on the docker context being built, but it
was not explicitly setup as an input. This commit adds the task as an
input to the docker build.

relates elastic#49613
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team v7.6.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildDockerImageTask runs in every invocation of :distribution:docker:integTest
5 participants