Skip to content

Commit

Permalink
localnet: add ping helpers for relayminers + logic to define supplier…
Browse files Browse the repository at this point in the history
…s based on localnet config
  • Loading branch information
eddyzags committed Nov 10, 2024
1 parent e0fb8cd commit fded44a
Show file tree
Hide file tree
Showing 11 changed files with 845 additions and 105 deletions.
825 changes: 748 additions & 77 deletions Makefile

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,8 @@ helm_resource(
actor_number = 0
for x in range(localnet_config["relayminers"]["count"]):
actor_number = actor_number + 1
helm_resource(
"relayminer" + str(actor_number),
chart_prefix + "relayminer",
flags=[

flags = [
"--values=./localnet/kubernetes/values-common.yaml",
"--values=./localnet/kubernetes/values-relayminer-common.yaml",
"--values=./localnet/kubernetes/values-relayminer-" + str(actor_number) + ".yaml",
Expand All @@ -262,6 +260,21 @@ for x in range(localnet_config["relayminers"]["count"]):
"--set=logLevel=" + str(localnet_config["relayminers"]["logs"]["level"]),
"--set=image.repository=poktrolld",
],
]

if localnet_config["rest"]["enabled"]:
flags.append("--values=./localnet/kubernetes/values-relayminer-" + str(actor_number) + "-rest" + ".yaml")

if localnet_config["ollama"]["enabled"]:
flags.append("--values=./localnet/kubernetes/values-relayminer-" + str(actor_number) + "-ollama" + ".yaml")

if localnet_config["rest"]["enabled"] and localnet_config["ollama"]["enabled"]:
flags.append("--values=./localnet/kubernetes/values-relayminer-" + str(actor_number) + "-all" + ".yaml")

helm_resource(
"relayminer" + str(actor_number),
chart_prefix + "relayminer",
flags=flags,
image_deps=["poktrolld"],
image_keys=[("image.repository", "image.tag")],
)
Expand All @@ -285,6 +298,7 @@ for x in range(localnet_config["relayminers"]["count"]):
# Use with pprof like this: `go tool pprof -http=:3333 http://localhost:6070/debug/pprof/goroutine`
str(6069 + actor_number)
+ ":6060", # Relayminer pprof port. relayminer1 - exposes 6070, relayminer2 exposes 6071, etc.
str(7000 + actor_number) + ":8081", # Relayminer ping port. relayminer1 - exposes 7001, relayminer2 exposes 7002, ect.
],
)

Expand Down
20 changes: 20 additions & 0 deletions localnet/kubernetes/values-relayminer-1-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
config:
suppliers:
- service_id: anvil
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer1
- service_id: rest
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://rest:10000/
publicly_exposed_endpoints:
- relayminer1
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer1
14 changes: 14 additions & 0 deletions localnet/kubernetes/values-relayminer-1-ollama.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config:
suppliers:
- service_id: anvil
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer1
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer1
14 changes: 14 additions & 0 deletions localnet/kubernetes/values-relayminer-1-rest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config:
suppliers:
- service_id: anvil
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer1
- service_id: rest
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://rest:10000/
publicly_exposed_endpoints:
- relayminer1
12 changes: 0 additions & 12 deletions localnet/kubernetes/values-relayminer-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,3 @@ config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer1
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer1
- service_id: rest
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://rest:10000/
publicly_exposed_endpoints:
- relayminer1
14 changes: 14 additions & 0 deletions localnet/kubernetes/values-relayminer-2-ollama.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config:
suppliers:
- service_id: anvil
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer2
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer2
6 changes: 0 additions & 6 deletions localnet/kubernetes/values-relayminer-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer2
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer2
14 changes: 14 additions & 0 deletions localnet/kubernetes/values-relayminer-3-ollama.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config:
suppliers:
- service_id: anvil
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer3
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer3
6 changes: 0 additions & 6 deletions localnet/kubernetes/values-relayminer-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ config:
backend_url: http://anvil:8547/
publicly_exposed_endpoints:
- relayminer3
- service_id: ollama
listen_url: http://0.0.0.0:8545
service_config:
backend_url: http://ollama:11434/
publicly_exposed_endpoints:
- relayminer3
3 changes: 3 additions & 0 deletions localnet/kubernetes/values-relayminer-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ config:
pprof:
enabled: true
addr: localhost:6060
ping:
enabled: true
addr: localhost:8081

0 comments on commit fded44a

Please sign in to comment.