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

update in_cluster for BYOHelper #1532

Merged
merged 1 commit into from
Jun 28, 2023
Merged

update in_cluster for BYOHelper #1532

merged 1 commit into from
Jun 28, 2023

Conversation

tgeoghegan
Copy link
Contributor

Updates the in_cluster test harness code to use the divviup-api API resource for managing aggregators and the automated task provisioning flow (#1486).

Resolves #1528

@tgeoghegan
Copy link
Contributor Author

tgeoghegan commented Jun 26, 2023

This isn't ready yet. We need a few divviup-api changes first, and then more changes here to adopt new interfaces:

integration_tests/tests/in_cluster.rs Outdated Show resolved Hide resolved
name: "leader".to_string(),
api_url: Self::in_cluster_aggregator_api_url(&leader_namespace).to_string(),
dap_url: Self::in_cluster_aggregator_dap_url(&leader_namespace).to_string(),
bearer_token: leader_aggregator_api_auth_token,
Copy link
Contributor Author

@tgeoghegan tgeoghegan Jun 27, 2023

Choose a reason for hiding this comment

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

This request needs to go to POST /aggregators to pair it as a global aggregator and not bound to account. Also, we need to add is_first_party: true to the request.

@tgeoghegan
Copy link
Contributor Author

This is still blocked on the listed divviup-api changes, but can be reviewed on its own.

@tgeoghegan tgeoghegan marked this pull request as ready for review June 27, 2023 23:24
@tgeoghegan tgeoghegan requested a review from a team as a code owner June 27, 2023 23:24
@tgeoghegan
Copy link
Contributor Author

Update: all the necessary changes have landed in divviup-api (last one was divviup/divviup-api#243) and this is now unblocked. That being said, this code only gets compiled and never run here in the Janus project.

Copy link
Contributor

@divergentdave divergentdave left a comment

Choose a reason for hiding this comment

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

LGTM, just have some comment cleanups.

Comment on lines 101 to 105
// From outside the cluster, the aggregators are reached at a dynamically allocated port on
// localhost. When the aggregators talk to each other, they do so in the cluster's network,
// so they need the in-cluster DNS name of the other aggregator, and they can use well-known
// service port numbers. The leader uses its view of its own endpoint URL to construct
// collection job URIs, so we will only patch each aggregator's view of its peer's endpoint.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we no longer directly construct new task request bodies from Task objects, and instead send in-cluster URLs when setting up each aggregator in divviup-api, the end of this comment isn't applicable anymore.

Suggested change
// From outside the cluster, the aggregators are reached at a dynamically allocated port on
// localhost. When the aggregators talk to each other, they do so in the cluster's network,
// so they need the in-cluster DNS name of the other aggregator, and they can use well-known
// service port numbers. The leader uses its view of its own endpoint URL to construct
// collection job URIs, so we will only patch each aggregator's view of its peer's endpoint.
// From outside the cluster, the aggregators are reached at a dynamically allocated port on
// localhost. When the aggregators talk to each other, they do so in the cluster's network,
// so they need the in-cluster DNS name of the other aggregator, and they can use well-known
// service port numbers.

Comment on lines 124 to 125
// - pair a global aggregator implictly marks it as "first-party" in divviup-api, which is
// necessary for the task we later provision to pass a validity check.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo

Suggested change
// - pair a global aggregator implictly marks it as "first-party" in divviup-api, which is
// necessary for the task we later provision to pass a validity check.
// - pairing a global aggregator implictly marks it as "first-party" in divviup-api, which
// is necessary for the task we later provision to pass a validity check.

Comment on lines 173 to 174
// Update the task with the ID and collector auth token from divviup-api, and aggregator
// endpoints with the in-cluster URLs.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is partly outdated, as the endpoints aren't updated here anymore. submit_measurements_and_verify_aggregate() already overrides the host and port of aggregator endpoints to be 127.0.0.1 and whatever the local forwarded port is.

Suggested change
// Update the task with the ID and collector auth token from divviup-api, and aggregator
// endpoints with the in-cluster URLs.
// Update the task with the ID and collector auth token from divviup-api.

Updates the `in_cluster` test harness code to use the divviup-api API
resource for managing aggregators and the automated task provisioning
flow (#1486).

Resolves #1528
@tgeoghegan tgeoghegan merged commit f9443a5 into main Jun 28, 2023
@tgeoghegan tgeoghegan deleted the timg/in-cluster-fixes branch June 28, 2023 18:39
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.

Update in_cluster test harness to use new divviup-api task provisioning flow
2 participants