Skip to content

Commit

Permalink
revert Remove DEFAULT_RPC_PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Nov 22, 2022
1 parent c7497a3 commit 1029c92
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public class ComputerJobDeployer {
private static final String TRANSPORT_PORT_NAME = "transport-port";
private static final String RPC_PORT_NAME = "rpc-port";
private static final int DEFAULT_TRANSPORT_PORT = 8099;
private static final int DEFAULT_RPC_PORT = 8190;
private static final String COMPUTER_CONFIG_MAP_VOLUME = "computer-config-map-volume";

private static final String POD_IP_KEY = "status.podIP";
Expand Down Expand Up @@ -196,13 +197,18 @@ private Set<ContainerPort> handleConfig(ComputerJobSpec spec) {
config.put(ComputerOptions.TRANSPORT_SERVER_PORT.name(),
transportPort);
}

ContainerPort transportContainerPort = new ContainerPortBuilder()
.withName(TRANSPORT_PORT_NAME)
.withContainerPort(Integer.valueOf(transportPort))
.withProtocol(PROTOCOL)
.build();
String rpcPort = config.getOrDefault(ComputerOptions.RPC_SERVER_PORT.name(), RANDOM_PORT);

String rpcPort = config.get(
ComputerOptions.RPC_SERVER_PORT.name());
if (StringUtils.isBlank(rpcPort) || RANDOM_PORT.equals(rpcPort)) {
rpcPort = String.valueOf(DEFAULT_RPC_PORT);
config.put(ComputerOptions.RPC_SERVER_PORT.name(), rpcPort);
}
ContainerPort rpcContainerPort = new ContainerPortBuilder()
.withName(RPC_PORT_NAME)
.withContainerPort(Integer.valueOf(rpcPort))
Expand Down

0 comments on commit 1029c92

Please sign in to comment.