2020-10-31 04:42:18 -07:00
|
|
|
# This Tiltfile contains the deployment and build config for the Wormhole devnet.
|
|
|
|
#
|
|
|
|
# We use Buildkit cache mounts and careful layering to avoid unnecessary rebuilds - almost
|
|
|
|
# all source code changes result in small, incremental rebuilds. Dockerfiles are written such
|
|
|
|
# that, for example, changing the contract source code won't cause Solana itself to be rebuilt.
|
|
|
|
#
|
|
|
|
|
2021-07-20 13:33:47 -07:00
|
|
|
load("ext://namespace", "namespace_create", "namespace_inject")
|
2021-08-22 12:52:48 -07:00
|
|
|
load("ext://secret", "secret_yaml_generic")
|
|
|
|
|
|
|
|
allow_k8s_contexts("ci")
|
|
|
|
|
|
|
|
# Disable telemetry by default
|
|
|
|
analytics_settings(False)
|
2020-12-05 07:32:37 -08:00
|
|
|
|
2022-02-13 18:47:38 -08:00
|
|
|
# Moar updates (default is 3)
|
|
|
|
update_settings(max_parallel_updates=10)
|
|
|
|
|
2020-12-05 07:32:37 -08:00
|
|
|
# Runtime configuration
|
2021-08-22 12:52:48 -07:00
|
|
|
config.define_bool("ci", False, "We are running in CI")
|
2021-12-08 08:40:05 -08:00
|
|
|
config.define_bool("manual", False, "Set TRIGGER_MODE_MANUAL by default")
|
2020-12-05 07:32:37 -08:00
|
|
|
|
2020-08-19 05:23:00 -07:00
|
|
|
config.define_string("num", False, "Number of guardian nodes to run")
|
2020-12-05 07:32:37 -08:00
|
|
|
|
|
|
|
# You do not usually need to set this argument - this argument is for debugging only. If you do use a different
|
2021-07-21 10:04:04 -07:00
|
|
|
# namespace, note that the "wormhole" namespace is hardcoded in tests and don't forget specifying the argument
|
2020-12-05 07:32:37 -08:00
|
|
|
# when running "tilt down".
|
|
|
|
#
|
|
|
|
config.define_string("namespace", False, "Kubernetes namespace to use")
|
|
|
|
|
2021-08-23 23:01:00 -07:00
|
|
|
# These arguments will enable writing Guardian events to a cloud BigTable instance.
|
|
|
|
# Writing to a cloud BigTable is optional. These arguments are not required to run the devnet.
|
2021-07-07 02:39:48 -07:00
|
|
|
config.define_string("gcpProject", False, "GCP project ID for BigTable persistence")
|
|
|
|
config.define_string("bigTableKeyPath", False, "Path to BigTable json key file")
|
|
|
|
|
2021-12-02 08:41:33 -08:00
|
|
|
# When running Tilt on a server, this can be used to set the public hostname Tilt runs on
|
|
|
|
# for service links in the UI to work.
|
|
|
|
config.define_string("webHost", False, "Public hostname for port forwards")
|
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
# Components
|
2022-02-28 12:48:50 -08:00
|
|
|
config.define_bool("algorand", False, "Enable Algorand component")
|
|
|
|
config.define_bool("solana", False, "Enable Solana component")
|
2021-09-13 06:38:20 -07:00
|
|
|
config.define_bool("pyth", False, "Enable Pyth-to-Wormhole component")
|
|
|
|
config.define_bool("explorer", False, "Enable explorer component")
|
2021-10-26 03:02:59 -07:00
|
|
|
config.define_bool("bridge_ui", False, "Enable bridge UI component")
|
2021-12-13 06:40:06 -08:00
|
|
|
config.define_bool("e2e", False, "Enable E2E testing stack")
|
2022-02-08 00:55:10 -08:00
|
|
|
config.define_bool("ci_tests", False, "Enable tests runner component")
|
2022-02-11 20:01:11 -08:00
|
|
|
config.define_bool("bridge_ui_hot", False, "Enable hot loading bridge_ui")
|
2021-09-13 06:38:20 -07:00
|
|
|
|
2020-08-19 05:23:00 -07:00
|
|
|
cfg = config.parse()
|
2021-09-13 10:39:32 -07:00
|
|
|
num_guardians = int(cfg.get("num", "1"))
|
2020-12-05 07:32:37 -08:00
|
|
|
namespace = cfg.get("namespace", "wormhole")
|
2021-08-23 23:01:00 -07:00
|
|
|
gcpProject = cfg.get("gcpProject", "local-dev")
|
|
|
|
bigTableKeyPath = cfg.get("bigTableKeyPath", "./event_database/devnet_key.json")
|
2021-12-02 08:41:33 -08:00
|
|
|
webHost = cfg.get("webHost", "localhost")
|
2022-02-28 12:48:50 -08:00
|
|
|
algorand = cfg.get("algorand", True)
|
|
|
|
solana = cfg.get("solana", True)
|
2021-08-22 12:52:48 -07:00
|
|
|
ci = cfg.get("ci", False)
|
2021-09-13 06:38:20 -07:00
|
|
|
pyth = cfg.get("pyth", ci)
|
|
|
|
explorer = cfg.get("explorer", ci)
|
2021-10-26 03:02:59 -07:00
|
|
|
bridge_ui = cfg.get("bridge_ui", ci)
|
2021-12-13 06:40:06 -08:00
|
|
|
e2e = cfg.get("e2e", ci)
|
2022-02-08 00:55:10 -08:00
|
|
|
ci_tests = cfg.get("ci_tests", ci)
|
2020-12-05 07:32:37 -08:00
|
|
|
|
2022-02-11 20:01:11 -08:00
|
|
|
bridge_ui_hot = not ci
|
|
|
|
|
2021-12-08 08:40:05 -08:00
|
|
|
if cfg.get("manual", False):
|
|
|
|
trigger_mode = TRIGGER_MODE_MANUAL
|
|
|
|
else:
|
|
|
|
trigger_mode = TRIGGER_MODE_AUTO
|
|
|
|
|
2020-12-05 07:32:37 -08:00
|
|
|
# namespace
|
|
|
|
|
2021-08-22 12:52:48 -07:00
|
|
|
if not ci:
|
|
|
|
namespace_create(namespace)
|
2020-12-05 07:32:37 -08:00
|
|
|
|
|
|
|
def k8s_yaml_with_ns(objects):
|
|
|
|
return k8s_yaml(namespace_inject(objects, namespace))
|
2020-08-19 05:23:00 -07:00
|
|
|
|
2020-08-15 13:14:24 -07:00
|
|
|
# protos
|
|
|
|
|
2022-02-16 04:12:18 -08:00
|
|
|
proto_deps = ["./proto", "buf.yaml", "buf.gen.yaml"]
|
2021-07-30 15:12:28 -07:00
|
|
|
|
2020-08-15 13:14:24 -07:00
|
|
|
local_resource(
|
|
|
|
name = "proto-gen",
|
2021-07-30 15:12:28 -07:00
|
|
|
deps = proto_deps,
|
2021-08-26 03:56:10 -07:00
|
|
|
cmd = "tilt docker build -- --target go-export -f Dockerfile.proto -o type=local,dest=node .",
|
|
|
|
env = {"DOCKER_BUILDKIT": "1"},
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["protobuf"],
|
2022-02-13 18:47:38 -08:00
|
|
|
allow_parallel=True,
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2020-08-15 13:14:24 -07:00
|
|
|
)
|
|
|
|
|
2021-07-21 10:04:04 -07:00
|
|
|
local_resource(
|
|
|
|
name = "proto-gen-web",
|
2022-02-23 10:12:16 -08:00
|
|
|
deps = proto_deps + ["buf.gen.web.yaml"],
|
2021-07-30 15:12:28 -07:00
|
|
|
resource_deps = ["proto-gen"],
|
2021-08-26 03:56:10 -07:00
|
|
|
cmd = "tilt docker build -- --target node-export -f Dockerfile.proto -o type=local,dest=. .",
|
|
|
|
env = {"DOCKER_BUILDKIT": "1"},
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["protobuf"],
|
2022-02-13 18:47:38 -08:00
|
|
|
allow_parallel=True,
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-08-26 03:56:10 -07:00
|
|
|
)
|
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
if algorand:
|
|
|
|
local_resource(
|
|
|
|
name = "teal-gen",
|
|
|
|
deps = ["staging/algorand/teal"],
|
|
|
|
cmd = "tilt docker build -- --target teal-export -f Dockerfile.teal -o type=local,dest=. .",
|
|
|
|
env = {"DOCKER_BUILDKIT": "1"},
|
|
|
|
labels = ["algorand"],
|
|
|
|
allow_parallel=True,
|
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-12-22 08:22:04 -08:00
|
|
|
|
2021-08-26 03:56:10 -07:00
|
|
|
# wasm
|
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
if solana:
|
|
|
|
local_resource(
|
|
|
|
name = "wasm-gen",
|
|
|
|
deps = ["solana"],
|
|
|
|
dir = "solana",
|
|
|
|
cmd = "tilt docker build -- -f Dockerfile.wasm -o type=local,dest=.. .",
|
|
|
|
env = {"DOCKER_BUILDKIT": "1"},
|
|
|
|
labels = ["solana"],
|
|
|
|
allow_parallel=True,
|
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-07-21 10:04:04 -07:00
|
|
|
|
2021-08-30 07:19:00 -07:00
|
|
|
# node
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
if explorer:
|
|
|
|
k8s_yaml_with_ns(
|
|
|
|
secret_yaml_generic(
|
2021-09-21 09:08:07 -07:00
|
|
|
"node-bigtable-key",
|
2021-09-13 06:38:20 -07:00
|
|
|
from_file = "bigtable-key.json=" + bigTableKeyPath,
|
|
|
|
),
|
|
|
|
)
|
2021-07-07 02:39:48 -07:00
|
|
|
|
2020-08-15 13:14:24 -07:00
|
|
|
docker_build(
|
|
|
|
ref = "guardiand-image",
|
2021-08-26 01:35:09 -07:00
|
|
|
context = "node",
|
|
|
|
dockerfile = "node/Dockerfile",
|
2020-08-15 13:14:24 -07:00
|
|
|
)
|
|
|
|
|
2021-08-30 07:19:00 -07:00
|
|
|
def build_node_yaml():
|
|
|
|
node_yaml = read_yaml_stream("devnet/node.yaml")
|
2020-08-19 05:23:00 -07:00
|
|
|
|
2021-08-30 07:19:00 -07:00
|
|
|
for obj in node_yaml:
|
2020-08-20 09:56:35 -07:00
|
|
|
if obj["kind"] == "StatefulSet" and obj["metadata"]["name"] == "guardian":
|
|
|
|
obj["spec"]["replicas"] = num_guardians
|
|
|
|
container = obj["spec"]["template"]["spec"]["containers"][0]
|
|
|
|
if container["name"] != "guardiand":
|
2020-08-19 05:23:00 -07:00
|
|
|
fail("container 0 is not guardiand")
|
2020-10-28 14:41:38 -07:00
|
|
|
container["command"] += ["--devNumGuardians", str(num_guardians)]
|
2021-09-13 06:38:20 -07:00
|
|
|
|
|
|
|
if explorer:
|
|
|
|
container["command"] += [
|
|
|
|
"--bigTablePersistenceEnabled",
|
|
|
|
"--bigTableInstanceName",
|
|
|
|
"wormhole",
|
|
|
|
"--bigTableTableName",
|
|
|
|
"v2Events",
|
2021-11-04 02:00:52 -07:00
|
|
|
"--bigTableTopicName",
|
|
|
|
"new-vaa-devnet",
|
2021-09-13 06:38:20 -07:00
|
|
|
"--bigTableKeyPath",
|
|
|
|
"/tmp/mounted-keys/bigtable-key.json",
|
|
|
|
"--bigTableGCPProject",
|
|
|
|
gcpProject,
|
|
|
|
]
|
2020-08-19 05:23:00 -07:00
|
|
|
|
2021-08-30 07:19:00 -07:00
|
|
|
return encode_yaml_stream(node_yaml)
|
2020-08-19 05:23:00 -07:00
|
|
|
|
2021-08-30 07:19:00 -07:00
|
|
|
k8s_yaml_with_ns(build_node_yaml())
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
guardian_resource_deps = ["proto-gen", "eth-devnet", "eth-devnet2", "terra-terrad"]
|
|
|
|
if solana:
|
|
|
|
guardian_resource_deps = guardian_resource_deps + ["solana-devnet"]
|
|
|
|
|
2021-12-08 08:40:05 -08:00
|
|
|
k8s_resource(
|
|
|
|
"guardian",
|
2022-02-28 12:48:50 -08:00
|
|
|
resource_deps = guardian_resource_deps,
|
2021-12-08 08:40:05 -08:00
|
|
|
port_forwards = [
|
|
|
|
port_forward(6060, name = "Debug/Status Server [:6060]", host = webHost),
|
|
|
|
port_forward(7070, name = "Public gRPC [:7070]", host = webHost),
|
|
|
|
port_forward(7071, name = "Public REST [:7071]", host = webHost),
|
|
|
|
port_forward(2345, name = "Debugger [:2345]", host = webHost),
|
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["guardian"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2021-12-02 16:02:32 -08:00
|
|
|
# spy
|
|
|
|
k8s_yaml_with_ns("devnet/spy.yaml")
|
|
|
|
|
2021-12-08 08:40:05 -08:00
|
|
|
k8s_resource(
|
|
|
|
"spy",
|
|
|
|
resource_deps = ["proto-gen", "guardian"],
|
|
|
|
port_forwards = [
|
|
|
|
port_forward(6061, container_port = 6060, name = "Debug/Status Server [:6061]", host = webHost),
|
|
|
|
port_forward(7072, name = "Spy gRPC [:7072]", host = webHost),
|
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["guardian"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-12-02 16:02:32 -08:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
if solana:
|
2020-08-15 13:14:24 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
# solana client cli (used for devnet setup)
|
2020-08-15 14:54:44 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
docker_build(
|
|
|
|
ref = "bridge-client",
|
|
|
|
context = ".",
|
|
|
|
only = ["./proto", "./solana", "./clients"],
|
|
|
|
dockerfile = "Dockerfile.client",
|
|
|
|
# Ignore target folders from local (non-container) development.
|
|
|
|
ignore = ["./solana/*/target"],
|
|
|
|
)
|
2020-08-20 09:56:26 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
# solana smart contract
|
|
|
|
|
|
|
|
docker_build(
|
|
|
|
ref = "solana-contract",
|
|
|
|
context = "solana",
|
|
|
|
dockerfile = "solana/Dockerfile",
|
|
|
|
)
|
2020-08-20 09:56:26 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
# solana local devnet
|
2020-08-15 14:54:44 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
k8s_yaml_with_ns("devnet/solana-devnet.yaml")
|
2020-08-15 14:54:44 -07:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
k8s_resource(
|
|
|
|
"solana-devnet",
|
|
|
|
port_forwards = [
|
|
|
|
port_forward(8899, name = "Solana RPC [:8899]", host = webHost),
|
|
|
|
port_forward(8900, name = "Solana WS [:8900]", host = webHost),
|
|
|
|
port_forward(9000, name = "Solana PubSub [:9000]", host = webHost),
|
|
|
|
],
|
|
|
|
labels = ["solana"],
|
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2020-08-15 16:38:10 -07:00
|
|
|
|
|
|
|
# eth devnet
|
|
|
|
|
|
|
|
docker_build(
|
|
|
|
ref = "eth-node",
|
2020-08-16 03:10:03 -07:00
|
|
|
context = "./ethereum",
|
|
|
|
dockerfile = "./ethereum/Dockerfile",
|
2020-08-16 02:17:35 -07:00
|
|
|
|
2020-08-16 03:10:03 -07:00
|
|
|
# ignore local node_modules (in case they're present)
|
|
|
|
ignore = ["./ethereum/node_modules"],
|
2020-08-17 07:31:48 -07:00
|
|
|
|
|
|
|
# sync external scripts for incremental development
|
|
|
|
# (everything else needs to be restarted from scratch for determinism)
|
|
|
|
#
|
|
|
|
# This relies on --update-mode=exec to work properly with a non-root user.
|
|
|
|
# https://github.com/tilt-dev/tilt/issues/3708
|
|
|
|
live_update = [
|
|
|
|
sync("./ethereum/src", "/home/node/app/src"),
|
|
|
|
],
|
2020-08-15 16:38:10 -07:00
|
|
|
)
|
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
if solana and pyth:
|
2021-09-14 06:40:05 -07:00
|
|
|
# pyth autopublisher
|
|
|
|
docker_build(
|
|
|
|
ref = "pyth",
|
|
|
|
context = ".",
|
|
|
|
dockerfile = "third_party/pyth/Dockerfile.pyth",
|
|
|
|
)
|
|
|
|
k8s_yaml_with_ns("./devnet/pyth.yaml")
|
|
|
|
|
2022-02-13 12:26:07 -08:00
|
|
|
k8s_resource(
|
|
|
|
"pyth",
|
|
|
|
resource_deps = ["solana-devnet"],
|
|
|
|
labels = ["solana"],
|
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-09-14 06:40:05 -07:00
|
|
|
|
|
|
|
# pyth2wormhole client autoattester
|
|
|
|
docker_build(
|
2021-10-28 04:48:43 -07:00
|
|
|
ref = "p2w-attest",
|
2021-09-14 06:40:05 -07:00
|
|
|
context = ".",
|
|
|
|
only = ["./solana", "./third_party"],
|
2021-10-28 04:48:43 -07:00
|
|
|
dockerfile = "./third_party/pyth/Dockerfile.p2w-attest",
|
2021-09-14 06:40:05 -07:00
|
|
|
ignore = ["./solana/*/target"],
|
|
|
|
)
|
|
|
|
|
2022-02-23 10:12:16 -08:00
|
|
|
# Automatic pyth2wormhole relay, showcasing p2w-sdk
|
|
|
|
docker_build(
|
|
|
|
ref = "p2w-relay",
|
|
|
|
context = ".",
|
|
|
|
dockerfile = "./third_party/pyth/p2w-relay/Dockerfile",
|
|
|
|
)
|
|
|
|
|
2021-10-28 04:48:43 -07:00
|
|
|
k8s_yaml_with_ns("devnet/p2w-attest.yaml")
|
2021-09-14 06:40:05 -07:00
|
|
|
k8s_resource(
|
2021-10-28 04:48:43 -07:00
|
|
|
"p2w-attest",
|
|
|
|
resource_deps = ["solana-devnet", "pyth", "guardian"],
|
2021-09-14 06:40:05 -07:00
|
|
|
port_forwards = [],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["solana"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-09-14 06:40:05 -07:00
|
|
|
)
|
|
|
|
|
2022-02-23 10:12:16 -08:00
|
|
|
k8s_yaml_with_ns("devnet/p2w-relay.yaml")
|
|
|
|
k8s_resource(
|
|
|
|
"p2w-relay",
|
|
|
|
resource_deps = ["solana-devnet", "eth-devnet", "pyth", "guardian", "p2w-attest", "proto-gen-web", "wasm-gen"],
|
|
|
|
port_forwards = [],
|
|
|
|
)
|
|
|
|
|
2020-12-05 07:32:37 -08:00
|
|
|
k8s_yaml_with_ns("devnet/eth-devnet.yaml")
|
2020-08-15 16:38:10 -07:00
|
|
|
|
2021-12-08 08:40:05 -08:00
|
|
|
k8s_resource(
|
|
|
|
"eth-devnet",
|
|
|
|
port_forwards = [
|
|
|
|
port_forward(8545, name = "Ganache RPC [:8545]", host = webHost),
|
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["evm"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2020-11-10 10:39:32 -08:00
|
|
|
|
2021-12-08 08:40:05 -08:00
|
|
|
k8s_resource(
|
|
|
|
"eth-devnet2",
|
|
|
|
port_forwards = [
|
|
|
|
port_forward(8546, name = "Ganache RPC [:8546]", host = webHost),
|
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["evm"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-09-28 02:26:31 -07:00
|
|
|
|
2021-10-26 03:02:59 -07:00
|
|
|
if bridge_ui:
|
2022-02-11 20:01:11 -08:00
|
|
|
entrypoint = "npm run build && /app/node_modules/.bin/serve -s build -n"
|
|
|
|
live_update = []
|
|
|
|
if bridge_ui_hot:
|
|
|
|
entrypoint = "npm start"
|
|
|
|
live_update = [
|
|
|
|
sync("./bridge_ui/public", "/app/public"),
|
|
|
|
sync("./bridge_ui/src", "/app/src"),
|
|
|
|
]
|
|
|
|
|
2021-10-26 03:02:59 -07:00
|
|
|
docker_build(
|
|
|
|
ref = "bridge-ui",
|
|
|
|
context = ".",
|
2022-02-08 00:55:10 -08:00
|
|
|
only = ["./bridge_ui"],
|
2021-10-26 03:02:59 -07:00
|
|
|
dockerfile = "bridge_ui/Dockerfile",
|
2022-02-11 20:01:11 -08:00
|
|
|
entrypoint = entrypoint,
|
|
|
|
live_update = live_update,
|
2021-10-26 03:02:59 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
k8s_yaml_with_ns("devnet/bridge-ui.yaml")
|
|
|
|
|
|
|
|
k8s_resource(
|
|
|
|
"bridge-ui",
|
2022-02-08 00:55:10 -08:00
|
|
|
resource_deps = [],
|
2021-10-26 03:02:59 -07:00
|
|
|
port_forwards = [
|
2021-12-02 08:41:33 -08:00
|
|
|
port_forward(3000, name = "Bridge UI [:3000]", host = webHost),
|
2021-10-26 03:02:59 -07:00
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["portal"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-10-26 03:02:59 -07:00
|
|
|
)
|
|
|
|
|
2022-02-08 00:55:10 -08:00
|
|
|
if ci_tests:
|
|
|
|
docker_build(
|
|
|
|
ref = "tests-image",
|
|
|
|
context = ".",
|
|
|
|
dockerfile = "testing/Dockerfile.tests",
|
|
|
|
only = [],
|
|
|
|
live_update = [
|
|
|
|
sync("./spydk/js/src", "/app/spydk/js/src"),
|
|
|
|
sync("./sdk/js/src", "/app/sdk/js/src"),
|
|
|
|
sync("./testing", "/app/testing"),
|
|
|
|
sync("./bridge_ui/src", "/app/bridge_ui/src"),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
k8s_yaml_with_ns("devnet/tests.yaml")
|
|
|
|
|
|
|
|
k8s_resource(
|
|
|
|
"ci-tests",
|
2022-02-13 18:47:38 -08:00
|
|
|
resource_deps = ["proto-gen-web", "wasm-gen", "eth-devnet", "eth-devnet2", "terra-terrad", "terra-fcd", "solana-devnet", "spy", "guardian"],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["ci"],
|
2022-02-08 00:55:10 -08:00
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
|
|
|
|
2021-12-08 16:32:16 -08:00
|
|
|
# algorand
|
2022-02-28 12:48:50 -08:00
|
|
|
if algorand:
|
|
|
|
k8s_yaml_with_ns("devnet/algorand.yaml")
|
2021-12-08 16:32:16 -08:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
docker_build(
|
|
|
|
ref = "algorand",
|
|
|
|
context = "third_party/algorand",
|
|
|
|
dockerfile = "third_party/algorand/Dockerfile",
|
|
|
|
)
|
2021-12-08 16:32:16 -08:00
|
|
|
|
2022-02-28 12:48:50 -08:00
|
|
|
k8s_resource(
|
|
|
|
"algorand",
|
|
|
|
resource_deps = ["teal-gen"],
|
|
|
|
port_forwards = [
|
|
|
|
port_forward(4001, name = "Algorand RPC [:4001]", host = webHost),
|
|
|
|
port_forward(4002, name = "Algorand KMD [:4002]", host = webHost),
|
|
|
|
],
|
|
|
|
labels = ["algorand"],
|
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-12-08 16:32:16 -08:00
|
|
|
|
2021-12-12 16:45:49 -08:00
|
|
|
# e2e
|
2021-12-13 06:40:06 -08:00
|
|
|
if e2e:
|
|
|
|
k8s_yaml_with_ns("devnet/e2e.yaml")
|
2021-12-12 16:45:49 -08:00
|
|
|
|
2021-12-13 06:40:06 -08:00
|
|
|
docker_build(
|
|
|
|
ref = "e2e",
|
|
|
|
context = "e2e",
|
|
|
|
dockerfile = "e2e/Dockerfile",
|
|
|
|
network = "host",
|
|
|
|
)
|
2021-12-12 16:45:49 -08:00
|
|
|
|
2021-12-13 06:40:06 -08:00
|
|
|
k8s_resource(
|
|
|
|
"e2e",
|
|
|
|
port_forwards = [
|
|
|
|
port_forward(6080, name = "VNC [:6080]", host = webHost, link_path = "/vnc_auto.html"),
|
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["ci"],
|
2021-12-13 06:40:06 -08:00
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
2021-12-12 16:45:49 -08:00
|
|
|
|
2021-08-23 23:01:00 -07:00
|
|
|
# bigtable
|
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
if explorer:
|
2021-08-26 03:09:03 -07:00
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
k8s_yaml_with_ns("devnet/bigtable.yaml")
|
2021-08-23 23:01:00 -07:00
|
|
|
|
2021-12-02 16:02:32 -08:00
|
|
|
k8s_resource(
|
|
|
|
"bigtable-emulator",
|
2021-12-02 08:41:33 -08:00
|
|
|
port_forwards = [port_forward(8086, name = "BigTable clients [:8086]", host = webHost)],
|
2021-09-21 09:08:07 -07:00
|
|
|
labels = ["explorer"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-09-21 09:08:07 -07:00
|
|
|
)
|
|
|
|
|
2021-11-04 02:00:52 -07:00
|
|
|
k8s_resource("pubsub-emulator",
|
|
|
|
port_forwards = [port_forward(8085, name = "PubSub listeners [:8085]")],
|
|
|
|
labels = ["explorer"],
|
|
|
|
)
|
|
|
|
|
2021-11-04 01:43:43 -07:00
|
|
|
docker_build(
|
|
|
|
ref = "cloud-functions",
|
|
|
|
context = "./event_database/cloud_functions",
|
|
|
|
dockerfile = "./event_database/cloud_functions/Dockerfile",
|
|
|
|
live_update = [
|
|
|
|
sync("./event_database/cloud_functions", "/app"),
|
|
|
|
],
|
2021-09-21 09:08:07 -07:00
|
|
|
)
|
2021-09-13 06:38:20 -07:00
|
|
|
k8s_resource(
|
2021-11-04 01:43:43 -07:00
|
|
|
"cloud-functions",
|
2021-11-04 02:00:52 -07:00
|
|
|
resource_deps = ["proto-gen", "bigtable-emulator", "pubsub-emulator"],
|
2021-11-04 01:43:43 -07:00
|
|
|
port_forwards = [port_forward(8090, name = "Cloud Functions [:8090]")],
|
2021-12-02 16:02:32 -08:00
|
|
|
labels = ["explorer"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-09-13 06:38:20 -07:00
|
|
|
)
|
2021-08-23 23:01:00 -07:00
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
# explorer web app
|
|
|
|
docker_build(
|
|
|
|
ref = "explorer",
|
|
|
|
context = "./explorer",
|
|
|
|
dockerfile = "./explorer/Dockerfile",
|
|
|
|
ignore = ["./explorer/node_modules"],
|
|
|
|
live_update = [
|
|
|
|
sync("./explorer/src", "/home/node/app/src"),
|
|
|
|
sync("./explorer/public", "/home/node/app/public"),
|
|
|
|
],
|
|
|
|
)
|
2021-05-25 00:51:49 -07:00
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
k8s_yaml_with_ns("devnet/explorer.yaml")
|
2021-05-25 00:51:49 -07:00
|
|
|
|
2021-09-13 06:38:20 -07:00
|
|
|
k8s_resource(
|
|
|
|
"explorer",
|
|
|
|
port_forwards = [
|
2021-12-02 08:41:33 -08:00
|
|
|
port_forward(8001, name = "Explorer Web UI [:8001]", host = webHost),
|
2021-09-13 06:38:20 -07:00
|
|
|
],
|
2021-09-21 09:08:07 -07:00
|
|
|
labels = ["explorer"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-09-13 06:38:20 -07:00
|
|
|
)
|
2021-05-25 00:51:49 -07:00
|
|
|
|
2020-11-16 04:28:07 -08:00
|
|
|
# terra devnet
|
|
|
|
|
2020-11-30 03:34:31 -08:00
|
|
|
docker_build(
|
|
|
|
ref = "terra-image",
|
2020-12-03 05:37:23 -08:00
|
|
|
context = "./terra/devnet",
|
|
|
|
dockerfile = "terra/devnet/Dockerfile",
|
|
|
|
)
|
|
|
|
|
|
|
|
docker_build(
|
|
|
|
ref = "terra-contracts",
|
|
|
|
context = "./terra",
|
|
|
|
dockerfile = "./terra/Dockerfile",
|
2020-11-30 03:34:31 -08:00
|
|
|
)
|
|
|
|
|
2020-12-05 07:32:37 -08:00
|
|
|
k8s_yaml_with_ns("devnet/terra-devnet.yaml")
|
2020-11-16 04:28:07 -08:00
|
|
|
|
2020-11-27 16:33:57 -08:00
|
|
|
k8s_resource(
|
|
|
|
"terra-terrad",
|
2021-10-04 04:52:11 -07:00
|
|
|
port_forwards = [
|
2021-12-02 08:41:33 -08:00
|
|
|
port_forward(26657, name = "Terra RPC [:26657]", host = webHost),
|
|
|
|
port_forward(1317, name = "Terra LCD [:1317]", host = webHost),
|
2021-10-04 04:52:11 -07:00
|
|
|
],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["terra"],
|
|
|
|
trigger_mode = trigger_mode,
|
|
|
|
)
|
|
|
|
|
|
|
|
k8s_resource(
|
|
|
|
"terra-postgres",
|
|
|
|
labels = ["terra"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2020-11-27 16:33:57 -08:00
|
|
|
)
|
2021-07-27 04:46:36 -07:00
|
|
|
|
|
|
|
k8s_resource(
|
|
|
|
"terra-fcd",
|
2022-02-13 12:26:07 -08:00
|
|
|
resource_deps = ["terra-terrad", "terra-postgres"],
|
2021-12-02 08:41:33 -08:00
|
|
|
port_forwards = [port_forward(3060, name = "Terra FCD [:3060]", host = webHost)],
|
2022-02-13 12:26:07 -08:00
|
|
|
labels = ["terra"],
|
2021-12-08 08:40:05 -08:00
|
|
|
trigger_mode = trigger_mode,
|
2021-07-30 15:12:28 -07:00
|
|
|
)
|