Commit cf985fa
[release/13.4] Add proxyless endpoint on-demand allocation (#17859)
* Add proxyless endpoint on-demand allocation
Allow dynamic proxyless container endpoints to allocate a target-port fallback when an endpoint reference requires an allocated endpoint before container creation. Disable the on-demand allocator once container ports are built so later resolution continues to use DCP service updates.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Log proxyless endpoint fallback allocation
Log when a dynamic proxyless container endpoint is resolved before container creation and Aspire assigns the public port to match the target port.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use atomic proxyless allocator cutoff
Replace the endpoint allocation cutoff lock with an atomic exchange so BuildContainerPorts remains the point where on-demand proxyless endpoint allocation stops.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove proxyless allocator clear helper
Use the atomic OnDemandAllocatedEndpointProvider setter directly at the BuildContainerPorts cutoff instead of a dedicated clear wrapper.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify proxyless allocator provider storage
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move proxyless allocator cutoff into port build
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move on-demand endpoint allocation ownership to resource
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Clarify on-demand endpoint allocation lifecycle
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify resource-owned endpoint allocation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move proxyless allocation cutoff after configuration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: David Negstad <David.Negstad@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 62d6f98 commit cf985fa
7 files changed
Lines changed: 222 additions & 36 deletions
File tree
- src/Aspire.Hosting
- ApplicationModel
- Dcp
- tests/Aspire.Hosting.Tests/Dcp
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
457 | 476 | | |
458 | 477 | | |
459 | 478 | | |
| |||
Lines changed: 24 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
224 | 244 | | |
225 | 245 | | |
226 | 246 | | |
| |||
242 | 262 | | |
243 | 263 | | |
244 | 264 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
259 | 268 | | |
260 | 269 | | |
261 | 270 | | |
| |||
382 | 391 | | |
383 | 392 | | |
384 | 393 | | |
385 | | - | |
386 | | - | |
| 394 | + | |
387 | 395 | | |
388 | 396 | | |
389 | 397 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | 309 | | |
315 | 310 | | |
316 | 311 | | |
| |||
321 | 316 | | |
322 | 317 | | |
323 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
329 | 337 | | |
330 | 338 | | |
331 | 339 | | |
| |||
987 | 995 | | |
988 | 996 | | |
989 | 997 | | |
| 998 | + | |
990 | 999 | | |
991 | 1000 | | |
992 | 1001 | | |
993 | | - | |
| 1002 | + | |
994 | 1003 | | |
995 | 1004 | | |
996 | 1005 | | |
| |||
1000 | 1009 | | |
1001 | 1010 | | |
1002 | 1011 | | |
1003 | | - | |
| 1012 | + | |
1004 | 1013 | | |
1005 | | - | |
| 1014 | + | |
1006 | 1015 | | |
1007 | 1016 | | |
1008 | 1017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
90 | 102 | | |
91 | 103 | | |
92 | 104 | | |
| |||
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
164 | | - | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
| 179 | + | |
167 | 180 | | |
168 | 181 | | |
169 | 182 | | |
| |||
182 | 195 | | |
183 | 196 | | |
184 | 197 | | |
185 | | - | |
| 198 | + | |
186 | 199 | | |
187 | 200 | | |
188 | 201 | | |
| |||
192 | 205 | | |
193 | 206 | | |
194 | 207 | | |
195 | | - | |
| 208 | + | |
196 | 209 | | |
197 | 210 | | |
198 | 211 | | |
| |||
207 | 220 | | |
208 | 221 | | |
209 | 222 | | |
210 | | - | |
| 223 | + | |
211 | 224 | | |
212 | 225 | | |
213 | 226 | | |
| |||
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
281 | 330 | | |
282 | 331 | | |
283 | 332 | | |
| |||
0 commit comments