Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
ea9d00e7
Unverified
Commit
ea9d00e7
authored
Nov 26, 2025
by
Yan Ru Pei
Committed by
GitHub
Nov 26, 2025
Browse files
fix: allow router to be registered as general transport type (#4633)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
6a0e67ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
lib/llm/src/discovery/model_manager.rs
lib/llm/src/discovery/model_manager.rs
+5
-6
lib/runtime/src/component.rs
lib/runtime/src/component.rs
+1
-0
lib/runtime/src/component/endpoint.rs
lib/runtime/src/component/endpoint.rs
+1
-1
No files found.
lib/llm/src/discovery/model_manager.rs
View file @
ea9d00e7
...
@@ -10,11 +10,10 @@ use parking_lot::{Mutex, RwLock};
...
@@ -10,11 +10,10 @@ use parking_lot::{Mutex, RwLock};
use
tokio
::
sync
::
oneshot
;
use
tokio
::
sync
::
oneshot
;
use
dynamo_runtime
::{
use
dynamo_runtime
::{
component
::{
Endpoint
,
T
ransport
T
ype
},
component
::{
Endpoint
,
build_t
ransport
_t
ype
},
discovery
::
DiscoverySpec
,
discovery
::
DiscoverySpec
,
prelude
::
DistributedRuntimeProvider
,
prelude
::
DistributedRuntimeProvider
,
protocols
::
EndpointId
,
protocols
::
EndpointId
,
transports
::
nats
,
};
};
use
crate
::{
use
crate
::{
...
@@ -318,18 +317,18 @@ impl ModelManager {
...
@@ -318,18 +317,18 @@ impl ModelManager {
// Register router via discovery mechanism
// Register router via discovery mechanism
let
discovery
=
endpoint
.component
()
.drt
()
.discovery
();
let
discovery
=
endpoint
.component
()
.drt
()
.discovery
();
let
instance_id
=
discovery
.instance_id
();
let
instance_id
=
discovery
.instance_id
();
let
request_plane_mode
=
endpoint
.drt
()
.request_plane
();
// Build
NATS
transport
subject for the
router endpoint
// Build transport
for
router endpoint
based on request plane mode
// Use KV_ROUTER_COMPONENT as the component name to distinguish from the generate endpoint's component
// Use KV_ROUTER_COMPONENT as the component name to distinguish from the generate endpoint's component
let
router_endpoint_id
=
router_endpoint_id
(
endpoint
.id
()
.namespace
);
let
router_endpoint_id
=
router_endpoint_id
(
endpoint
.id
()
.namespace
);
// Placeholder subject - router is not callable, only registered for lifecycle coordination
let
transport
=
build_transport_type
(
request_plane_mode
,
&
router_endpoint_id
,
instance_id
);
let
nats_subject
=
nats
::
instance_subject
(
&
router_endpoint_id
,
instance_id
);
let
discovery_spec
=
DiscoverySpec
::
Endpoint
{
let
discovery_spec
=
DiscoverySpec
::
Endpoint
{
namespace
:
router_endpoint_id
.namespace
.clone
(),
namespace
:
router_endpoint_id
.namespace
.clone
(),
component
:
router_endpoint_id
.component
.clone
(),
component
:
router_endpoint_id
.component
.clone
(),
endpoint
:
router_endpoint_id
.name
.clone
(),
endpoint
:
router_endpoint_id
.name
.clone
(),
transport
:
TransportType
::
Nats
(
nats_subject
)
,
transport
,
};
};
discovery
.register
(
discovery_spec
)
.await
?
;
discovery
.register
(
discovery_spec
)
.await
?
;
...
...
lib/runtime/src/component.rs
View file @
ea9d00e7
...
@@ -65,6 +65,7 @@ mod registry;
...
@@ -65,6 +65,7 @@ mod registry;
pub
mod
service
;
pub
mod
service
;
pub
use
client
::
Client
;
pub
use
client
::
Client
;
pub
use
endpoint
::
build_transport_type
;
#[derive(Debug,
Clone,
Serialize,
Deserialize,
Eq,
PartialEq,
Hash)]
#[derive(Debug,
Clone,
Serialize,
Deserialize,
Eq,
PartialEq,
Hash)]
#[serde(rename_all
=
"snake_case"
)]
#[serde(rename_all
=
"snake_case"
)]
...
...
lib/runtime/src/component/endpoint.rs
View file @
ea9d00e7
...
@@ -256,7 +256,7 @@ impl EndpointConfigBuilder {
...
@@ -256,7 +256,7 @@ impl EndpointConfigBuilder {
/// - HTTP: Uses full URL path including endpoint name (e.g., http://host:port/v1/rpc/endpoint_name)
/// - HTTP: Uses full URL path including endpoint name (e.g., http://host:port/v1/rpc/endpoint_name)
/// - TCP: Includes endpoint name for routing (e.g., host:port/endpoint_name)
/// - TCP: Includes endpoint name for routing (e.g., host:port/endpoint_name)
/// - NATS: Uses subject-based addressing (unique per endpoint)
/// - NATS: Uses subject-based addressing (unique per endpoint)
fn
build_transport_type
(
pub
fn
build_transport_type
(
mode
:
RequestPlaneMode
,
mode
:
RequestPlaneMode
,
endpoint_id
:
&
EndpointId
,
endpoint_id
:
&
EndpointId
,
connection_id
:
u64
,
connection_id
:
u64
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment