xorbitsai / xoscar

Python actor framework for heterogeneous computing.
https://xoscar.dev
Apache License 2.0
89 stars 21 forks source link

Enable create_actor_pool to use elastic ip #95

Closed frostyplanet closed 1 month ago

frostyplanet commented 2 months ago

create_actor_pool: Add extra_conf option listen_elastic_ip

Usage:

        create_actor_pool(elastic_address,
            n_process=0,
            extra_conf={'listen_elastic_ip': True},
        )

While xinference worker serve on cloud elastic_ip, the address used in create_actor_pool() and create_actor both have to be the elastic ip, in order for ActorRef passing around RPC method to client, but we could only listen on 0.0.0.0. (Because the ip is not only valid outside the host)

Additional fixes:

  1. The previous PR #92 does not consider ucx address format: ucx://127:0.0.1:3456
  2. Fix some address.split() for ipv6 case because ipv6 contains multiple : in the ip part

Add cross unittests for ipv6 X listen_elastic_ip X ucx. The only missing part is ucx X ipv6, because ucx does not supoort ipv6 ISSUE: https://github.com/xorbitsai/xoscar/issues/96

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.03%. Comparing base (d6465c9) to head (0a5cdf8). Report is 7 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #95 +/- ## ========================================== - Coverage 88.97% 85.03% -3.95% ========================================== Files 48 54 +6 Lines 4038 4552 +514 Branches 770 831 +61 ========================================== + Hits 3593 3871 +278 - Misses 358 587 +229 - Partials 87 94 +7 ``` | [Flag](https://app.codecov.io/gh/xorbitsai/xoscar/pull/95/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xorbitsai) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/xorbitsai/xoscar/pull/95/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xorbitsai) | `84.86% <ø> (-3.95%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xorbitsai#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.