-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tests to provision 3 nodes cluster tests with a replicated loglet with replication property 2 #27
Open
tillrohrmann
wants to merge
1
commit into
restatedev:main
Choose a base branch
from
tillrohrmann:issues/26
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update tests to provision 3 nodes cluster tests with a replicated loglet with replication property 2 #27
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -46,24 +46,28 @@ class RestateContainer( | |
private val WAIT_STARTUP_STRATEGY = | ||
WaitAllStrategy() | ||
.withStrategy( | ||
Wait.forHttp("/restate/health") | ||
.forPort(RUNTIME_INGRESS_ENDPOINT_PORT) | ||
Wait.forHttp("/metrics") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
.forPort(RUNTIME_NODE_PORT) | ||
.withRateLimiter( | ||
RateLimiterBuilder.newBuilder() | ||
.withRate(200, TimeUnit.MILLISECONDS) | ||
.withConstantThroughput() | ||
.build())) | ||
.withStartupTimeout(120.seconds.toJavaDuration()) | ||
|
||
private val WAIT_INGRESS_READY_STRATEGY = | ||
WaitAllStrategy() | ||
.withStrategy( | ||
Wait.forHttp("/health") | ||
.forPort(RUNTIME_ADMIN_ENDPOINT_PORT) | ||
Wait.forHttp("/restate/health") | ||
.forPort(RUNTIME_INGRESS_ENDPOINT_PORT) | ||
.withRateLimiter( | ||
RateLimiterBuilder.newBuilder() | ||
.withRate(200, TimeUnit.MILLISECONDS) | ||
.withConstantThroughput() | ||
.build())) | ||
.withStartupTimeout(120.seconds.toJavaDuration()) | ||
|
||
fun bootstrapRestateCluster( | ||
fun createRestateContainers( | ||
config: RestateDeployerConfig, | ||
network: Network, | ||
envs: Map<String, String>, | ||
|
@@ -80,13 +84,14 @@ class RestateContainer( | |
mapOf<String, String>( | ||
"RESTATE_CLUSTER_NAME" to clusterId, | ||
"RESTATE_BIFROST__DEFAULT_PROVIDER" to "replicated", | ||
"RESTATE_ALLOW_BOOTSTRAP" to "true", | ||
"RESTATE_ALLOW_BOOTSTRAP" to "false", | ||
"RESTATE_ROLES" to "[worker,log-server,admin,metadata-store]", | ||
) | ||
val followerEnvs = | ||
mapOf<String, String>( | ||
"RESTATE_CLUSTER_NAME" to clusterId, | ||
"RESTATE_BIFROST__DEFAULT_PROVIDER" to "replicated", | ||
"RESTATE_ALLOW_BOOTSTRAP" to "false", | ||
"RESTATE_ROLES" to "[worker,admin,log-server]", | ||
"RESTATE_METADATA_STORE_CLIENT__ADDRESS" to | ||
"http://$RESTATE_RUNTIME:$RUNTIME_NODE_PORT") | ||
|
@@ -191,6 +196,10 @@ class RestateContainer( | |
WAIT_STARTUP_STRATEGY.waitUntilReady(this) | ||
} | ||
|
||
fun waitIngressReady() { | ||
WAIT_INGRESS_READY_STRATEGY.waitUntilReady(this) | ||
} | ||
|
||
fun dumpConfiguration() { | ||
check(isRunning) { "The container is not running, can't dump configuration" } | ||
dockerClient.killContainerCmd(containerId).withSignal("SIGUSR1").exec() | ||
|
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,78 @@ | ||
// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH | ||
// | ||
// This file is part of the Restate service protocol, which is | ||
// released under the MIT license. | ||
// | ||
// You can find a copy of the license in file LICENSE in the root | ||
// directory of this repository or package, or at | ||
// https://github.com/restatedev/proto/blob/main/LICENSE | ||
|
||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "restate/cluster.proto"; | ||
import "restate/common.proto"; | ||
import "restate/node.proto"; | ||
|
||
package restate.node_ctl_svc; | ||
|
||
service NodeCtlSvc { | ||
// Get identity information from this node. | ||
rpc GetIdent(google.protobuf.Empty) returns (IdentResponse); | ||
|
||
rpc GetMetadata(GetMetadataRequest) returns (GetMetadataResponse); | ||
|
||
// Provision the Restate cluster on this node. | ||
rpc ProvisionCluster(ProvisionClusterRequest) returns (ProvisionClusterResponse); | ||
} | ||
|
||
message ProvisionClusterRequest { | ||
bool dry_run = 1; | ||
optional uint32 num_partitions = 2; | ||
optional restate.cluster.ReplicationStrategy placement_strategy = 3; | ||
optional restate.cluster.DefaultProvider log_provider = 4; | ||
} | ||
|
||
enum ProvisionClusterResponseKind { | ||
ProvisionClusterResponseType_UNKNOWN = 0; | ||
DRY_RUN = 1; | ||
NEWLY_PROVISIONED = 2; | ||
ALREADY_PROVISIONED = 3; | ||
} | ||
|
||
message ProvisionClusterResponse { | ||
ProvisionClusterResponseKind kind = 1; | ||
// This field will be empty if the cluster is already provisioned | ||
optional restate.cluster.ClusterConfiguration cluster_configuration = 3; | ||
} | ||
|
||
message IdentResponse { | ||
restate.common.NodeStatus status = 1; | ||
restate.common.NodeId node_id = 2; | ||
string cluster_name = 3; | ||
// indicates which roles are enabled on this node | ||
repeated string roles = 4; | ||
// Age of the running node in seconds (how many seconds since the daemon | ||
// started) | ||
uint64 age_s = 5; | ||
restate.common.AdminStatus admin_status = 6; | ||
restate.common.WorkerStatus worker_status = 7; | ||
restate.common.LogServerStatus log_server_status = 8; | ||
restate.common.MetadataServerStatus metadata_server_status = 9; | ||
uint32 nodes_config_version = 10; | ||
uint32 logs_version = 11; | ||
uint32 schema_version = 12; | ||
uint32 partition_table_version = 13; | ||
} | ||
|
||
message GetMetadataRequest { | ||
// If set, we'll first sync with metadata store to esnure we are returning the latest value. | ||
// Otherwise, we'll return the local value on this node. | ||
bool sync = 1; | ||
restate.node.MetadataKind kind = 2; | ||
} | ||
|
||
message GetMetadataResponse { | ||
// polymorphic. The value depends on the MetadataKind requested | ||
bytes encoded = 1; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This license is needed for
javax.annotation:javax.annotation-api
which is pulled in byio.grpc:grpc-kotlin-stub
. It should not be a problem since we are not changing the sources.