diff --git a/.circleci/api-load-test.sh b/.circleci/api-load-test.sh index a7d1ea7e2d..1b3bc9f6d8 100755 --- a/.circleci/api-load-test.sh +++ b/.circleci/api-load-test.sh @@ -22,6 +22,9 @@ readonly MARQUEZ_HOST="localhost" readonly MARQUEZ_ADMIN_PORT=8081 readonly MARQUEZ_URL="http://${MARQUEZ_HOST}:${MARQUEZ_ADMIN_PORT}" readonly MARQUEZ_DB="marquez-db" +readonly POSTGRES_PORT=5432 +readonly API_PORT=5000 +readonly API_ADMIN_PORT=5001 readonly METADATA_FILE="api/load-testing/metadata.json" readonly METADATA_STATS_QUERY=$(cat <<-END diff --git a/.circleci/config.yml b/.circleci/config.yml index b6ce4ebd02..6a4f957a88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -161,6 +161,8 @@ jobs: path: marquez - store_artifacts: path: k6 + environment: + - POSTGRES_PORT=5432 migrate-db: working_directory: ~/marquez @@ -171,6 +173,10 @@ jobs: - checkout - run: ./.circleci/get-docker-compose.sh - run: ./.circleci/db-migration.sh + environment: + - POSTGRES_PORT=5432 + - API_PORT=5000 + - API_ADMIN_PORT=5001 publish-snapshot: working_directory: ~/marquez diff --git a/.circleci/db-migration.sh b/.circleci/db-migration.sh index 3c35919613..990187983c 100755 --- a/.circleci/db-migration.sh +++ b/.circleci/db-migration.sh @@ -16,6 +16,7 @@ readonly POSTGRES_VERSION="14" readonly MARQUEZ_VERSION=0.47.0 # Build version of Marquez readonly MARQUEZ_BUILD_VERSION="$(git log --pretty=format:'%h' -n 1)" # SHA1 +readonly POSTGRES_PORT=5432 readonly DB_MIGRATION_VOLUME="marquez_db-backup" readonly DB_MIGRATION_BACKUP="db-migration-backup" diff --git a/.env.example b/.env.example index 6c90c92b09..4612671cd0 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ API_PORT=5000 API_ADMIN_PORT=5001 WEB_PORT=3000 +POSTGRES_PORT=5432 TAG=0.47.0 diff --git a/docker-compose.db.yml b/docker-compose.db.yml index 77cfa1e9fb..f23df32550 100644 --- a/docker-compose.db.yml +++ b/docker-compose.db.yml @@ -4,7 +4,7 @@ services: image: postgres:14 container_name: marquez-db ports: - - "5432:5432" + - "${POSTGRES_PORT}:${POSTGRES_PORT}" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=password diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8248837266..ca6d9a3222 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -12,4 +12,4 @@ services: ports: - "8080:8080" environment: - DATABASE_URL: postgres://postgres:password@db:5432 + DATABASE_URL: postgres://postgres:password@db:${POSTGRES_PORT} diff --git a/docker-compose.yml b/docker-compose.yml index bf275001be..b8b4403d4a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,13 +15,17 @@ services: - "db:postgres" depends_on: - db - entrypoint: ["/opt/marquez/wait-for-it.sh", "db:5432", "--", "./entrypoint.sh"] + entrypoint: + - /opt/marquez/wait-for-it.sh + - db:${POSTGRES_PORT} + - -- + - ./entrypoint.sh db: image: postgres:14 container_name: marquez-db ports: - - "5432:5432" + - "${POSTGRES_PORT}:${POSTGRES_PORT}" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=password diff --git a/docker/up.sh b/docker/up.sh index af9aedba84..32fc4b415f 100755 --- a/docker/up.sh +++ b/docker/up.sh @@ -64,6 +64,7 @@ compose_files="-f docker-compose.yml" API_PORT=5000 API_ADMIN_PORT=5001 WEB_PORT=3000 +POSTGRES_PORT=5432 NO_WEB="false" NO_VOLUMES="false" TAG="${VERSION}" @@ -84,6 +85,10 @@ while [ $# -gt 0 ]; do shift WEB_PORT="${1}" ;; + -p|'--pg-port') + shift + POSTGRES_PORT="${1}" + ;; -t|'--tag') shift TAG="${1}" @@ -142,5 +147,5 @@ if [[ "${NO_VOLUMES}" = "false" ]]; then fi # Run docker compose cmd with overrides -DOCKER_SCAN_SUGGEST="false" API_PORT=${API_PORT} API_ADMIN_PORT=${API_ADMIN_PORT} WEB_PORT=${WEB_PORT} TAG=${TAG} \ +DOCKER_SCAN_SUGGEST="false" API_PORT=${API_PORT} API_ADMIN_PORT=${API_ADMIN_PORT} WEB_PORT=${WEB_PORT} POSTGRES_PORT=${POSTGRES_PORT} TAG=${TAG} \ docker --log-level ERROR compose $compose_files up $compose_args diff --git a/docs/v2/docs/quickstart/index.mdx b/docs/v2/docs/quickstart/index.mdx index 648dae9cdc..7f5aaf7586 100644 --- a/docs/v2/docs/quickstart/index.mdx +++ b/docs/v2/docs/quickstart/index.mdx @@ -150,4 +150,4 @@ In this simple example, we showed you how to write sample lineage metadata to a ## Feedback {#feedback} -What did you think of this guide? You can reach out to us on [slack](https://join.slack.com/t/marquezproject/shared_invite/zt-29w4n8y45-Re3B1KTlZU5wO6X6JRzGmA) and leave us feedback, or [open a pull request](https://github.com/MarquezProject/marquez/blob/main/CONTRIBUTING.md#submitting-a-pull-request) with your suggestions! +What did you think of this guide? You can reach out to us on [slack](https://bit.ly/Marquez_Slack_invite) and leave us feedback, or [open a pull request](https://github.com/MarquezProject/marquez/blob/main/CONTRIBUTING.md#submitting-a-pull-request) with your suggestions! diff --git a/marquez.dev.yml b/marquez.dev.yml index cbc0f0e71d..930f91e759 100644 --- a/marquez.dev.yml +++ b/marquez.dev.yml @@ -9,7 +9,7 @@ server: db: driverClass: org.postgresql.Driver - url: jdbc:postgresql://postgres:5432/marquez + url: jdbc:postgresql://postgres:${POSTGRES_PORT:-5432}/marquez user: marquez password: marquez