Skip to content

Commit e364738

Browse files
authored
Allow manual gateway scaling (drop feature flag) (#4142)
The number of gateway replicas can now be changed in-place. ```shell $ dstack apply -f my-gateway.dstack.yml Found gateway my-gateway. Detected changes that can be updated in-place: - replicas Update the gateway? [y/n]: ``` When scaling in, `dstack` stops the oldest replicas first.
1 parent 2b12e65 commit e364738

3 files changed

Lines changed: 1 addition & 10 deletions

File tree

mkdocs/docs/concepts/gateways.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ $ dstack gateway list
172172
!!! warning "Experimental"
173173
Replicated gateways are an experimental feature and currently have limitations:
174174

175-
- Changing the number of replicas or redeploying replicas is not supported.
176175
- HTTPS is only supported for AWS gateways with the `acm` [certificate type](#certificate). For other gateways, use an external load balancer for TLS termination.
177176
- All replicas are bound to the same backend and region.
178177
- At most 3 replicas are allowed per gateway.

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
from dstack._internal.server.services.pipelines import PipelineHinterProtocol
8080
from dstack._internal.server.services.plugins import apply_plugin_policies
8181
from dstack._internal.server.utils.common import gather_map_async
82-
from dstack._internal.settings import FeatureFlags
8382
from dstack._internal.utils import crypto
8483
from dstack._internal.utils.common import (
8584
get_current_datetime,
@@ -89,9 +88,7 @@
8988
from dstack._internal.utils.logging import get_logger
9089

9190
logger = get_logger(__name__)
92-
_CONF_UPDATABLE_FIELDS = frozenset({"domain", "default"})
93-
if FeatureFlags.GATEWAY_SCALING:
94-
_CONF_UPDATABLE_FIELDS |= {"replicas"}
91+
_CONF_UPDATABLE_FIELDS = frozenset({"domain", "default", "replicas"})
9592

9693

9794
def switch_gateway_status(

src/dstack/_internal/settings.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,3 @@ class FeatureFlags:
4747
"""If DSTACK_FF_CLI_PRINT_JOB_CONNECTION_INFO enabled, `dstack apply` command prints server-provided
4848
IDE URL(s) and SSH command(s) before job logs (for dev-environments only).
4949
"""
50-
GATEWAY_SCALING = os.getenv("DSTACK_FF_GATEWAY_SCALING") is not None
51-
"""Allows in-place update of gateway `replicas`.
52-
Has limited applicability at the current stage — without a state sync mechanism, newly started
53-
gateway replicas are not aware of existing services.
54-
"""

0 commit comments

Comments
 (0)