Skip to content

Commit

Permalink
fix: Add Duchy ControlService to InternalApiServer's NetworkPolicy al…
Browse files Browse the repository at this point in the history
…low list. (#1824)
  • Loading branch information
renjiezh authored Sep 23, 2024
1 parent 23211c7 commit 4a09f63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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)
}
}

0 comments on commit 4a09f63

Please sign in to comment.