Skip to content

Commit be78b26

Browse files
jvstmepranitnaik43
authored andcommitted
[chore]: Update/remove dstack-proxy TODOs (dstackai#2239)
1 parent c8dddca commit be78b26

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

docs/docs/reference/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ For more details on the options below, refer to the [server deployment](../guide
103103
- `DSTACK_DATABASE_URL`{ #DSTACK_DATABASE_URL } – The database URL to use instead of default SQLite. Currently `dstack` supports Postgres. Example: `postgresql+asyncpg://myuser:mypassword@localhost:5432/mydatabase`. Defaults to `None`.
104104
- `DSTACK_SERVER_CLOUDWATCH_LOG_GROUP`{ #DSTACK_SERVER_CLOUDWATCH_LOG_GROUP } – The CloudWatch Logs group for workloads logs. If not set, the default file-based log storage is used.
105105
- `DSTACK_SERVER_CLOUDWATCH_LOG_REGION`{ #DSTACK_SERVER_CLOUDWATCH_LOG_REGION } – The CloudWatch Logs region. Defaults to `None`.
106-
- `DSTACK_DEFAULT_SERVICE_CLIENT_MAX_BODY_SIZE`{ #DSTACK_DEFAULT_SERVICE_CLIENT_MAX_BODY_SIZE } – Request body size limit for services, in bytes. Defaults to 64 MiB.
106+
- `DSTACK_DEFAULT_SERVICE_CLIENT_MAX_BODY_SIZE`{ #DSTACK_DEFAULT_SERVICE_CLIENT_MAX_BODY_SIZE } – Request body size limit for services running with a gateway, in bytes. Defaults to 64 MiB.
107107
- `DSTACK_FORBID_SERVICES_WITHOUT_GATEWAY`{ #DSTACK_FORBID_SERVICES_WITHOUT_GATEWAY } – Forbids registering new services without a gateway if set to any value.
108108

109109
??? info "Internal environment variables"

src/dstack/_internal/proxy/lib/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Service(ImmutableModel):
3131
domain: Optional[str] # only used on gateways
3232
https: Optional[bool] # only used on gateways
3333
auth: bool
34-
client_max_body_size: int
34+
client_max_body_size: int # only enforced on gateways
3535
replicas: tuple[Replica, ...]
3636

3737
@property

src/dstack/_internal/proxy/lib/services/service_connection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async def client(self) -> ServiceClient:
8787

8888
class ServiceConnectionPool:
8989
def __init__(self) -> None:
90-
# TODO(#1595): remove connections to stopped replicas in-server
90+
# TODO(#2238): remove connections to stopped replicas in-server
9191
self.connections: Dict[str, ServiceConnection] = {}
9292

9393
async def get(self, replica_id: str) -> Optional[ServiceConnection]:
@@ -139,7 +139,6 @@ async def get_service_replica_client(
139139
timeout=HTTP_TIMEOUT,
140140
)
141141
# Nginx not available, forward directly to the tunnel
142-
# TODO(#1595): consider trying different replicas, e.g. using HTTPMultiClient
143142
replica = random.choice(service.replicas)
144143
connection = await service_conn_pool.get(replica.id)
145144
if connection is None:

src/dstack/_internal/server/services/proxy/routers/service_proxy.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,3 @@ async def service_reverse_proxy(
4040
return await service_proxy.proxy(
4141
project_name, run_name, path, request, auth, repo, service_conn_pool
4242
)
43-
44-
45-
# TODO(#1595): support websockets

src/dstack/_internal/server/services/proxy/services/service_proxy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ async def proxy(
2626
repo: BaseProxyRepo,
2727
service_conn_pool: ServiceConnectionPool,
2828
) -> fastapi.responses.Response:
29-
# TODO(#1595): enforce client_max_body_size
30-
3129
if "Upgrade" in request.headers:
3230
raise ProxyError("Upgrading connections is not supported", status.HTTP_400_BAD_REQUEST)
3331

@@ -95,7 +93,7 @@ async def build_upstream_request(
9593
).get_stream()
9694
client.cookies.clear() # the client is shared by all users, don't leak cookies
9795

98-
# TODO(#1595): add common proxy headers
96+
# TODO(#2237): add common proxy headers
9997
return client.build_request(
10098
downstream_request.method, url, headers=downstream_request.headers, content=request_stream
10199
)

0 commit comments

Comments
 (0)