Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add Duchy ControlService to InternalApiServer's NetworkPolicy allow list. #1824

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/k8s/duchy.cue
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ import ("strings")
_object_prefix + "llv2-mill-app",
_object_prefix + "hmss-mill-app",
_object_prefix + "async-computation-control-server-app",
_object_prefix + "computation-control-server-app",
_object_prefix + "requisition-fulfillment-server-app",
_object_prefix + "computations-cleaner-app",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fun ComputationToken.inputPathList(): List<String> =

/** Extract the [RoleInComputation] from a [ComputationToken]. */
fun ComputationToken.role(): RoleInComputation {
@Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA") // Proto enum fields are never null.
return when (computationDetails.protocolCase) {
ComputationDetails.ProtocolCase.LIQUID_LEGIONS_V2 -> computationDetails.liquidLegionsV2.role
ComputationDetails.ProtocolCase.REACH_ONLY_LIQUID_LEGIONS_V2 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package org.wfanet.measurement.duchy.service.system.v1alpha
import com.google.protobuf.ByteString
import io.grpc.Status
import io.grpc.StatusException
import java.util.logging.Level
import java.util.logging.Logger
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import org.wfanet.measurement.common.ConsumedFlowItem
Expand Down Expand Up @@ -148,6 +150,9 @@ class ComputationControlService(
)
.token
} catch (e: StatusException) {
logger.log(Level.WARNING) {
"Fail to get computation token. global_computation_id=${stageKey.computationId}"
}
throw when (e.status.code) {
Status.Code.UNAVAILABLE -> Status.UNAVAILABLE
Status.Code.ABORTED -> Status.ABORTED
Expand All @@ -160,4 +165,8 @@ class ComputationControlService(
}
return computationToken.toSystemStage(duchyId)
}

companion object {
private val logger: Logger = Logger.getLogger(this::class.java.name)
}
}
Loading