diff --git a/codalab/bin/ws_server.py b/codalab/bin/ws_server.py index 30da8df3f..583befc9f 100644 --- a/codalab/bin/ws_server.py +++ b/codalab/bin/ws_server.py @@ -1,4 +1,5 @@ -# Main entry point for CodaLab cl-ws-server. +# Main entry point to the CodaLab Websocket Server. +# The Websocket Server handles communication between the REST server and workers. import argparse import asyncio from collections import defaultdict diff --git a/codalab/worker/worker.py b/codalab/worker/worker.py index 4630edc6f..f1662f2ad 100644 --- a/codalab/worker/worker.py +++ b/codalab/worker/worker.py @@ -1,6 +1,5 @@ import asyncio import logging -import io import os import shutil from subprocess import PIPE, Popen @@ -140,9 +139,6 @@ def __init__( self.ws_server = ws_server - assert ( - num_coroutines > 0 and type(num_coroutines) is int - ), "num_coroutines must be a natural number." self.num_coroutines = num_coroutines self.runs = {} # type: Dict[str, RunState] @@ -852,7 +848,7 @@ def netcat_fn(): break total_data.append(data) s.close() - reply(None, {}, io.BytesIO(b''.join(total_data))) + reply(None, {}, b''.join(total_data)) except BundleServiceException: traceback.print_exc() except Exception as e: