From dbc255335f041fcf6537f91bfa1b32fe21b202b0 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 30 Oct 2024 22:58:17 +0000 Subject: [PATCH 01/51] fix some issues --- .github/workflows/run-k8s-tests.yml | 4 + docs/gke/correctness-test.md | 3 +- .../reporting/ReportingUserSimulator.kt | 194 ++++++++++++++++++ .../k8s/testing/correctness_test_config.proto | 9 + .../k8s/AbstractCorrectnessTest.kt | 20 ++ .../measurement/integration/k8s/BUILD.bazel | 5 + .../k8s/EmptyClusterCorrectnessTest.kt | 4 + .../k8s/SyntheticGeneratorCorrectnessTest.kt | 36 ++++ .../correctness_test_config.tmpl.textproto | 2 + 9 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt diff --git a/.github/workflows/run-k8s-tests.yml b/.github/workflows/run-k8s-tests.yml index 0f6ccea3c86..708aa2fde6a 100644 --- a/.github/workflows/run-k8s-tests.yml +++ b/.github/workflows/run-k8s-tests.yml @@ -52,6 +52,8 @@ jobs: MC_NAME: ${{ vars.MC_NAME }} MC_API_KEY: ${{ secrets.MC_API_KEY }} GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT }} + REPORTING_PUBLIC_API_TARGET: v2alpha.reporting.dev.halo-cmm.org:8443 + REPORTING_PUBLIC_API_CERT_HOST: localhost run: | cat << EOF > ~/.bazelrc common --config=ci @@ -59,6 +61,8 @@ jobs: build --define mc_name=$MC_NAME build --define mc_api_key=$MC_API_KEY build --define google_cloud_project=$GCLOUD_PROJECT + build --define reporting_public_api_target=$REPORTING_PUBLIC_API_TARGET + build --define reporting_public_api_cert_host=$REPORTING_PUBLIC_API_CERT_HOST test --test_output=streamed test --test_timeout=3600 EOF diff --git a/docs/gke/correctness-test.md b/docs/gke/correctness-test.md index 5b738737809..055def71ac0 100644 --- a/docs/gke/correctness-test.md +++ b/docs/gke/correctness-test.md @@ -80,7 +80,8 @@ bazel test //src/test/kotlin/org/wfanet/measurement/integration/k8s:SyntheticGen --test_output=streamed \ --define=kingdom_public_api_target=v2alpha.kingdom.dev.halo-cmm.org:8443 \ --define=mc_name=measurementConsumers/Rcn7fKd25C8 \ ---define=mc_api_key=W9q4zad246g +--define=mc_api_key=W9q4zad246g \ +--define=reporting_public_api_target=v2alpha.reporting.dev.halo-cmm.org:8443 ``` The time the test takes depends on the size of the data set. With the default diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt new file mode 100644 index 00000000000..ddb6efe85af --- /dev/null +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -0,0 +1,194 @@ +/* + * Copyright 2024 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.wfanet.measurement.loadtest.reporting + +import com.google.common.truth.Truth.assertThat +import com.google.type.DayOfWeek +import com.google.type.date +import com.google.type.dateTime +import com.google.type.timeZone +import java.util.logging.Logger +import kotlinx.coroutines.delay +import org.wfanet.measurement.api.withAuthenticationKey +import org.wfanet.measurement.reporting.v2alpha.EventGroup +import org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpec +import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecKt +import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.MetricSpecKt +import org.wfanet.measurement.reporting.v2alpha.Report +import org.wfanet.measurement.reporting.v2alpha.ReportKt +import org.wfanet.measurement.reporting.v2alpha.ReportingSet +import org.wfanet.measurement.reporting.v2alpha.ReportingSetKt +import org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.ReportsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.createMetricCalculationSpecRequest +import org.wfanet.measurement.reporting.v2alpha.createReportRequest +import org.wfanet.measurement.reporting.v2alpha.createReportingSetRequest +import org.wfanet.measurement.reporting.v2alpha.getReportRequest +import org.wfanet.measurement.reporting.v2alpha.listEventGroupsRequest +import org.wfanet.measurement.reporting.v2alpha.metricCalculationSpec +import org.wfanet.measurement.reporting.v2alpha.metricSpec +import org.wfanet.measurement.reporting.v2alpha.report +import org.wfanet.measurement.reporting.v2alpha.reportingSet + +/** Simulator for Reporting operations on the Reporting public API. */ +class ReportingUserSimulator( + private val measurementConsumerName: String, + private val apiAuthenticationKey: String, + private val eventGroupsClient: EventGroupsGrpcKt.EventGroupsCoroutineStub, + private val reportingSetsClient: ReportingSetsGrpcKt.ReportingSetsCoroutineStub, + private val metricCalculationSpecsClient: + MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub, + private val reportsClient: ReportsGrpcKt.ReportsCoroutineStub, +) { + suspend fun testCreateReport(runId: String) { + logger.info("Creating report...") + + val eventGroup = listEventGroups().first() + val createdPrimitiveReportingSet = createPrimitiveReportingSet(eventGroup) + val createdMetricCalculationSpec = createMetricCalculationSpec() + + val report = report { + reportingMetricEntries += + ReportKt.reportingMetricEntry { + key = createdPrimitiveReportingSet.name + value = + ReportKt.reportingMetricCalculationSpec { + metricCalculationSpecs += createdMetricCalculationSpec.name + } + } + reportingInterval = + ReportKt.reportingInterval { + reportStart = dateTime { + year = 2024 + month = 1 + day = 3 + timeZone = timeZone { id = "America/Los_Angeles" } + } + reportEnd = date { + year = 2024 + month = 1 + day = 18 + } + } + } + + val createdReport = + reportsClient + .withAuthenticationKey(apiAuthenticationKey) + .createReport( + createReportRequest { + parent = measurementConsumerName + this.report = report + reportId = "a-$runId" + } + ) + + val completedReport = pollForCompletedReport(createdReport.name) + + assertThat(completedReport.state).isEqualTo(Report.State.SUCCEEDED) + logger.info("Report creation succeeded") + } + + private suspend fun listEventGroups(): List { + return eventGroupsClient + .withAuthenticationKey(apiAuthenticationKey) + .listEventGroups( + listEventGroupsRequest { + parent = measurementConsumerName + pageSize = 1000 + } + ) + .eventGroupsList + } + + private suspend fun createPrimitiveReportingSet(eventGroup: EventGroup): ReportingSet { + val primitiveReportingSet = reportingSet { + primitive = ReportingSetKt.primitive { cmmsEventGroups += eventGroup.cmmsEventGroup } + } + + return reportingSetsClient + .withAuthenticationKey(apiAuthenticationKey) + .createReportingSet( + createReportingSetRequest { + parent = measurementConsumerName + reportingSet = primitiveReportingSet + reportingSetId = "a-123" + } + ) + } + + private suspend fun createMetricCalculationSpec(): MetricCalculationSpec { + return metricCalculationSpecsClient + .withAuthenticationKey(apiAuthenticationKey) + .createMetricCalculationSpec( + createMetricCalculationSpecRequest { + parent = measurementConsumerName + metricCalculationSpecId = "a-123" + metricCalculationSpec = metricCalculationSpec { + displayName = "union reach" + metricSpecs += metricSpec { + reach = + MetricSpecKt.reachParams { + singleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams { } + } + multipleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams { } + } + } + } + metricFrequencySpec = + MetricCalculationSpecKt.metricFrequencySpec { + weekly = + MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { + dayOfWeek = DayOfWeek.WEDNESDAY + } + } + trailingWindow = + MetricCalculationSpecKt.trailingWindow { + count = 1 + increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK + } + } + } + ) + } + + private suspend fun pollForCompletedReport(reportName: String): Report { + while (true) { + val retrievedReport = + reportsClient + .withAuthenticationKey(apiAuthenticationKey) + .getReport(getReportRequest { name = reportName }) + + @Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA") // Proto enum fields are never null. + when (retrievedReport.state) { + Report.State.SUCCEEDED, + Report.State.FAILED -> return retrievedReport + Report.State.RUNNING, + Report.State.UNRECOGNIZED, + Report.State.STATE_UNSPECIFIED -> delay(5000) + } + } + } + + companion object { + private val logger: Logger = Logger.getLogger(this::class.java.name) + } +} diff --git a/src/main/proto/wfa/measurement/integration/k8s/testing/correctness_test_config.proto b/src/main/proto/wfa/measurement/integration/k8s/testing/correctness_test_config.proto index 4c894b4ca4f..25b14b56827 100644 --- a/src/main/proto/wfa/measurement/integration/k8s/testing/correctness_test_config.proto +++ b/src/main/proto/wfa/measurement/integration/k8s/testing/correctness_test_config.proto @@ -38,4 +38,13 @@ message CorrectnessTestConfig { // Authentication key for the CMMS public API. string api_authentication_key = 4; + + // gRPC target of Reporting public API server. + string reporting_public_api_target = 5; + + // Expected hostname (DNS-ID) in the reporting public API server's TLS + // certificate. + // + // If not specified, standard TLS DNS-ID derivation will be used. + string reporting_public_api_cert_host = 6; } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt index f4a28f4d1cd..ab081fdd41a 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt @@ -28,6 +28,7 @@ import org.wfanet.measurement.common.crypto.SigningKeyHandle import org.wfanet.measurement.integration.common.loadEncryptionPrivateKey import org.wfanet.measurement.integration.common.loadSigningKey import org.wfanet.measurement.loadtest.measurementconsumer.MeasurementConsumerSimulator +import org.wfanet.measurement.loadtest.reporting.ReportingUserSimulator /** Test for correctness of the CMMS on Kubernetes. */ abstract class AbstractCorrectnessTest(private val measurementSystem: MeasurementSystem) { @@ -37,6 +38,9 @@ abstract class AbstractCorrectnessTest(private val measurementSystem: Measuremen private val testHarness: MeasurementConsumerSimulator get() = measurementSystem.testHarness + private val reportingTestHarness: ReportingUserSimulator? + get() = measurementSystem.reportingTestHarness + @Test(timeout = 1 * 60 * 1000) fun `impression measurement completes with expected result`() = runBlocking { testHarness.testImpression("$runId-impression") @@ -63,9 +67,17 @@ abstract class AbstractCorrectnessTest(private val measurementSystem: Measuremen ) } + @Test(timeout = 1 * 60 * 1000) + fun `report can be created`() = runBlocking { + if (reportingTestHarness != null) { + reportingTestHarness!!.testCreateReport("$runId-test-report") + } + } + interface MeasurementSystem { val runId: String val testHarness: MeasurementConsumerSimulator + val reportingTestHarness: ReportingUserSimulator? } companion object { @@ -97,6 +109,14 @@ abstract class AbstractCorrectnessTest(private val measurementSystem: Measuremen SigningCerts.fromPemFiles(cert, key, trustedCerts) } + val REPORTING_SIGNING_CERTS: SigningCerts by lazy { + val secretFiles = getRuntimePath(SECRET_FILES_PATH) + val trustedCerts = secretFiles.resolve("reporting_root.pem").toFile() + val cert = secretFiles.resolve("mc_tls.pem").toFile() + val key = secretFiles.resolve("mc_tls.key").toFile() + SigningCerts.fromPemFiles(cert, key, trustedCerts) + } + val MC_ENCRYPTION_PRIVATE_KEY: PrivateKeyHandle by lazy { loadEncryptionPrivateKey(MC_ENCRYPTION_PRIVATE_KEY_NAME) } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/integration/k8s/BUILD.bazel index 3883661dbdb..2f0097c1e6f 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/BUILD.bazel @@ -13,11 +13,13 @@ kt_jvm_library( srcs = ["AbstractCorrectnessTest.kt"], data = [ "//src/main/k8s/testing/secretfiles:mc_trusted_certs.pem", + "//src/main/k8s/testing/secretfiles:reporting_root.pem", "//src/main/k8s/testing/secretfiles:secret_files", ], deps = [ "//src/main/kotlin/org/wfanet/measurement/integration/common:configs", "//src/main/kotlin/org/wfanet/measurement/loadtest/measurementconsumer:simulator", + "//src/main/kotlin/org/wfanet/measurement/loadtest/reporting:simulator", "@wfa_common_jvm//imports/java/com/google/common/truth", "@wfa_common_jvm//imports/java/org/junit", "@wfa_common_jvm//imports/kotlin/kotlinx/coroutines:core", @@ -58,6 +60,7 @@ kt_jvm_library( "//src/main/kotlin/org/wfanet/measurement/integration/common:synthetic_generation_specs", "//src/main/kotlin/org/wfanet/measurement/loadtest/config:vid_sampling", "//src/main/kotlin/org/wfanet/measurement/loadtest/measurementconsumer:synthetic_generator_event_query", + "//src/main/kotlin/org/wfanet/measurement/loadtest/reporting:simulator", "//src/main/proto/wfa/measurement/integration/k8s/testing:correctness_test_config_kt_jvm_proto", "@wfa_common_jvm//imports/java/org/junit", "@wfa_common_jvm//imports/kotlin/kotlinx/coroutines:core", @@ -74,6 +77,8 @@ expand_template( "{kingdom_public_api_cert_host}": "localhost", "{mc_name}": TEST_K8S_SETTINGS.mc_name, "{mc_api_key}": TEST_K8S_SETTINGS.mc_api_key, + "{reporting_public_api_target}": "$(reporting_public_api_target)", + "{reporting_public_api_cert_host}": "localhost", }, tags = ["manual"], template = "correctness_test_config.tmpl.textproto", diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 0ddd08ec41b..3ad68d21e3f 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -69,6 +69,7 @@ import org.wfanet.measurement.internal.kingdom.AccountsGrpcKt import org.wfanet.measurement.loadtest.measurementconsumer.MeasurementConsumerData import org.wfanet.measurement.loadtest.measurementconsumer.MeasurementConsumerSimulator import org.wfanet.measurement.loadtest.measurementconsumer.MetadataSyntheticGeneratorEventQuery +import org.wfanet.measurement.loadtest.reporting.ReportingUserSimulator import org.wfanet.measurement.loadtest.resourcesetup.DuchyCert import org.wfanet.measurement.loadtest.resourcesetup.EntityContent import org.wfanet.measurement.loadtest.resourcesetup.ResourceSetup @@ -174,6 +175,9 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override val testHarness: MeasurementConsumerSimulator get() = _testHarness + override val reportingTestHarness: ReportingUserSimulator? + get() = null + override fun apply(base: Statement, description: Description): Statement { return object : Statement() { override fun evaluate() { diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt index 86608dd80fa..7c4c9a57b24 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt @@ -41,6 +41,9 @@ import org.wfanet.measurement.loadtest.dataprovider.SyntheticGeneratorEventQuery import org.wfanet.measurement.loadtest.measurementconsumer.MeasurementConsumerData import org.wfanet.measurement.loadtest.measurementconsumer.MeasurementConsumerSimulator import org.wfanet.measurement.loadtest.measurementconsumer.MetadataSyntheticGeneratorEventQuery +import org.wfanet.measurement.loadtest.reporting.ReportingUserSimulator +import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.ReportsGrpcKt /** * Test for correctness of an existing CMMS on Kubernetes where the EDP simulators use @@ -55,9 +58,14 @@ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSys override val runId: String by lazy { UUID.randomUUID().toString() } private lateinit var _testHarness: MeasurementConsumerSimulator + private lateinit var _reportingTestHarness: ReportingUserSimulator + override val testHarness: MeasurementConsumerSimulator get() = _testHarness + override val reportingTestHarness: ReportingUserSimulator? + get() = _reportingTestHarness + private val channels = mutableListOf() override fun apply(base: Statement, description: Description): Statement { @@ -65,6 +73,7 @@ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSys override fun evaluate() { try { _testHarness = createTestHarness() + _reportingTestHarness = createReportingTestHarness() base.evaluate() } finally { shutDownChannels() @@ -110,6 +119,33 @@ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSys ) } + private fun createReportingTestHarness(): ReportingUserSimulator { + val publicApiChannel = + buildMutualTlsChannel( + TEST_CONFIG.reportingPublicApiTarget, + REPORTING_SIGNING_CERTS, + TEST_CONFIG.reportingPublicApiCertHost, + ) + .also { channels.add(it) } + .withDefaultDeadline(RPC_DEADLINE_DURATION) + + return ReportingUserSimulator( + measurementConsumerName = TEST_CONFIG.measurementConsumer, + apiAuthenticationKey = TEST_CONFIG.apiAuthenticationKey, + eventGroupsClient = + org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( + publicApiChannel + ), + reportingSetsClient = + org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineStub( + publicApiChannel + ), + metricCalculationSpecsClient = + MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub(publicApiChannel), + reportsClient = ReportsGrpcKt.ReportsCoroutineStub(publicApiChannel), + ) + } + private fun shutDownChannels() { for (channel in channels) { channel.shutdown() diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/correctness_test_config.tmpl.textproto b/src/test/kotlin/org/wfanet/measurement/integration/k8s/correctness_test_config.tmpl.textproto index a6b54b93d85..1242cd723ec 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/correctness_test_config.tmpl.textproto +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/correctness_test_config.tmpl.textproto @@ -4,3 +4,5 @@ kingdom_public_api_target: "{kingdom_public_api_target}" kingdom_public_api_cert_host: "{kingdom_public_api_cert_host}" measurement_consumer: "{mc_name}" api_authentication_key: "{mc_api_key}" +reporting_public_api_target: "{reporting_public_api_target}" +reporting_public_api_cert_host: "{reporting_public_api_cert_host}" From 15c3ea63a501060e736a02faffb6e9b1a03cf7de Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 4 Nov 2024 21:36:51 +0000 Subject: [PATCH 02/51] remove unneeded lines --- .github/workflows/run-k8s-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/run-k8s-tests.yml b/.github/workflows/run-k8s-tests.yml index 708aa2fde6a..6fd06c500d1 100644 --- a/.github/workflows/run-k8s-tests.yml +++ b/.github/workflows/run-k8s-tests.yml @@ -53,7 +53,6 @@ jobs: MC_API_KEY: ${{ secrets.MC_API_KEY }} GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT }} REPORTING_PUBLIC_API_TARGET: v2alpha.reporting.dev.halo-cmm.org:8443 - REPORTING_PUBLIC_API_CERT_HOST: localhost run: | cat << EOF > ~/.bazelrc common --config=ci @@ -62,7 +61,6 @@ jobs: build --define mc_api_key=$MC_API_KEY build --define google_cloud_project=$GCLOUD_PROJECT build --define reporting_public_api_target=$REPORTING_PUBLIC_API_TARGET - build --define reporting_public_api_cert_host=$REPORTING_PUBLIC_API_CERT_HOST test --test_output=streamed test --test_timeout=3600 EOF From 93d8d470213f264db6c13d1c353ed006eab43850 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 6 Nov 2024 21:52:06 +0000 Subject: [PATCH 03/51] Shrink time interval --- .../measurement/loadtest/reporting/ReportingUserSimulator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index ddb6efe85af..8268c36d0b1 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -83,7 +83,7 @@ class ReportingUserSimulator( reportEnd = date { year = 2024 month = 1 - day = 18 + day = 4 } } } From 6151fe48a48ffcbfd8ae2cfc1c0ccf36932f2e78 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 6 Nov 2024 22:31:58 +0000 Subject: [PATCH 04/51] Use edp with hmss if available --- .../kingdom/service/api/v2alpha/BUILD.bazel | 1 + .../loadtest/reporting/BUILD.bazel | 26 +++ .../reporting/ReportingUserSimulator.kt | 166 +++++++++++------- .../k8s/SyntheticGeneratorCorrectnessTest.kt | 1 + 4 files changed, 133 insertions(+), 61 deletions(-) create mode 100644 src/main/kotlin/org/wfanet/measurement/loadtest/reporting/BUILD.bazel diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel index 2865c224525..15694208ce0 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel @@ -8,6 +8,7 @@ package(default_visibility = [ "//src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/testing:__pkg__", "//src/main/kotlin/org/wfanet/measurement/loadtest/panelmatch:__pkg__", "//src/main/kotlin/org/wfanet/measurement/loadtest/panelmatchresourcesetup:__pkg__", + "//src/main/kotlin/org/wfanet/measurement/loadtest/reporting:__pkg__", "//src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup:__pkg__", "//src/test/kotlin/org/wfanet/measurement/integration/common:__pkg__", ]) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/BUILD.bazel new file mode 100644 index 00000000000..962beda9818 --- /dev/null +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/BUILD.bazel @@ -0,0 +1,26 @@ +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") + +package( + default_testonly = True, + default_visibility = [ + "//src/main/kotlin/org/wfanet/measurement/integration:__subpackages__", + "//src/main/kotlin/org/wfanet/measurement/loadtest:__subpackages__", + "//src/test/kotlin/org/wfanet/measurement/integration:__subpackages__", + "//src/test/kotlin/org/wfanet/measurement/loadtest:__subpackages__", + ], +) + +kt_jvm_library( + name = "simulator", + srcs = ["ReportingUserSimulator.kt"], + deps = [ + "//src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha:data_providers_service", + "//src/main/kotlin/org/wfanet/measurement/loadtest/config:test_identifiers", + "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:event_groups_service", + "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:metric_calculation_specs_service", + "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:reporting_sets_service", + "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:reports_service", + "//src/main/proto/wfa/measurement/api/v2alpha/event_templates/testing:test_event_kt_jvm_proto", + "@wfa_common_jvm//imports/java/com/google/common/truth/extensions/proto", + ], +) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index 8268c36d0b1..d83c4a73d0e 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -21,9 +21,14 @@ import com.google.type.DayOfWeek import com.google.type.date import com.google.type.dateTime import com.google.type.timeZone +import io.grpc.StatusException import java.util.logging.Logger import kotlinx.coroutines.delay +import org.wfanet.measurement.api.v2alpha.DataProvider +import org.wfanet.measurement.api.v2alpha.DataProvidersGrpcKt +import org.wfanet.measurement.api.v2alpha.getDataProviderRequest import org.wfanet.measurement.api.withAuthenticationKey +import org.wfanet.measurement.loadtest.config.TestIdentifiers import org.wfanet.measurement.reporting.v2alpha.EventGroup import org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpec @@ -50,6 +55,7 @@ import org.wfanet.measurement.reporting.v2alpha.reportingSet class ReportingUserSimulator( private val measurementConsumerName: String, private val apiAuthenticationKey: String, + private val dataProvidersClient: DataProvidersGrpcKt.DataProvidersCoroutineStub, private val eventGroupsClient: EventGroupsGrpcKt.EventGroupsCoroutineStub, private val reportingSetsClient: ReportingSetsGrpcKt.ReportingSetsCoroutineStub, private val metricCalculationSpecsClient: @@ -59,7 +65,13 @@ class ReportingUserSimulator( suspend fun testCreateReport(runId: String) { logger.info("Creating report...") - val eventGroup = listEventGroups().first() + val eventGroup = listEventGroups().filter { + it.eventGroupReferenceId.startsWith( + TestIdentifiers.SIMULATOR_EVENT_GROUP_REFERENCE_ID_PREFIX + ) + }.firstOrNull { + getDataProvider(it.cmmsDataProvider).capabilities.honestMajorityShareShuffleSupported + } ?: listEventGroups().first() val createdPrimitiveReportingSet = createPrimitiveReportingSet(eventGroup) val createdMetricCalculationSpec = createMetricCalculationSpec() @@ -89,15 +101,19 @@ class ReportingUserSimulator( } val createdReport = - reportsClient - .withAuthenticationKey(apiAuthenticationKey) - .createReport( - createReportRequest { - parent = measurementConsumerName - this.report = report - reportId = "a-$runId" - } - ) + try { + reportsClient + .withAuthenticationKey(apiAuthenticationKey) + .createReport( + createReportRequest { + parent = measurementConsumerName + this.report = report + reportId = "a-$runId" + } + ) + } catch (e: StatusException) { + throw Exception("Error creating Report", e) + } val completedReport = pollForCompletedReport(createdReport.name) @@ -106,15 +122,31 @@ class ReportingUserSimulator( } private suspend fun listEventGroups(): List { - return eventGroupsClient - .withAuthenticationKey(apiAuthenticationKey) - .listEventGroups( - listEventGroupsRequest { - parent = measurementConsumerName - pageSize = 1000 - } - ) - .eventGroupsList + try { + return eventGroupsClient + .withAuthenticationKey(apiAuthenticationKey) + .listEventGroups( + listEventGroupsRequest { + parent = measurementConsumerName + pageSize = 1000 + } + ) + .eventGroupsList + } catch (e: StatusException) { + throw Exception("Error listing EventGroups", e) + } + } + + private suspend fun getDataProvider(dataProviderName: String): DataProvider { + try { + return dataProvidersClient + .withAuthenticationKey(apiAuthenticationKey) + .getDataProvider(getDataProviderRequest { + name = dataProviderName + }) + } catch (e: StatusException) { + throw Exception("Error getting DataProvider $dataProviderName", e) + } } private suspend fun createPrimitiveReportingSet(eventGroup: EventGroup): ReportingSet { @@ -122,60 +154,72 @@ class ReportingUserSimulator( primitive = ReportingSetKt.primitive { cmmsEventGroups += eventGroup.cmmsEventGroup } } - return reportingSetsClient - .withAuthenticationKey(apiAuthenticationKey) - .createReportingSet( - createReportingSetRequest { - parent = measurementConsumerName - reportingSet = primitiveReportingSet - reportingSetId = "a-123" - } - ) + try { + return reportingSetsClient + .withAuthenticationKey(apiAuthenticationKey) + .createReportingSet( + createReportingSetRequest { + parent = measurementConsumerName + reportingSet = primitiveReportingSet + reportingSetId = "a-123" + } + ) + } catch (e: StatusException) { + throw Exception("Error creating ReportingSet", e) + } } private suspend fun createMetricCalculationSpec(): MetricCalculationSpec { - return metricCalculationSpecsClient - .withAuthenticationKey(apiAuthenticationKey) - .createMetricCalculationSpec( - createMetricCalculationSpecRequest { - parent = measurementConsumerName - metricCalculationSpecId = "a-123" - metricCalculationSpec = metricCalculationSpec { - displayName = "union reach" - metricSpecs += metricSpec { - reach = - MetricSpecKt.reachParams { - singleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { - privacyParams = MetricSpecKt.differentialPrivacyParams { } - } - multipleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { - privacyParams = MetricSpecKt.differentialPrivacyParams { } + try { + return metricCalculationSpecsClient + .withAuthenticationKey(apiAuthenticationKey) + .createMetricCalculationSpec( + createMetricCalculationSpecRequest { + parent = measurementConsumerName + metricCalculationSpecId = "a-123" + metricCalculationSpec = metricCalculationSpec { + displayName = "union reach" + metricSpecs += metricSpec { + reach = + MetricSpecKt.reachParams { + singleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams { } + } + multipleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams { } + } } + } + metricFrequencySpec = + MetricCalculationSpecKt.metricFrequencySpec { + weekly = + MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { + dayOfWeek = DayOfWeek.WEDNESDAY + } + } + trailingWindow = + MetricCalculationSpecKt.trailingWindow { + count = 1 + increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK } } - metricFrequencySpec = - MetricCalculationSpecKt.metricFrequencySpec { - weekly = - MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { - dayOfWeek = DayOfWeek.WEDNESDAY - } - } - trailingWindow = - MetricCalculationSpecKt.trailingWindow { - count = 1 - increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK - } } - } - ) + ) + } catch (e: StatusException) { + throw Exception("Error creating MetricCalculationSpec", e) + } } private suspend fun pollForCompletedReport(reportName: String): Report { while (true) { val retrievedReport = - reportsClient - .withAuthenticationKey(apiAuthenticationKey) - .getReport(getReportRequest { name = reportName }) + try { + reportsClient + .withAuthenticationKey(apiAuthenticationKey) + .getReport(getReportRequest { name = reportName }) + } catch (e: StatusException) { + throw Exception("Error getting Report", e) + } @Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA") // Proto enum fields are never null. when (retrievedReport.state) { diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt index 7c4c9a57b24..47fe2fd1cc0 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt @@ -132,6 +132,7 @@ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSys return ReportingUserSimulator( measurementConsumerName = TEST_CONFIG.measurementConsumer, apiAuthenticationKey = TEST_CONFIG.apiAuthenticationKey, + dataProvidersClient = DataProvidersGrpcKt.DataProvidersCoroutineStub(publicApiChannel), eventGroupsClient = org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( publicApiChannel From 76a836ab5595027cb90c223bbf35e3d8f885f075 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 6 Nov 2024 22:33:32 +0000 Subject: [PATCH 05/51] lint fix --- .../reporting/ReportingUserSimulator.kt | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index d83c4a73d0e..794a5f7e787 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -65,13 +65,16 @@ class ReportingUserSimulator( suspend fun testCreateReport(runId: String) { logger.info("Creating report...") - val eventGroup = listEventGroups().filter { - it.eventGroupReferenceId.startsWith( - TestIdentifiers.SIMULATOR_EVENT_GROUP_REFERENCE_ID_PREFIX - ) - }.firstOrNull { - getDataProvider(it.cmmsDataProvider).capabilities.honestMajorityShareShuffleSupported - } ?: listEventGroups().first() + val eventGroup = + listEventGroups() + .filter { + it.eventGroupReferenceId.startsWith( + TestIdentifiers.SIMULATOR_EVENT_GROUP_REFERENCE_ID_PREFIX + ) + } + .firstOrNull { + getDataProvider(it.cmmsDataProvider).capabilities.honestMajorityShareShuffleSupported + } ?: listEventGroups().first() val createdPrimitiveReportingSet = createPrimitiveReportingSet(eventGroup) val createdMetricCalculationSpec = createMetricCalculationSpec() @@ -141,9 +144,7 @@ class ReportingUserSimulator( try { return dataProvidersClient .withAuthenticationKey(apiAuthenticationKey) - .getDataProvider(getDataProviderRequest { - name = dataProviderName - }) + .getDataProvider(getDataProviderRequest { name = dataProviderName }) } catch (e: StatusException) { throw Exception("Error getting DataProvider $dataProviderName", e) } @@ -182,12 +183,14 @@ class ReportingUserSimulator( metricSpecs += metricSpec { reach = MetricSpecKt.reachParams { - singleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { - privacyParams = MetricSpecKt.differentialPrivacyParams { } - } - multipleDataProviderParams = MetricSpecKt.samplingAndPrivacyParams { - privacyParams = MetricSpecKt.differentialPrivacyParams { } - } + singleDataProviderParams = + MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams {} + } + multipleDataProviderParams = + MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams {} + } } } metricFrequencySpec = From 36cf415fb5673cae4a68329ac053735a1128cfd1 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 19:42:58 +0000 Subject: [PATCH 06/51] Test empty cluster test --- .github/workflows/run-k8s-tests.yml | 2 +- .../reporting/ReportingUserSimulator.kt | 31 ++++++------ .../k8s/AbstractCorrectnessTest.kt | 8 ++- .../k8s/EmptyClusterCorrectnessTest.kt | 49 +++++++++++++++++-- .../k8s/SyntheticGeneratorCorrectnessTest.kt | 5 +- 5 files changed, 65 insertions(+), 30 deletions(-) diff --git a/.github/workflows/run-k8s-tests.yml b/.github/workflows/run-k8s-tests.yml index 6fd06c500d1..5906348104b 100644 --- a/.github/workflows/run-k8s-tests.yml +++ b/.github/workflows/run-k8s-tests.yml @@ -52,7 +52,7 @@ jobs: MC_NAME: ${{ vars.MC_NAME }} MC_API_KEY: ${{ secrets.MC_API_KEY }} GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT }} - REPORTING_PUBLIC_API_TARGET: v2alpha.reporting.dev.halo-cmm.org:8443 + REPORTING_PUBLIC_API_TARGET: ${{ vars.REPORTING_PUBLIC_API_TARGET }} run: | cat << EOF > ~/.bazelrc common --config=ci diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index 794a5f7e787..06ccef192c7 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -27,10 +27,10 @@ import kotlinx.coroutines.delay import org.wfanet.measurement.api.v2alpha.DataProvider import org.wfanet.measurement.api.v2alpha.DataProvidersGrpcKt import org.wfanet.measurement.api.v2alpha.getDataProviderRequest -import org.wfanet.measurement.api.withAuthenticationKey import org.wfanet.measurement.loadtest.config.TestIdentifiers import org.wfanet.measurement.reporting.v2alpha.EventGroup import org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.ListEventGroupsResponse import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpec import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecKt import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecsGrpcKt @@ -54,7 +54,6 @@ import org.wfanet.measurement.reporting.v2alpha.reportingSet /** Simulator for Reporting operations on the Reporting public API. */ class ReportingUserSimulator( private val measurementConsumerName: String, - private val apiAuthenticationKey: String, private val dataProvidersClient: DataProvidersGrpcKt.DataProvidersCoroutineStub, private val eventGroupsClient: EventGroupsGrpcKt.EventGroupsCoroutineStub, private val reportingSetsClient: ReportingSetsGrpcKt.ReportingSetsCoroutineStub, @@ -106,7 +105,6 @@ class ReportingUserSimulator( val createdReport = try { reportsClient - .withAuthenticationKey(apiAuthenticationKey) .createReport( createReportRequest { parent = measurementConsumerName @@ -126,15 +124,20 @@ class ReportingUserSimulator( private suspend fun listEventGroups(): List { try { - return eventGroupsClient - .withAuthenticationKey(apiAuthenticationKey) - .listEventGroups( - listEventGroupsRequest { - parent = measurementConsumerName - pageSize = 1000 - } - ) - .eventGroupsList + return buildList { + var response: ListEventGroupsResponse = ListEventGroupsResponse.getDefaultInstance() + do { + response = eventGroupsClient + .listEventGroups( + listEventGroupsRequest { + parent = measurementConsumerName + pageSize = 1000 + pageToken = response.nextPageToken + } + ) + addAll(response.eventGroupsList) + } while (response.nextPageToken.isNotEmpty()) + } } catch (e: StatusException) { throw Exception("Error listing EventGroups", e) } @@ -143,7 +146,6 @@ class ReportingUserSimulator( private suspend fun getDataProvider(dataProviderName: String): DataProvider { try { return dataProvidersClient - .withAuthenticationKey(apiAuthenticationKey) .getDataProvider(getDataProviderRequest { name = dataProviderName }) } catch (e: StatusException) { throw Exception("Error getting DataProvider $dataProviderName", e) @@ -157,7 +159,6 @@ class ReportingUserSimulator( try { return reportingSetsClient - .withAuthenticationKey(apiAuthenticationKey) .createReportingSet( createReportingSetRequest { parent = measurementConsumerName @@ -173,7 +174,6 @@ class ReportingUserSimulator( private suspend fun createMetricCalculationSpec(): MetricCalculationSpec { try { return metricCalculationSpecsClient - .withAuthenticationKey(apiAuthenticationKey) .createMetricCalculationSpec( createMetricCalculationSpecRequest { parent = measurementConsumerName @@ -218,7 +218,6 @@ class ReportingUserSimulator( val retrievedReport = try { reportsClient - .withAuthenticationKey(apiAuthenticationKey) .getReport(getReportRequest { name = reportName }) } catch (e: StatusException) { throw Exception("Error getting Report", e) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt index ab081fdd41a..64ed27e3e9b 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/AbstractCorrectnessTest.kt @@ -38,7 +38,7 @@ abstract class AbstractCorrectnessTest(private val measurementSystem: Measuremen private val testHarness: MeasurementConsumerSimulator get() = measurementSystem.testHarness - private val reportingTestHarness: ReportingUserSimulator? + private val reportingTestHarness: ReportingUserSimulator get() = measurementSystem.reportingTestHarness @Test(timeout = 1 * 60 * 1000) @@ -69,15 +69,13 @@ abstract class AbstractCorrectnessTest(private val measurementSystem: Measuremen @Test(timeout = 1 * 60 * 1000) fun `report can be created`() = runBlocking { - if (reportingTestHarness != null) { - reportingTestHarness!!.testCreateReport("$runId-test-report") - } + reportingTestHarness.testCreateReport("$runId-test-report") } interface MeasurementSystem { val runId: String val testHarness: MeasurementConsumerSimulator - val reportingTestHarness: ReportingUserSimulator? + val reportingTestHarness: ReportingUserSimulator } companion object { diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 3ad68d21e3f..1e74c165ddf 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -74,6 +74,8 @@ import org.wfanet.measurement.loadtest.resourcesetup.DuchyCert import org.wfanet.measurement.loadtest.resourcesetup.EntityContent import org.wfanet.measurement.loadtest.resourcesetup.ResourceSetup import org.wfanet.measurement.loadtest.resourcesetup.Resources +import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.ReportsGrpcKt /** * Test for correctness of the CMMS on a single "empty" Kubernetes cluster using the `local` @@ -175,8 +177,10 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override val testHarness: MeasurementConsumerSimulator get() = _testHarness - override val reportingTestHarness: ReportingUserSimulator? - get() = null + + private lateinit var _reportingTestHarness: ReportingUserSimulator + override val reportingTestHarness: ReportingUserSimulator + get() = _reportingTestHarness override fun apply(base: Statement, description: Description): Statement { return object : Statement() { @@ -186,6 +190,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { withTimeout(Duration.ofMinutes(5)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) + _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) } } base.evaluate() @@ -263,6 +268,38 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { ) } + private suspend fun createReportingUserSimulator( + measurementConsumerData: MeasurementConsumerData + ): ReportingUserSimulator { + val reportingPublicPod: V1Pod = getPod(REPORTING_PUBLIC_DEPLOYMENT_NAME) + + val publicApiForwarder = PortForwarder(reportingPublicPod, REPORTING_SERVER_PORT) + portForwarders.add(publicApiForwarder) + + val publicApiAddress: InetSocketAddress = + withContext(Dispatchers.IO) { publicApiForwarder.start() } + val publicApiChannel: Channel = + buildMutualTlsChannel(publicApiAddress.toTarget(), MEASUREMENT_CONSUMER_SIGNING_CERTS) + .also { channels.add(it) } + .withDefaultDeadline(DEFAULT_RPC_DEADLINE) + + return ReportingUserSimulator( + measurementConsumerName = measurementConsumerData.name, + dataProvidersClient = DataProvidersGrpcKt.DataProvidersCoroutineStub(publicApiChannel), + eventGroupsClient = + org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( + publicApiChannel + ), + reportingSetsClient = + org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineStub( + publicApiChannel + ), + metricCalculationSpecsClient = + MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub(publicApiChannel), + reportsClient = ReportsGrpcKt.ReportsCoroutineStub(publicApiChannel), + ) + } + fun stopPortForwarding() { for (channel in channels) { channel.shutdown() @@ -275,8 +312,8 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File) { val appliedObjects: List = withContext(Dispatchers.IO) { - val outputDir = tempDir.newFolder("cmms") - extractTar(getRuntimePath(LOCAL_K8S_TESTING_PATH.resolve("cmms.tar")).toFile(), outputDir) + val outputDir = tempDir.newFolder("cmms_with_reporting_v2") + extractTar(getRuntimePath(LOCAL_K8S_TESTING_PATH.resolve("cmms_with_reporting_v2.tar")).toFile(), outputDir) val configFilesDir = outputDir.toPath().resolve(CONFIG_FILES_PATH).toFile() logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") @@ -284,7 +321,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val configTemplate: File = outputDir.resolve("config.yaml") kustomize( - outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms").toFile(), + outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms_with_reporting_v2").toFile(), configTemplate, ) @@ -457,9 +494,11 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } private const val SERVER_PORT: Int = 8443 + private const val REPORTING_SERVER_PORT: Int = 9443 private val DEFAULT_RPC_DEADLINE = Duration.ofSeconds(30) private const val KINGDOM_INTERNAL_DEPLOYMENT_NAME = "gcp-kingdom-data-server-deployment" private const val KINGDOM_PUBLIC_DEPLOYMENT_NAME = "v2alpha-public-api-server-deployment" + private const val REPORTING_PUBLIC_DEPLOYMENT_NAME = "reporting-v2alpha-public-api-server-deployment" private const val NUM_DATA_PROVIDERS = 6 private val EDP_DISPLAY_NAMES: List = (1..NUM_DATA_PROVIDERS).map { "edp$it" } private val READY_TIMEOUT = Duration.ofMinutes(2L) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt index 47fe2fd1cc0..6108c68c62f 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/SyntheticGeneratorCorrectnessTest.kt @@ -51,7 +51,7 @@ import org.wfanet.measurement.reporting.v2alpha.ReportsGrpcKt * The computation composition is using ACDP by assumption. * * This currently assumes that the CMMS instance is using the certificates and keys from this Bazel - * workspace. + * workspace. It also assumes that there is a Reporting system connected to the CMMS. */ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { private class RunningMeasurementSystem : MeasurementSystem, TestRule { @@ -63,7 +63,7 @@ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSys override val testHarness: MeasurementConsumerSimulator get() = _testHarness - override val reportingTestHarness: ReportingUserSimulator? + override val reportingTestHarness: ReportingUserSimulator get() = _reportingTestHarness private val channels = mutableListOf() @@ -131,7 +131,6 @@ class SyntheticGeneratorCorrectnessTest : AbstractCorrectnessTest(measurementSys return ReportingUserSimulator( measurementConsumerName = TEST_CONFIG.measurementConsumer, - apiAuthenticationKey = TEST_CONFIG.apiAuthenticationKey, dataProvidersClient = DataProvidersGrpcKt.DataProvidersCoroutineStub(publicApiChannel), eventGroupsClient = org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( From 8ab55ca13c14462a25ca6c14e87c8c59fb20a67f Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 19:54:53 +0000 Subject: [PATCH 07/51] lint fix --- src/main/k8s/local/testing/BUILD.bazel | 1 + .../reporting/ReportingUserSimulator.kt | 101 +++++++++--------- .../k8s/EmptyClusterCorrectnessTest.kt | 31 +++--- 3 files changed, 68 insertions(+), 65 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 51b188a2f9d..f19cf577b2b 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -83,6 +83,7 @@ kustomization_dir( "//src/main/k8s/local:emulators", "//src/main/k8s/local:kingdom", "//src/main/k8s/local:postgres_database", + "//src/main/k8s/local:reporting_v2", ], generate_kustomization = True, tags = ["manual"], diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index 06ccef192c7..b27c4f0c47e 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -104,14 +104,13 @@ class ReportingUserSimulator( val createdReport = try { - reportsClient - .createReport( - createReportRequest { - parent = measurementConsumerName - this.report = report - reportId = "a-$runId" - } - ) + reportsClient.createReport( + createReportRequest { + parent = measurementConsumerName + this.report = report + reportId = "a-$runId" + } + ) } catch (e: StatusException) { throw Exception("Error creating Report", e) } @@ -127,8 +126,8 @@ class ReportingUserSimulator( return buildList { var response: ListEventGroupsResponse = ListEventGroupsResponse.getDefaultInstance() do { - response = eventGroupsClient - .listEventGroups( + response = + eventGroupsClient.listEventGroups( listEventGroupsRequest { parent = measurementConsumerName pageSize = 1000 @@ -145,8 +144,7 @@ class ReportingUserSimulator( private suspend fun getDataProvider(dataProviderName: String): DataProvider { try { - return dataProvidersClient - .getDataProvider(getDataProviderRequest { name = dataProviderName }) + return dataProvidersClient.getDataProvider(getDataProviderRequest { name = dataProviderName }) } catch (e: StatusException) { throw Exception("Error getting DataProvider $dataProviderName", e) } @@ -158,14 +156,13 @@ class ReportingUserSimulator( } try { - return reportingSetsClient - .createReportingSet( - createReportingSetRequest { - parent = measurementConsumerName - reportingSet = primitiveReportingSet - reportingSetId = "a-123" - } - ) + return reportingSetsClient.createReportingSet( + createReportingSetRequest { + parent = measurementConsumerName + reportingSet = primitiveReportingSet + reportingSetId = "a-123" + } + ) } catch (e: StatusException) { throw Exception("Error creating ReportingSet", e) } @@ -173,41 +170,40 @@ class ReportingUserSimulator( private suspend fun createMetricCalculationSpec(): MetricCalculationSpec { try { - return metricCalculationSpecsClient - .createMetricCalculationSpec( - createMetricCalculationSpecRequest { - parent = measurementConsumerName - metricCalculationSpecId = "a-123" - metricCalculationSpec = metricCalculationSpec { - displayName = "union reach" - metricSpecs += metricSpec { - reach = - MetricSpecKt.reachParams { - singleDataProviderParams = - MetricSpecKt.samplingAndPrivacyParams { - privacyParams = MetricSpecKt.differentialPrivacyParams {} - } - multipleDataProviderParams = - MetricSpecKt.samplingAndPrivacyParams { - privacyParams = MetricSpecKt.differentialPrivacyParams {} - } - } - } - metricFrequencySpec = - MetricCalculationSpecKt.metricFrequencySpec { - weekly = - MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { - dayOfWeek = DayOfWeek.WEDNESDAY + return metricCalculationSpecsClient.createMetricCalculationSpec( + createMetricCalculationSpecRequest { + parent = measurementConsumerName + metricCalculationSpecId = "a-123" + metricCalculationSpec = metricCalculationSpec { + displayName = "union reach" + metricSpecs += metricSpec { + reach = + MetricSpecKt.reachParams { + singleDataProviderParams = + MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams {} + } + multipleDataProviderParams = + MetricSpecKt.samplingAndPrivacyParams { + privacyParams = MetricSpecKt.differentialPrivacyParams {} } - } - trailingWindow = - MetricCalculationSpecKt.trailingWindow { - count = 1 - increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK } } + metricFrequencySpec = + MetricCalculationSpecKt.metricFrequencySpec { + weekly = + MetricCalculationSpecKt.MetricFrequencySpecKt.weekly { + dayOfWeek = DayOfWeek.WEDNESDAY + } + } + trailingWindow = + MetricCalculationSpecKt.trailingWindow { + count = 1 + increment = MetricCalculationSpec.TrailingWindow.Increment.WEEK + } } - ) + } + ) } catch (e: StatusException) { throw Exception("Error creating MetricCalculationSpec", e) } @@ -217,8 +213,7 @@ class ReportingUserSimulator( while (true) { val retrievedReport = try { - reportsClient - .getReport(getReportRequest { name = reportName }) + reportsClient.getReport(getReportRequest { name = reportName }) } catch (e: StatusException) { throw Exception("Error getting Report", e) } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 1e74c165ddf..13c38927cf8 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -177,7 +177,6 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override val testHarness: MeasurementConsumerSimulator get() = _testHarness - private lateinit var _reportingTestHarness: ReportingUserSimulator override val reportingTestHarness: ReportingUserSimulator get() = _reportingTestHarness @@ -287,15 +286,15 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { measurementConsumerName = measurementConsumerData.name, dataProvidersClient = DataProvidersGrpcKt.DataProvidersCoroutineStub(publicApiChannel), eventGroupsClient = - org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( - publicApiChannel - ), + org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( + publicApiChannel + ), reportingSetsClient = - org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineStub( - publicApiChannel - ), + org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineStub( + publicApiChannel + ), metricCalculationSpecsClient = - MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub(publicApiChannel), + MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub(publicApiChannel), reportsClient = ReportsGrpcKt.ReportsCoroutineStub(publicApiChannel), ) } @@ -312,8 +311,11 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File) { val appliedObjects: List = withContext(Dispatchers.IO) { - val outputDir = tempDir.newFolder("cmms_with_reporting_v2") - extractTar(getRuntimePath(LOCAL_K8S_TESTING_PATH.resolve("cmms_with_reporting_v2.tar")).toFile(), outputDir) + val outputDir = tempDir.newFolder("cmms") + extractTar( + getRuntimePath(LOCAL_K8S_TESTING_PATH.resolve("cmms.tar")).toFile(), + outputDir, + ) val configFilesDir = outputDir.toPath().resolve(CONFIG_FILES_PATH).toFile() logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") @@ -321,7 +323,11 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val configTemplate: File = outputDir.resolve("config.yaml") kustomize( - outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms_with_reporting_v2").toFile(), + outputDir + .toPath() + .resolve(LOCAL_K8S_TESTING_PATH) + .resolve("cmms") + .toFile(), configTemplate, ) @@ -498,7 +504,8 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { private val DEFAULT_RPC_DEADLINE = Duration.ofSeconds(30) private const val KINGDOM_INTERNAL_DEPLOYMENT_NAME = "gcp-kingdom-data-server-deployment" private const val KINGDOM_PUBLIC_DEPLOYMENT_NAME = "v2alpha-public-api-server-deployment" - private const val REPORTING_PUBLIC_DEPLOYMENT_NAME = "reporting-v2alpha-public-api-server-deployment" + private const val REPORTING_PUBLIC_DEPLOYMENT_NAME = + "reporting-v2alpha-public-api-server-deployment" private const val NUM_DATA_PROVIDERS = 6 private val EDP_DISPLAY_NAMES: List = (1..NUM_DATA_PROVIDERS).map { "edp$it" } private val READY_TIMEOUT = Duration.ofMinutes(2L) From 6f72e32ddac1a872379e53a738ddc1f553fe7796 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 20:08:07 +0000 Subject: [PATCH 08/51] lint fix --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 13c38927cf8..5de0332e908 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -312,10 +312,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val appliedObjects: List = withContext(Dispatchers.IO) { val outputDir = tempDir.newFolder("cmms") - extractTar( - getRuntimePath(LOCAL_K8S_TESTING_PATH.resolve("cmms.tar")).toFile(), - outputDir, - ) + extractTar(getRuntimePath(LOCAL_K8S_TESTING_PATH.resolve("cmms.tar")).toFile(), outputDir) val configFilesDir = outputDir.toPath().resolve(CONFIG_FILES_PATH).toFile() logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") @@ -323,11 +320,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val configTemplate: File = outputDir.resolve("config.yaml") kustomize( - outputDir - .toPath() - .resolve(LOCAL_K8S_TESTING_PATH) - .resolve("cmms") - .toFile(), + outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms").toFile(), configTemplate, ) @@ -338,6 +331,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { .replace("{worker1_cert_name}", resourceInfo.worker1Cert) .replace("{worker2_cert_name}", resourceInfo.worker2Cert) .replace("{mc_name}", resourceInfo.measurementConsumer) + .replace("{mc_api_key", resourceInfo.apiKey) .let { var config = it for ((displayName, resource) in resourceInfo.dataProviders) { From 6196dcce36ec096f28351550bf84e2246497daab Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 20:10:37 +0000 Subject: [PATCH 09/51] update build --- src/main/k8s/local/testing/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index f19cf577b2b..e8117d6f8fb 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -90,6 +90,7 @@ kustomization_dir( deps = [ ":config_files", ":db_creds", + "//src/main/k8s/local:mc_config", "//src/main/k8s/testing/secretfiles:kustomization", ], ) From a673e8c508d8146f40bb2e1b42fd4fd88e446328 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 20:20:31 +0000 Subject: [PATCH 10/51] add cert in test --- .../k8s/EmptyClusterCorrectnessTest.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 5de0332e908..c0d604730ad 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -111,6 +111,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val worker1Cert: String, val worker2Cert: String, val measurementConsumer: String, + val measurementConsumerCert: String, val apiKey: String, val dataProviders: Map, ) { @@ -120,6 +121,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { var worker1Cert: String? = null var worker2Cert: String? = null var measurementConsumer: String? = null + var measurementConsumerCert: String? = null var apiKey: String? = null val dataProviders = mutableMapOf() @@ -129,6 +131,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { Resources.Resource.ResourceCase.MEASUREMENT_CONSUMER -> { measurementConsumer = resource.name apiKey = resource.measurementConsumer.apiKey + measurementConsumerCert = resource.measurementConsumer.certificate } Resources.Resource.ResourceCase.DATA_PROVIDER -> { val displayName = resource.dataProvider.displayName @@ -149,12 +152,13 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } return ResourceInfo( - requireNotNull(aggregatorCert), - requireNotNull(worker1Cert), - requireNotNull(worker2Cert), - requireNotNull(measurementConsumer), - requireNotNull(apiKey), - dataProviders, + aggregatorCert = requireNotNull(aggregatorCert), + worker1Cert = requireNotNull(worker1Cert), + worker2Cert = requireNotNull(worker2Cert), + measurementConsumer = requireNotNull(measurementConsumer), + measurementConsumerCert = requireNotNull(measurementConsumerCert), + apiKey = requireNotNull(apiKey), + dataProviders = dataProviders, ) } } @@ -331,7 +335,8 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { .replace("{worker1_cert_name}", resourceInfo.worker1Cert) .replace("{worker2_cert_name}", resourceInfo.worker2Cert) .replace("{mc_name}", resourceInfo.measurementConsumer) - .replace("{mc_api_key", resourceInfo.apiKey) + .replace("{mc_api_key}", resourceInfo.apiKey) + .replace("{mc_cert_name}", resourceInfo.measurementConsumerCert) .let { var config = it for ((displayName, resource) in resourceInfo.dataProviders) { From b3c98f8204bfac52d9c1b3b17528d8f2cd6929bc Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 20:30:14 +0000 Subject: [PATCH 11/51] update build --- src/main/k8s/local/testing/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index e8117d6f8fb..6afb10f4908 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS") +load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS", "TEST_K8S_SETTINGS") load("//build/k8s:defs.bzl", "kustomization_dir") load("//src/main/k8s:macros.bzl", "cue_dump") From 18fc932f614ce018ab4758fdfd4172cc0a263125 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 21:18:10 +0000 Subject: [PATCH 12/51] update build --- src/main/k8s/local/testing/BUILD.bazel | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 6afb10f4908..28ae5a95885 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS", "TEST_K8S_SETTINGS") +load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS") load("//build/k8s:defs.bzl", "kustomization_dir") load("//src/main/k8s:macros.bzl", "cue_dump") @@ -14,6 +14,8 @@ SECRET_NAME = "certs-and-configs" DB_SECRET_NAME = "db-creds" +MC_CONFIG_SECRET_NAME = "mc-config" + cue_dump( name = "duchies", cue_tags = { @@ -75,6 +77,30 @@ kustomization_dir( }, ) +expand_template( + name = "gen_measurement_consumer_config", + out = "measurement_consumer_config.textproto", + substitutions = { + "{key}": TEST_K8S_SETTINGS.mc_name, + "{api_key}": TEST_K8S_SETTINGS.mc_api_key, + "{signing_certificate_name}": TEST_K8S_SETTINGS.mc_cert_name, + }, + tags = ["manual"], + template = "measurement_consumer_config.tmpl.textproto", +) + +kustomization_dir( + name = "mc_config", + srcs = [ + "mc_config_kustomization.yaml", + ":measurement_consumer_config.textproto", + ], + renames = { + "mc_config_kustomization.yaml": "kustomization.yaml", + }, + tags = ["manual"], +) + kustomization_dir( name = "cmms", srcs = [ @@ -90,7 +116,7 @@ kustomization_dir( deps = [ ":config_files", ":db_creds", - "//src/main/k8s/local:mc_config", + ":mc_config", "//src/main/k8s/testing/secretfiles:kustomization", ], ) From 6c118eb45e62f9c5316448ec16fb9c72df893769 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 21:18:47 +0000 Subject: [PATCH 13/51] update build --- src/main/k8s/local/testing/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 28ae5a95885..9c8d7c59fe5 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS") +load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS", "TEST_K8S_SETTINGS") load("//build/k8s:defs.bzl", "kustomization_dir") load("//src/main/k8s:macros.bzl", "cue_dump") From bbe4405ab326ea5b49b8eb9d2eb2ddd3fe01b3da Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Mon, 11 Nov 2024 21:29:27 +0000 Subject: [PATCH 14/51] update build --- src/main/k8s/local/testing/BUILD.bazel | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 9c8d7c59fe5..cc5eed666df 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -1,4 +1,5 @@ -load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS", "TEST_K8S_SETTINGS") +load("@wfa_common_jvm//build:defs.bzl", "expand_template") +load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS", "TEST_K8S_SETTINGS") load("//build/k8s:defs.bzl", "kustomization_dir") load("//src/main/k8s:macros.bzl", "cue_dump") @@ -14,8 +15,6 @@ SECRET_NAME = "certs-and-configs" DB_SECRET_NAME = "db-creds" -MC_CONFIG_SECRET_NAME = "mc-config" - cue_dump( name = "duchies", cue_tags = { From 887eedfd58a6c0faff1c2a0cd52d58516135f5f5 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Tue, 12 Nov 2024 22:07:55 +0000 Subject: [PATCH 15/51] update workflow --- .github/workflows/build-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ea039a28bc9..93528038444 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -67,6 +67,8 @@ jobs: build --define worker2_id=worker2 build --define worker2_public_api_target=worker2.example.com:8443 build --define mc_name=measurementConsumers/foo + build --define mc_api_key=foo + build --define mc_cert_name=measurementConsumers/foo/certificates/bar build --define edp1_name=dataProviders/foo1 build --define edp1_cert_name=dataProviders/foo1/certificates/bar1 build --define edp2_name=dataProviders/foo2 From cd9841c523e6d867888a839302378e546a69f38d Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Tue, 12 Nov 2024 23:54:35 +0000 Subject: [PATCH 16/51] update build --- src/main/k8s/local/testing/BUILD.bazel | 29 ++------------------------ 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index cc5eed666df..e8117d6f8fb 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -1,5 +1,4 @@ -load("@wfa_common_jvm//build:defs.bzl", "expand_template") -load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS", "TEST_K8S_SETTINGS") +load("//build:variables.bzl", "IMAGE_REPOSITORY_SETTINGS") load("//build/k8s:defs.bzl", "kustomization_dir") load("//src/main/k8s:macros.bzl", "cue_dump") @@ -76,30 +75,6 @@ kustomization_dir( }, ) -expand_template( - name = "gen_measurement_consumer_config", - out = "measurement_consumer_config.textproto", - substitutions = { - "{key}": TEST_K8S_SETTINGS.mc_name, - "{api_key}": TEST_K8S_SETTINGS.mc_api_key, - "{signing_certificate_name}": TEST_K8S_SETTINGS.mc_cert_name, - }, - tags = ["manual"], - template = "measurement_consumer_config.tmpl.textproto", -) - -kustomization_dir( - name = "mc_config", - srcs = [ - "mc_config_kustomization.yaml", - ":measurement_consumer_config.textproto", - ], - renames = { - "mc_config_kustomization.yaml": "kustomization.yaml", - }, - tags = ["manual"], -) - kustomization_dir( name = "cmms", srcs = [ @@ -115,7 +90,7 @@ kustomization_dir( deps = [ ":config_files", ":db_creds", - ":mc_config", + "//src/main/k8s/local:mc_config", "//src/main/k8s/testing/secretfiles:kustomization", ], ) From b897d5a83147fece4543ab930999f7929f0c6b00 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 00:08:52 +0000 Subject: [PATCH 17/51] increases timeout to test --- .../measurement/integration/k8s/EmptyClusterCorrectnessTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index c0d604730ad..22e017ae263 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -507,7 +507,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { "reporting-v2alpha-public-api-server-deployment" private const val NUM_DATA_PROVIDERS = 6 private val EDP_DISPLAY_NAMES: List = (1..NUM_DATA_PROVIDERS).map { "edp$it" } - private val READY_TIMEOUT = Duration.ofMinutes(2L) + private val READY_TIMEOUT = Duration.ofMinutes(3L) private val LOCAL_K8S_PATH = Paths.get("src", "main", "k8s", "local") private val LOCAL_K8S_TESTING_PATH = LOCAL_K8S_PATH.resolve("testing") From 7964bd50948c87a87faa2580044cf90a7129e825 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 00:57:27 +0000 Subject: [PATCH 18/51] increase overall timeout --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 22e017ae263..1c4063f04e0 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -351,7 +351,9 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { kubectlApply(configContent) } - waitUntilDeploymentsComplete(appliedObjects) + withTimeout(Duration.ofMinutes(10)) { + waitUntilDeploymentsComplete(appliedObjects) + } } private suspend fun loadKingdom() { @@ -507,7 +509,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { "reporting-v2alpha-public-api-server-deployment" private const val NUM_DATA_PROVIDERS = 6 private val EDP_DISPLAY_NAMES: List = (1..NUM_DATA_PROVIDERS).map { "edp$it" } - private val READY_TIMEOUT = Duration.ofMinutes(3L) + private val READY_TIMEOUT = Duration.ofMinutes(2L) private val LOCAL_K8S_PATH = Paths.get("src", "main", "k8s", "local") private val LOCAL_K8S_TESTING_PATH = LOCAL_K8S_PATH.resolve("testing") From f6c89ecddd42fb2a3c022d1f4a4a0b183d8d0351 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 01:05:51 +0000 Subject: [PATCH 19/51] increase overall timeout --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 1c4063f04e0..420c36996f1 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -190,7 +190,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(5)) { + withTimeout(Duration.ofMinutes(10)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) @@ -351,9 +351,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { kubectlApply(configContent) } - withTimeout(Duration.ofMinutes(10)) { - waitUntilDeploymentsComplete(appliedObjects) - } + waitUntilDeploymentsComplete(appliedObjects) } private suspend fun loadKingdom() { From f88d58f25c7fcbf139b3f71345d10484a070e119 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 01:28:50 +0000 Subject: [PATCH 20/51] add logging --- .../wfanet/measurement/common/k8s/KubernetesClient.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt index 2a2beec17e3..eba50520c21 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt +++ b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt @@ -253,6 +253,16 @@ class KubernetesClientImpl( .buildCall(null) ) .filter { response: Watch.Response -> + watch( + coreApi + .listNamespacedPod(namespace) + .fieldSelector("metadata.name=$name") + .timeoutSeconds(timeout.seconds.toInt()) + .watch(true) + .buildCall(null) + ) + .collect { println("Pod status $name: ${it.`object`.status}") } + when (WatchEventType.valueOf(response.type)) { WatchEventType.ADDED, WatchEventType.MODIFIED -> true From 69fadaec7952df241d849d533d458750f8445a7d Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 01:30:41 +0000 Subject: [PATCH 21/51] add logging --- .../org/wfanet/measurement/common/k8s/KubernetesClient.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt index eba50520c21..731b3cbde5a 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt +++ b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt @@ -261,7 +261,10 @@ class KubernetesClientImpl( .watch(true) .buildCall(null) ) - .collect { println("Pod status $name: ${it.`object`.status}") } + .collect { + println("Pod status $name: ${it.`object`.status}") + println("Pod spec $name: ${it.`object`.spec.toJson()}") + } when (WatchEventType.valueOf(response.type)) { WatchEventType.ADDED, From da9e933c975dedd5310a0c6c33edea588c0f44d1 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 01:31:25 +0000 Subject: [PATCH 22/51] add logging --- .../org/wfanet/measurement/common/k8s/KubernetesClient.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt index 731b3cbde5a..5575248f98f 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt +++ b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt @@ -54,6 +54,7 @@ import kotlin.random.Random import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.awaitClose +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.buffer import kotlinx.coroutines.flow.channelFlow @@ -266,6 +267,8 @@ class KubernetesClientImpl( println("Pod spec $name: ${it.`object`.spec.toJson()}") } + delay(Duration.ofSeconds(5).toMillis()) + when (WatchEventType.valueOf(response.type)) { WatchEventType.ADDED, WatchEventType.MODIFIED -> true From 071b3543a72a37835f61567a88c0b8af4980e4df Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 05:12:32 +0000 Subject: [PATCH 23/51] add logging --- .../org/wfanet/measurement/common/k8s/KubernetesClient.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt index 5575248f98f..22960890519 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt +++ b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt @@ -258,7 +258,7 @@ class KubernetesClientImpl( coreApi .listNamespacedPod(namespace) .fieldSelector("metadata.name=$name") - .timeoutSeconds(timeout.seconds.toInt()) + .timeoutSeconds(1) .watch(true) .buildCall(null) ) @@ -267,8 +267,6 @@ class KubernetesClientImpl( println("Pod spec $name: ${it.`object`.spec.toJson()}") } - delay(Duration.ofSeconds(5).toMillis()) - when (WatchEventType.valueOf(response.type)) { WatchEventType.ADDED, WatchEventType.MODIFIED -> true From 9c6592a018d419e9332d11178c832ee404aafbac Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 05:39:30 +0000 Subject: [PATCH 24/51] remove logging --- .../measurement/common/k8s/KubernetesClient.kt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt index 22960890519..2a2beec17e3 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt +++ b/src/main/kotlin/org/wfanet/measurement/common/k8s/KubernetesClient.kt @@ -54,7 +54,6 @@ import kotlin.random.Random import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.awaitClose -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.buffer import kotlinx.coroutines.flow.channelFlow @@ -254,19 +253,6 @@ class KubernetesClientImpl( .buildCall(null) ) .filter { response: Watch.Response -> - watch( - coreApi - .listNamespacedPod(namespace) - .fieldSelector("metadata.name=$name") - .timeoutSeconds(1) - .watch(true) - .buildCall(null) - ) - .collect { - println("Pod status $name: ${it.`object`.status}") - println("Pod spec $name: ${it.`object`.spec.toJson()}") - } - when (WatchEventType.valueOf(response.type)) { WatchEventType.ADDED, WatchEventType.MODIFIED -> true From 85e50af33a21ba44500ebc2fb6ad419e992dbd22 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 16:08:31 +0000 Subject: [PATCH 25/51] update config files --- src/main/k8s/local/testing/BUILD.bazel | 2 ++ src/main/k8s/local/testing/config_files_kustomization.yaml | 2 ++ .../measurement/integration/k8s/EmptyClusterCorrectnessTest.kt | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index e8117d6f8fb..495b0b64038 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -61,8 +61,10 @@ kustomization_dir( name = "config_files", srcs = [ "config_files_kustomization.yaml", + "//src/main/k8s/local:encryption_key_pair_config.textproto", "//src/main/k8s/testing/data:synthetic_generation_specs_small", "//src/main/k8s/testing/secretfiles:known_event_group_metadata_type_set", + "//src/main/k8s/testing/secretfiles:metric_spec_config.textproto", ], renames = {"config_files_kustomization.yaml": "kustomization.yaml"}, ) diff --git a/src/main/k8s/local/testing/config_files_kustomization.yaml b/src/main/k8s/local/testing/config_files_kustomization.yaml index d882167e307..71c188ba7fb 100644 --- a/src/main/k8s/local/testing/config_files_kustomization.yaml +++ b/src/main/k8s/local/testing/config_files_kustomization.yaml @@ -16,6 +16,8 @@ configMapGenerator: - name: config-files files: - authority_key_identifier_to_principal_map.textproto + - encryption_key_pair_config.textproto + - metric_spec_config.textproto - synthetic_population_spec_small.textproto - synthetic_event_group_spec_small_1.textproto - synthetic_event_group_spec_small_2.textproto diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 420c36996f1..c0d604730ad 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -190,7 +190,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(10)) { + withTimeout(Duration.ofMinutes(5)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) From 160680574d7c1c4aa9daf752d3e3698dd7fa5ca9 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 16:38:54 +0000 Subject: [PATCH 26/51] add debug logging --- .../measurement/loadtest/reporting/ReportingUserSimulator.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index b27c4f0c47e..f673f309728 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -122,6 +122,7 @@ class ReportingUserSimulator( } private suspend fun listEventGroups(): List { + println("measurement consumer name: $measurementConsumerName") try { return buildList { var response: ListEventGroupsResponse = ListEventGroupsResponse.getDefaultInstance() From cdc5c667d53bdccb6e2ae302c5ffb4168b295453 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 16:56:18 +0000 Subject: [PATCH 27/51] add debug logging --- .../measurement/loadtest/reporting/ReportingUserSimulator.kt | 1 - .../reporting/service/api/v2alpha/EventGroupsService.kt | 1 + .../measurement/integration/k8s/EmptyClusterCorrectnessTest.kt | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt index f673f309728..b27c4f0c47e 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/reporting/ReportingUserSimulator.kt @@ -122,7 +122,6 @@ class ReportingUserSimulator( } private suspend fun listEventGroups(): List { - println("measurement consumer name: $measurementConsumerName") try { return buildList { var response: ListEventGroupsResponse = ListEventGroupsResponse.getDefaultInstance() diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt index 825e90c2bff..e2d10e2b190 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt @@ -54,6 +54,7 @@ class EventGroupsService( private val celEnvProvider: CelEnvProvider, ) : EventGroupsCoroutineImplBase() { override suspend fun listEventGroups(request: ListEventGroupsRequest): ListEventGroupsResponse { + println("testing testing testing") val parentKey = grpcRequireNotNull(MeasurementConsumerKey.fromName(request.parent)) { "Parent is either unspecified or invalid." diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index c0d604730ad..a8afe92d193 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -75,6 +75,7 @@ import org.wfanet.measurement.loadtest.resourcesetup.EntityContent import org.wfanet.measurement.loadtest.resourcesetup.ResourceSetup import org.wfanet.measurement.loadtest.resourcesetup.Resources import org.wfanet.measurement.reporting.v2alpha.MetricCalculationSpecsGrpcKt +import org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt import org.wfanet.measurement.reporting.v2alpha.ReportsGrpcKt /** @@ -294,7 +295,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { publicApiChannel ), reportingSetsClient = - org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineStub( + ReportingSetsGrpcKt.ReportingSetsCoroutineStub( publicApiChannel ), metricCalculationSpecsClient = From 098ef40687ca0d6d12cb13b18b3fae67cf3928a5 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Wed, 13 Nov 2024 17:14:52 +0000 Subject: [PATCH 28/51] add debug logging --- .../reporting/service/api/v2alpha/EventGroupsService.kt | 1 - .../measurement/integration/k8s/EmptyClusterCorrectnessTest.kt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt index e2d10e2b190..825e90c2bff 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/EventGroupsService.kt @@ -54,7 +54,6 @@ class EventGroupsService( private val celEnvProvider: CelEnvProvider, ) : EventGroupsCoroutineImplBase() { override suspend fun listEventGroups(request: ListEventGroupsRequest): ListEventGroupsResponse { - println("testing testing testing") val parentKey = grpcRequireNotNull(MeasurementConsumerKey.fromName(request.parent)) { "Parent is either unspecified or invalid." diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index a8afe92d193..8337ffe1dd1 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -277,7 +277,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { ): ReportingUserSimulator { val reportingPublicPod: V1Pod = getPod(REPORTING_PUBLIC_DEPLOYMENT_NAME) - val publicApiForwarder = PortForwarder(reportingPublicPod, REPORTING_SERVER_PORT) + val publicApiForwarder = PortForwarder(reportingPublicPod, SERVER_PORT) portForwarders.add(publicApiForwarder) val publicApiAddress: InetSocketAddress = @@ -500,7 +500,6 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } private const val SERVER_PORT: Int = 8443 - private const val REPORTING_SERVER_PORT: Int = 9443 private val DEFAULT_RPC_DEADLINE = Duration.ofSeconds(30) private const val KINGDOM_INTERNAL_DEPLOYMENT_NAME = "gcp-kingdom-data-server-deployment" private const val KINGDOM_PUBLIC_DEPLOYMENT_NAME = "v2alpha-public-api-server-deployment" From 5cb0b1948c61cf9896062032381aa63ec9e37dab Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 20:04:26 +0000 Subject: [PATCH 29/51] output config file --- .../loadtest/resourcesetup/BUILD.bazel | 1 + .../loadtest/resourcesetup/ResourceSetup.kt | 21 +++++++++++++++++++ .../k8s/EmptyClusterCorrectnessTest.kt | 2 ++ 3 files changed, 24 insertions(+) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel index f4a374643f5..50bdebccb33 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel @@ -36,6 +36,7 @@ kt_jvm_library( "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumer_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/config:authority_key_to_principal_map_kt_jvm_proto", + "//src/main/proto/wfa/measurement/config/reporting:measurement_consumer_config_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/kingdom:account_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/kingdom:accounts_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/kingdom:certificate_kt_jvm_proto", diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt index 4bae0c8d911..8bed540b191 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt @@ -65,6 +65,8 @@ import org.wfanet.measurement.internal.kingdom.account as internalAccount import org.wfanet.measurement.internal.kingdom.certificate as internalCertificate import org.wfanet.measurement.internal.kingdom.createMeasurementConsumerCreationTokenRequest import org.wfanet.measurement.internal.kingdom.dataProvider as internalDataProvider +import org.wfanet.measurement.config.reporting.measurementConsumerConfig +import org.wfanet.measurement.config.reporting.measurementConsumerConfigs import org.wfanet.measurement.internal.kingdom.dataProviderDetails import org.wfanet.measurement.kingdom.service.api.v2alpha.fillCertificateFromDer import org.wfanet.measurement.kingdom.service.api.v2alpha.parseCertificateDer @@ -213,6 +215,23 @@ class ResourceSetup( TextFormat.printer().print(akidMap, writer) } + val measurementConsumerConfig = measurementConsumerConfigs { + for (resource in resources) { + when (resource.resourceCase) { + Resources.Resource.ResourceCase.MEASUREMENT_CONSUMER -> + configs.put(resource.name, measurementConsumerConfig { + apiKey = resource.measurementConsumer.apiKey + signingCertificateName = resource.measurementConsumer.certificate + signingPrivateKeyPath = MEASUREMENT_CONSUMER_SIGNING_PRIVATE_KEY_PATH + }) + else -> continue + } + } + } + output.resolve(MEASUREMENT_CONSUMER_CONFIG_FILE).writer().use { writer -> + TextFormat.printer().print(measurementConsumerConfig, writer) + } + val configName = bazelConfigName output.resolve(BAZEL_RC_FILE).writer().use { writer -> for (resource in resources) { @@ -413,6 +432,8 @@ class ResourceSetup( const val RESOURCES_OUTPUT_FILE = "resources.textproto" const val AKID_PRINCIPAL_MAP_FILE = "authority_key_identifier_to_principal_map.textproto" const val BAZEL_RC_FILE = "resource-setup.bazelrc" + const val MEASUREMENT_CONSUMER_CONFIG_FILE = "measurement_consumer_config.textproto" + const val MEASUREMENT_CONSUMER_SIGNING_PRIVATE_KEY_PATH = "mc_cs_private.der" private val logger: Logger = Logger.getLogger(this::class.java.name) } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 8337ffe1dd1..ba3828f8743 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -425,6 +425,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { return ResourceSetupOutput( resources, outputDir.resolve(ResourceSetup.AKID_PRINCIPAL_MAP_FILE), + outputDir.resolve(ResourceSetup.MEASUREMENT_CONSUMER_CONFIG_FILE), ) } @@ -486,6 +487,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { data class ResourceSetupOutput( val resources: List, val akidPrincipalMap: File, + val measurementConsumerConfig: File, ) } From 4dbd6248870eaf787e55667575cc76f165fdb7b2 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 20:29:00 +0000 Subject: [PATCH 30/51] output config file --- src/main/k8s/local/testing/BUILD.bazel | 14 +++++++++++++- .../local/testing/mc_config_kustomization.yaml | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/main/k8s/local/testing/mc_config_kustomization.yaml diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 495b0b64038..028976dd23b 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -77,6 +77,18 @@ kustomization_dir( }, ) +kustomization_dir( + name = "mc_config", + srcs = [ + "mc_config_kustomization.yaml", + ":measurement_consumer_config.textproto", + ], + renames = { + "mc_config_kustomization.yaml": "kustomization.yaml", + }, + tags = ["manual"], +) + kustomization_dir( name = "cmms", srcs = [ @@ -92,7 +104,7 @@ kustomization_dir( deps = [ ":config_files", ":db_creds", - "//src/main/k8s/local:mc_config", + ":mc_config", "//src/main/k8s/testing/secretfiles:kustomization", ], ) diff --git a/src/main/k8s/local/testing/mc_config_kustomization.yaml b/src/main/k8s/local/testing/mc_config_kustomization.yaml new file mode 100644 index 00000000000..3c66beda716 --- /dev/null +++ b/src/main/k8s/local/testing/mc_config_kustomization.yaml @@ -0,0 +1,18 @@ +# Copyright 2023 The Cross-Media Measurement Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +secretGenerator: +- name: mc-config + files: + - measurement_consumer_config.textproto From f6ea852b599f38eb020dfdbdd95d02d8541db6b0 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 20:46:08 +0000 Subject: [PATCH 31/51] output config file --- src/main/k8s/local/testing/BUILD.bazel | 14 +------------- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 028976dd23b..495b0b64038 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -77,18 +77,6 @@ kustomization_dir( }, ) -kustomization_dir( - name = "mc_config", - srcs = [ - "mc_config_kustomization.yaml", - ":measurement_consumer_config.textproto", - ], - renames = { - "mc_config_kustomization.yaml": "kustomization.yaml", - }, - tags = ["manual"], -) - kustomization_dir( name = "cmms", srcs = [ @@ -104,7 +92,7 @@ kustomization_dir( deps = [ ":config_files", ":db_creds", - ":mc_config", + "//src/main/k8s/local:mc_config", "//src/main/k8s/testing/secretfiles:kustomization", ], ) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index ba3828f8743..877cdc838d6 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -225,7 +225,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val resourceSetupOutput = runResourceSetup(duchyCerts, edpEntityContents, measurementConsumerContent) val resourceInfo = ResourceInfo.from(resourceSetupOutput.resources) - loadFullCmms(resourceInfo, resourceSetupOutput.akidPrincipalMap) + loadFullCmms(resourceInfo, resourceSetupOutput.akidPrincipalMap, resourceSetupOutput.measurementConsumerConfig) val encryptionPrivateKey: TinkPrivateKeyHandle = withContext(Dispatchers.IO) { @@ -313,7 +313,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } } - private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File) { + private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File, measurementConsumerConfig: File) { val appliedObjects: List = withContext(Dispatchers.IO) { val outputDir = tempDir.newFolder("cmms") @@ -323,6 +323,10 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") akidPrincipalMap.copyTo(configFilesDir.resolve(akidPrincipalMap.name)) + val mcConfigDir = outputDir.toPath().resolve(MC_CONFIG_PATH).toFile() + logger.info("Copying $measurementConsumerConfig to $MC_CONFIG_PATH") + measurementConsumerConfig.copyTo(mcConfigDir.resolve(measurementConsumerConfig.name)) + val configTemplate: File = outputDir.resolve("config.yaml") kustomize( outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms").toFile(), @@ -514,6 +518,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { private val LOCAL_K8S_PATH = Paths.get("src", "main", "k8s", "local") private val LOCAL_K8S_TESTING_PATH = LOCAL_K8S_PATH.resolve("testing") private val CONFIG_FILES_PATH = LOCAL_K8S_TESTING_PATH.resolve("config_files") + private val MC_CONFIG_PATH = LOCAL_K8S_TESTING_PATH.resolve("mc_config") private val IMAGE_PUSHER_PATH = Paths.get("src", "main", "docker", "push_all_local_images.bash") private val tempDir = TemporaryFolder() From f3f5cb62b9e9d03d020b26f09c0c57b4323cbc7a Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 21:04:28 +0000 Subject: [PATCH 32/51] add delay --- .../measurement/loadtest/resourcesetup/ResourceSetup.kt | 1 + .../integration/k8s/EmptyClusterCorrectnessTest.kt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt index 8bed540b191..68c4b8e002a 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt @@ -228,6 +228,7 @@ class ResourceSetup( } } } + println("measurement consumer config: $measurementConsumerConfig") output.resolve(MEASUREMENT_CONSUMER_CONFIG_FILE).writer().use { writer -> TextFormat.printer().print(measurementConsumerConfig, writer) } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 877cdc838d6..9041eac9aaa 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -32,6 +32,7 @@ import java.time.Duration import java.util.UUID import java.util.logging.Logger import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import kotlinx.coroutines.time.withTimeout import kotlinx.coroutines.withContext @@ -191,9 +192,10 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(5)) { + withTimeout(Duration.ofMinutes(6)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) + delay(30000) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) } } From cf81c311f061078cf02b4784f3ccf6732c72d103 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 21:27:22 +0000 Subject: [PATCH 33/51] increase delay --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 9041eac9aaa..336fa3112a7 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -192,10 +192,10 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(6)) { + withTimeout(Duration.ofMinutes(7)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) - delay(30000) + delay(60000) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) } } From 5dd8795bc04dedee295980f79f01189569007664 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 21:44:10 +0000 Subject: [PATCH 34/51] increase delay --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 336fa3112a7..6218a31e55e 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -192,10 +192,10 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(7)) { + withTimeout(Duration.ofMinutes(8)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) - delay(60000) + delay(120000) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) } } From 2235174fb7ae86755508197d4fc24ee65b77a4e3 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 22:48:03 +0000 Subject: [PATCH 35/51] increase delay --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 6218a31e55e..a66ced7799e 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -192,10 +192,10 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(8)) { + withTimeout(Duration.ofMinutes(10)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) - delay(120000) + delay(240000) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) } } From 391b99b33e657ac4d547e96f5b73ab625deb019b Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 14 Nov 2024 23:40:58 +0000 Subject: [PATCH 36/51] change cert --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index a66ced7799e..b6cbc9abd21 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -192,10 +192,9 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { override fun evaluate() { try { runBlocking { - withTimeout(Duration.ofMinutes(10)) { + withTimeout(Duration.ofMinutes(5)) { val measurementConsumerData = populateCluster() _testHarness = createTestHarness(measurementConsumerData) - delay(240000) _reportingTestHarness = createReportingUserSimulator(measurementConsumerData) } } @@ -285,7 +284,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val publicApiAddress: InetSocketAddress = withContext(Dispatchers.IO) { publicApiForwarder.start() } val publicApiChannel: Channel = - buildMutualTlsChannel(publicApiAddress.toTarget(), MEASUREMENT_CONSUMER_SIGNING_CERTS) + buildMutualTlsChannel(publicApiAddress.toTarget(), REPORTING_SIGNING_CERTS) .also { channels.add(it) } .withDefaultDeadline(DEFAULT_RPC_DEADLINE) From 8d783b778fde05f69dc6f3f4952ebf88bde805d4 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 00:12:36 +0000 Subject: [PATCH 37/51] add debug logging --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index b6cbc9abd21..2e6f6d7c6eb 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -354,9 +354,13 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { config } + println("config content: $configContent") kubectlApply(configContent) } + for (appliedObject in appliedObjects) { + println("appliedObject: ${appliedObject.metadata.name}") + } waitUntilDeploymentsComplete(appliedObjects) } From 664be790c016d9afa5e175a9aa46e53f8bd9fba2 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 00:38:07 +0000 Subject: [PATCH 38/51] add debug logging --- .../wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt | 1 - .../measurement/integration/k8s/EmptyClusterCorrectnessTest.kt | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt index 68c4b8e002a..8bed540b191 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt @@ -228,7 +228,6 @@ class ResourceSetup( } } } - println("measurement consumer config: $measurementConsumerConfig") output.resolve(MEASUREMENT_CONSUMER_CONFIG_FILE).writer().use { writer -> TextFormat.printer().print(measurementConsumerConfig, writer) } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 2e6f6d7c6eb..2d9e89e80aa 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -315,6 +315,8 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File, measurementConsumerConfig: File) { + println("print akidPrincipalMap: $akidPrincipalMap") + println("print measurementConsumerConfig: $measurementConsumerConfig") val appliedObjects: List = withContext(Dispatchers.IO) { val outputDir = tempDir.newFolder("cmms") From 188686a4225b3dfd9ea3f981343fbc9c4b05a6a9 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 00:44:48 +0000 Subject: [PATCH 39/51] add debug logging --- .../deploy/v2/common/server/V2AlphaPublicApiServer.kt | 2 ++ .../integration/k8s/EmptyClusterCorrectnessTest.kt | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt index bfb517477e5..8437cb5566a 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt @@ -144,6 +144,8 @@ private object V2AlphaPublicApiServer { MeasurementConsumerConfigs.getDefaultInstance(), ) + println("measurement consumer config: $measurementConsumerConfigs") + val internalMeasurementConsumersCoroutineStub = InternalMeasurementConsumersCoroutineStub(channel) runBlocking { diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 2d9e89e80aa..e1b5dcd82eb 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -315,8 +315,6 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File, measurementConsumerConfig: File) { - println("print akidPrincipalMap: $akidPrincipalMap") - println("print measurementConsumerConfig: $measurementConsumerConfig") val appliedObjects: List = withContext(Dispatchers.IO) { val outputDir = tempDir.newFolder("cmms") @@ -356,13 +354,8 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { config } - println("config content: $configContent") kubectlApply(configContent) } - - for (appliedObject in appliedObjects) { - println("appliedObject: ${appliedObject.metadata.name}") - } waitUntilDeploymentsComplete(appliedObjects) } From 10f6569c47c0b7a1866501cd547e81d759bc4700 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 02:13:26 +0000 Subject: [PATCH 40/51] add debug logging --- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index e1b5dcd82eb..aac8a347bb5 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -59,7 +59,9 @@ import org.wfanet.measurement.common.k8s.KubernetesClient import org.wfanet.measurement.common.k8s.KubernetesClientImpl import org.wfanet.measurement.common.k8s.testing.PortForwarder import org.wfanet.measurement.common.k8s.testing.Processes +import org.wfanet.measurement.common.parseTextProto import org.wfanet.measurement.common.testing.chainRulesSequentially +import org.wfanet.measurement.config.reporting.MeasurementConsumerConfigs import org.wfanet.measurement.integration.common.ALL_DUCHY_NAMES import org.wfanet.measurement.integration.common.MC_DISPLAY_NAME import org.wfanet.measurement.integration.common.SyntheticGenerationSpecs @@ -328,6 +330,8 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { logger.info("Copying $measurementConsumerConfig to $MC_CONFIG_PATH") measurementConsumerConfig.copyTo(mcConfigDir.resolve(measurementConsumerConfig.name)) + println("measurement consumer config text: ${parseTextProto(measurementConsumerConfig, MeasurementConsumerConfigs.getDefaultInstance())}") + val configTemplate: File = outputDir.resolve("config.yaml") kustomize( outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms").toFile(), From 5d2b7f46a068a27f13dd34b145546d9ceea752cc Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 06:31:11 +0000 Subject: [PATCH 41/51] add debug logging --- src/main/k8s/local/testing/BUILD.bazel | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 495b0b64038..f87016564d9 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -77,6 +77,18 @@ kustomization_dir( }, ) +kustomization_dir( + name = "mc_config", + srcs = [ + "mc_config_kustomization.yaml", + "//src/main/k8s/local/testing/secretfiles:measurement_consumer_config.textproto", + ], + renames = { + "mc_config_kustomization.yaml": "kustomization.yaml", + }, + tags = ["manual"], +) + kustomization_dir( name = "cmms", srcs = [ @@ -92,7 +104,7 @@ kustomization_dir( deps = [ ":config_files", ":db_creds", - "//src/main/k8s/local:mc_config", + ":mc_config", "//src/main/k8s/testing/secretfiles:kustomization", ], ) From b9349f14d5c92749e348a75aa38863a29543a9db Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 06:57:41 +0000 Subject: [PATCH 42/51] add debug logging --- src/main/k8s/local/testing/BUILD.bazel | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index f87016564d9..d6914107ed4 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -79,10 +79,7 @@ kustomization_dir( kustomization_dir( name = "mc_config", - srcs = [ - "mc_config_kustomization.yaml", - "//src/main/k8s/local/testing/secretfiles:measurement_consumer_config.textproto", - ], + srcs = ["mc_config_kustomization.yaml"], renames = { "mc_config_kustomization.yaml": "kustomization.yaml", }, From 79c02756c5ade93979c6329bc3438e6f00f48121 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 15:11:30 +0000 Subject: [PATCH 43/51] add debug logging --- .../deploy/v2/common/server/V2AlphaPublicApiServer.kt | 4 ++-- .../integration/k8s/EmptyClusterCorrectnessTest.kt | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt index 8437cb5566a..6e1a2a1154d 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt @@ -109,6 +109,8 @@ private object V2AlphaPublicApiServer { @CommandLine.Mixin v2AlphaPublicServerFlags: V2AlphaPublicServerFlags, @CommandLine.Mixin encryptionKeyPairMap: EncryptionKeyPairMap, ) { + println("encryption key pair config: ${encryptionKeyPairMap.keyPairs.entries}") + val clientCerts = SigningCerts.fromPemFiles( certificateFile = commonServerFlags.tlsFlags.certFile, @@ -144,8 +146,6 @@ private object V2AlphaPublicApiServer { MeasurementConsumerConfigs.getDefaultInstance(), ) - println("measurement consumer config: $measurementConsumerConfigs") - val internalMeasurementConsumersCoroutineStub = InternalMeasurementConsumersCoroutineStub(channel) runBlocking { diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index aac8a347bb5..c8dd1163675 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -330,8 +330,6 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { logger.info("Copying $measurementConsumerConfig to $MC_CONFIG_PATH") measurementConsumerConfig.copyTo(mcConfigDir.resolve(measurementConsumerConfig.name)) - println("measurement consumer config text: ${parseTextProto(measurementConsumerConfig, MeasurementConsumerConfigs.getDefaultInstance())}") - val configTemplate: File = outputDir.resolve("config.yaml") kustomize( outputDir.toPath().resolve(LOCAL_K8S_TESTING_PATH).resolve("cmms").toFile(), From a797b9188eab5dab80a57d718b44875f35886c6b Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 16:05:38 +0000 Subject: [PATCH 44/51] fix config --- src/main/k8s/local/testing/BUILD.bazel | 1 - .../loadtest/resourcesetup/ResourceSetup.kt | 24 +++++++++++++++++++ .../common/server/V2AlphaPublicApiServer.kt | 1 - .../k8s/EmptyClusterCorrectnessTest.kt | 9 +++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index d6914107ed4..7086c2c45ed 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -61,7 +61,6 @@ kustomization_dir( name = "config_files", srcs = [ "config_files_kustomization.yaml", - "//src/main/k8s/local:encryption_key_pair_config.textproto", "//src/main/k8s/testing/data:synthetic_generation_specs_small", "//src/main/k8s/testing/secretfiles:known_event_group_metadata_type_set", "//src/main/k8s/testing/secretfiles:metric_spec_config.textproto", diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt index 8bed540b191..fcd3fe6727e 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt @@ -65,6 +65,8 @@ import org.wfanet.measurement.internal.kingdom.account as internalAccount import org.wfanet.measurement.internal.kingdom.certificate as internalCertificate import org.wfanet.measurement.internal.kingdom.createMeasurementConsumerCreationTokenRequest import org.wfanet.measurement.internal.kingdom.dataProvider as internalDataProvider +import org.wfanet.measurement.config.reporting.EncryptionKeyPairConfigKt +import org.wfanet.measurement.config.reporting.encryptionKeyPairConfig import org.wfanet.measurement.config.reporting.measurementConsumerConfig import org.wfanet.measurement.config.reporting.measurementConsumerConfigs import org.wfanet.measurement.internal.kingdom.dataProviderDetails @@ -232,6 +234,25 @@ class ResourceSetup( TextFormat.printer().print(measurementConsumerConfig, writer) } + val encryptionKeyPairConfig = encryptionKeyPairConfig { + for (resource in resources) { + when (resource.resourceCase) { + Resources.Resource.ResourceCase.MEASUREMENT_CONSUMER -> + principalKeyPairs += EncryptionKeyPairConfigKt.principalKeyPairs { + principal = resource.name + keyPairs += EncryptionKeyPairConfigKt.keyPair { + publicKeyFile = MEASUREMENT_CONSUMER_ENCRYPTION_PUBLIC_KEY_PATH + privateKeyFile = MEASUREMENT_CONSUMER_ENCRYPTION_PRIVATE_KEY_PATH + } + } + else -> continue + } + } + } + output.resolve(ENCRYPTION_KEY_PAIR_CONFIG_FILE).writer().use { writer -> + TextFormat.printer().print(encryptionKeyPairConfig, writer) + } + val configName = bazelConfigName output.resolve(BAZEL_RC_FILE).writer().use { writer -> for (resource in resources) { @@ -433,7 +454,10 @@ class ResourceSetup( const val AKID_PRINCIPAL_MAP_FILE = "authority_key_identifier_to_principal_map.textproto" const val BAZEL_RC_FILE = "resource-setup.bazelrc" const val MEASUREMENT_CONSUMER_CONFIG_FILE = "measurement_consumer_config.textproto" + const val ENCRYPTION_KEY_PAIR_CONFIG_FILE = "encryption_key_pair_config.textproto" const val MEASUREMENT_CONSUMER_SIGNING_PRIVATE_KEY_PATH = "mc_cs_private.der" + const val MEASUREMENT_CONSUMER_ENCRYPTION_PUBLIC_KEY_PATH = "mc_enc_public.tink" + const val MEASUREMENT_CONSUMER_ENCRYPTION_PRIVATE_KEY_PATH = "mc_enc_private.tink" private val logger: Logger = Logger.getLogger(this::class.java.name) } diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt index 6e1a2a1154d..98feb6f48f0 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt @@ -109,7 +109,6 @@ private object V2AlphaPublicApiServer { @CommandLine.Mixin v2AlphaPublicServerFlags: V2AlphaPublicServerFlags, @CommandLine.Mixin encryptionKeyPairMap: EncryptionKeyPairMap, ) { - println("encryption key pair config: ${encryptionKeyPairMap.keyPairs.entries}") val clientCerts = SigningCerts.fromPemFiles( diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index c8dd1163675..1938cdd4fc8 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -228,7 +228,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val resourceSetupOutput = runResourceSetup(duchyCerts, edpEntityContents, measurementConsumerContent) val resourceInfo = ResourceInfo.from(resourceSetupOutput.resources) - loadFullCmms(resourceInfo, resourceSetupOutput.akidPrincipalMap, resourceSetupOutput.measurementConsumerConfig) + loadFullCmms(resourceInfo, resourceSetupOutput.akidPrincipalMap, resourceSetupOutput.measurementConsumerConfig, resourceSetupOutput.encryptionKeyPairConfig) val encryptionPrivateKey: TinkPrivateKeyHandle = withContext(Dispatchers.IO) { @@ -316,7 +316,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } } - private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File, measurementConsumerConfig: File) { + private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File, measurementConsumerConfig: File, encryptionKeyPairConfig: File) { val appliedObjects: List = withContext(Dispatchers.IO) { val outputDir = tempDir.newFolder("cmms") @@ -326,6 +326,9 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") akidPrincipalMap.copyTo(configFilesDir.resolve(akidPrincipalMap.name)) + logger.info("Copying $encryptionKeyPairConfig to $CONFIG_FILES_PATH") + encryptionKeyPairConfig.copyTo(configFilesDir.resolve(encryptionKeyPairConfig.name)) + val mcConfigDir = outputDir.toPath().resolve(MC_CONFIG_PATH).toFile() logger.info("Copying $measurementConsumerConfig to $MC_CONFIG_PATH") measurementConsumerConfig.copyTo(mcConfigDir.resolve(measurementConsumerConfig.name)) @@ -432,6 +435,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { resources, outputDir.resolve(ResourceSetup.AKID_PRINCIPAL_MAP_FILE), outputDir.resolve(ResourceSetup.MEASUREMENT_CONSUMER_CONFIG_FILE), + outputDir.resolve(ResourceSetup.ENCRYPTION_KEY_PAIR_CONFIG_FILE), ) } @@ -494,6 +498,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val resources: List, val akidPrincipalMap: File, val measurementConsumerConfig: File, + val encryptionKeyPairConfig: File, ) } From ce012b0aaa53b2f3856b94ea0bbc683a473c3df7 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 16:16:14 +0000 Subject: [PATCH 45/51] fix config --- .../org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel index 50bdebccb33..94955ed1f51 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/BUILD.bazel @@ -36,6 +36,7 @@ kt_jvm_library( "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumer_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/config:authority_key_to_principal_map_kt_jvm_proto", + "//src/main/proto/wfa/measurement/config/reporting:encryption_key_pair_config_kt_jvm_proto", "//src/main/proto/wfa/measurement/config/reporting:measurement_consumer_config_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/kingdom:account_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/kingdom:accounts_service_kt_jvm_grpc_proto", From f10c78cf137896fd09507f0644af08307c61c3c0 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 16:57:09 +0000 Subject: [PATCH 46/51] create new config files for panel match --- src/main/k8s/local/testing/BUILD.bazel | 13 ++++++- ...g_files_for_panel_match_kustomization.yaml | 23 ++++++++++++ .../loadtest/resourcesetup/ResourceSetup.kt | 35 +++++++++++-------- .../k8s/EmptyClusterCorrectnessTest.kt | 22 +++++++----- 4 files changed, 68 insertions(+), 25 deletions(-) create mode 100644 src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 7086c2c45ed..6debf4f0bee 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -68,6 +68,17 @@ kustomization_dir( renames = {"config_files_kustomization.yaml": "kustomization.yaml"}, ) +kustomization_dir( + name = "config_files_for_panel_match", + srcs = [ + "config_files_for_panel_match_kustomization.yaml", + "//src/main/k8s/testing/data:synthetic_generation_specs_small", + "//src/main/k8s/testing/secretfiles:known_event_group_metadata_type_set", + "//src/main/k8s/testing/secretfiles:metric_spec_config.textproto", + ], + renames = {"config_files_for_panel_match_kustomization.yaml": "kustomization.yaml"}, +) + kustomization_dir( name = "db_creds", srcs = ["db_creds_kustomization.yaml"], @@ -115,7 +126,7 @@ kustomization_dir( generate_kustomization = True, tags = ["manual"], deps = [ - ":config_files", + ":config_files_for_panel_match", "//src/main/k8s/testing/secretfiles:kustomization", ], ) diff --git a/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml b/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml new file mode 100644 index 00000000000..b2f35cbd76a --- /dev/null +++ b/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml @@ -0,0 +1,23 @@ +# Copyright 2024 The Cross-Media Measurement Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +configMapGenerator: +- name: config-files + files: + - authority_key_identifier_to_principal_map.textproto + - metric_spec_config.textproto + - synthetic_population_spec_small.textproto + - synthetic_event_group_spec_small_1.textproto + - synthetic_event_group_spec_small_2.textproto + - known_event_group_metadata_type_set.pb diff --git a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt index fcd3fe6727e..4123f6bb86b 100644 --- a/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt +++ b/src/main/kotlin/org/wfanet/measurement/loadtest/resourcesetup/ResourceSetup.kt @@ -55,6 +55,10 @@ import org.wfanet.measurement.common.crypto.tink.SelfIssuedIdTokens.generateIdTo import org.wfanet.measurement.common.identity.externalIdToApiId import org.wfanet.measurement.config.AuthorityKeyToPrincipalMapKt import org.wfanet.measurement.config.authorityKeyToPrincipalMap +import org.wfanet.measurement.config.reporting.EncryptionKeyPairConfigKt +import org.wfanet.measurement.config.reporting.encryptionKeyPairConfig +import org.wfanet.measurement.config.reporting.measurementConsumerConfig +import org.wfanet.measurement.config.reporting.measurementConsumerConfigs import org.wfanet.measurement.consent.client.measurementconsumer.signEncryptionPublicKey import org.wfanet.measurement.internal.kingdom.Account as InternalAccount import org.wfanet.measurement.internal.kingdom.AccountsGrpcKt @@ -65,10 +69,6 @@ import org.wfanet.measurement.internal.kingdom.account as internalAccount import org.wfanet.measurement.internal.kingdom.certificate as internalCertificate import org.wfanet.measurement.internal.kingdom.createMeasurementConsumerCreationTokenRequest import org.wfanet.measurement.internal.kingdom.dataProvider as internalDataProvider -import org.wfanet.measurement.config.reporting.EncryptionKeyPairConfigKt -import org.wfanet.measurement.config.reporting.encryptionKeyPairConfig -import org.wfanet.measurement.config.reporting.measurementConsumerConfig -import org.wfanet.measurement.config.reporting.measurementConsumerConfigs import org.wfanet.measurement.internal.kingdom.dataProviderDetails import org.wfanet.measurement.kingdom.service.api.v2alpha.fillCertificateFromDer import org.wfanet.measurement.kingdom.service.api.v2alpha.parseCertificateDer @@ -221,11 +221,14 @@ class ResourceSetup( for (resource in resources) { when (resource.resourceCase) { Resources.Resource.ResourceCase.MEASUREMENT_CONSUMER -> - configs.put(resource.name, measurementConsumerConfig { - apiKey = resource.measurementConsumer.apiKey - signingCertificateName = resource.measurementConsumer.certificate - signingPrivateKeyPath = MEASUREMENT_CONSUMER_SIGNING_PRIVATE_KEY_PATH - }) + configs.put( + resource.name, + measurementConsumerConfig { + apiKey = resource.measurementConsumer.apiKey + signingCertificateName = resource.measurementConsumer.certificate + signingPrivateKeyPath = MEASUREMENT_CONSUMER_SIGNING_PRIVATE_KEY_PATH + }, + ) else -> continue } } @@ -238,13 +241,15 @@ class ResourceSetup( for (resource in resources) { when (resource.resourceCase) { Resources.Resource.ResourceCase.MEASUREMENT_CONSUMER -> - principalKeyPairs += EncryptionKeyPairConfigKt.principalKeyPairs { - principal = resource.name - keyPairs += EncryptionKeyPairConfigKt.keyPair { - publicKeyFile = MEASUREMENT_CONSUMER_ENCRYPTION_PUBLIC_KEY_PATH - privateKeyFile = MEASUREMENT_CONSUMER_ENCRYPTION_PRIVATE_KEY_PATH + principalKeyPairs += + EncryptionKeyPairConfigKt.principalKeyPairs { + principal = resource.name + keyPairs += + EncryptionKeyPairConfigKt.keyPair { + publicKeyFile = MEASUREMENT_CONSUMER_ENCRYPTION_PUBLIC_KEY_PATH + privateKeyFile = MEASUREMENT_CONSUMER_ENCRYPTION_PRIVATE_KEY_PATH + } } - } else -> continue } } diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index 1938cdd4fc8..af5c7e85ac7 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -32,7 +32,6 @@ import java.time.Duration import java.util.UUID import java.util.logging.Logger import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import kotlinx.coroutines.time.withTimeout import kotlinx.coroutines.withContext @@ -59,9 +58,7 @@ import org.wfanet.measurement.common.k8s.KubernetesClient import org.wfanet.measurement.common.k8s.KubernetesClientImpl import org.wfanet.measurement.common.k8s.testing.PortForwarder import org.wfanet.measurement.common.k8s.testing.Processes -import org.wfanet.measurement.common.parseTextProto import org.wfanet.measurement.common.testing.chainRulesSequentially -import org.wfanet.measurement.config.reporting.MeasurementConsumerConfigs import org.wfanet.measurement.integration.common.ALL_DUCHY_NAMES import org.wfanet.measurement.integration.common.MC_DISPLAY_NAME import org.wfanet.measurement.integration.common.SyntheticGenerationSpecs @@ -228,7 +225,12 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { val resourceSetupOutput = runResourceSetup(duchyCerts, edpEntityContents, measurementConsumerContent) val resourceInfo = ResourceInfo.from(resourceSetupOutput.resources) - loadFullCmms(resourceInfo, resourceSetupOutput.akidPrincipalMap, resourceSetupOutput.measurementConsumerConfig, resourceSetupOutput.encryptionKeyPairConfig) + loadFullCmms( + resourceInfo, + resourceSetupOutput.akidPrincipalMap, + resourceSetupOutput.measurementConsumerConfig, + resourceSetupOutput.encryptionKeyPairConfig, + ) val encryptionPrivateKey: TinkPrivateKeyHandle = withContext(Dispatchers.IO) { @@ -297,10 +299,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { org.wfanet.measurement.reporting.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineStub( publicApiChannel ), - reportingSetsClient = - ReportingSetsGrpcKt.ReportingSetsCoroutineStub( - publicApiChannel - ), + reportingSetsClient = ReportingSetsGrpcKt.ReportingSetsCoroutineStub(publicApiChannel), metricCalculationSpecsClient = MetricCalculationSpecsGrpcKt.MetricCalculationSpecsCoroutineStub(publicApiChannel), reportsClient = ReportsGrpcKt.ReportsCoroutineStub(publicApiChannel), @@ -316,7 +315,12 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { } } - private suspend fun loadFullCmms(resourceInfo: ResourceInfo, akidPrincipalMap: File, measurementConsumerConfig: File, encryptionKeyPairConfig: File) { + private suspend fun loadFullCmms( + resourceInfo: ResourceInfo, + akidPrincipalMap: File, + measurementConsumerConfig: File, + encryptionKeyPairConfig: File, + ) { val appliedObjects: List = withContext(Dispatchers.IO) { val outputDir = tempDir.newFolder("cmms") From d7cf172c1d88edb1ca615586e20fd4d773eea4a4 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 17:25:56 +0000 Subject: [PATCH 47/51] create new config files for panel match --- src/main/k8s/local/testing/BUILD.bazel | 1 - .../testing/config_files_for_panel_match_kustomization.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/src/main/k8s/local/testing/BUILD.bazel b/src/main/k8s/local/testing/BUILD.bazel index 6debf4f0bee..77a3f9dc270 100644 --- a/src/main/k8s/local/testing/BUILD.bazel +++ b/src/main/k8s/local/testing/BUILD.bazel @@ -74,7 +74,6 @@ kustomization_dir( "config_files_for_panel_match_kustomization.yaml", "//src/main/k8s/testing/data:synthetic_generation_specs_small", "//src/main/k8s/testing/secretfiles:known_event_group_metadata_type_set", - "//src/main/k8s/testing/secretfiles:metric_spec_config.textproto", ], renames = {"config_files_for_panel_match_kustomization.yaml": "kustomization.yaml"}, ) diff --git a/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml b/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml index b2f35cbd76a..5b72b4db7c5 100644 --- a/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml +++ b/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml @@ -16,7 +16,6 @@ configMapGenerator: - name: config-files files: - authority_key_identifier_to_principal_map.textproto - - metric_spec_config.textproto - synthetic_population_spec_small.textproto - synthetic_event_group_spec_small_1.textproto - synthetic_event_group_spec_small_2.textproto From e8de3d291263a9eb5fa8f7245c4f259fd7067d91 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 17:43:06 +0000 Subject: [PATCH 48/51] create new config files for panel match --- .../testing/config_files_for_panel_match_kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml b/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml index 5b72b4db7c5..364ed73ac20 100644 --- a/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml +++ b/src/main/k8s/local/testing/config_files_for_panel_match_kustomization.yaml @@ -13,7 +13,7 @@ # limitations under the License. configMapGenerator: -- name: config-files +- name: config-files-for-panel-match files: - authority_key_identifier_to_principal_map.textproto - synthetic_population_spec_small.textproto From 503f3741d64f7342775971581f92d6c3a63e28cc Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 18:01:42 +0000 Subject: [PATCH 49/51] create new config files for panel match --- src/main/k8s/local/testing/mc_config_kustomization.yaml | 2 +- .../deploy/v2/common/server/V2AlphaPublicApiServer.kt | 1 - .../integration/k8s/EmptyClusterCorrectnessTest.kt | 1 + .../k8s/EmptyClusterPanelMatchCorrectnessTest.kt | 7 +++---- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/k8s/local/testing/mc_config_kustomization.yaml b/src/main/k8s/local/testing/mc_config_kustomization.yaml index 3c66beda716..8e329fcff4d 100644 --- a/src/main/k8s/local/testing/mc_config_kustomization.yaml +++ b/src/main/k8s/local/testing/mc_config_kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 The Cross-Media Measurement Authors +# Copyright 2024 The Cross-Media Measurement Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt index 98feb6f48f0..bfb517477e5 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2/common/server/V2AlphaPublicApiServer.kt @@ -109,7 +109,6 @@ private object V2AlphaPublicApiServer { @CommandLine.Mixin v2AlphaPublicServerFlags: V2AlphaPublicServerFlags, @CommandLine.Mixin encryptionKeyPairMap: EncryptionKeyPairMap, ) { - val clientCerts = SigningCerts.fromPemFiles( certificateFile = commonServerFlags.tlsFlags.certFile, diff --git a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt index af5c7e85ac7..95f24dc4307 100644 --- a/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/integration/k8s/EmptyClusterCorrectnessTest.kt @@ -365,6 +365,7 @@ class EmptyClusterCorrectnessTest : AbstractCorrectnessTest(measurementSystem) { kubectlApply(configContent) } + waitUntilDeploymentsComplete(appliedObjects) } diff --git a/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt b/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt index 8c126916597..ff121b36d25 100644 --- a/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt @@ -345,8 +345,8 @@ class EmptyClusterPanelMatchCorrectnessTest : AbstractPanelMatchCorrectnessTest( outputDir, ) - val configFilesDir = outputDir.toPath().resolve(CONFIG_FILES_PATH).toFile() - logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") + val configFilesDir = outputDir.toPath().resolve(PANELMATCH_CONFIG_FILES_PATH).toFile() + logger.info("Copying $akidPrincipalMap to $PANELMATCH_CONFIG_FILES_PATH") akidPrincipalMap.copyTo(configFilesDir.resolve(akidPrincipalMap.name)) val configFile: File = outputDir.resolve("config.yaml") @@ -494,9 +494,8 @@ class EmptyClusterPanelMatchCorrectnessTest : AbstractPanelMatchCorrectnessTest( private val LOCAL_K8S_PATH = Paths.get("src", "main", "k8s", "local") private val LOCAL_K8S_TESTING_PATH = LOCAL_K8S_PATH.resolve("testing") - private val CONFIG_FILES_PATH = LOCAL_K8S_TESTING_PATH.resolve("config_files") private val LOCAL_K8S_PANELMATCH_PATH = Paths.get("src", "main", "k8s", "panelmatch", "local") - private val PANELMATCH_CONFIG_FILES_PATH = LOCAL_K8S_PANELMATCH_PATH.resolve("config_files") + private val PANELMATCH_CONFIG_FILES_PATH = LOCAL_K8S_PANELMATCH_PATH.resolve("config_files_for_panel_match") private const val KINGDOM_INTERNAL_DEPLOYMENT_NAME = "gcp-kingdom-data-server-deployment" private const val KINGDOM_PUBLIC_DEPLOYMENT_NAME = "v2alpha-public-api-server-deployment" From 3ba7279757920f67e3b3be3d24c72e335b4e963c Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 18:30:28 +0000 Subject: [PATCH 50/51] fix path --- .../k8s/EmptyClusterPanelMatchCorrectnessTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt b/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt index ff121b36d25..07de2db818b 100644 --- a/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt @@ -345,8 +345,8 @@ class EmptyClusterPanelMatchCorrectnessTest : AbstractPanelMatchCorrectnessTest( outputDir, ) - val configFilesDir = outputDir.toPath().resolve(PANELMATCH_CONFIG_FILES_PATH).toFile() - logger.info("Copying $akidPrincipalMap to $PANELMATCH_CONFIG_FILES_PATH") + val configFilesDir = outputDir.toPath().resolve(CONFIG_FILES_PATH).toFile() + logger.info("Copying $akidPrincipalMap to $CONFIG_FILES_PATH") akidPrincipalMap.copyTo(configFilesDir.resolve(akidPrincipalMap.name)) val configFile: File = outputDir.resolve("config.yaml") @@ -494,8 +494,9 @@ class EmptyClusterPanelMatchCorrectnessTest : AbstractPanelMatchCorrectnessTest( private val LOCAL_K8S_PATH = Paths.get("src", "main", "k8s", "local") private val LOCAL_K8S_TESTING_PATH = LOCAL_K8S_PATH.resolve("testing") + private val CONFIG_FILES_PATH = LOCAL_K8S_TESTING_PATH.resolve("config_files_for_panel_match") private val LOCAL_K8S_PANELMATCH_PATH = Paths.get("src", "main", "k8s", "panelmatch", "local") - private val PANELMATCH_CONFIG_FILES_PATH = LOCAL_K8S_PANELMATCH_PATH.resolve("config_files_for_panel_match") + private val PANELMATCH_CONFIG_FILES_PATH = LOCAL_K8S_PANELMATCH_PATH.resolve("config_files") private const val KINGDOM_INTERNAL_DEPLOYMENT_NAME = "gcp-kingdom-data-server-deployment" private const val KINGDOM_PUBLIC_DEPLOYMENT_NAME = "v2alpha-public-api-server-deployment" From 66bc758193e0e33bce6462b2df1d5c50f7a43dee Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Fri, 15 Nov 2024 20:26:01 +0000 Subject: [PATCH 51/51] increase timeout --- .../integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt b/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt index 07de2db818b..11b3a2cff7f 100644 --- a/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt +++ b/src/test/kotlin/org/wfanet/panelmatch/integration/k8s/EmptyClusterPanelMatchCorrectnessTest.kt @@ -140,7 +140,7 @@ class EmptyClusterPanelMatchCorrectnessTest : AbstractPanelMatchCorrectnessTest( return object : Statement() { override fun evaluate() { runBlocking { - withTimeout(Duration.ofMinutes(5)) { + withTimeout(Duration.ofMinutes(6)) { _testHarness = createTestHarness(populateCluster()) } }