Skip to content

Commit

Permalink
Add WellKnownTypes to the Orchestrator (#21897)
Browse files Browse the repository at this point in the history
* Add WellKnownTypes to the Orchestrator

* Add comments
  • Loading branch information
gosusnp authored Jan 26, 2023
1 parent 4068bbe commit fa24ad6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airbyte-container-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ENV AIRBYTE_ENTRYPOINT "/app/${APPLICATION}-${VERSION}/bin/${APPLICATION}"

WORKDIR /app

# Grab well-known types file
COPY WellKnownTypes.json /app

# Move orchestrator app
ADD bin/${APPLICATION}-${VERSION}.tar /app

Expand Down
16 changes: 16 additions & 0 deletions airbyte-container-orchestrator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import groovy.json.JsonBuilder
import groovy.yaml.YamlSlurper

plugins {
id 'application'
}
Expand Down Expand Up @@ -54,6 +57,19 @@ application {
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
}

// Duplicated from :airbyte-worker, eventually, this should be handled in :airbyte-protocol
task generateWellKnownTypes() {
doLast {
def wellKnownTypesYaml = project(':airbyte-protocol').file('protocol-models/src/main/resources/airbyte_protocol/well_known_types.yaml').text
def parsedYaml = new YamlSlurper().parseText(wellKnownTypesYaml)
def wellKnownTypesJson = new JsonBuilder(parsedYaml).toPrettyString()
def targetFile = project.file("build/docker/WellKnownTypes.json")
targetFile.getParentFile().mkdirs()
targetFile.text = wellKnownTypesJson
}
}

tasks.named("buildDockerImage") {
dependsOn copyGeneratedTar
dependsOn generateWellKnownTypes
}
2 changes: 2 additions & 0 deletions airbyte-workers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ task cloudStorageIntegrationTest(type: Test) {
}
}

// Duplicated in :airbyte-container-orchestrator, eventually, this should be handled in :airbyte-protocol
task generateWellKnownTypes() {
doLast {
def wellKnownTypesYaml = project(':airbyte-protocol').file('protocol-models/src/main/resources/airbyte_protocol/well_known_types.yaml').text
Expand All @@ -143,6 +144,7 @@ task generateWellKnownTypes() {

tasks.named("buildDockerImage") {
dependsOn copyGeneratedTar
dependsOn generateWellKnownTypes
}

// Ideally, we would have buildDockerImage depend on generateWellKnownTypes
Expand Down

0 comments on commit fa24ad6

Please sign in to comment.