Skip to content

Commit 3ad8370

Browse files
jvstmepranitnaik43
authored andcommitted
Optimize dstack-gateway installation time (dstackai#2146)
Add the `dstack[gateway]` extra, so that the gateway doesn't install `dstack[server]`. `dstack[gateway]` still has some unnecessary dependencies from BASE_DEPS, but the current optimization is enough for now. Also increase the gateway installation timeout just in case.
1 parent 6f30757 commit 3ad8370

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

gateway/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requires-python = ">=3.10"
1111
dynamic = ["version"]
1212
dependencies = [
1313
# release builds of dstack-gateway depend on a PyPI version of dstack instead
14-
"dstack[server] @ https://github.com/dstackai/dstack/archive/refs/heads/master.zip",
14+
"dstack[gateway] @ https://github.com/dstackai/dstack/archive/refs/heads/master.zip",
1515
]
1616

1717
[tool.setuptools.package-data]

setup.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ def get_long_description():
5151
"gpuhunt>=0.0.17,<0.1.0",
5252
]
5353

54-
SERVER_DEPS = [
54+
GATEWAY_AND_SERVER_COMMON_DEPS = [
5555
"fastapi",
5656
"starlette>=0.26.0",
5757
"uvicorn",
58+
"aiorwlock",
59+
"aiocache",
60+
"httpx",
61+
"jinja2",
62+
]
63+
64+
SERVER_DEPS = GATEWAY_AND_SERVER_COMMON_DEPS + [
5865
"watchfiles",
5966
"sqlalchemy[asyncio]>=2.0.0",
6067
"sqlalchemy_utils>=0.40.0",
@@ -66,12 +73,8 @@ def get_long_description():
6673
"sentry-sdk[fastapi]",
6774
"alembic-postgresql-enum",
6875
"asyncpg",
69-
"aiorwlock",
70-
"aiocache",
7176
"cachetools",
72-
"httpx",
7377
"python-json-logger",
74-
"jinja2",
7578
"grpcio>=1.50", # indirect
7679
]
7780

@@ -138,6 +141,7 @@ def get_long_description():
138141
install_requires=BASE_DEPS,
139142
extras_require={
140143
"all": ALL_DEPS,
144+
"gateway": GATEWAY_AND_SERVER_COMMON_DEPS,
141145
"server": SERVER_DEPS,
142146
"aws": SERVER_DEPS + AWS_DEPS,
143147
"azure": SERVER_DEPS + AZURE_DEPS,

src/dstack/_internal/server/services/gateways/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
GATEWAY_CONNECT_ATTEMPTS = 30
8080
GATEWAY_CONNECT_DELAY = 10
81-
GATEWAY_CONFIGURE_ATTEMPTS = 40
81+
GATEWAY_CONFIGURE_ATTEMPTS = 50
8282
GATEWAY_CONFIGURE_DELAY = 3
8383

8484

0 commit comments

Comments
 (0)