mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
[Dashboard] Try to work around aiohttp 4.0.0 breaking changes (#19120)
This commit is contained in:
parent
a43193b9e5
commit
2d0355548e
5 changed files with 17 additions and 7 deletions
|
@ -11,6 +11,7 @@ import time
|
|||
import traceback
|
||||
|
||||
from grpc.experimental import aio as aiogrpc
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import ray
|
||||
import ray.dashboard.consts as dashboard_consts
|
||||
|
@ -143,8 +144,12 @@ class DashboardAgent(object):
|
|||
sys.exit(-1)
|
||||
|
||||
# Create a http session for all modules.
|
||||
self.http_session = aiohttp.ClientSession(
|
||||
loop=asyncio.get_event_loop())
|
||||
# aiohttp<4.0.0 uses a 'loop' variable, aiohttp>=4.0.0 doesn't anymore
|
||||
if LooseVersion(aiohttp.__version__) < LooseVersion("4.0.0"):
|
||||
self.http_session = aiohttp.ClientSession(
|
||||
loop=asyncio.get_event_loop())
|
||||
else:
|
||||
self.http_session = aiohttp.ClientSession()
|
||||
|
||||
# Start a grpc asyncio server.
|
||||
await self.server.start()
|
||||
|
|
|
@ -7,6 +7,7 @@ import ipaddress
|
|||
import threading
|
||||
|
||||
from grpc.experimental import aio as aiogrpc
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import ray._private.services
|
||||
import ray.dashboard.consts as dashboard_consts
|
||||
|
@ -171,8 +172,12 @@ class DashboardHead:
|
|||
sys.exit(-1)
|
||||
|
||||
# Create a http session for all modules.
|
||||
self.http_session = aiohttp.ClientSession(
|
||||
loop=asyncio.get_event_loop())
|
||||
# aiohttp<4.0.0 uses a 'loop' variable, aiohttp>=4.0.0 doesn't anymore
|
||||
if LooseVersion(aiohttp.__version__) < LooseVersion("4.0.0"):
|
||||
self.http_session = aiohttp.ClientSession(
|
||||
loop=asyncio.get_event_loop())
|
||||
else:
|
||||
self.http_session = aiohttp.ClientSession()
|
||||
|
||||
# Waiting for GCS is ready.
|
||||
self.aiogrpc_gcs_channel = await make_gcs_grpc_channel(
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# In short, if you change it here, PLEASE also change it in setup.py.
|
||||
#
|
||||
# setup.py install_requires
|
||||
aiohttp==3.7
|
||||
aiohttp>=3.7
|
||||
aioredis < 2
|
||||
click >= 7.0
|
||||
cloudpickle
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
aiohttp
|
||||
aiohttp>=3.7
|
||||
aiohttp_cors
|
||||
aioredis<2
|
||||
colorful
|
||||
|
|
|
@ -190,7 +190,7 @@ if setup_spec.type == SetupType.RAY:
|
|||
"fsspec",
|
||||
],
|
||||
"default": [
|
||||
"aiohttp",
|
||||
"aiohttp >= 3.7",
|
||||
"aiohttp_cors",
|
||||
"aioredis < 2",
|
||||
"colorful",
|
||||
|
|
Loading…
Add table
Reference in a new issue