-
Notifications
You must be signed in to change notification settings - Fork 27
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
CORE-17476 Modifying helm charts to create ClusterIP services for workers, passing to FlowWorker #4777
Conversation
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.
I suspect the port isn't configurable, and if not, making it so would not be part of this PR. The other suggestions are just stylistic.
@@ -5,5 +5,5 @@ internal const val HTTP_SERVICE_UNAVAILABLE_CODE = 503 | |||
internal const val HTTP_HEALTH_ROUTE = "/isHealthy" | |||
internal const val HTTP_METRICS_ROUTE = "/metrics" | |||
internal const val HTTP_STATUS_ROUTE = "/status" | |||
internal const val WORKER_SERVER_PORT = 7000 | |||
internal const val WORKER_SERVER_PORT = 7000 // Note: This variable is defined in charts/corda-lib/templates/_helpers.kt:622 |
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.
This is really the definition of the port. The Helm chart variable tells the rest of the world what this value is. I don't know whether this port is configurable on a worker but, if it is, the Helm chart could pass the value in and then be sure that everything ties up nicely (even if the value we pass in is still 7000!).
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.
It defaults to 7000, but you can override it using the -p
param:
Line 37 in f45367e
names = ["-p", "--worker-server-port"], |
(just FYI)
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.
Good to know! 🤔 I'll remove the comment then, as it's not adding any clarity to the code 😅
charts/corda/templates/workers.yaml
Outdated
{{- include "corda.worker" ( list $ .Values.workers.flow "flow" | ||
( dict "stateManagerDbAccess" true ) | ||
( dict "stateManagerDbAccess" true "additionalWorkerArgs" $args ) |
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.
It probably doesn't make much difference while the flow worker is the only worker doing this but I'd still be tempted to pass servicesAccessed
in the dictionary and then do the processing of that within corda.worker
rather than here.
charts/corda/templates/workers.yaml
Outdated
{{- $endpoint := include "corda.getWorkerEndpoint" (dict "context" $ "worker" $worker) }} | ||
{{- $args = append $args (printf "--endpoint=%s" $endpoint) }} |
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.
nit: just for readability, I'd be tempted to indent these lines to indicate that they're nested within the range
(the white space being eaten by {{-
anyway).
@@ -5,5 +5,5 @@ internal const val HTTP_SERVICE_UNAVAILABLE_CODE = 503 | |||
internal const val HTTP_HEALTH_ROUTE = "/isHealthy" | |||
internal const val HTTP_METRICS_ROUTE = "/metrics" | |||
internal const val HTTP_STATUS_ROUTE = "/status" | |||
internal const val WORKER_SERVER_PORT = 7000 | |||
internal const val WORKER_SERVER_PORT = 7000 // Note: This variable is defined in charts/corda-lib/templates/_helpers.kt:622 |
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.
It defaults to 7000, but you can override it using the -p
param:
Line 37 in f45367e
names = ["-p", "--worker-server-port"], |
(just FYI)
{{/* | ||
The port which should be used to connect to Corda worker instances | ||
*/}} | ||
{{- define "worker.port" -}} |
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.
Bit nitpicky (and don't propose it needs to be changed), but I guess technically this is the LB port, not the worker port?
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.
Technically its both the port for the worker and for the load balancer; the LB forwards port :7000 to port :7000 on the respective worker. I'm on the fence about it, but I figure worker.port
makes the overall intent more clear.
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.
oh - but now you've highlighted it again, I realise this breaks the naming convention for functions. They are all corda.
something. This is because the functions are in a global namespace when charts are combined together.
|
||
@Option(names = ["--endpoint"], description = ["Internal RPC endpoints for Corda workers"], required = true) |
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.
Nitpick: can we update the description to HTTP endpoints instead, as that what they are?. Just trying to avoid weeks of works in the future trying to refactor from RPC to HTTP again (it already happened for the old rpc-worker
)?.
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.
👍
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.
LGTM
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.
LGTM
…kers, passing endpoints to FlowWorker
869fdac
to
702ae56
Compare
9072689
Jenkins build for PR 4777 build 7 Build Successful: |
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.
LGTM
As part of the Corda topology redesign, communication between the flow engine and Corda workers is moving from a Kafka message bus to synchronous RPC calls. In order to support this, we're adding a load balancing layer (Here, a
ClusterIP
service per worker) which will expose a single endpoint which distributes calls across all worker instances.The endpoint for this ClusterIP service is now being passed into the additional startup args of the
FlowWorker
; a future PR will use these to define a routing component for external messages.Related PRs: