Skip to content

Commit 1091e61

Browse files
committed
fix: tokern-lineage-engine should accept environment variables
The file was ignoring environment variables passed through docker-compose command. Also the command-line wrongly accepted CATALOG_PORT for --catalog-db option. Update README to provide more information on connecting to an external postgres. Update version to 0.7.7 Fix #61
1 parent 5d88616 commit 1091e61

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,27 @@ Run docker-compose
7070
docker-compose up -d
7171

7272

73-
If you want to use an external Postgres database, replace the following parameters in `tokern-lineage-engine.yml`:
73+
If you want to use an external Postgres database, change the following parameters in `tokern-lineage-engine.yml`:
7474

7575
* CATALOG_HOST
7676
* CATALOG_USER
7777
* CATALOG_PASSWORD
7878
* CATALOG_DB
7979

80+
You can also override default values using environement variables.
81+
82+
CATALOG_HOST=... CATALOG_USER=... CATALOG_PASSWORD=... CATALOG_DB=... docker-compose -f ... up -d
83+
84+
For more advanced usage of environment variables with docker-compose, [refer to docker-compose docs](https://docs.docker.com/compose/environment-variables/)
85+
86+
**Pro-tip**
87+
88+
If you want to connect to a database in the host machine, set
89+
90+
CATALOG_HOST: host.docker.internal # For mac or windows
91+
#OR
92+
CATALOG_HOST: 172.17.0.1 # Linux
93+
8094
## Supported Technologies
8195

8296
* Postgres

data_lineage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# flake8: noqa
2-
__version__ = "0.7.6"
2+
__version__ = "0.7.7"
33

44
import datetime
55
import json

data_lineage/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"--catalog-port", help="Database Password", envvar="CATALOG_PORT", default=5432
2626
)
2727
@click.option(
28-
"--catalog-db", help="Postgres Database", envvar="CATALOG_PORT", default="tokern"
28+
"--catalog-db", help="Postgres Database", envvar="CATALOG_DB", default="tokern"
2929
)
3030
@click.option(
3131
"--server-address",

install-manifests/docker-compose/tokern-lineage-engine.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ services:
2020
- tokern-internal
2121
- tokern-net
2222
environment:
23-
CATALOG_PASSWORD: catal0g_passw0rd
24-
CATALOG_USER: catalog_user
25-
CATALOG_DB: tokern
26-
CATALOG_HOST: tokern-catalog
23+
CATALOG_PASSWORD: ${CATALOG_PASSWORD:-catal0g_passw0rd}
24+
CATALOG_USER: ${CATALOG_USER:-catalog_user}
25+
CATALOG_DB: ${CATALOG_DB:-tokern}
26+
CATALOG_HOST: ${CATALOG_HOST:-tokern-catalog}
2727
SERVER_ADDRESS: "0.0.0.0:4142"
28-
toker-viz:
28+
tokern-viz:
2929
image: tokern/data-lineage-viz:latest
3030
container_name: tokern-data-lineage-visualizer
3131
restart: unless-stopped

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "data-lineage"
3-
version = "0.7.6"
3+
version = "0.7.7"
44
description = "Open Source Data Lineage Tool for Redshift. Snowflake and many other databases"
55
authors = ["Tokern <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)