Skip to content

Commit

Permalink
feat(gradle): quickstart postgres gradle task (#9329)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Nov 29, 2023
1 parent 4dd6738 commit 0795f0b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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') {
Expand Down Expand Up @@ -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(" ")
}
2 changes: 1 addition & 1 deletion docker/docker-compose-without-neo4j.postgres.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 0795f0b

Please sign in to comment.