Commit d137594
authored
Support in-place update for service
The `gateway` property in service configurations
can now be updated in-place.
```shell
$ dstack apply -f my-service.dstack.yml
Active run my-service already exists. Detected changes that can be updated in-place:
- Configuration properties:
- gateway
Update the run? [y/n]: y
NAME BACKEND GPU PRICE STATUS SUBMITTED
my-service aws (us-east-2) - $0.0005 (spot) running 09:22
my-service provisioning completed (running)
Service is published at:
http://my-service.second-gateway.example.com
```
This allows you to reassign a service to a
different gateway without stopping the service.
```shell
$ dstack event
[2026-08-27 09:28:33] [run my-service, gateway second-gateway] Service assigned to gateway
[2026-08-27 09:28:33] [👤admin] [run my-service] Run updated. Deployment: 1. Changed fields: configuration.gateway
[2026-08-27 09:28:39] [run my-service, gateway-replica first-gateway-0] Service unregistered
[2026-08-27 09:28:39] [job my-service-0-0, gateway-replica first-gateway-0] Service replica unregistered
[2026-08-27 09:28:41] [run my-service, gateway-replica second-gateway-0] Service registered
[2026-08-27 09:28:41] [job my-service-0-0, gateway-replica second-gateway-0] Service replica registered
```
Migrating between gateways would typically result
in service downtime while you are rerouting your
client traffic to the new gateway. During
reassignment, the service may also be unavailable
on both gateways for a brief period (several
seconds).
Migration from a gateway to running without a
gateway (`gateway: false`) and vice versa is also
supported.gateway (#4221)1 parent 260060c commit d137594
6 files changed
Lines changed: 415 additions & 11 deletions
File tree
- mkdocs/docs/concepts
- src
- dstack/_internal
- core/models
- server/services
- runs
- services
- tests/_internal/server/routers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1534 | 1534 | | |
1535 | 1535 | | |
1536 | 1536 | | |
1537 | | - | |
| 1537 | + | |
1538 | 1538 | | |
1539 | 1539 | | |
1540 | 1540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1167 | 1167 | | |
1168 | 1168 | | |
1169 | 1169 | | |
1170 | | - | |
| 1170 | + | |
| 1171 | + | |
1171 | 1172 | | |
1172 | 1173 | | |
1173 | 1174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
678 | 689 | | |
679 | 690 | | |
680 | 691 | | |
| |||
783 | 794 | | |
784 | 795 | | |
785 | 796 | | |
786 | | - | |
787 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
788 | 800 | | |
789 | 801 | | |
790 | 802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
436 | | - | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
| |||
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
73 | 84 | | |
74 | | - | |
| 85 | + | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
80 | | - | |
| 91 | + | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| |||
86 | 98 | | |
87 | 99 | | |
88 | 100 | | |
89 | | - | |
| 101 | + | |
90 | 102 | | |
91 | 103 | | |
92 | 104 | | |
| |||
150 | 162 | | |
151 | 163 | | |
152 | 164 | | |
153 | | - | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
0 commit comments