MarquezProject / marquez

Collect, aggregate, and visualize a data ecosystem's metadata
https://marquezproject.ai
Apache License 2.0
1.78k stars 320 forks source link

Using custom port and host address for the database #2795

Open jpatidar30 opened 7 months ago

jpatidar30 commented 7 months ago

Issue: None of the environment variables (MARQUEZ_DB_HOST, POSTGRES_HOST, POSTGRESQL_HOST, POSTGRES_PORT) supplied to marquez seem to work for specifying the PostgreSQL host and port. Consequently, this prevents proper integration with external PostgreSQL instances.

Use Case: In our deployment setup, we rely on an external PostgreSQL database to manage our data. As such, it is imperative to configure Marquez to connect to this external database by specifying the PostgreSQL host and port via environment variables.

Expected Behavior: I expect Marquez to provide support for specifying the PostgreSQL host and port via environment variables when deployed using Docker images, allowing seamless integration with external PostgreSQL instances.

Docker Compose:

version: "3.7"
services:
  marquez_api:
    image: "marquezproject/marquez:0.46.0"
    container_name: marquez-api
    environment:
      - MARQUEZ_PORT=5000
      - MARQUEZ_ADMIN_PORT=5001
      - MARQUEZ_DB_HOST="test"
      - POSTGRES_HOST="test"
      - POSTGRESQL_HOST="test"
      - POSTGRES_PORT=5432
      - POSTGRES_DB=postgres
      - POSTGRES_USER=password
    ports:
      - "5000:5000"
      - "5001:5001"
    volumes:
      - data:/opt/marquez
    depends_on:
      - test

  marquez_web:
    image: marquezproject/marquez-web:0.46.0
    environment:
      - MARQUEZ_HOST=marquez_api
      - MARQUEZ_PORT=5000
    ports:
      - "3000:3000"
    stdin_open: true
    tty: true
    depends_on:
      - marquez_api

  test:
    image: postgres:14
    container_name: marquez-db
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
      - MARQUEZ_DB=marquez
      - MARQUEZ_USER=marquez
      - MARQUEZ_PASSWORD=marquez
    volumes:
      - db-conf-new:/etc/postgresql
      - db-init-new:/docker-entrypoint-initdb.d
      - db-backup-new:/var/lib/postgresql/data
    command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
    # Enables SQL statement logging (see: https://www.postgresql.org/docs/12/runtime-config-logging.html#GUC-LOG-STATEMENT)
    # command: ["postgres", "-c", "log_statement=all"]

volumes:
  data:
  db-conf-new:
  db-init-new:
  db-backup-new:
boring-cyborg[bot] commented 7 months ago

Thanks for opening your first issue in the Marquez project! Please be sure to follow the issue template!

publicmatt commented 1 week ago

Bump.