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

Bmoric/remove docker compose for build #7500

Merged
merged 47 commits into from
Nov 5, 2021

Conversation

benmoriceau
Copy link
Contributor

@benmoriceau benmoriceau commented Oct 29, 2021

What

This making the build using a gradle plugin instead of using docker-compose build.
It aims to make the build to be more incremental as described in #7306

  • Building the docker image don't rely on docker-compose anymore.
  • The docker build step is isolated into a dedicated folder (in order to make sure that gradle plugin don't recompute the build of the docker container)
  • Gradle is responsible for copying the files that docker needs to build its image.
  • That removes the need of having a dockerignore file.

This might not be effective until #7539 is solved.

@benmoriceau benmoriceau added area/developer Everything related to build, developer UX build type/enhancement New feature or request labels Oct 29, 2021
@benmoriceau benmoriceau marked this pull request as draft October 29, 2021 21:34
@benmoriceau
Copy link
Contributor Author

I am not sure that it will be an improvment probably because of

Execution optimizations have been disabled for task ':airbyte-workers:jar' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/benoitmoriceau/workspace/airbyte/airbyte-workers/build/libs/io.airbyte-airbyte-workers-0.30.23-alpha.jar'. Reason: Task ':airbyte-workers:buildMyAppImage' uses this output of task ':airbyte-workers:jar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

I move back the review to a draft until I fix this issue.

@benmoriceau benmoriceau temporarily deployed to more-secrets October 29, 2021 22:08 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets October 29, 2021 22:31 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 1, 2021 17:11 Inactive
def buildTag = System.getenv('VERSION') ?: 'dev'
// Use task types
task buildMyAppImage(type: DockerBuildImage) {
dependsOn processResources
Copy link
Contributor

Choose a reason for hiding this comment

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

why does building the image depend on processTestResources, compileTestJava, test, jacocoTestReport? why wouldn't it just depend on what is required to create the artifacts. like, I'm wondering if it could just depend on assemble.

Copy link
Contributor

Choose a reason for hiding this comment

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

i'm asking this based on my understanding of the task dependency structure of the gradle java plugin: https://docs.gradle.org/current/userguide/java_plugin.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plugin I am using has some implicit dependencies that will make the execution optimization to be ignore if the dependencies are not explicitly written. Like:

  - Gradle detected a problem with the following location: '/Users/benoitmoriceau/workspace/airbyte/airbyte-db/lib/build/reports/jacoco/test/html'. Reason: Task ':airbyte-db:lib:buildMyAppImage' uses this output of task ':airbyte-db:lib:jacocoTestReport' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

I will try to only depend on build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cgardens I tried to make it to depends only on jar and some optimization have gone away with because of that:

Execution optimizations have been disabled for task ':airbyte-scheduler:app:startScripts' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/benoitmoriceau/workspace/airbyte/airbyte-scheduler/app/build/scripts'. Reason: Task ':airbyte-scheduler:app:buildMyAppImage' uses this output of task ':airbyte-scheduler:app:startScripts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

@benmoriceau benmoriceau temporarily deployed to more-secrets November 1, 2021 20:58 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 1, 2021 21:00 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 3, 2021 23:07 Inactive
@benmoriceau
Copy link
Contributor Author

I re-request a review since there were quite a lot of changes since the latest approval.

@benmoriceau benmoriceau temporarily deployed to more-secrets November 3, 2021 23:28 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 3, 2021 23:49 Inactive
Copy link
Contributor

@jrhizor jrhizor left a comment

Choose a reason for hiding this comment

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

Looks good. Only minor comments and the build errors need to be resolved ofc.


## Version

This doc is relevant starting from the version 0.30.28-alpha. Prior to that, it was another design.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove this section since nobody cares about the prior design.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, That's surprising I would have expect something like Since in the javadoc,

@@ -0,0 +1,46 @@
# Developing on docker
Copy link
Contributor

Choose a reason for hiding this comment

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

This doc needs to be added to SUMMARY.md so it actually shows up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


## Incrementality

The docker build is fully incremental, which means that it will only build an image if it is needed. We need to keep it that way.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's worth clarifying that this is for the platform build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done,

@benmoriceau benmoriceau temporarily deployed to more-secrets November 4, 2021 00:15 Inactive
@benmoriceau
Copy link
Contributor Author

Looks good. Only minor comments and the build errors need to be resolved ofc.

@jrhizor, the comments are addressed, the failing test for the build is failing in the action but not on my local.

@benmoriceau benmoriceau temporarily deployed to more-secrets November 4, 2021 17:07 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 4, 2021 20:57 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 5, 2021 15:31 Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets November 5, 2021 18:27 Inactive
@benmoriceau benmoriceau merged commit 4e17fa2 into master Nov 5, 2021
@benmoriceau benmoriceau deleted the bmoric/remove-docker-compose-for-build branch November 5, 2021 18:58
@h7kanna h7kanna mentioned this pull request Nov 5, 2021
benmoriceau added a commit that referenced this pull request Nov 6, 2021
benmoriceau added a commit that referenced this pull request Nov 6, 2021
benmoriceau added a commit that referenced this pull request Nov 8, 2021
benmoriceau added a commit that referenced this pull request Nov 8, 2021
…" (#7746)

This reverts commit 797d11a.

Restore the removal of the docker compose file
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
This making the build using a gradle plugin instead of using docker-compose build.
It aims to make the build to be more incremental as described in airbytehq#7306

Building the docker image don't rely on docker-compose anymore.
The docker build step is isolated into a dedicated folder (in order to make sure that gradle plugin don't recompute the build of the docker container)
Gradle is responsible for copying the files that docker needs to build its image.
That removes the need of having a dockerignore file.
This might not be effective until airbytehq#7539 is solved.
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
…" (airbytehq#7698)" (airbytehq#7746)

This reverts commit 797d11a.

Restore the removal of the docker compose file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/developer Everything related to build, developer UX area/documentation Improvements or additions to documentation area/platform issues related to the platform area/scheduler area/server area/worker Related to worker build type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants