|
33 | 33 | from materialize import MZ_ROOT
|
34 | 34 | from materialize.mzcompose.composition import Composition, Service
|
35 | 35 | from materialize.mzcompose.services.balancerd import Balancerd
|
| 36 | +from materialize.mzcompose.services.dnsmasq import Dnsmasq, DnsmasqEntry |
36 | 37 | from materialize.mzcompose.services.frontegg import FronteggMock
|
37 | 38 | from materialize.mzcompose.services.materialized import Materialized
|
38 | 39 | from materialize.mzcompose.services.mz import Mz
|
@@ -84,10 +85,32 @@ def app_password(email: str) -> str:
|
84 | 85 | SERVICES = [
|
85 | 86 | TestCerts(),
|
86 | 87 | Testdrive(
|
87 |
| - materialize_url=f"postgres://{quote(ADMIN_USER)}:{app_password(ADMIN_USER)}@balancerd:6875?sslmode=require", |
| 88 | + materialize_url=f"postgres://{quote(ADMIN_USER)}:{app_password(ADMIN_USER)}@:6875?sslmode=require", |
88 | 89 | materialize_use_https=True,
|
89 | 90 | no_reset=True,
|
90 | 91 | ),
|
| 92 | + Dnsmasq( |
| 93 | + dns_overrides=[ |
| 94 | + # Docker compose will insert into all service pods an arec for |
| 95 | + # materialized. But what we need is a cname that points to an arec |
| 96 | + # with the tenant id in the name and the value should point to the |
| 97 | + # ip of materailized. We're going to use a new network for this |
| 98 | + # to ensure that we can get a unique ip space and we're going to |
| 99 | + # use explicit IPs for dnsmasq to set it it as the dns server for |
| 100 | + # balancerd. |
| 101 | + DnsmasqEntry( |
| 102 | + type="cname", |
| 103 | + key="materialized", |
| 104 | + value="environmentd.environment-58cd23ff-a4d7-4bd0-ad85-a6ff29cc86c3-0.svc.cluster.local", |
| 105 | + ), |
| 106 | + DnsmasqEntry( |
| 107 | + type="address", |
| 108 | + key="environmentd.environment-58cd23ff-a4d7-4bd0-ad85-a6ff29cc86c3-0.svc.cluster.local", |
| 109 | + value="10.10.0.4", |
| 110 | + ), |
| 111 | + ], |
| 112 | + networks={"mzcompose": {"ipv4_address": "10.10.0.2"}}, |
| 113 | + ), |
91 | 114 | Balancerd(
|
92 | 115 | command=[
|
93 | 116 | "--startup-log-filter=debug",
|
@@ -115,6 +138,9 @@ def app_password(email: str) -> str:
|
115 | 138 | volumes=[
|
116 | 139 | "secrets:/secrets",
|
117 | 140 | ],
|
| 141 | + # Points to DNSMasq which has an explicit ip |
| 142 | + dns=["10.10.0.2"], |
| 143 | + networks={"mzcompose": {"ipv4_address": "10.10.0.3"}}, |
118 | 144 | ),
|
119 | 145 | FronteggMock(
|
120 | 146 | issuer=FRONTEGG_URL,
|
@@ -147,6 +173,7 @@ def app_password(email: str) -> str:
|
147 | 173 | "secrets:/secrets",
|
148 | 174 | ],
|
149 | 175 | listeners_config_path=f"{MZ_ROOT}/src/materialized/ci/listener_configs/no_auth_https.json",
|
| 176 | + networks={"mzcompose": {"ipv4_address": "10.10.0.4"}}, |
150 | 177 | ),
|
151 | 178 | ]
|
152 | 179 |
|
@@ -661,10 +688,9 @@ def workflow_user(c: Composition) -> None:
|
661 | 688 |
|
662 | 689 |
|
663 | 690 | def workflow_many_connections(c: Composition) -> None:
|
664 |
| - c.up("balancerd", "frontegg-mock", "materialized") |
665 |
| - |
| 691 | + c.up("balancerd", "dnsmasq", "frontegg-mock", "materialized") |
666 | 692 | cursors = []
|
667 |
| - connections = 1000 - 10 # Go almost to the limit, but not above |
| 693 | + connections = 100 - 10 # Go almost to the limit, but not above |
668 | 694 | print(f"Opening {connections} connections.")
|
669 | 695 | start = time.time()
|
670 | 696 | for _ in range(connections):
|
|
0 commit comments