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

Support Query input from URL on report collector side + integration test #1510

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

akoshelev
Copy link
Collaborator

This builds on top #1509 and #1508 and supports polling for inputs mode on the report collector side and adds an integration test to verify correctness of this setup end-to-end.

Test passes, so it seems we are quite close

Ok(manifest_path)
}

fn create_upload_file<const SHARDS: usize>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works, but my original plan was to generate SHARDS raw input files, then encrypt each with --length-delimited. either way is fine with me, this just puts a little extra weight on the rust implementation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would you run ipa in the clear on those?

let enc2 = dir.path().join("helper2.enc");
let enc3 = dir.path().join("helper3.enc");

let poll_port = TcpListener::bind("127.0.0.1:0").unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be some random high value port?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what :0 will do.

panic!("Either --url-file-list or --enc-input-file1, --enc-input-file2, and --enc-input-file3 must be provided");
}
},
// encrypted_inputs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// encrypted_inputs,

@eriktaubeneck
Copy link
Member

I didn't have a chance to review #1508 yet, but the integration test changes look good to me.

}
if helper_input.len() != shard_count {
return Err(format!(
"Helper {helper_id} does not have enough input. Expected {shard_count}, got {}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nit given the nature of this exercise, but: maybe just read all the lines immediately and complain if the file doesn't have the expected number of lines (3 * N)?

Attributing the incorrect length to a particular helper may be confusing, and this will accept a file that is too long, including e.g. if the length is 3 * M for an incorrect number of shards M > N.

let enc2 = dir.path().join("helper2.enc");
let enc3 = dir.path().join("helper3.enc");

let poll_port = TcpListener::bind("127.0.0.1:0").unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what :0 will do.


// update manifest file
for (path, mut file) in files {
// let path = path.strip_prefix(dest_dir).unwrap().to_str().unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// let path = path.strip_prefix(dest_dir).unwrap().to_str().unwrap();

])
.silent();

let _server_handle = command.spawn().unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _server_handle = command.spawn().unwrap();
let _server_handle = command.spawn().unwrap().terminate_on_drop();

@akoshelev akoshelev mentioned this pull request Dec 20, 2024
@andyleiserson
Copy link
Collaborator

#1514 will fix the test failures.

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 7.20721% with 103 lines in your changes missing coverage. Please review.

Project coverage is 93.05%. Comparing base (291efab) to head (66e15ff).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ipa-core/src/bin/report_collector.rs 8.00% 92 Missing ⚠️
ipa-core/src/cli/playbook/hybrid.rs 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1510      +/-   ##
==========================================
- Coverage   93.20%   93.05%   -0.16%     
==========================================
  Files         241      241              
  Lines       44054    44126      +72     
==========================================
- Hits        41061    41060       -1     
- Misses       2993     3066      +73     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akoshelev
Copy link
Collaborator Author

yea we don't get coverage for integration tests :(

@akoshelev akoshelev merged commit e0efbf8 into private-attribution:main Dec 20, 2024
11 of 12 checks passed
@akoshelev akoshelev deleted the rc-stream-upload branch December 20, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants