Files.copy(savedModelFile, new File(tempDir, "model.bin.gz"));
}
log.info("Configuring recommender...");
RunnerConfiguration runnerConfig = new RunnerConfiguration();
runnerConfig.setInstanceID("test");
runnerConfig.setPort(8090); // Odd ports to avoid conflicts
if (useSecurity()) {
runnerConfig.setSecurePort(8453); // Odd ports to avoid conflicts
runnerConfig.setKeystorePassword("changeit");
runnerConfig.setKeystoreFile(new File("testdata/keystore"));
runnerConfig.setUserName("foo");
runnerConfig.setPassword("bar");
}
runnerConfig.setLocalInputDir(tempDir);
runner = new Runner(runnerConfig);
runner.call();
boolean clientSecure = runnerConfig.getKeystoreFile() != null;
int clientPort = clientSecure ? runnerConfig.getSecurePort() : runnerConfig.getPort();
MyrrixClientConfiguration clientConfig = new MyrrixClientConfiguration();
clientConfig.setHost("localhost");
clientConfig.setPort(clientPort);
clientConfig.setSecure(clientSecure);
clientConfig.setKeystorePassword(runnerConfig.getKeystorePassword());
clientConfig.setKeystoreFile(runnerConfig.getKeystoreFile());
clientConfig.setUserName(runnerConfig.getUserName());
clientConfig.setPassword(runnerConfig.getPassword());
client = new ClientRecommender(clientConfig);
if (callAwait()) {
log.info("Waiting for client...");
client.await();