kgen.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. from materialize.mzcompose.service import (
  10. Service,
  11. )
  12. class Kgen(Service):
  13. def __init__(
  14. self,
  15. name: str = "kgen",
  16. mzbuild: str = "kgen",
  17. depends_on: list[str] = ["kafka"],
  18. ) -> None:
  19. entrypoint = [
  20. "kgen",
  21. "--bootstrap-server=kafka:9092",
  22. ]
  23. if "schema-registry" in depends_on:
  24. entrypoint.append("--schema-registry-url=http://schema-registry:8081")
  25. super().__init__(
  26. name=name,
  27. config={
  28. "mzbuild": mzbuild,
  29. "depends_on": depends_on,
  30. "entrypoint": entrypoint,
  31. },
  32. )