Skip to content

Commit

Permalink
add instructions for later
Browse files Browse the repository at this point in the history
  • Loading branch information
tremblerz committed Aug 15, 2024
1 parent cca0128 commit 1463894
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/communication/grpc/comm.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// To generate the gRPC code, run the following command:
// python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. comm.proto --pyi_out=.
syntax = "proto3";

service CommunicationServer {
Expand Down
9 changes: 9 additions & 0 deletions src/utils/communication/grpc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
from utils.communication.interface import CommunicationInterface


# TODO: Several changes needed to improve the quality of the code
# 1. We need to improve comm.proto and get rid of singletons like Rank, Port etc.
# 2. Some parts of the code are heavily nested and need to be refactored
# 3. Insert try-except blocks wherever communication is involved
# 4. Probably a good idea to move the Servicer class to a separate file
# 5. Not needed for benchmarking but for the system to be robust, we need to implement timeouts and fault tolerance
# 6. Peer_ids should be indexed by a unique identifier
# 7. Try to get rid of type: ignore as much as possible

def is_port_available(port: int) -> bool:
"""
Check if a port is available for use.
Expand Down

0 comments on commit 1463894

Please sign in to comment.