diff --git a/.github/workflows/test_on_ray2.4.0.yml b/.github/workflows/test_on_ray2.4.0.yml new file mode 100644 index 0000000..11b0a3c --- /dev/null +++ b/.github/workflows/test_on_ray2.4.0.yml @@ -0,0 +1,38 @@ +name: test on ray2.4.0 + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + run-unit-tests: + timeout-minutes: 60 + runs-on: ubuntu-latest + container: docker.io/library/ubuntu:latest + + steps: + - uses: actions/checkout@v2 + + - name: Install basic dependencies + run: | + apt-get update + apt-get install -yq wget gcc g++ python3.9 zlib1g-dev zip libuv1.dev + apt-get install -yq pip + + - name: Install python dependencies + run: | + python3 -m pip install virtualenv + python3 -m virtualenv -p python3 py3 + . py3/bin/activate + which python + pip install pytest torch cloudpickle cryptography + pip install "protobuf<4.0" + pip install ray==2.4.0 + + - name: Build and test + run: | + . py3/bin/activate + pip install -e . -v + sh test.sh diff --git a/fed/_private/compatible_utils.py b/fed/_private/compatible_utils.py index c32fb51..04fe553 100644 --- a/fed/_private/compatible_utils.py +++ b/fed/_private/compatible_utils.py @@ -17,7 +17,6 @@ import fed._private.constants as fed_constants import ray.experimental.internal_kv as ray_internal_kv -from ray._private.gcs_utils import GcsClient from fed._private import constants @@ -102,6 +101,13 @@ def __init__(self) -> None: super().__init__() def initialize(self): + try: + from ray._private.gcs_utils import GcsClient + except ImportError: + # The GcsClient was moved to `ray._raylet` module in `ray-2.5.0`. + assert _compare_version_strings(ray.__version__, "2.4.0") + from ray._raylet import GcsClient + gcs_client = GcsClient( address=_get_gcs_address_from_ray_worker(), nums_reconnect_retry=10)