mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[core] remove aiohttp dependencies (#17181)
This commit is contained in:
parent
dad8db46e1
commit
e881c6cff8
7 changed files with 25 additions and 9 deletions
|
@ -310,6 +310,9 @@ install_dependencies() {
|
|||
fi
|
||||
fi
|
||||
|
||||
# Default requirements
|
||||
pip install -r "${WORKSPACE_DIR}"/python/requirements/requirements_default.txt
|
||||
|
||||
if [ "${LINT-}" = 1 ]; then
|
||||
install_linters
|
||||
# readthedocs has an antiquated build env.
|
||||
|
|
|
@ -14,6 +14,7 @@ import aiohttp
|
|||
import aiohttp.web
|
||||
import aiohttp_cors
|
||||
from aiohttp import hdrs
|
||||
|
||||
from grpc.experimental import aio as aiogrpc
|
||||
|
||||
import ray
|
||||
|
|
|
@ -2,8 +2,16 @@ import sys
|
|||
|
||||
try:
|
||||
import aiohttp.web
|
||||
import aiohttp
|
||||
except ImportError:
|
||||
import aiohttp_cors # noqa: F401
|
||||
print("The dashboard requires aiohttp to run.")
|
||||
import aioredis # noqa: F401
|
||||
except (ModuleNotFoundError, ImportError):
|
||||
print("Not all Ray Dashboard dependencies were found. "
|
||||
"In Ray 1.4+, the Ray CLI, autoscaler, and dashboard will "
|
||||
"only be usable via `pip install 'ray[default]'`. Please "
|
||||
"update your install command.")
|
||||
# Set an exit code different from throwing an exception.
|
||||
sys.exit(2)
|
||||
|
||||
|
|
|
@ -1175,11 +1175,15 @@ def start_dashboard(require_dashboard,
|
|||
# Make sure the process can start.
|
||||
try:
|
||||
import aiohttp # noqa: F401
|
||||
import aioredis # noqa: F401
|
||||
import aiohttp_cors # noqa: F401
|
||||
import grpc # noqa: F401
|
||||
except ImportError:
|
||||
warning_message = (
|
||||
"Missing dependencies for dashboard. Please run "
|
||||
"pip install aiohttp grpcio'.")
|
||||
"Not all Ray Dashboard dependencies were found. "
|
||||
"In Ray 1.4+, the Ray CLI, autoscaler, and dashboard will "
|
||||
"only be usable via `pip install 'ray[default]'`. Please "
|
||||
"update your install command.")
|
||||
raise ImportError(warning_message)
|
||||
|
||||
# Start the dashboard process.
|
||||
|
|
|
@ -9,7 +9,6 @@ aiohttp==3.7
|
|||
aioredis
|
||||
click >= 7.0
|
||||
cloudpickle
|
||||
colorful
|
||||
filelock
|
||||
gpustat
|
||||
grpcio >= 1.28.1
|
||||
|
|
4
python/requirements/requirements_default.txt
Normal file
4
python/requirements/requirements_default.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
aiohttp
|
||||
aiohttp_cors
|
||||
aioredis
|
||||
colorful
|
|
@ -149,6 +149,9 @@ ray_files += [
|
|||
if setup_spec.type == SetupType.RAY:
|
||||
setup_spec.extras = {
|
||||
"default": [
|
||||
"aiohttp", # noqa
|
||||
"aiohttp_cors", # noqa
|
||||
"aioredis", # noqa
|
||||
"colorful", # noqa
|
||||
"py-spy >= 0.2.0", # noqa
|
||||
"jsonschema", # noqa
|
||||
|
@ -184,12 +187,6 @@ if setup_spec.type == SetupType.RAY:
|
|||
# the change in the matching section of requirements/requirements.txt
|
||||
if setup_spec.type == SetupType.RAY:
|
||||
setup_spec.install_requires = [
|
||||
# TODO(alex) Pin the version once this PR is
|
||||
# included in the stable release.
|
||||
# https://github.com/aio-libs/aiohttp/pull/4556#issuecomment-679228562
|
||||
"aiohttp",
|
||||
"aiohttp_cors",
|
||||
"aioredis",
|
||||
"attrs",
|
||||
"click >= 7.0",
|
||||
"dataclasses; python_version < '3.7'",
|
||||
|
|
Loading…
Add table
Reference in a new issue