-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RelayMiner]: add proxy.Ping(...)
capability to test connectivity between relay servers and backend URLs
#1037
base: main
Are you sure you want to change the base?
Changes from all commits
ac63426
4b36c18
f8465c1
2247aec
d6d51e3
90f437f
1c20aa2
6064831
3c07ffe
6088199
ffc2ef3
fbc9696
49f5e05
9abeb17
f399b8e
a5ae8f1
5c293da
794e1b4
bc157c0
fad5ce2
272cf7b
d50655b
fdb19a5
4862c15
340b828
120337c
62fc209
a2aef02
6854d12
70005e3
52016a0
8febff7
426333b
eb12baa
9796134
8b1e4e1
abb22d4
0a468b7
5c9e5f9
f9e22f9
d3ac840
30f05b9
48206b7
bdf6fd4
2c0f0c1
8e4cb1a
ec24891
257fb0a
b9711d8
3879bb1
0bb603d
b86f096
5d38bb8
c60b902
fa82001
56c4b0a
e92e5d9
b7dc7b1
a86a7c9
30b327d
fd80434
63647c5
97e8705
a96751d
83304f5
c49624c
3535314
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
bryanchriswhite marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,6 @@ config: | |
pprof: | ||
enabled: true | ||
addr: localhost:6060 | ||
ping: | ||
enabled: true | ||
addr: localhost:8081 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,6 @@ suppliers: | |
pprof: | ||
enabled: false | ||
addr: localhost:6060 | ||
ping: | ||
enabled: false | ||
addr: localhost:8082 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,6 @@ suppliers: | |
pprof: | ||
enabled: false | ||
addr: localhost:6070 | ||
ping: | ||
enabled: false | ||
addr: localhost:8081 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
######################## | ||
### Localnet Helpers ### | ||
######################## | ||
|
||
.PHONY: localnet_relayminer1_ping | ||
localnet_relayminer1_ping: | ||
@echo "Pinging relayminer 1..." | ||
@curl -X GET localhost:7001 || (echo "Failed to ping relayminer1. Make sure your localnet environment or the relayminer 1 pod is up and running"; exit 1) | ||
@echo "OK" | ||
|
||
.PHONY: localnet_relayminer2_ping | ||
localnet_relayminer2_ping: | ||
@echo "Pinging relayminer 2..." | ||
@curl -X GET localhost:7002 || (echo "Failed to ping relayminer2. Make sure your localnet environment or the relayminer 2 pod is up and running"; exit 1) | ||
@echo "OK" | ||
|
||
.PHONY: localnet_relayminer3_ping | ||
localnet_relayminer3_ping: | ||
@echo "Pinging relayminer 3..." | ||
@curl -X GET localhost:7003 || (echo "Failed to ping relayminer3. Make sure your localnet environment or the relayminer 3 pod is up and running"; exit 1) | ||
@echo "OK" |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -42,6 +42,11 @@ func ParseRelayMinerConfigs(configContent []byte) (*RelayMinerConfig, error) { | |||||||||||
Addr: yamlRelayMinerConfig.Pprof.Addr, | ||||||||||||
} | ||||||||||||
|
||||||||||||
relayMinerConfig.Ping = &RelayMinerPingConfig{ | ||||||||||||
Enabled: yamlRelayMinerConfig.Ping.Enabled, | ||||||||||||
Addr: yamlRelayMinerConfig.Ping.Addr, | ||||||||||||
} | ||||||||||||
Comment on lines
+45
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would then reduce:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on this comment, I assume that @red-0ne will make the change. |
||||||||||||
|
||||||||||||
// Hydrate the pocket node urls | ||||||||||||
if err := relayMinerConfig.HydratePocketNodeUrls(&yamlRelayMinerConfig.PocketNode); err != nil { | ||||||||||||
return nil, err | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this change intentionally persisted, and if so, how is it related to this feature?
I think this change should be reverted. My assumption is that this is the result of an older commit which was never reconciled completely with
main
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I wasn't clear in my previous comments.
Yes, this change was intentionally made to ensure the Ping safeguard at startup succeeds for the Relayminer with the localnet default configuration, and/or any custom localnet configuration in that regard (link to localnet default configuration in the main branch). In the default localnet configuration, the Ollama Kubernetes deployment is not applied (
ollama.enabled=false
). However, the relayminer configuration still referenced Ollama suppliers in its configuration files, even though the container wasn’t deployed (link to relayminer-1 configuration for localnet). With the newly introduced mechanism of the Ping safeguard at startup, this will cause the relayminer to fail continuously because the Ollama container isn't deployed.To solve this issue, I found a way to dynamically define the relayminer's configuration based on the localnet configuration by modifying the
poktrolld/Tiltfile
. Hence, those modifications.For
poktrolld
users that are deploying a Relayminer without relying on the localnet, they will have to make sure that theirconfig.suppliers[*].service_config.backend_url
are up and running and reachable before deploying a Relayminer.I disagree, they exists:
I cannot find that. Can you link me to the precise line in my fork that makes you think that please? 🙏🏾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddyzags thanks for the detailed response here! 🙌
I was referring to .yaml files referenced in this commit, but I also see that they're not referenced any more. I just didn't understand the rationale behind moving the config into the Tiltfile.
(@okdas @red-0ne thoughts?)
I was just pointing out that the config fields which you've removed from the relayminer configs correspond to the flags you've added in the Tiltfile. The point being, to question why should we prefer to provide the config via flags over the yaml file, which you answered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, Bryan; I am glad it was clear. Waiting for @okdas and @red-0ne feedback. I am open to suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddyzags This LGTM but #PUC in the code with your explanation related to
Ping safeguard
.You already have it written down anyhow :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note here: f710d48