Skip to content

Commit 2c28a00

Browse files
Merge branch 'privacysandbox:main' into main
2 parents 6d8fe21 + dae5c45 commit 2c28a00

File tree

227 files changed

+2711
-874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+2711
-874
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [2.8.0](https://github.com/privacysandbox/aggregation-service/compare/v2.7.0...v2.8.0) (2024-09-11)
4+
5+
- Increased read threads in Aggregation Service to match the number of CPUs.
6+
- Enabled worker instance OTel logs - processed job's id and worker health status.
7+
- [GCP only] Updated the GCP image build target to "worker_mp_gcp_prod". Note: This change would
8+
impact only if you build your own image.
9+
310
## [2.7.0](https://github.com/privacysandbox/aggregation-service/compare/v2.6.0...v2.7.0) (2024-08-01)
411

512
- Added support for aggregating reports belonging to multiple reporting origins under the same

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.0
1+
2.8.0

WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROTOBUF_CORE_VERSION = "3.25.2"
2424

2525
PROTOBUF_SHA_256 = "3c83e4301b968d0b4f29a0c29c0b3cde1da81d790ffd344b111c523ba1954392"
2626

27-
COORDINATOR_VERSION = "v1.9.0-rc03" # version updated on 2024-07-17
27+
COORDINATOR_VERSION = "v1.10.0-rc07" # version updated on 2024-09-12
2828

2929
JACKSON_VERSION = "2.16.1"
3030

@@ -80,6 +80,7 @@ git_repository(
8080
patches = [
8181
"//build_defs/shared_libraries:coordinator.patch",
8282
"//build_defs/shared_libraries:rules_pkg_build_fix.patch",
83+
"//build_defs/shared_libraries:v1.10_serverless_connector.patch",
8384
],
8485
tag = COORDINATOR_VERSION,
8586
workspace_file = "@shared_libraries_workspace//file",
@@ -97,6 +98,7 @@ OTEL_ARTIFACTS = [
9798
"io.opentelemetry:opentelemetry-sdk-common:" + OTEL_VERSION,
9899
"io.opentelemetry:opentelemetry-sdk-metrics:" + OTEL_VERSION,
99100
"io.opentelemetry:opentelemetry-sdk-testing:" + OTEL_VERSION,
101+
"io.opentelemetry:opentelemetry-sdk-logs:" + OTEL_VERSION,
100102
"io.opentelemetry:opentelemetry-sdk-trace:" + OTEL_VERSION,
101103
"io.opentelemetry.contrib:opentelemetry-aws-xray:" + OTEL_VERSION,
102104
]
@@ -113,6 +115,7 @@ maven_install(
113115
"com.amazonaws:aws-java-sdk-kms:" + AWS_JAVA_SDK_VERSION,
114116
"com.amazonaws:aws-java-sdk-core:" + AWS_JAVA_SDK_VERSION,
115117
"com.amazonaws:aws-java-sdk-xray:" + AWS_JAVA_SDK_VERSION,
118+
"com.amazonaws:aws-java-sdk-logs:" + AWS_JAVA_SDK_VERSION,
116119
"com.amazonaws:aws-java-sdk-cloudwatch:" + AWS_JAVA_SDK_VERSION,
117120
"com.beust:jcommander:1.82",
118121
"com.google.cloud.functions.invoker:java-function-invoker:1.1.0",
@@ -138,6 +141,8 @@ maven_install(
138141
"com.google.cloud:google-cloud-storage:2.32.1",
139142
"com.google.cloud:google-cloud-spanner:6.56.0",
140143
"com.google.cloud:google-cloud-compute:1.44.0",
144+
"com.google.cloud:google-cloud-logging:1.92.0",
145+
"com.google.api.grpc:proto-google-cloud-logging-v2:0.109.0",
141146
"com.google.api.grpc:proto-google-cloud-compute-v1:1.44.0",
142147
"com.google.cloud.functions:functions-framework-api:1.1.0",
143148
"commons-logging:commons-logging:1.3.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sha256:16112ae93b810eb1ec6d1db6e01835d2444c8ca99aa678e03dd104ea3ec68408
1+
sha256:903d3225acecaa272bbdd7273c6c312c2af8b73644058838d23a8c9e6e5c82cf

build-scripts/gcp/cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
steps:
1616
- name: '$_BUILD_IMAGE_REPO_PATH/bazel-build-container:$_VERSION'
1717
script: |
18-
bazel run worker/gcp:worker_mp_gcp_g3p_prod -- -dst "$_IMAGE_REPO_PATH/$_IMAGE_NAME:$_IMAGE_TAG"
18+
bazel run worker/gcp:worker_mp_gcp_prod -- -dst "$_IMAGE_REPO_PATH/$_IMAGE_NAME:$_IMAGE_TAG"
1919
bazel run //terraform/gcp:frontend_service_http_cloud_function_release \
2020
--//terraform/gcp:bucket_flag=$_JARS_PUBLISH_BUCKET --//terraform/gcp:bucket_path_flag=$_JARS_PUBLISH_BUCKET_PATH \
2121
-- --version=$_VERSION

build_defs/container_dependencies.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
# - java_base: Distroless image for running Java.
2525
################################################################################
2626

27-
# Updated as of: 2024-07-26
27+
# Updated as of: 2024-09-08
2828

2929
CONTAINER_DEPS = {
3030
"amazonlinux_2": {
31-
"digest": "sha256:b2ed30084a71c34c0f41a5add7dd623a2e623f2c3b50117c720bbc02d7653fa1",
31+
"digest": "sha256:238da73d5f7e26f01b30f1e30b4a7156d3b344d9368c278ef5bd14d2294f27f6",
3232
"registry": "index.docker.io",
3333
"repository": "amazonlinux",
3434
},
@@ -38,7 +38,7 @@ CONTAINER_DEPS = {
3838
"repository": "aws-observability/aws-otel-collector",
3939
},
4040
"java_base": {
41-
"digest": "sha256:c7846b62436ccf2961972fea5b776527610a1a51b48d8e7b434287146904cf2d",
41+
"digest": "sha256:587ce66b08faea2e2e1568d6bb6c5fd6b085909621f4c14762206d687ff7d202",
4242
"registry": "gcr.io",
4343
"repository": "distroless/java17-debian11",
4444
},
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/operator/terraform/gcp/modules/vpc/serverless-connector.tf b/operator/terraform/gcp/modules/vpc/serverless-connector.tf
2+
index be2932bae..0c17a0da5 100644
3+
--- a/operator/terraform/gcp/modules/vpc/serverless-connector.tf
4+
+++ b/operator/terraform/gcp/modules/vpc/serverless-connector.tf
5+
@@ -1,6 +1,7 @@
6+
module "serverless-connector" {
7+
count = var.create_connectors ? 1 : 0
8+
source = "terraform-google-modules/network/google//modules/vpc-serverless-connector-beta"
9+
+ version = "<= 9.1.0"
10+
project_id = var.project_id
11+
vpc_connectors = [
12+
for index, region in tolist(var.regions) : {

docs/collecting.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ for examples.
2626
- Reporting URL:
2727
`http://adtech.localhost/.well-known/attribution-reporting/debug/report-aggregate-attribution`
2828

29+
The Private Aggregation API is used to support reports triggered within a Protected Audience or
30+
Shared Storage context. The predefined endpoints for those two use cases are defined
31+
[here](https://github.com/patcg-individual-drafts/private-aggregation-api/blob/main/README.md#reports).
32+
33+
1. Protected Audience
34+
- Reporting URL:
35+
`http://adtech.localhost/.well-known/private-aggregation/report-protected-audience`
36+
1. Shared Storage
37+
- Reporting URL:
38+
`http://adtech.localhost/.well-known/private-aggregation/report-shared-storage`
39+
2940
_The `.well-known/...` paths are predefined paths which can not be customized. To collect reports,
3041
you need to run an endpoint that can respond to POST requests on the above paths._
3142

java/com/google/aggregate/adtech/worker/AggregationWorkerArgs.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,14 @@ public final class AggregationWorkerArgs {
250250
description = "Overrides the region of the compute instance.")
251251
private String adtechRegionOverride = "";
252252

253-
// TODO(b/241266079): remove trusted_party_region_override after giving migration time.
254253
@Parameter(
255254
names = {"--trusted_party_region_override", "--coordinator_a_region_override"},
256255
description = "Overrides the region of coordinator A services.")
257-
// TODO(b/241266079): set default to us-east-1 once services move there.
258256
private String coordinatorARegionOverride = "us-west-2";
259257

260258
@Parameter(
261259
names = "--coordinator_b_region_override",
262260
description = "Overrides the region of coordinator B services.")
263-
// TODO(b/241266079): set default to us-east-1 once services move there.
264261
private String coordinatorBRegionOverride = "us-west-2";
265262

266263
@Parameter(
@@ -334,25 +331,21 @@ public final class AggregationWorkerArgs {
334331
@Parameter(
335332
names = "--coordinator_a_privacy_budgeting_endpoint",
336333
description = "Coordinator A's HTTP endpoint for privacy budgeting.")
337-
// TODO(b/218508112): Better default value
338334
private String coordinatorAPrivacyBudgetingEndpoint = "https://foo.com/v1";
339335

340336
@Parameter(
341337
names = "--coordinator_a_privacy_budget_service_auth_endpoint",
342338
description = "Coordinator A's Auth endpoint for privacy budgeting service.")
343-
// TODO(b/218508112): Better default value
344339
private String coordinatorAPrivacyBudgetServiceAuthEndpoint = "https://foo.com/auth";
345340

346341
@Parameter(
347342
names = "--coordinator_b_privacy_budgeting_endpoint",
348343
description = "Coordinator B's HTTP endpoint for privacy budgeting.")
349-
// TODO(b/218508112): Better default value
350344
private String coordinatorBPrivacyBudgetingEndpoint = "https://bar.com/v1";
351345

352346
@Parameter(
353347
names = "--coordinator_b_privacy_budget_service_auth_endpoint",
354348
description = "Coordinator B's Auth endpoint for privacy budgeting service.")
355-
// TODO(b/218508112): Better default value
356349
private String coordinatorBPrivacyBudgetServiceAuthEndpoint = "https://bar.com/auth";
357350

358351
@Parameter(names = "--noising_distribution", description = "Distribution to use for noising.")
@@ -392,6 +385,11 @@ public final class AggregationWorkerArgs {
392385
+ " http://localhost:4317")
393386
private String grpcCollectorEndpoint = "http://localhost:4317";
394387

388+
@Parameter(
389+
names = "--otel_logs_enabled",
390+
description = "Flag to enable the otel to export the logs.")
391+
private boolean otelLogsEnabled = false;
392+
395393
@Parameter(
396394
names = "--return_stack_trace",
397395
description =
@@ -721,6 +719,10 @@ String getGrpcCollectorEndpoint() {
721719
return grpcCollectorEndpoint;
722720
}
723721

722+
boolean isOTelLogsEnabled() {
723+
return otelLogsEnabled;
724+
}
725+
724726
public boolean isEnableReturningStackTraceInResponse() {
725727
return enableReturningStackTraceInResponse;
726728
}

java/com/google/aggregate/adtech/worker/AggregationWorkerModule.java

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.google.aggregate.adtech.worker.Annotations.EnablePrivacyBudgetKeyFiltering;
3131
import com.google.aggregate.adtech.worker.Annotations.EnableStackTraceInResponse;
3232
import com.google.aggregate.adtech.worker.Annotations.EnableThresholding;
33+
import com.google.aggregate.adtech.worker.Annotations.InstanceId;
3334
import com.google.aggregate.adtech.worker.Annotations.MaxDepthOfStackTrace;
3435
import com.google.aggregate.adtech.worker.Annotations.NonBlockingThreadPool;
3536
import com.google.aggregate.adtech.worker.Annotations.OutputShardFileSizeBytes;
@@ -69,6 +70,7 @@
6970
import com.google.inject.Provides;
7071
import com.google.inject.TypeLiteral;
7172
import com.google.inject.multibindings.OptionalBinder;
73+
import com.google.privacysandbox.otel.Annotations.EnableOTelLogs;
7274
import com.google.privacysandbox.otel.Annotations.GrpcOtelCollectorEndpoint;
7375
import com.google.scp.operator.cpio.blobstorageclient.aws.S3BlobStorageClientModule.S3EndpointOverrideBinding;
7476
import com.google.scp.operator.cpio.blobstorageclient.aws.S3BlobStorageClientModule.S3UsePartialRequests;
@@ -121,6 +123,7 @@
121123
import javax.inject.Singleton;
122124
import software.amazon.awssdk.http.SdkHttpClient;
123125
import software.amazon.awssdk.http.apache.ApacheHttpClient;
126+
import software.amazon.awssdk.regions.internal.util.EC2MetadataUtils;
124127

125128
public final class AggregationWorkerModule extends AbstractModule {
126129

@@ -324,8 +327,8 @@ protected void configure() {
324327

325328
// Parameter to set exception cache. This is a test only flag.
326329
bind(Long.class)
327-
.annotatedWith(ExceptionCacheEntryTtlSec.class)
328-
.toInstance(args.getExceptionCacheEntryTtlSec());
330+
.annotatedWith(ExceptionCacheEntryTtlSec.class)
331+
.toInstance(args.getExceptionCacheEntryTtlSec());
329332

330333
// Dependencies for privacy budgeting.
331334
bind(PrivacyBudgetingServiceBridge.class).to(args.getPrivacyBudgeting().getBridge());
@@ -381,17 +384,19 @@ protected void configure() {
381384

382385
// Otel exporter.
383386
switch (args.getOTelExporterSelector()) {
384-
// Specifying CollectorEndpoint is required for GRPC exporter because aggregation service
385-
// would send metric to the CollectorEndpoint and thus collector/exporter could collect.
387+
// Specifying CollectorEndpoint is required for GRPC exporter because aggregation service
388+
// would send metric to the CollectorEndpoint and thus collector/exporter could collect.
386389
case GRPC:
387390
bind(String.class)
388391
.annotatedWith(GrpcOtelCollectorEndpoint.class)
389392
.toInstance(args.getGrpcCollectorEndpoint());
390393
break;
391-
default:
394+
// No need to bind anything for JSON.
395+
case JSON:
392396
break;
393397
}
394398
install(args.getOTelExporterSelector().getOTelConfigurationModule());
399+
bind(boolean.class).annotatedWith(EnableOTelLogs.class).toInstance(args.isOTelLogsEnabled());
395400

396401
// Response related flags.
397402
bind(boolean.class)
@@ -457,7 +462,6 @@ Supplier<ImmutableMap<String, String>> providesLocalFileJobParameters() {
457462
@Singleton
458463
@NonBlockingThreadPool
459464
ListeningExecutorService provideNonBlockingThreadPool() {
460-
// TODO(b/281572881): Investigate on optimal value for nonBlockingThreadPool size.
461465
return MoreExecutors.listeningDecorator(
462466
Executors.newFixedThreadPool(args.getNonBlockingThreadPoolSize()));
463467
}
@@ -466,7 +470,6 @@ ListeningExecutorService provideNonBlockingThreadPool() {
466470
@Singleton
467471
@BlockingThreadPool
468472
ListeningExecutorService provideBlockingThreadPool() {
469-
// TODO(b/281572881): Investigate on optimal value for blockingThreadPool size.
470473
return MoreExecutors.listeningDecorator(
471474
Executors.newFixedThreadPool(args.getBlockingThreadPoolSize()));
472475
}
@@ -477,4 +480,13 @@ ListeningExecutorService provideBlockingThreadPool() {
477480
ListeningExecutorService provideCustomForkJoinThreadPool() {
478481
return MoreExecutors.listeningDecorator(new ForkJoinPool(args.getNonBlockingThreadPoolSize()));
479482
}
483+
484+
@Provides
485+
@InstanceId
486+
String provideInstanceID() {
487+
if (EC2MetadataUtils.getInstanceId() == null) {
488+
return "";
489+
}
490+
return EC2MetadataUtils.getInstanceId();
491+
}
480492
}

0 commit comments

Comments
 (0)