-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Changes from 7 commits
0f06d95
e85f1a9
dbbb298
9b00dc5
0f049e7
8957cd7
e3dd246
8f83ea8
5ab190c
7d32b90
d693c5c
8084031
e63c0f2
1b6bc9b
3b9efe9
5b3f566
dee7b07
2976178
cb538db
fecb366
71e79da
24a7cf8
c9251d9
d12c485
07d67f6
b8bbbab
23ed511
3acd34e
d279ca2
b32056c
d53150c
0c47eb7
014a29a
cba2bce
fa899f9
43bb8b0
a52643f
b0ae593
8a3b1fc
317ae87
86b22b2
d64750a
d42857a
24fd33c
2bf9b18
0a378cc
1d3d22f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
* | ||
!src | ||
!scripts | ||
!build | ||
!Dockerfile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage | ||
|
||
plugins { | ||
id 'java' | ||
id 'com.bmuschko.docker-remote-api' | ||
} | ||
|
||
dependencies { | ||
implementation 'commons-cli:commons-cli:1.4' | ||
|
||
implementation project(':airbyte-config:models') | ||
} | ||
|
||
def buildTag = System.getenv('VERSION') ?: 'dev' | ||
// Use task types | ||
task buildMyAppImage(type: DockerBuildImage) { | ||
dependsOn compileTestJava | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the test-related tasks still necessary to include when using the |
||
dependsOn jar | ||
dependsOn processTestResources | ||
inputDir = file('.') | ||
images.add("airbyte/init:$buildTag") | ||
} | ||
build.dependsOn(buildMyAppImage) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
* | ||
!src | ||
!Dockerfile | ||
!build |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,8 @@ | ||||||
import com.bmuschko.gradle.docker.tasks.image.* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
|
||||||
plugins { | ||||||
id 'java-library' | ||||||
id 'com.bmuschko.docker-remote-api' | ||||||
} | ||||||
|
||||||
dependencies { | ||||||
|
@@ -69,3 +72,14 @@ task(dumpJobsSchema, dependsOn: 'classes', type: JavaExec) { | |||||
classpath = sourceSets.main.runtimeClasspath | ||||||
args 'jobs', 'dump_schema' | ||||||
} | ||||||
|
||||||
def buildTag = System.getenv('VERSION') ?: 'dev' | ||||||
// Use task types | ||||||
task buildMyAppImage(type: DockerBuildImage) { | ||||||
dependsOn compileTestJava | ||||||
dependsOn jar | ||||||
dependsOn processTestResources | ||||||
inputDir = file('.') | ||||||
images.add("airbyte/db:$buildTag") | ||||||
} | ||||||
build.dependsOn(buildMyAppImage) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* | ||
!src | ||
!Dockerfile | ||
!build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* | ||
!src | ||
!Dockerfile | ||
!build |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,8 @@ | ||||||
import com.bmuschko.gradle.docker.tasks.image.* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||
|
||||||
plugins { | ||||||
id 'application' | ||||||
id 'com.bmuschko.docker-remote-api' | ||||||
} | ||||||
|
||||||
dependencies { | ||||||
|
@@ -57,3 +60,23 @@ run { | |||||
environment "TEMPORAL_HOST", "localhost:7233" | ||||||
|
||||||
} | ||||||
|
||||||
def buildTag = System.getenv('VERSION') ?: 'dev' | ||||||
// Use task types | ||||||
task buildMyAppImage(type: DockerBuildImage) { | ||||||
dependsOn processResources | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why does building the image depend on There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
I will try to only depend on build. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
|
||||||
dependsOn processTestResources | ||||||
dependsOn compileJava | ||||||
dependsOn compileTestJava | ||||||
dependsOn test | ||||||
dependsOn jar | ||||||
dependsOn startScripts | ||||||
dependsOn distTar | ||||||
dependsOn distZip | ||||||
dependsOn jacocoTestReport | ||||||
inputDir = file('.') | ||||||
images.add("airbyte/scheduler:$buildTag") | ||||||
noCache = false | ||||||
quiet = false | ||||||
} | ||||||
assemble.dependsOn(buildMyAppImage) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* | ||
!src | ||
!Dockerfile | ||
!build |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,10 @@ | ||||||
import com.bmuschko.gradle.docker.tasks.image.* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
|
||||||
plugins { | ||||||
id 'application' | ||||||
id 'maven-publish' | ||||||
id 'com.github.johnrengelman.shadow' version '7.1.0' | ||||||
id 'com.bmuschko.docker-remote-api' | ||||||
} | ||||||
|
||||||
shadowJar { | ||||||
|
@@ -126,3 +129,31 @@ run { | |||||
environment "AIRBYTE_ROLE", System.getenv('AIRBYTE_ROLE') | ||||||
environment "TEMPORAL_HOST", "localhost:7233" | ||||||
} | ||||||
|
||||||
def buildTag = System.getenv('VERSION') ?: 'dev' | ||||||
// Use task types | ||||||
task buildMyAppImage(type: DockerBuildImage) { | ||||||
dependsOn copySeed | ||||||
dependsOn processResources | ||||||
dependsOn processTestResources | ||||||
dependsOn jar | ||||||
dependsOn shadowJar | ||||||
dependsOn compileTestJava | ||||||
dependsOn distTar | ||||||
dependsOn distZip | ||||||
dependsOn shadowDistTar | ||||||
dependsOn shadowDistZip | ||||||
dependsOn startScripts | ||||||
dependsOn startShadowScripts | ||||||
dependsOn test | ||||||
dependsOn jacocoTestReport | ||||||
inputDir = file('.') | ||||||
images.add("airbyte/server:$buildTag") | ||||||
} | ||||||
build.dependsOn(buildMyAppImage) | ||||||
startScripts.dependsOn(shadowJar) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These will all be cleaned up in the followup "make server build incemental" I hope? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope too, I will remove them since that should be part of the other issue. |
||||||
distTar.dependsOn(shadowJar) | ||||||
distZip.dependsOn(shadowJar) | ||||||
startShadowScripts.dependsOn(jar) | ||||||
shadowDistTar.dependsOn(jar) | ||||||
shadowDistZip.dependsOn(jar) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,9 @@ | ||||||
import com.bmuschko.gradle.docker.tasks.image.* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||
|
||||||
plugins { | ||||||
id "base" | ||||||
id "com.github.node-gradle.node" version "3.1.1" | ||||||
id 'com.bmuschko.docker-remote-api' | ||||||
} | ||||||
|
||||||
def nodeVersion = System.getenv('NODE_VERSION') ?: '14.11.0' | ||||||
|
@@ -40,3 +43,14 @@ task copyDocs(type: Copy) { | |||||
|
||||||
copyDocs.dependsOn npm_run_build | ||||||
assemble.dependsOn copyDocs | ||||||
|
||||||
// Use task types | ||||||
task buildMyAppImage(type: DockerBuildImage) { | ||||||
dependsOn copyDocs | ||||||
dependsOn nodeSetup | ||||||
dependsOn npmInstall | ||||||
dependsOn npm_run_build | ||||||
inputDir = file('.') | ||||||
images.add("airbyte/webapp:$version") | ||||||
} | ||||||
build.dependsOn(buildMyAppImage) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* | ||
!src | ||
!Dockerfile | ||
!build |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,9 +1,11 @@ | ||||||
import org.jsonschema2pojo.SourceType | ||||||
import com.bmuschko.gradle.docker.tasks.image.* | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
|
||||||
plugins { | ||||||
id 'application' | ||||||
id 'com.github.eirnym.js2p' version '1.0' | ||||||
id 'airbyte-integration-test-java' | ||||||
id 'com.bmuschko.docker-remote-api' | ||||||
} | ||||||
|
||||||
configurations { | ||||||
|
@@ -62,3 +64,20 @@ application { | |||||
mainClass = mainClassName | ||||||
applicationDefaultJvmArgs = ['-XX:MaxRAMPercentage=75.0'] | ||||||
} | ||||||
|
||||||
def buildTag = System.getenv('VERSION') ?: 'dev' | ||||||
// Use task types | ||||||
task buildMyAppImage(type: DockerBuildImage) { | ||||||
dependsOn compileTestJava | ||||||
dependsOn distTar | ||||||
dependsOn distZip | ||||||
dependsOn jar | ||||||
dependsOn processTestResources | ||||||
dependsOn startScripts | ||||||
dependsOn compileIntegrationTestJavaJava | ||||||
dependsOn test | ||||||
dependsOn jacocoTestReport | ||||||
inputDir = file('.') | ||||||
images.add("airbyte/worker:$buildTag") | ||||||
} | ||||||
assemble.dependsOn(buildMyAppImage) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
buildscript { | ||
repositories { | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath 'com.bmuschko:gradle-docker-plugin:7.1.0' | ||
} | ||
} | ||
|
||
plugins { | ||
id 'base' | ||
id 'pmd' | ||
|
@@ -58,22 +69,22 @@ def createJavaLicenseWith = { license -> | |
// monorepo setup and it doesn't actually exclude directories reliably. This code makes the behavior predictable. | ||
def createSpotlessTarget = { pattern -> | ||
def excludes = [ | ||
'.gradle', | ||
'node_modules', | ||
'.eggs', | ||
'.mypy_cache', | ||
'.venv', | ||
'*.egg-info', | ||
'build', | ||
'dbt-project-template', | ||
'dbt-project-template-mssql', | ||
'dbt-project-template-mysql', | ||
'dbt-project-template-oracle', | ||
'dbt_test_config', | ||
'normalization_test_output', | ||
'tools', | ||
'secrets', | ||
'charts' // Helm charts often have injected template strings that will fail general linting. Helm linting is done separately. | ||
'.gradle', | ||
'node_modules', | ||
'.eggs', | ||
'.mypy_cache', | ||
'.venv', | ||
'*.egg-info', | ||
'build', | ||
'dbt-project-template', | ||
'dbt-project-template-mssql', | ||
'dbt-project-template-mysql', | ||
'dbt-project-template-oracle', | ||
'dbt_test_config', | ||
'normalization_test_output', | ||
'tools', | ||
'secrets', | ||
'charts' // Helm charts often have injected template strings that will fail general linting. Helm linting is done separately. | ||
] | ||
|
||
if (System.getenv().containsKey("SUB_BUILD")) { | ||
|
@@ -125,9 +136,9 @@ allprojects { | |
":airbyte-webapp", | ||
].toSet().asImmutable() | ||
|
||
if (project.getPath() in composeDeps) { | ||
/*if (project.getPath() in composeDeps) { | ||
composeBuild.dependsOn(project.getPath() + ':assemble') | ||
} | ||
}*/ | ||
} | ||
} | ||
|
||
|
@@ -233,6 +244,7 @@ subprojects { | |
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.2' | ||
testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4' | ||
testImplementation 'org.assertj:assertj-core:3.21.0' | ||
|
||
} | ||
|
||
tasks.withType(Tar) { | ||
|
@@ -244,28 +256,6 @@ subprojects { | |
} | ||
} | ||
|
||
task composeBuild { | ||
def buildTag = System.getenv('VERSION') ?: 'dev' | ||
def buildPlatform = System.getenv('DOCKER_BUILD_PLATFORM') ?: 'linux/amd64' | ||
def buildArch = System.getenv('DOCKER_BUILD_ARCH') ?: 'amd64' | ||
def jdkVersion = System.getenv('JDK_VERSION') ?: '14.0.2' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should try not to remove the functionality we have here. Currently, someone following the instructions on https://docs.airbyte.io/contributing-to-airbyte/developing-locally#build-with-gradle to build for M1 won't be able to since these env vars aren't captured and don't make it to the docker build steps. |
||
def dockerComposeFile = buildArch == 'arm64' ? 'docker-compose.build-m1.yaml' : 'docker-compose.build.yaml' | ||
doFirst { | ||
exec { | ||
workingDir rootDir | ||
commandLine 'docker-compose', '-f', dockerComposeFile, 'build', '--parallel', '--quiet' | ||
environment 'VERSION', buildTag | ||
environment 'DOCKER_BUILD_PLATFORM', buildPlatform | ||
environment 'DOCKER_BUILD_ARCH', buildArch | ||
environment 'JDK_VERSION', jdkVersion | ||
} | ||
} | ||
} | ||
|
||
if (!System.getenv().containsKey("SUB_BUILD") || System.getenv().get("SUB_BUILD") == "PLATFORM") { | ||
build.dependsOn(composeBuild) | ||
} | ||
|
||
task('generate') { | ||
dependsOn subprojects.collect { it.getTasksByName('generateProtocolClassFiles', true) } | ||
dependsOn subprojects.collect { it.getTasksByName('generateJsonSchema2Pojo', true) } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget to update this file before moving it to ready to be review.