Skip to content
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

feat: add tcp endpoint for grpc channel #583

Merged
merged 10 commits into from
Jan 17, 2025
Merged

feat: add tcp endpoint for grpc channel #583

merged 10 commits into from
Jan 17, 2025

Conversation

jfonseca-aneo
Copy link
Contributor

@jfonseca-aneo jfonseca-aneo commented Jan 9, 2025

Motivation

Java does not support grpc communication between the worker and the agent over unix sockets, this PR adds the option to use a tcp socket instead.

Description

Enlarged the kestrel configuration options in the worker server so it also accepts to listen on a tcp socket.

Testing

Not applicable

Impact

Carry on similar logic on the server configuration on the Agent in Armonik.Core

Additional Information

Not applicable

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have thoroughly tested my modifications and added tests when necessary.
  • Tests pass locally and in the CI.
  • I have assessed the performance impact of my modifications.

@CLAassistant
Copy link

CLAassistant commented Jan 9, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Jan 9, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1482 1251 84% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 585b499 by action🐍

Copy link
Contributor

@aneojgurhem aneojgurhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to do something similar in Agent Program.cs in Core. I'd also try to factorize the code with the GrpcChannelProvider

packages/csharp/ArmoniK.Api.Worker/Utils/WorkerServer.cs Outdated Show resolved Hide resolved
packages/csharp/ArmoniK.Api.Worker/Utils/WorkerServer.cs Outdated Show resolved Hide resolved
- Factorize kestrel options definition in the GrpcChannelProvider
class
- Apply review suggestions
@ngruelaneo ngruelaneo merged commit a985732 into main Jan 17, 2025
63 checks passed
@ngruelaneo ngruelaneo deleted the jf/agent_tcp branch January 17, 2025 10:14
jfonseca-aneo added a commit to aneoconsulting/ArmoniK.Core that referenced this pull request Jan 20, 2025
# Motivation

Java does not support grpc communication between the worker and the
agent over unix sockets, this PR builds on the changes introduced in
aneoconsulting/ArmoniK.Api#583 to enable the
option to use a tcp socket instead.

# Description

Mimic the changes in
aneoconsulting/ArmoniK.Api#583 and enlarged the
kestrel configuration options in the `AgentHandler` such that it also
accepts to listen on a tcp socket. In addition this PR separates the
volumes used for shared data and unix socket. Before the PR both of them
where mounted on `\cache`, the updated mount point for shared data is
`\comm`.

# Testing

Terraform deployment and `just` file have been modified to take into
account a new variable `socket_type`, that can be set to either
`unixdomainsocket` or `tcp` so the deployment configures which socket
type should be employed accordingly. With these changes the same set of
tests that ran for unix sockets can be executed but using a tcp socket
instead .

# Impact

The desired life cycle behavior in a deployment with the whole
infrastructure is that the worker starts before the agent and stops
after it. This is currently enforced by checking the absence/existence
of the unix socket created by the agent. With the changes of this PR, in
the case of choosing a tcp socket for the connection, the unix socket is
not created. Hence, the infra should be adapted accordingly to guarantee
the desired worker/agent life cycle. One option is to transform the
worker container in Kubernetes POD into a sidecar container, but this
will require the direct use of Helm charts since the Kubernetes provider
we use for terraform does not support this yet.

# Additional Information

Not applicable

# Checklist

- [x] My code adheres to the coding and style guidelines of the project.
- [x] I have performed a self-review of my code.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have made corresponding changes to the documentation.
- [x] I have thoroughly tested my modifications and added tests when
necessary.
- [x] Tests pass locally and in the CI.
- [ ] I have assessed the performance impact of my modifications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants