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

mostly incremental builds #817

Merged
merged 50 commits into from
Nov 9, 2020
Merged

mostly incremental builds #817

merged 50 commits into from
Nov 9, 2020

Conversation

jrhizor
Copy link
Contributor

@jrhizor jrhizor commented Nov 4, 2020

This introduces more cachability and uses plugins to configure all of our behavior.

More is cacheable than before. This also uses buildkit for docker builds which should be faster. Incremental isn't fully working for Python since I didn't figure out how to get the internal pipInstall to be cacheable.

Recommended order:

  • buildSrc/*
  • everything else

@jrhizor jrhizor changed the title WIP incremental builds mostly incremental builds Nov 6, 2020
@jrhizor jrhizor marked this pull request as ready for review November 6, 2020 19:01
@@ -1,26 +1,2 @@
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry about these, need to rerun formatting.

@@ -0,0 +1,11 @@
plugins {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

def result = [] as Set<String>

dockerfile.eachLine { line ->
if (line.startsWith("FROM ")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the worse that can happen if the parsing doesn't work? This piece seems a bit brittle (not saying we should change it but we need to understand the limits and how it can fail, and fail loudly if it is outside of the limit)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there's a way it's depending on a separate image that isn't caught by COPY --from or FROM, that's the worst case, because it won't be caught at all.

If it does use COPY --from or FROM but uses some unexpected syntax, it'd end up adding the wrong string or an empty string which should almost always result in an inability to find a current image hash, which would always require image rebuilding (slow but not too terrible of an outcome).

I can at least change this to assert the the image is not empty.

exceptionFormat "full"
}

if(project.hasProperty("airbyteDocker")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this dependOn belong in the airbyte-docker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. I actually just did something like this for the source test too, since airbyte-docker should be applied first, before airbyte-integration-test-java exists.

@michel-tricot
Copy link
Contributor

AMAZING PR!

rootDir = project.rootProject.rootDir
projectDir = project.projectDir
projectFiles = filteredProjectFiles
idFileOutput = project.file(Paths.get(project.rootProject.rootDir.absolutePath, '.dockerversions', hash).toString())
Copy link
Contributor

Choose a reason for hiding this comment

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

i think i'd prefer not to remove it on a clean since there is already a diff computation mechanism, so this LGTM

@jrhizor jrhizor merged commit e1d7add into master Nov 9, 2020
@jrhizor jrhizor deleted the jrhizor/cached-builds branch November 9, 2020 19:00
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.

3 participants