forked from restatedev/restate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit separates the ingress from the worker role. To support backward compatibility this feature is not yet turned on by default and users need to enable it explicity via `experimental-feature-enable-separate-ingress-role` to be able to configure the ingress role separately. When enabled, users can place the ingress role on a set of freely chosen nodes. This fixes restatedev#1312.
- Loading branch information
1 parent
206e3ee
commit 2eafd58
Showing
16 changed files
with
166 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH. | ||
// All rights reserved. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0. | ||
|
||
use restate_core::network::partition_processor_rpc_client::PartitionProcessorRpcClient; | ||
use restate_core::network::rpc_router::ConnectionAwareRpcRouter; | ||
use restate_core::network::{MessageRouterBuilder, Networking, TransportConnect}; | ||
use restate_core::partitions::PartitionRouting; | ||
use restate_ingress_http::rpc_request_dispatcher::RpcRequestDispatcher; | ||
use restate_ingress_http::HyperServerIngress; | ||
use restate_types::config::IngressOptions; | ||
use restate_types::health::HealthStatus; | ||
use restate_types::live::{BoxedLiveLoad, Live}; | ||
use restate_types::partition_table::PartitionTable; | ||
use restate_types::protobuf::common::IngressStatus; | ||
use restate_types::schema::Schema; | ||
|
||
type IngressHttp<T> = HyperServerIngress<Schema, RpcRequestDispatcher<T>>; | ||
|
||
pub struct IngressRole<T> { | ||
ingress_http: IngressHttp<T>, | ||
} | ||
|
||
impl<T: TransportConnect> IngressRole<T> { | ||
pub fn create( | ||
mut ingress_options: BoxedLiveLoad<IngressOptions>, | ||
health: HealthStatus<IngressStatus>, | ||
networking: Networking<T>, | ||
schema: Live<Schema>, | ||
partition_table: Live<PartitionTable>, | ||
partition_routing: PartitionRouting, | ||
router_builder: &mut MessageRouterBuilder, | ||
) -> Self { | ||
let rpc_router = ConnectionAwareRpcRouter::new(router_builder); | ||
|
||
let dispatcher = RpcRequestDispatcher::new(PartitionProcessorRpcClient::new( | ||
networking, | ||
rpc_router, | ||
partition_table, | ||
partition_routing, | ||
)); | ||
let ingress_http = HyperServerIngress::from_options( | ||
ingress_options.live_load(), | ||
dispatcher, | ||
schema, | ||
health, | ||
); | ||
|
||
Self { ingress_http } | ||
} | ||
|
||
pub async fn run(self) -> anyhow::Result<()> { | ||
self.ingress_http.run().await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.