Skip to content
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

Time-bucketed fixed size support (release/0.6 backport) #3026

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions aggregator_api/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ pub(super) async fn get_config(
SupportedQueryType::TimeInterval,
SupportedQueryType::FixedSize,
],
// Unconditionally indicate to divviup-api that we support collector auth token hashes and
// upload metrics.
features: &["TokenHash", "UploadMetrics"],
features: &["TokenHash", "UploadMetrics", "TimeBucketedFixedSize"],
})
}

Expand Down
2 changes: 1 addition & 1 deletion aggregator_api/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn get_config() {
r#"{"protocol":"DAP-07","dap_url":"https://dap.url/","role":"Either","vdafs":"#,
r#"["Prio3Count","Prio3Sum","Prio3Histogram","Prio3CountVec","Prio3SumVec"],"#,
r#""query_types":["TimeInterval","FixedSize"],"#,
r#""features":["TokenHash","UploadMetrics"]}"#,
r#""features":["TokenHash","UploadMetrics","TimeBucketedFixedSize"]}"#,
)
);
}
Expand Down
35 changes: 34 additions & 1 deletion integration_tests/tests/integration/in_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ use janus_core::{
install_test_trace_subscriber,
kubernetes::{Cluster, PortForward},
},
time::DurationExt,
vdaf::VdafInstance,
};
use janus_integration_tests::{client::ClientBackend, TaskParameters};
use janus_messages::TaskId;
use janus_messages::{Duration as JanusDuration, TaskId};
use std::{env, str::FromStr, time::Duration};
use trillium_rustls::RustlsConfig;
use trillium_tokio::ClientConfig;
Expand Down Expand Up @@ -430,6 +431,13 @@ impl InClusterJanusPair {
QueryType::TimeInterval => None,
QueryType::FixedSize { max_batch_size, .. } => Some(*max_batch_size),
},
batch_time_window_size_seconds: match task.query_type() {
QueryType::TimeInterval => None,
QueryType::FixedSize {
batch_time_window_size,
..
} => batch_time_window_size.map(|window| window.as_seconds()),
},
time_precision_seconds: task.time_precision().as_seconds(),
collector_credential_id,
};
Expand Down Expand Up @@ -561,6 +569,31 @@ async fn in_cluster_fixed_size() {
.await;
}

#[tokio::test(flavor = "multi_thread")]
async fn in_cluster_time_bucketed_fixed_size() {
install_test_trace_subscriber();
initialize_rustls();

// Start port forwards and set up task.
let janus_pair = InClusterJanusPair::new(
VdafInstance::Prio3Count,
QueryType::FixedSize {
max_batch_size: Some(110),
batch_time_window_size: Some(JanusDuration::from_hours(8).unwrap()),
},
)
.await;

// Run the behavioral test.
submit_measurements_and_verify_aggregate(
"in_cluster_time_bucketed_fixed_size",
&janus_pair.task_parameters,
(janus_pair.leader.port(), janus_pair.helper.port()),
&ClientBackend::InProcess,
)
.await;
}

#[cfg(feature = "in-cluster-rate-limits")]
mod rate_limits {
use super::InClusterJanusPair;
Expand Down
Loading