feat(gradle): quickstart postgres gradle task (#9329)

This commit is contained in:
david-leifker 2023-11-29 09:16:48 -06:00 committed by GitHub
parent 4dd6738ae7
commit 0795f0b2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 1 deletions

View File

@ -15,6 +15,7 @@ ext {
':metadata-service:war',
':datahub-frontend',
]
debug_modules = quickstart_modules - [':metadata-jobs:mce-consumer-job',
':metadata-jobs:mae-consumer-job']
debug_compose_args = [
@ -27,6 +28,13 @@ ext {
'datahub-gms',
'datahub-frontend-react'
]
// Postgres
pg_quickstart_modules = quickstart_modules - [':docker:mysql-setup'] + [':docker:postgres-setup']
pg_compose_args = [
'-f', 'docker-compose-without-neo4j.yml',
'-f', 'docker-compose-without-neo4j.postgres.override.yml'
]
}
task quickstart(type: Exec, dependsOn: ':metadata-ingestion:install') {
@ -125,3 +133,29 @@ task debugReload(type: Exec) {
def cmd = ['docker compose -p datahub'] + debug_compose_args + ['restart'] + debug_reloadable
commandLine 'bash', '-c', cmd.join(" ")
}
task quickstartPg(type: Exec, dependsOn: ':metadata-ingestion:install') {
dependsOn(pg_quickstart_modules.collect { it + ':dockerTag' })
shouldRunAfter ':metadata-ingestion:clean', 'quickstartNuke'
environment "DATAHUB_TELEMETRY_ENABLED", "false"
environment "DOCKER_COMPOSE_BASE", "file://${rootProject.projectDir}"
environment "DATAHUB_POSTGRES_VERSION", "15.5"
// OpenSearch
environment "DATAHUB_SEARCH_IMAGE", 'opensearchproject/opensearch'
environment "DATAHUB_SEARCH_TAG", '2.9.0'
environment "XPACK_SECURITY_ENABLED", 'plugins.security.disabled=true'
environment "USE_AWS_ELASTICSEARCH", 'true'
def cmd = [
'source ../metadata-ingestion/venv/bin/activate && ',
'datahub docker quickstart',
'--no-pull-images',
'--standalone_consumers',
'--version', "v${version}",
'--dump-logs-on-failure'
] + pg_compose_args
commandLine 'bash', '-c', cmd.join(" ")
}

View File

@ -53,7 +53,7 @@ services:
postgres:
container_name: postgres
hostname: postgres
image: postgres:12.3
image: postgres:${DATAHUB_POSTGRES_VERSION:-12.3}
env_file: postgres/env/docker.env
ports:
- '5432:5432'