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

refactor: remove legacy code #393

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions lib/python/flame/channel_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@

from flame.backends import backend_provider
from flame.channel import Channel
from flame.common.constants import DEFAULT_RUN_ASYNC_WAIT_TIME, BackendEvent
from flame.common.constants import BackendEvent
from flame.common.util import background_thread_loop, run_async
from flame.config import Config
from flame.discovery_clients import discovery_client_provider
from flame.selectors import selector_provider

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -67,7 +66,6 @@ class ChannelManager(object):

_backend = None # default backend in case there is no per-channel backend
_backends = dict() # backend per channel
_discovery_client = None

def __new__(cls):
"""Create a singleton instance."""
Expand All @@ -85,13 +83,8 @@ def __call__(self, config: Config):

self._channels = {}

with background_thread_loop() as loop:
self._loop = loop

self._setup_backends()

self._discovery_client = discovery_client_provider.get(self._config.task)

atexit.register(self.cleanup)

def _setup_backends(self):
Expand Down Expand Up @@ -178,18 +171,7 @@ def leave(self, name):
"""Leave a channel."""
if not self.is_joined(name):
return

# TODO: reset_channel isn't implemented; the whole discovery module
# needs to be revisited.
coro = self._discovery_client.reset_channel(
self._job_id, name, self._role, self._backend.uid()
)

_, status = run_async(coro, self._loop, DEFAULT_RUN_ASYNC_WAIT_TIME)
if status:
del self._channels[name]

return status
# TODO: reset_channel isn't implemented yet

def get_by_tag(self, tag: str) -> Optional[Channel]:
"""Return a channel object that matches a given function tag."""
Expand Down
17 changes: 0 additions & 17 deletions lib/python/flame/discovery/__init__.py

This file was deleted.

124 changes: 0 additions & 124 deletions lib/python/flame/discovery/local_client.py

This file was deleted.

138 changes: 0 additions & 138 deletions lib/python/flame/discovery/local_server.py

This file was deleted.

33 changes: 0 additions & 33 deletions lib/python/flame/discovery_clients.py

This file was deleted.

2 changes: 0 additions & 2 deletions lib/python/flame/proto/protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#
# SPDX-License-Identifier: Apache-2.0


protoc -I=./ --python_out=./ ./registry_msg.proto
# To run the following command, grpcio-tools is needed.
# if it's not installed, run "pip install grpcio-tools"
python -m grpc_tools.protoc -I=./ --python_out=./ --grpc_python_out=./ ./backend_msg.proto
Loading