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

feat(gradle): quickstart postgres gradle task #9329

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading