Skip to content

Commit 0f41c22

Browse files
committed
Tiltfile: add optional support for a second local data-plane
A second data-plane is rarely useful, but is required for testing task and collection migration.
1 parent a8799bc commit 0f41c22

File tree

1 file changed

+94
-4
lines changed

1 file changed

+94
-4
lines changed

Tiltfile

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ DATABASE_URL="postgresql://postgres:[email protected]:5432/postgres"
33

44
# Secret used to sign Authorizations within a local data plane, as base64("supersecret").
55
# Also allow requests without an Authorization (to not break data-plane-gateway just yet).
6-
AUTH_KEYS="c3VwZXJzZWNyZXQ=,AA=="
6+
AUTH_KEYS="c3VwZXJzZWNyZXQ="
77

88
REPO_BASE= '%s/..' % os.getcwd()
99
TEST_KMS_KEY="projects/helpful-kingdom-273219/locations/us-central1/keyRings/dev/cryptoKeys/testing"
@@ -103,6 +103,7 @@ local_resource(
103103
"BROKER_SERVER_CERT_FILE": TLS_CERT_PATH,
104104
"BROKER_SERVER_CERT_KEY_FILE": TLS_KEY_PATH,
105105
"ETCD_ADDRESS": "http://etcd.flow.localhost:2379",
106+
"ETCD_PREFIX": "/gazette/cluster",
106107
"LOG_LEVEL": "info",
107108
},
108109
links='https://gazette.flow.localhost:%d/debug/pprof' % port,
@@ -132,6 +133,7 @@ local_resource(
132133
"CONSUMER_SERVER_CERT_KEY_FILE": TLS_KEY_PATH,
133134
"DOCKER_DEFAULT_PLATFORM": "linux/amd64",
134135
"ETCD_ADDRESS": "http://etcd.flow.localhost:2379",
136+
"ETCD_PREFIX": "/flow/cluster",
135137
"FLOW_ALLOW_LOCAL": "true",
136138
"FLOW_BUILDS_ROOT": FLOW_BUILDS_ROOT,
137139
"FLOW_CONTROL_API": "http://agent.flow.localhost:8675",
@@ -140,7 +142,7 @@ local_resource(
140142
"FLOW_NETWORK": "supabase_network_flow",
141143
"LOG_LEVEL": "info",
142144
},
143-
links='https://reactor.flow.localhost:9000/debug/pprof',
145+
links='https://reactor.flow.localhost:%d/debug/pprof' % port,
144146
resource_deps=['etcd'],
145147
readiness_probe=probe(
146148
initial_delay_secs=5,
@@ -181,10 +183,10 @@ local_resource(
181183
"manual": {\
182184
"brokerAddress": "https://gazette.flow.localhost:8080",\
183185
"reactorAddress": "https://reactor.flow.localhost:9000",\
184-
"hmacKeys": ["c3VwZXJzZWNyZXQ="]\
186+
"hmacKeys": ["%s"]\
185187
}\
186188
}\
187-
}\' http://agent.flow.localhost:8675/admin/create-data-plane' % SYSTEM_USER_TOKEN,
189+
}\' http://agent.flow.localhost:8675/admin/create-data-plane' % (SYSTEM_USER_TOKEN, AUTH_KEYS),
188190
resource_deps=['agent']
189191
)
190192

@@ -224,3 +226,91 @@ local_resource(
224226
serve_cmd='BROWSER=none npm start',
225227
links='http://localhost:3000'
226228
)
229+
230+
231+
# Uncomment the below sections to enable a second data-plane cluster.
232+
233+
234+
# A second data-plane cluster.
235+
#OTHER_AUTH_KEYS="b3RoZXItY2x1c3Rlcg=="
236+
#
237+
#[local_resource(
238+
# 'gazette-%d' % port,
239+
# serve_cmd='%s/flow/.build/package/bin/gazette serve' % REPO_BASE,
240+
# serve_env={
241+
# "BROKER_ALLOW_ORIGIN": "http://localhost:3000",
242+
# "BROKER_AUTH_KEYS": OTHER_AUTH_KEYS,
243+
# "BROKER_AUTO_SUSPEND": "true",
244+
# "BROKER_FILE_ONLY": "true",
245+
# "BROKER_FILE_ROOT": FLOW_DIR,
246+
# "BROKER_HOST": "other-gazette.flow.localhost",
247+
# "BROKER_PEER_CA_FILE": CA_CERT_PATH,
248+
# "BROKER_PORT": "%d" % port,
249+
# "BROKER_SERVER_CERT_FILE": TLS_CERT_PATH,
250+
# "BROKER_SERVER_CERT_KEY_FILE": TLS_KEY_PATH,
251+
# "ETCD_ADDRESS": "http://etcd.flow.localhost:2379",
252+
# "ETCD_PREFIX": "/other/gazette/cluster",
253+
# "LOG_LEVEL": "info",
254+
# },
255+
# links='https://other-gazette.flow.localhost:%d/debug/pprof' % port,
256+
# resource_deps=['etcd'],
257+
# readiness_probe=probe(
258+
# initial_delay_secs=5,
259+
# http_get=http_get_action(port=port, path='/debug/ready', scheme='https')
260+
# )
261+
#) for port in range(8180, 8184)]
262+
#
263+
#[local_resource(
264+
# 'reactor-%d' % port,
265+
# serve_cmd='%s/flow/.build/package/bin/flowctl-go serve consumer' % (REPO_BASE),
266+
# serve_env={
267+
# "BROKER_ADDRESS": "https://other-gazette.flow.localhost:8180",
268+
# "BROKER_AUTH_KEYS": OTHER_AUTH_KEYS,
269+
# "BROKER_CACHE_SIZE": "128",
270+
# "BROKER_FILE_ROOT": FLOW_DIR,
271+
# "BROKER_TRUSTED_CA_FILE": CA_CERT_PATH,
272+
# "CONSUMER_ALLOW_ORIGIN": "http://localhost:3000",
273+
# "CONSUMER_AUTH_KEYS": OTHER_AUTH_KEYS,
274+
# "CONSUMER_HOST": "other-reactor.flow.localhost",
275+
# "CONSUMER_LIMIT": "1024",
276+
# "CONSUMER_PEER_CA_FILE": CA_CERT_PATH,
277+
# "CONSUMER_PORT": "%d" % port,
278+
# "CONSUMER_SERVER_CERT_FILE": TLS_CERT_PATH,
279+
# "CONSUMER_SERVER_CERT_KEY_FILE": TLS_KEY_PATH,
280+
# "DOCKER_DEFAULT_PLATFORM": "linux/amd64",
281+
# "ETCD_ADDRESS": "http://etcd.flow.localhost:2379",
282+
# "ETCD_PREFIX": "/other/flow/cluster",
283+
# "FLOW_ALLOW_LOCAL": "true",
284+
# "FLOW_BUILDS_ROOT": FLOW_BUILDS_ROOT,
285+
# "FLOW_CONTROL_API": "http://agent.flow.localhost:8675",
286+
# "FLOW_DASHBOARD": "http://localhost:3000",
287+
# "FLOW_DATA_PLANE_FQDN": "other-cluster.dp.estuary-data.com",
288+
# "FLOW_NETWORK": "supabase_network_flow",
289+
# "LOG_LEVEL": "info",
290+
# },
291+
# links='https://other-reactor.flow.localhost:%d/debug/pprof' % port,
292+
# resource_deps=['etcd'],
293+
# readiness_probe=probe(
294+
# initial_delay_secs=5,
295+
# http_get=http_get_action(port=port, path='/debug/ready', scheme='https')
296+
# ),
297+
#) for port in range(9100, 9101)]
298+
#
299+
#local_resource(
300+
# 'create-data-plane-other-cluster',
301+
# cmd='sleep 2 && curl -v \
302+
# -X POST \
303+
# -H "content-type: application/json" \
304+
# -H "authorization: bearer %s" \
305+
# --data-binary \'{ \
306+
# "name":"other-cluster",\
307+
# "category": {\
308+
# "manual": {\
309+
# "brokerAddress": "https://other-gazette.flow.localhost:8180",\
310+
# "reactorAddress": "https://other-reactor.flow.localhost:9100",\
311+
# "hmacKeys": ["%s"]\
312+
# }\
313+
# }\
314+
# }\' http://agent.flow.localhost:8675/admin/create-data-plane' % (SYSTEM_USER_TOKEN, OTHER_AUTH_KEYS),
315+
# resource_deps=['agent']
316+
#)

0 commit comments

Comments
 (0)