mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -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
|
import traceback
|
||||||
|
|
||||||
from grpc.experimental import aio as aiogrpc
|
from grpc.experimental import aio as aiogrpc
|
||||||
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
import ray
|
import ray
|
||||||
import ray.dashboard.consts as dashboard_consts
|
import ray.dashboard.consts as dashboard_consts
|
||||||
|
@ -143,8 +144,12 @@ class DashboardAgent(object):
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
# Create a http session for all modules.
|
# Create a http session for all modules.
|
||||||
|
# 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(
|
self.http_session = aiohttp.ClientSession(
|
||||||
loop=asyncio.get_event_loop())
|
loop=asyncio.get_event_loop())
|
||||||
|
else:
|
||||||
|
self.http_session = aiohttp.ClientSession()
|
||||||
|
|
||||||
# Start a grpc asyncio server.
|
# Start a grpc asyncio server.
|
||||||
await self.server.start()
|
await self.server.start()
|
||||||
|
|
|
@ -7,6 +7,7 @@ import ipaddress
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from grpc.experimental import aio as aiogrpc
|
from grpc.experimental import aio as aiogrpc
|
||||||
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
import ray._private.services
|
import ray._private.services
|
||||||
import ray.dashboard.consts as dashboard_consts
|
import ray.dashboard.consts as dashboard_consts
|
||||||
|
@ -171,8 +172,12 @@ class DashboardHead:
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
# Create a http session for all modules.
|
# Create a http session for all modules.
|
||||||
|
# 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(
|
self.http_session = aiohttp.ClientSession(
|
||||||
loop=asyncio.get_event_loop())
|
loop=asyncio.get_event_loop())
|
||||||
|
else:
|
||||||
|
self.http_session = aiohttp.ClientSession()
|
||||||
|
|
||||||
# Waiting for GCS is ready.
|
# Waiting for GCS is ready.
|
||||||
self.aiogrpc_gcs_channel = await make_gcs_grpc_channel(
|
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.
|
# In short, if you change it here, PLEASE also change it in setup.py.
|
||||||
#
|
#
|
||||||
# setup.py install_requires
|
# setup.py install_requires
|
||||||
aiohttp==3.7
|
aiohttp>=3.7
|
||||||
aioredis < 2
|
aioredis < 2
|
||||||
click >= 7.0
|
click >= 7.0
|
||||||
cloudpickle
|
cloudpickle
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
aiohttp
|
aiohttp>=3.7
|
||||||
aiohttp_cors
|
aiohttp_cors
|
||||||
aioredis<2
|
aioredis<2
|
||||||
colorful
|
colorful
|
||||||
|
|
|
@ -190,7 +190,7 @@ if setup_spec.type == SetupType.RAY:
|
||||||
"fsspec",
|
"fsspec",
|
||||||
],
|
],
|
||||||
"default": [
|
"default": [
|
||||||
"aiohttp",
|
"aiohttp >= 3.7",
|
||||||
"aiohttp_cors",
|
"aiohttp_cors",
|
||||||
"aioredis < 2",
|
"aioredis < 2",
|
||||||
"colorful",
|
"colorful",
|
||||||
|
|
Loading…
Add table
Reference in a new issue