Skip to content

Commit e718601

Browse files
authored
chore: actor epoxy scoped consensus (#4502)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? Please describe the tests that you ran to verify your changes. ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes
1 parent 89703c3 commit e718601

26 files changed

Lines changed: 717 additions & 377 deletions

File tree

Cargo.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ members = [
108108
rstest = "0.26.1"
109109
rustls-pemfile = "2.2.0"
110110
rustyline = "15.0.0"
111-
scc = "3.3.2"
111+
scc = "3.6.12"
112112
semver = "1.0.27"
113113
serde_bare = "0.5.0"
114114
serde_html_form = "0.2.7"

engine/artifacts/openapi.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/packages/api-peer/src/internal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ pub async fn set_epoxy_kv(
593593
}],
594594
},
595595
purge_cache: true,
596+
target_replicas: None,
596597
})
597598
.await?;
598599

engine/packages/api-public/src/actors/utils.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ pub async fn find_dc_for_actor_creation(
146146
} else {
147147
// Find the nearest DC with runners
148148
let res = ctx
149-
.op(pegboard::ops::runner::find_dc_with_runner::Input {
150-
namespace_id,
151-
runner_name: runner_name.into(),
152-
})
149+
.op(
150+
pegboard::ops::runner::list_runner_config_enabled_dcs::Input {
151+
namespace_id,
152+
runner_name: runner_name.into(),
153+
},
154+
)
153155
.await?;
154-
if let Some(dc_label) = res.dc_label {
156+
if let Some(dc_label) = res.dc_labels.into_iter().next() {
155157
dc_label
156158
} else {
157159
return Err(pegboard::errors::Actor::NoRunnersAvailable {

engine/packages/api-public/src/runner_configs/delete.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,12 @@ async fn delete_inner(ctx: ApiCtx, path: DeletePath, query: DeleteQuery) -> Resu
8585
.await?
8686
.ok_or_else(|| namespace::errors::Namespace::NotFound.build())?;
8787

88-
// Purge cache
89-
ctx.cache()
90-
.clone()
91-
.request()
92-
.purge(
93-
"namespace.runner_config.get",
94-
vec![(namespace.namespace_id, path.runner_name.clone())],
95-
)
96-
.await?;
88+
pegboard::utils::purge_runner_config_caches(
89+
ctx.cache(),
90+
namespace.namespace_id,
91+
&path.runner_name,
92+
)
93+
.await?;
9794

9895
Ok(DeleteResponse {})
9996
}

engine/packages/api-public/src/runner_configs/upsert.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,12 @@ async fn upsert_inner(
184184
}
185185
}
186186

187-
// Purge cache
188-
ctx.cache()
189-
.clone()
190-
.request()
191-
.purge(
192-
"namespace.runner_config.get",
193-
vec![(namespace.namespace_id, path.runner_name.clone())],
194-
)
195-
.await?;
187+
pegboard::utils::purge_runner_config_caches(
188+
ctx.cache(),
189+
namespace.namespace_id,
190+
&path.runner_name,
191+
)
192+
.await?;
196193

197194
Ok(UpsertResponse {
198195
endpoint_config_changed: any_endpoint_config_changed,

engine/packages/engine/tests/api_runner_configs_list.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ fn list_runner_configs_filter_by_variant_serverless() {
324324
min_runners: Some(1),
325325
max_runners: 5,
326326
runners_margin: Some(2),
327+
metadata_poll_interval: None,
327328
},
328329
metadata: None,
329330
drain_on_version_upgrade: true,
@@ -458,6 +459,7 @@ fn list_runner_configs_validates_returned_data() {
458459
min_runners: Some(2),
459460
max_runners: 10,
460461
runners_margin: Some(3),
462+
metadata_poll_interval: None,
461463
},
462464
metadata: Some(serde_json::json!({"key": "value"})),
463465
drain_on_version_upgrade: true,
@@ -573,6 +575,7 @@ fn list_runner_configs_mixed_variants() {
573575
min_runners: Some(1),
574576
max_runners: 5,
575577
runners_margin: Some(2),
578+
metadata_poll_interval: None,
576579
},
577580
metadata: None,
578581
drain_on_version_upgrade: true,

engine/packages/engine/tests/api_runner_configs_upsert.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fn upsert_runner_config_serverless() {
9898
min_runners: Some(1),
9999
max_runners: 5,
100100
runners_margin: Some(2),
101+
metadata_poll_interval: None,
101102
},
102103
metadata: None,
103104
drain_on_version_upgrade: true,
@@ -518,6 +519,7 @@ fn upsert_runner_config_overwrites_different_variant() {
518519
min_runners: Some(1),
519520
max_runners: 5,
520521
runners_margin: Some(2),
522+
metadata_poll_interval: None,
521523
},
522524
metadata: None,
523525
drain_on_version_upgrade: true,
@@ -617,6 +619,7 @@ fn upsert_runner_config_serverless_slots_per_runner_zero() {
617619
min_runners: Some(1),
618620
max_runners: 5,
619621
runners_margin: Some(2),
622+
metadata_poll_interval: None,
620623
},
621624
metadata: None,
622625
drain_on_version_upgrade: true,

engine/packages/epoxy/src/ops/explicit_prepare.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ async fn restart_phase1(
328328
.op(crate::ops::propose::Input {
329329
proposal,
330330
purge_cache: false,
331+
target_replicas: None,
331332
})
332333
.await?;
333334

0 commit comments

Comments
 (0)