mzcompose.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. """
  10. Test various Confluent Platform d Redpanda versions to make sure they are all
  11. working with Materialize.
  12. """
  13. from materialize import buildkite
  14. from materialize.mzcompose import DEFAULT_CONFLUENT_PLATFORM_VERSION
  15. from materialize.mzcompose.composition import Composition
  16. from materialize.mzcompose.services.kafka import Kafka
  17. from materialize.mzcompose.services.localstack import Localstack
  18. from materialize.mzcompose.services.materialized import Materialized
  19. from materialize.mzcompose.services.redpanda import REDPANDA_VERSION, Redpanda
  20. from materialize.mzcompose.services.schema_registry import SchemaRegistry
  21. from materialize.mzcompose.services.testdrive import Testdrive
  22. from materialize.mzcompose.services.zookeeper import Zookeeper
  23. REDPANDA_VERSIONS = [
  24. "v22.3.25",
  25. "v23.1.21",
  26. "v23.2.29",
  27. "v23.3.21",
  28. "v24.1.21",
  29. "v24.2.24",
  30. "v24.3.14",
  31. REDPANDA_VERSION,
  32. "latest",
  33. ]
  34. CONFLUENT_PLATFORM_VERSIONS = [
  35. "7.0.16",
  36. "7.1.16",
  37. "7.2.14",
  38. "7.3.12",
  39. "7.4.9",
  40. "7.5.8",
  41. "7.6.5",
  42. "7.7.3",
  43. "7.8.2",
  44. DEFAULT_CONFLUENT_PLATFORM_VERSION,
  45. # There is currently a mismatch in the latest versions between zookeeper
  46. # (7.9.0) and cp-kafka (8.0.0), making running them in combination
  47. # impossible
  48. # "latest",
  49. ]
  50. SERVICES = [
  51. Materialized(default_replication_factor=2),
  52. # Occasional timeouts in CI with 60s timeout
  53. Testdrive(
  54. volumes_extra=["../testdrive:/workdir/testdrive"], default_timeout="120s"
  55. ),
  56. Redpanda(),
  57. Zookeeper(),
  58. Kafka(),
  59. SchemaRegistry(),
  60. Localstack(),
  61. ]
  62. TD_CMD = [
  63. f"--var=default-replica-size={Materialized.Size.DEFAULT_SIZE}-{Materialized.Size.DEFAULT_SIZE}",
  64. f"--var=default-storage-size={Materialized.Size.DEFAULT_SIZE}-1",
  65. *[f"testdrive/{td}" for td in ["kafka-sinks.td", "kafka-upsert-sources.td"]],
  66. ]
  67. def workflow_default(c: Composition) -> None:
  68. c.up("localstack")
  69. redpanda_versions = buildkite.shard_list(REDPANDA_VERSIONS, lambda v: v)
  70. print(
  71. f"Redpanda versions in shard with index {buildkite.get_parallelism_index()}: {redpanda_versions}"
  72. )
  73. for redpanda_version in redpanda_versions:
  74. print(f"--- Testing Redpanda {redpanda_version}")
  75. with c.override(Redpanda(version=redpanda_version)):
  76. c.down(destroy_volumes=True)
  77. c.up("redpanda", "materialized")
  78. c.run_testdrive_files(*TD_CMD)
  79. confluent_versions = buildkite.shard_list(CONFLUENT_PLATFORM_VERSIONS, lambda v: v)
  80. print(
  81. f"Confluent Platform versions in shard with index {buildkite.get_parallelism_index()}: {confluent_versions}"
  82. )
  83. for confluent_version in confluent_versions:
  84. print(f"--- Testing Confluent Platform {confluent_version}")
  85. with c.override(
  86. Zookeeper(tag=confluent_version),
  87. Kafka(tag=confluent_version),
  88. SchemaRegistry(tag=confluent_version),
  89. ):
  90. c.down(destroy_volumes=True)
  91. c.up("zookeeper", "kafka", "schema-registry", "materialized")
  92. c.run_testdrive_files(*TD_CMD)