2021-06-03 13:24:33 -07:00
|
|
|
plugins {
|
|
|
|
id 'org.springframework.boot'
|
|
|
|
id 'java'
|
2022-12-26 10:09:08 -06:00
|
|
|
id 'com.palantir.docker'
|
|
|
|
}
|
|
|
|
|
2023-01-31 18:44:37 -06:00
|
|
|
apply from: "../gradle/versioning/versioning.gradle"
|
|
|
|
|
2022-12-26 10:09:08 -06:00
|
|
|
ext {
|
2023-02-10 09:39:09 -06:00
|
|
|
docker_registry = rootProject.ext.docker_registry == 'linkedin' ? 'acryldata' : docker_registry
|
2022-12-26 10:09:08 -06:00
|
|
|
docker_repo = 'datahub-upgrade'
|
2021-06-03 13:24:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-09-01 09:06:01 -05:00
|
|
|
implementation project(':metadata-io')
|
|
|
|
implementation project(':metadata-service:factories')
|
2024-03-23 06:15:36 -05:00
|
|
|
implementation project(':metadata-service:restli-client-api')
|
2023-09-01 09:06:01 -05:00
|
|
|
implementation project(':metadata-service:configuration')
|
|
|
|
implementation project(':metadata-dao-impl:kafka-producer')
|
2023-06-07 18:42:19 -05:00
|
|
|
implementation externalDependency.charle
|
2021-06-03 13:24:33 -07:00
|
|
|
|
2023-09-01 09:06:01 -05:00
|
|
|
implementation externalDependency.javaxInject
|
|
|
|
implementation(externalDependency.hadoopClient) {
|
2021-06-30 22:57:39 -07:00
|
|
|
exclude group: 'net.minidev', module: 'json-smart'
|
|
|
|
exclude group: 'com.nimbusds', module: 'nimbus-jose-jwt'
|
|
|
|
exclude group: "org.apache.htrace", module: "htrace-core4"
|
2024-03-07 14:15:22 -06:00
|
|
|
exclude group: "org.eclipse.jetty"
|
2023-02-20 19:53:59 -06:00
|
|
|
exclude group: "org.apache.hadoop.thirdparty", module: "hadoop-shaded-protobuf_3_7"
|
2023-06-07 18:42:19 -05:00
|
|
|
exclude group: "com.charleskorn.kaml", module:"kaml"
|
|
|
|
|
2021-06-30 22:57:39 -07:00
|
|
|
}
|
2022-12-09 14:11:12 -06:00
|
|
|
|
|
|
|
constraints {
|
|
|
|
implementation(externalDependency.hadoopCommon3) {
|
|
|
|
because("previous versions are vulnerable to CVE-2021-37404")
|
|
|
|
}
|
2023-02-20 00:02:05 -06:00
|
|
|
implementation(externalDependency.snakeYaml) {
|
|
|
|
because("previous versions are vulnerable to CVE-2022-25857")
|
|
|
|
}
|
|
|
|
implementation(externalDependency.woodstoxCore) {
|
|
|
|
because("previous versions are vulnerable to CVE-2022-40151-2")
|
|
|
|
}
|
|
|
|
implementation(externalDependency.jettison) {
|
|
|
|
because("previous versions are vulnerable")
|
|
|
|
}
|
2024-03-07 14:15:22 -06:00
|
|
|
implementation(externalDependency.guava) {
|
|
|
|
because("CVE-2023-2976")
|
|
|
|
}
|
2024-06-18 11:28:39 -05:00
|
|
|
implementation('io.airlift:aircompressor:0.27') {
|
|
|
|
because("CVE-2024-36114")
|
|
|
|
}
|
2024-08-23 10:26:42 -05:00
|
|
|
implementation('dnsjava:dnsjava:3.6.1') {
|
|
|
|
because("CVE-2024-25638")
|
|
|
|
}
|
2022-12-09 14:11:12 -06:00
|
|
|
}
|
|
|
|
|
2023-05-17 10:32:23 -05:00
|
|
|
|
|
|
|
// mock internal schema registry
|
|
|
|
implementation externalDependency.kafkaAvroSerde
|
|
|
|
implementation externalDependency.kafkaAvroSerializer
|
2024-08-20 13:42:45 -05:00
|
|
|
implementation "org.apache.kafka:kafka_2.12:3.7.1"
|
2023-05-17 10:32:23 -05:00
|
|
|
|
2022-12-04 21:57:47 -06:00
|
|
|
implementation externalDependency.slf4jApi
|
|
|
|
compileOnly externalDependency.lombok
|
2023-09-01 09:06:01 -05:00
|
|
|
implementation externalDependency.picocli
|
|
|
|
implementation externalDependency.parquet
|
2022-12-26 10:09:08 -06:00
|
|
|
implementation externalDependency.protobuf
|
2023-09-01 09:06:01 -05:00
|
|
|
implementation externalDependency.springBeans
|
|
|
|
implementation externalDependency.springBootAutoconfigure
|
|
|
|
implementation externalDependency.springCore
|
|
|
|
implementation externalDependency.springKafka
|
2021-06-03 13:24:33 -07:00
|
|
|
|
2023-09-01 09:06:01 -05:00
|
|
|
runtimeOnly externalDependency.logbackClassic
|
|
|
|
runtimeOnly externalDependency.mariadbConnector
|
|
|
|
runtimeOnly externalDependency.mysqlConnector
|
|
|
|
runtimeOnly externalDependency.postgresql
|
2021-06-03 13:24:33 -07:00
|
|
|
|
2024-03-15 15:02:54 -07:00
|
|
|
implementation externalDependency.awsMskIamAuth
|
2022-11-22 16:36:53 -05:00
|
|
|
|
2021-06-03 13:24:33 -07:00
|
|
|
annotationProcessor externalDependency.lombok
|
|
|
|
annotationProcessor externalDependency.picocli
|
2022-12-27 12:35:48 -06:00
|
|
|
|
|
|
|
testImplementation externalDependency.springBootTest
|
2023-09-01 09:06:01 -05:00
|
|
|
testImplementation externalDependency.mockito
|
|
|
|
testImplementation externalDependency.testng
|
|
|
|
testRuntimeOnly externalDependency.logbackClassic
|
2023-11-14 19:00:22 -06:00
|
|
|
|
|
|
|
constraints {
|
|
|
|
implementation(implementation externalDependency.parquetHadoop) {
|
|
|
|
because("CVE-2022-42003")
|
|
|
|
}
|
|
|
|
}
|
2021-06-03 13:24:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bootJar {
|
2023-04-13 12:01:51 -05:00
|
|
|
mainClass = 'com.linkedin.datahub.upgrade.UpgradeCliApplication'
|
2022-12-26 10:09:08 -06:00
|
|
|
archiveFileName = "${project.name}.jar"
|
|
|
|
}
|
|
|
|
|
2024-06-17 19:53:54 -05:00
|
|
|
bootRun {
|
|
|
|
environment "ENTITY_REGISTRY_CONFIG_PATH", "../metadata-models/src/main/resources/entity-registry.yml"
|
|
|
|
environment "ENABLE_STRUCTURED_PROPERTIES_SYSTEM_UPDATE", "true"
|
|
|
|
environment "ELASTICSEARCH_INDEX_BUILDER_MAPPINGS_REINDEX", "true"
|
|
|
|
environment "SERVER_PORT", "8083"
|
|
|
|
args += ["-u", "SystemUpdate"]
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Runs SystemUpdate on locally running system
|
|
|
|
*/
|
|
|
|
task run(type: Exec) {
|
|
|
|
dependsOn bootJar
|
|
|
|
group = "Execution"
|
|
|
|
description = "Run the datahub-upgrade SystemUpdate process locally."
|
|
|
|
environment "ENTITY_REGISTRY_CONFIG_PATH", "../metadata-models/src/main/resources/entity-registry.yml"
|
|
|
|
environment "ENABLE_STRUCTURED_PROPERTIES_SYSTEM_UPDATE", "true"
|
|
|
|
environment "ELASTICSEARCH_INDEX_BUILDER_MAPPINGS_REINDEX", "true"
|
2024-09-04 15:36:12 -05:00
|
|
|
commandLine "java",
|
|
|
|
"-agentlib:jdwp=transport=dt_socket,address=5003,server=y,suspend=n",
|
|
|
|
"-jar",
|
|
|
|
"-Dserver.port=8083", bootJar.getArchiveFile().get(), "-u", "SystemUpdate"
|
2024-06-17 19:53:54 -05:00
|
|
|
}
|
|
|
|
|
2022-12-26 10:09:08 -06:00
|
|
|
docker {
|
2023-01-31 18:44:37 -06:00
|
|
|
name "${docker_registry}/${docker_repo}:v${version}"
|
|
|
|
version "v${version}"
|
2022-12-26 10:09:08 -06:00
|
|
|
dockerfile file("${rootProject.projectDir}/docker/${docker_repo}/Dockerfile")
|
|
|
|
files bootJar.outputs.files
|
|
|
|
files fileTree(rootProject.projectDir) {
|
2023-11-13 16:26:53 -06:00
|
|
|
include '.dockerignore'
|
2022-12-26 10:09:08 -06:00
|
|
|
include "docker/${docker_repo}/*"
|
|
|
|
include 'metadata-models/src/main/resources/*'
|
2023-08-17 00:10:17 -05:00
|
|
|
}.exclude {
|
2023-11-13 16:26:53 -06:00
|
|
|
i -> (!i.file.name.endsWith(".dockerignore") && i.file.isHidden())
|
2022-12-26 10:09:08 -06:00
|
|
|
}
|
2023-02-16 10:41:42 -06:00
|
|
|
tag("Debug", "${docker_registry}/${docker_repo}:debug")
|
2022-12-26 10:09:08 -06:00
|
|
|
|
|
|
|
// platform('linux/arm64', 'linux/amd64')
|
|
|
|
buildx(true)
|
|
|
|
load(true)
|
|
|
|
push(false)
|
2023-11-28 21:52:11 +01:00
|
|
|
|
|
|
|
// Add build args if they are defined (needed for some CI or enterprise environments)
|
|
|
|
def dockerBuildArgs = [:]
|
|
|
|
if (project.hasProperty('alpineApkRepositoryUrl')) {
|
|
|
|
dockerBuildArgs.ALPINE_REPO_URL = project.getProperty('alpineApkRepositoryUrl')
|
|
|
|
}
|
|
|
|
if (project.hasProperty('githubMirrorUrl')) {
|
|
|
|
dockerBuildArgs.GITHUB_REPO_URL = project.getProperty('githubMirrorUrl')
|
|
|
|
}
|
|
|
|
if (project.hasProperty('mavenCentralRepositoryUrl')) {
|
|
|
|
dockerBuildArgs.MAVEN_CENTRAL_REPO_URL = project.getProperty('mavenCentralRepositoryUrl')
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dockerBuildArgs.size() > 0) {
|
|
|
|
buildArgs(dockerBuildArgs)
|
|
|
|
}
|
2022-12-26 10:09:08 -06:00
|
|
|
}
|
2023-09-02 19:25:44 -05:00
|
|
|
tasks.getByPath(":datahub-upgrade:docker").dependsOn([bootJar])
|
2022-12-26 10:09:08 -06:00
|
|
|
|
|
|
|
task cleanLocalDockerImages {
|
|
|
|
doLast {
|
2023-08-17 00:10:17 -05:00
|
|
|
rootProject.ext.cleanLocalDockerImages(docker_registry, docker_repo, "${version}")
|
2022-12-26 10:09:08 -06:00
|
|
|
}
|
2021-06-03 13:24:33 -07:00
|
|
|
}
|
2023-02-10 09:39:09 -06:00
|
|
|
dockerClean.finalizedBy(cleanLocalDockerImages)
|
2023-06-07 18:42:19 -05:00
|
|
|
|