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
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0f06d95
Remove the use of docker compose to build
benmoriceau Oct 29, 2021
e85f1a9
Update .dockerignore
benmoriceau Oct 29, 2021
dbbb298
Add explicit dependencies
benmoriceau Oct 29, 2021
9b00dc5
Allign .dockerfileingnore, rm implicit dependencies
benmoriceau Oct 29, 2021
0f049e7
improve scheduler gradle
benmoriceau Nov 1, 2021
8957cd7
Clean up migration gradle file
benmoriceau Nov 1, 2021
e3dd246
Clean up server gradle
benmoriceau Nov 1, 2021
8f83ea8
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 1, 2021
5ab190c
tmp
benmoriceau Nov 1, 2021
7d32b90
Look at diff
benmoriceau Nov 1, 2021
d693c5c
rm unwanted files
benmoriceau Nov 1, 2021
8084031
Make sure that we don't commit file that will be copied to the docker…
benmoriceau Nov 1, 2021
e63c0f2
Make the scheduler docker build to be increamental
benmoriceau Nov 1, 2021
1b6bc9b
Make the worker docker build to be incremental
benmoriceau Nov 1, 2021
3b9efe9
make a the server docker build to be incremental
benmoriceau Nov 1, 2021
5b3f566
Make the airbyte-migration to be incremental
benmoriceau Nov 1, 2021
dee7b07
Make the webapp docker build incremental
benmoriceau Nov 1, 2021
2976178
Make the config init docker build to be incremental
benmoriceau Nov 1, 2021
cb538db
Remove the dockerignorfile
benmoriceau Nov 1, 2021
fecb366
remove unused gradle block
benmoriceau Nov 1, 2021
71e79da
Make the airbyte cli docker build incremental
benmoriceau Nov 1, 2021
24a7cf8
Rm the use of composeBuild
benmoriceau Nov 1, 2021
c9251d9
Fix cli docker image name
benmoriceau Nov 2, 2021
d12c485
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 2, 2021
07d67f6
Fix migration build
benmoriceau Nov 2, 2021
b8bbbab
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 2, 2021
23ed511
Use the same version than prod
benmoriceau Nov 2, 2021
3acd34e
Add missing version update in the airbyte scheduler
benmoriceau Nov 2, 2021
d279ca2
Move all the docker build related files to the build folder
benmoriceau Nov 2, 2021
b32056c
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 2, 2021
d53150c
Remove outdated file updates
benmoriceau Nov 2, 2021
0c47eb7
Fix workers project
benmoriceau Nov 2, 2021
014a29a
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 2, 2021
cba2bce
update config docker build
benmoriceau Nov 2, 2021
fa899f9
Pr comments and factorization example
benmoriceau Nov 2, 2021
43bb8b0
Single definition of the incremental docker tasks
benmoriceau Nov 3, 2021
a52643f
Add documentation
benmoriceau Nov 3, 2021
b0ae593
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 3, 2021
8a3b1fc
test
benmoriceau Nov 3, 2021
317ae87
Make the factorize incremental to work
benmoriceau Nov 3, 2021
86b22b2
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 3, 2021
d64750a
Update docs and remove unused import
benmoriceau Nov 3, 2021
d42857a
Fix build and remove unused pluggins
benmoriceau Nov 3, 2021
24fd33c
Update doc based on PR comments
benmoriceau Nov 4, 2021
2bf9b18
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 4, 2021
0a378cc
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Nov 5, 2021
1d3d22f
format
benmoriceau Nov 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ serialize =

[bumpversion:file:.env]

[bumpversion:file:airbyte-migration/Dockerfile]

[bumpversion:file:airbyte-server/Dockerfile]

[bumpversion:file:airbyte-workers/Dockerfile]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ jobs:
EOF

- name: Build Platform Docker Images
run: SUB_BUILD=PLATFORM ./gradlew --no-daemon composebuild --scan
run: SUB_BUILD=PLATFORM ./gradlew --no-daemon assemble --scan
Copy link
Contributor

Choose a reason for hiding this comment

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

exciting

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto!


- name: Run End-to-End Frontend Tests
run: ./tools/bin/e2e_test.sh
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:
HOME: /home/runner

- name: Build Platform Docker Images
run: SUB_BUILD=PLATFORM ./gradlew composeBuild --scan
run: SUB_BUILD=PLATFORM ./gradlew assemble --scan

- name: Run Kubernetes End-to-End Acceptance Tests
env:
Expand Down
6 changes: 3 additions & 3 deletions airbyte-cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
plugins {
id "airbyte-docker"
}
Task dockerBuildTask = getDockerBuildTask("cli", "$project.projectDir")
dockerBuildTask.dependsOn(copyDocker)
assemble.dependsOn(dockerBuildTask)
3 changes: 0 additions & 3 deletions airbyte-config/init/.dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion airbyte-config/init/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ WORKDIR /app

# the sole purpose of this image is to seed the data volume with the default data
# that the app should have when it is first installed.
COPY scripts scripts
COPY bin/scripts scripts
11 changes: 11 additions & 0 deletions airbyte-config/init/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,14 @@ dependencies {

implementation project(':airbyte-config:models')
}

task copyScripts(type: Copy) {
dependsOn copyDocker

from('scripts')
into 'build/docker/bin/scripts'
}

Task dockerBuildTask = getDockerBuildTask("init", "$project.projectDir")
dockerBuildTask.dependsOn(copyScripts)
assemble.dependsOn(dockerBuildTask)
2 changes: 0 additions & 2 deletions airbyte-db/lib/.dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion airbyte-db/lib/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM postgres:13-alpine

COPY src/main/resources/init.sql /docker-entrypoint-initdb.d/000_init.sql
COPY bin/init.sql /docker-entrypoint-initdb.d/000_init.sql
13 changes: 13 additions & 0 deletions airbyte-db/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ task(dumpJobsSchema, dependsOn: 'classes', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
args 'jobs', 'dump_schema'
}

task copyInitSql(type: Copy) {
dependsOn copyDocker

from('src/main/resources') {
include 'init.sql'
}
into 'build/docker/bin'
}

Task dockerBuildTask = getDockerBuildTask("db", "$project.projectDir")
dockerBuildTask.dependsOn(copyInitSql)
assemble.dependsOn(dockerBuildTask)
3 changes: 0 additions & 3 deletions airbyte-migration/.dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion airbyte-migration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV APPLICATION airbyte-migration
WORKDIR /app

# Move and run scheduler
COPY build/distributions/${APPLICATION}*.tar ${APPLICATION}.tar
COPY bin/${APPLICATION}-0.30.28-alpha.tar ${APPLICATION}.tar

RUN tar xf ${APPLICATION}.tar --strip-components=1

Expand Down
13 changes: 13 additions & 0 deletions airbyte-migration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ application {
mainClass = 'io.airbyte.migrate.MigrationRunner'
}

task copyGeneratedTar(type: Copy) {
dependsOn distTar
dependsOn copyDocker

from('build/distributions') {
include 'airbyte-migration-*.tar'
}
into 'build/docker/bin'
}

Task dockerBuildTask = getDockerBuildTask("migration", "$project.projectDir")
dockerBuildTask.dependsOn(copyGeneratedTar)
assemble.dependsOn(dockerBuildTask)
3 changes: 0 additions & 3 deletions airbyte-scheduler/app/.dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion airbyte-scheduler/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV APPLICATION airbyte-scheduler

WORKDIR /app

ADD build/distributions/${APPLICATION}-0.30.28-alpha.tar /app
ADD bin/${APPLICATION}-0.30.28-alpha.tar /app

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.30.28-alpha/bin/${APPLICATION}"]
14 changes: 14 additions & 0 deletions airbyte-scheduler/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ run {
environment "TEMPORAL_HOST", "localhost:7233"

}

task copyGeneratedTar(type: Copy) {
dependsOn copyDocker
dependsOn distTar

from('build/distributions') {
include 'airbyte-scheduler-*.tar'
}
into 'build/docker/bin'
}

Task dockerBuildTask = getDockerBuildTask("scheduler", "$project.projectDir")
dockerBuildTask.dependsOn(copyGeneratedTar)
assemble.dependsOn(dockerBuildTask)
3 changes: 0 additions & 3 deletions airbyte-server/.dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion airbyte-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV APPLICATION airbyte-server

WORKDIR /app

ADD build/distributions/${APPLICATION}-0.30.28-alpha.tar /app
ADD bin/${APPLICATION}-0.30.28-alpha.tar /app

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.30.28-alpha/bin/${APPLICATION}"]
14 changes: 14 additions & 0 deletions airbyte-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,17 @@ run {
environment "AIRBYTE_ROLE", System.getenv('AIRBYTE_ROLE')
environment "TEMPORAL_HOST", "localhost:7233"
}

task copyGeneratedTar(type: Copy) {
dependsOn copyDocker
dependsOn distTar

from('build/distributions') {
include 'airbyte-server-*.tar'
}
into 'build/docker/bin'
}

Task dockerBuildTask = getDockerBuildTask("server", "$project.projectDir")
dockerBuildTask.dependsOn(copyGeneratedTar)
assemble.dependsOn(dockerBuildTask)
4 changes: 0 additions & 4 deletions airbyte-webapp/.dockerignore

This file was deleted.

8 changes: 3 additions & 5 deletions airbyte-webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM nginx:1.19-alpine as webapp

EXPOSE 80

COPY build/docs docs/
# docs get copied twice because npm gradle plugin ignores output dir.
COPY build /usr/share/nginx/html
RUN rm -rf /usr/share/nginx/html/docs
COPY nginx/default.conf.template /etc/nginx/templates/default.conf.template
COPY bin/docs docs/
COPY bin/build /usr/share/nginx/html
COPY bin/nginx/default.conf.template /etc/nginx/templates/default.conf.template
31 changes: 29 additions & 2 deletions airbyte-webapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,38 @@ task test(type: NpmTask) {
assemble.dependsOn npm_run_build
build.finalizedBy test

task copyBuild(type: Copy) {
dependsOn copyDocker

from "${project.projectDir}/build"
into "build/docker/bin/build"
exclude ".docker"
exclude "docker"
}

task copyDocs(type: Copy) {
from "${System.getProperty("user.dir")}/docs/integrations"
into "${buildDir}/docs/integrations"
dependsOn copyDocker

from "${project.rootProject.projectDir}/docs/integrations"
into "build/docker/bin/docs/integrations"
duplicatesStrategy DuplicatesStrategy.INCLUDE
}

task copyNginx(type: Copy) {
dependsOn copyDocker

from "${project.projectDir}/nginx"
into "build/docker/bin/nginx"
}

copyBuild.dependsOn npm_run_build
copyNginx.dependsOn npm_run_build
copyDocs.dependsOn npm_run_build
assemble.dependsOn copyDocs
copyDocker.dependsOn(npm_run_build)

Task dockerBuildTask = getDockerBuildTask("webapp", "$project.projectDir")
dockerBuildTask.dependsOn(copyBuild)
dockerBuildTask.dependsOn(copyNginx)
dockerBuildTask.dependsOn(copyDocs)
assemble.dependsOn(dockerBuildTask)
2 changes: 1 addition & 1 deletion airbyte-workers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENV APPLICATION airbyte-workers
WORKDIR /app

# Move worker app
ADD build/distributions/${APPLICATION}-0.30.28-alpha.tar /app
ADD bin/${APPLICATION}-0.30.28-alpha.tar /app

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.30.28-alpha/bin/${APPLICATION}"]
14 changes: 14 additions & 0 deletions airbyte-workers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ application {
mainClass = mainClassName
applicationDefaultJvmArgs = ['-XX:MaxRAMPercentage=75.0']
}

task copyGeneratedTar(type: Copy) {
dependsOn copyDocker
dependsOn distTar

from('build/distributions') {
include 'airbyte-workers-*.tar'
}
into 'build/docker/bin'
}

Task dockerBuildTask = getDockerBuildTask("worker", "$project.projectDir")
dockerBuildTask.dependsOn(copyGeneratedTar)
assemble.dependsOn(dockerBuildTask)
Loading