Tiltfile: optional pyth and explorer deployment
This adds the explorer and Pyth as optional components to improve Tilt startup times, as originally suggested by Justin. Defaults to true in CI. Change-Id: Id9fffe5b11311baadc042815c0cc747de037554e
This commit is contained in:
parent
7914512797
commit
ef0cb91ac6
29
Tiltfile
29
Tiltfile
|
@ -29,12 +29,18 @@ config.define_string("namespace", False, "Kubernetes namespace to use")
|
||||||
config.define_string("gcpProject", False, "GCP project ID for BigTable persistence")
|
config.define_string("gcpProject", False, "GCP project ID for BigTable persistence")
|
||||||
config.define_string("bigTableKeyPath", False, "Path to BigTable json key file")
|
config.define_string("bigTableKeyPath", False, "Path to BigTable json key file")
|
||||||
|
|
||||||
|
# Components
|
||||||
|
config.define_bool("pyth", False, "Enable Pyth-to-Wormhole component")
|
||||||
|
config.define_bool("explorer", False, "Enable explorer component")
|
||||||
|
|
||||||
cfg = config.parse()
|
cfg = config.parse()
|
||||||
num_guardians = int(cfg.get("num", "5"))
|
num_guardians = int(cfg.get("num", "5"))
|
||||||
namespace = cfg.get("namespace", "wormhole")
|
namespace = cfg.get("namespace", "wormhole")
|
||||||
gcpProject = cfg.get("gcpProject", "local-dev")
|
gcpProject = cfg.get("gcpProject", "local-dev")
|
||||||
bigTableKeyPath = cfg.get("bigTableKeyPath", "./event_database/devnet_key.json")
|
bigTableKeyPath = cfg.get("bigTableKeyPath", "./event_database/devnet_key.json")
|
||||||
ci = cfg.get("ci", False)
|
ci = cfg.get("ci", False)
|
||||||
|
pyth = cfg.get("pyth", ci)
|
||||||
|
explorer = cfg.get("explorer", ci)
|
||||||
|
|
||||||
# namespace
|
# namespace
|
||||||
|
|
||||||
|
@ -75,6 +81,7 @@ local_resource(
|
||||||
|
|
||||||
# node
|
# node
|
||||||
|
|
||||||
|
if explorer:
|
||||||
k8s_yaml_with_ns(
|
k8s_yaml_with_ns(
|
||||||
secret_yaml_generic(
|
secret_yaml_generic(
|
||||||
"bridge-bigtable-key",
|
"bridge-bigtable-key",
|
||||||
|
@ -98,7 +105,19 @@ def build_node_yaml():
|
||||||
if container["name"] != "guardiand":
|
if container["name"] != "guardiand":
|
||||||
fail("container 0 is not guardiand")
|
fail("container 0 is not guardiand")
|
||||||
container["command"] += ["--devNumGuardians", str(num_guardians)]
|
container["command"] += ["--devNumGuardians", str(num_guardians)]
|
||||||
container["command"] += ["--bigTableGCPProject", gcpProject]
|
|
||||||
|
if explorer:
|
||||||
|
container["command"] += [
|
||||||
|
"--bigTablePersistenceEnabled",
|
||||||
|
"--bigTableInstanceName",
|
||||||
|
"wormhole",
|
||||||
|
"--bigTableTableName",
|
||||||
|
"v2Events",
|
||||||
|
"--bigTableKeyPath",
|
||||||
|
"/tmp/mounted-keys/bigtable-key.json",
|
||||||
|
"--bigTableGCPProject",
|
||||||
|
gcpProject,
|
||||||
|
]
|
||||||
|
|
||||||
return encode_yaml_stream(node_yaml)
|
return encode_yaml_stream(node_yaml)
|
||||||
|
|
||||||
|
@ -110,6 +129,7 @@ k8s_resource("guardian", resource_deps = ["proto-gen", "solana-devnet"], port_fo
|
||||||
port_forward(7071, name = "Public REST [:7071]"),
|
port_forward(7071, name = "Public REST [:7071]"),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if pyth:
|
||||||
docker_build(
|
docker_build(
|
||||||
ref = "pyth",
|
ref = "pyth",
|
||||||
context = ".",
|
context = ".",
|
||||||
|
@ -168,6 +188,7 @@ k8s_resource(
|
||||||
|
|
||||||
# pyth2wormhole client
|
# pyth2wormhole client
|
||||||
|
|
||||||
|
if pyth:
|
||||||
docker_build(
|
docker_build(
|
||||||
ref = "p2w-client",
|
ref = "p2w-client",
|
||||||
context = ".",
|
context = ".",
|
||||||
|
@ -180,9 +201,10 @@ docker_build(
|
||||||
|
|
||||||
k8s_yaml_with_ns("devnet/p2w-client.yaml")
|
k8s_yaml_with_ns("devnet/p2w-client.yaml")
|
||||||
|
|
||||||
k8s_resource("p2w-client",
|
k8s_resource(
|
||||||
|
"p2w-client",
|
||||||
resource_deps = ["solana-devnet", "pyth"],
|
resource_deps = ["solana-devnet", "pyth"],
|
||||||
port_forwards=[]
|
port_forwards = [],
|
||||||
)
|
)
|
||||||
|
|
||||||
# eth devnet
|
# eth devnet
|
||||||
|
@ -237,6 +259,7 @@ def build_cloud_function(container_name, go_func_name, path, builder):
|
||||||
[path],
|
[path],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if explorer:
|
||||||
build_cloud_function(
|
build_cloud_function(
|
||||||
container_name = "cloud-function-readrow",
|
container_name = "cloud-function-readrow",
|
||||||
go_func_name = "ReadRow",
|
go_func_name = "ReadRow",
|
||||||
|
|
|
@ -105,13 +105,6 @@ spec:
|
||||||
- /tmp/admin.sock
|
- /tmp/admin.sock
|
||||||
- --dataDir
|
- --dataDir
|
||||||
- /tmp/data
|
- /tmp/data
|
||||||
- --bigTablePersistenceEnabled
|
|
||||||
- --bigTableInstanceName
|
|
||||||
- wormhole
|
|
||||||
- --bigTableTableName
|
|
||||||
- v2Events
|
|
||||||
- --bigTableKeyPath
|
|
||||||
- /tmp/mounted-keys/bigtable-key.json
|
|
||||||
# - --logLevel=debug
|
# - --logLevel=debug
|
||||||
securityContext:
|
securityContext:
|
||||||
capabilities:
|
capabilities:
|
||||||
|
|
Loading…
Reference in New Issue