Skip to content

Commit

Permalink
Default the username if not present.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Mar 7, 2024
1 parent 0c5a87e commit 5f3c051
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.hinfo
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ COPY python/lsst/consdb/hinfo.py ./hinfo/
# INSTRUMENT: LATISS, LSSTComCam, LSSTComCamSim, LSSTCam
# POSTGRES_URL: SQLAlchemy connection URL
# KAFKA_BOOTSTRAP: host:port of bootstrap server
# KAFKA_USERNAME: username for SASL_PLAIN authentication
# KAFKA_PASSWORD: password for SASL_PLAIN authentication
# SCHEMA_URL: Kafkit registry schema URL
# Optional environment variables:
# BUCKET_PREFIX: "rubin:" at USDF
# BUCKET_PREFIX: set to "rubin:" at USDF, default is ""
# KAFKA_GROUP_ID: name of consumer group, default is "consdb-consumer"
# KAFKA_USERNAME: username for SASL_PLAIN authentication, default is "consdb"

ENTRYPOINT [ "bash", "-c", "source loadLSST.bash; setup obs_lsst; python ./hinfo/hinfo.py" ]
3 changes: 2 additions & 1 deletion python/lsst/consdb/hinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def get_kafka_config() -> KafkaConfig:
return KafkaConfig(
bootstrap=os.environ["KAFKA_BOOTSTRAP"],
group_id=os.environ.get("KAFKA_GROUP_ID", "consdb-consumer"),
username=os.environ["KAFKA_USERNAME"],
username=os.environ.get("KAFKA_USERNAME", "consdb"),
password=os.environ["KAFKA_PASSWORD"],
schema_url=os.environ["SCHEMA_URL"],
)
Expand Down Expand Up @@ -324,6 +324,7 @@ async def main() -> None:
auto_offset_reset="earliest",
isolation_level="read_committed",
security_protocol="SASL_PLAINTEXT",
sasl_mechanism="SCRAM-SHA-512",
sasl_plain_username=kafka_config.username,
sasl_plain_password=kafka_config.password,
)
Expand Down

0 comments on commit 5f3c051

Please sign in to comment.