Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize dstack-gateway installation time #2146

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gateway/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
dynamic = ["version"]
dependencies = [
# release builds of dstack-gateway depend on a PyPI version of dstack instead
"dstack[server] @ https://github.com/dstackai/dstack/archive/refs/heads/master.zip",
"dstack[gateway] @ https://github.com/dstackai/dstack/archive/refs/heads/master.zip",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a fragile solution since there are no tests that run with dstack[gateway].

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge for now and think how we can test it.
Although we also don't test CLI or individual backends without [all], so it is not much more fragile than the existing extras.

]

[tool.setuptools.package-data]
Expand Down
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ def get_long_description():
"gpuhunt>=0.0.17,<0.1.0",
]

SERVER_DEPS = [
GATEWAY_AND_SERVER_COMMON_DEPS = [
"fastapi",
"starlette>=0.26.0",
"uvicorn",
"aiorwlock",
"aiocache",
"httpx",
"jinja2",
]

SERVER_DEPS = GATEWAY_AND_SERVER_COMMON_DEPS + [
"watchfiles",
"sqlalchemy[asyncio]>=2.0.0",
"sqlalchemy_utils>=0.40.0",
Expand All @@ -66,12 +73,8 @@ def get_long_description():
"sentry-sdk[fastapi]",
"alembic-postgresql-enum",
"asyncpg",
"aiorwlock",
"aiocache",
"cachetools",
"httpx",
"python-json-logger",
"jinja2",
"grpcio>=1.50", # indirect
]

Expand Down Expand Up @@ -138,6 +141,7 @@ def get_long_description():
install_requires=BASE_DEPS,
extras_require={
"all": ALL_DEPS,
"gateway": GATEWAY_AND_SERVER_COMMON_DEPS,
"server": SERVER_DEPS,
"aws": SERVER_DEPS + AWS_DEPS,
"azure": SERVER_DEPS + AZURE_DEPS,
Expand Down
2 changes: 1 addition & 1 deletion src/dstack/_internal/server/services/gateways/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

GATEWAY_CONNECT_ATTEMPTS = 30
GATEWAY_CONNECT_DELAY = 10
GATEWAY_CONFIGURE_ATTEMPTS = 40
GATEWAY_CONFIGURE_ATTEMPTS = 50
GATEWAY_CONFIGURE_DELAY = 3


Expand Down
Loading