Skip to content

Commit

Permalink
Merge branch 'main' into tristanvuong-configure-reporting-workflow-to…
Browse files Browse the repository at this point in the history
…-deploy-v2
  • Loading branch information
tristanvuong2021 authored Jan 25, 2024
2 parents fd0e71e + df2fff6 commit 47e7bcf
Show file tree
Hide file tree
Showing 11 changed files with 373 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,6 +23,7 @@ import org.wfanet.measurement.common.grpc.buildMutualTlsChannel
import org.wfanet.measurement.common.grpc.withVerboseLogging
import org.wfanet.measurement.reporting.bff.service.api.v1alpha.ReportsService
import org.wfanet.measurement.reporting.bff.v1alpha.ReportsGrpcKt.ReportsCoroutineStub
import org.wfanet.measurement.reporting.v2alpha.ReportingSetsGrpcKt as HaloReportingSetsGrpcKt
import org.wfanet.measurement.reporting.v2alpha.ReportsGrpcKt as HaloReportsGrpcKt
import picocli.CommandLine

Expand All @@ -32,7 +33,7 @@ private const val SERVER_NAME = "V1AlphaPublicUiServer"
name = SERVER_NAME,
description = ["Ui server daemon for Reporting v1alpha public API services."],
mixinStandardHelpOptions = true,
showDefaultValues = true
showDefaultValues = true,
)
private fun run(
@CommandLine.Mixin reportingApiServerFlags: ReportingApiServerFlags,
Expand All @@ -42,18 +43,24 @@ private fun run(
SigningCerts.fromPemFiles(
certificateFile = commonServerFlags.tlsFlags.certFile,
privateKeyFile = commonServerFlags.tlsFlags.privateKeyFile,
trustedCertCollectionFile = commonServerFlags.tlsFlags.certCollectionFile
trustedCertCollectionFile = commonServerFlags.tlsFlags.certCollectionFile,
)
val channel: Channel =
buildMutualTlsChannel(
reportingApiServerFlags.reportingApiFlags.target,
clientCerts,
reportingApiServerFlags.reportingApiFlags.certHost
reportingApiServerFlags.reportingApiFlags.certHost,
)
.withVerboseLogging(reportingApiServerFlags.debugVerboseGrpcClientLogging)

val services: List<ServerServiceDefinition> =
listOf(ReportsService(HaloReportsGrpcKt.ReportsCoroutineStub(channel)).bindService())
listOf(
ReportsService(
HaloReportsGrpcKt.ReportsCoroutineStub(channel),
HaloReportingSetsGrpcKt.ReportingSetsCoroutineStub(channel),
)
.bindService()
)
CommonServer.fromFlags(commonServerFlags, SERVER_NAME, services).start().blockUntilShutdown()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ kt_jvm_library(
],
deps = [
"//src/main/proto/wfa/measurement/reporting/bff/v1alpha:reports_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:reporting_sets_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:reports_service_kt_jvm_grpc_proto",
"@wfa_common_jvm//imports/java/com/google/protobuf/util",
"@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common",
Expand Down
Loading

0 comments on commit 47e7bcf

Please sign in to comment.