@Test public void testSimpleDistributedTFConfigGeneratorWorker() { String json = TensorFlowConfigEnvGenerator.getTFConfigEnv("worker", 5, 3, "wtan", "tf-job-001", "example.com"); assertEquals(json, "{\\\"cluster\\\":{\\\"master\\\":[\\\"master-0.wtan" + ".tf-job-001.example.com:8000\\\"],\\\"worker\\\":[\\\"worker-0.wtan" + ".tf-job-001.example.com:8000\\\",\\\"worker-1.wtan.tf-job-001" + ".example.com:8000\\\",\\\"worker-2.wtan.tf-job-001.example" + ".com:8000\\\",\\\"worker-3.wtan.tf-job-001.example.com:8000\\\"]," + "\\\"ps\\\":[\\\"ps-0.wtan.tf-job-001.example.com:8000\\\",\\\"ps-1" + ".wtan.tf-job-001.example.com:8000\\\",\\\"ps-2.wtan.tf-job-001" + ".example.com:8000\\\"]},\\\"task\\\":{ \\\"type\\\":\\\"worker\\\", " + "\\\"index\\\":$_TASK_INDEX},\\\"environment\\\":\\\"cloud\\\"}"); }
public static String getTFConfigEnv(String componentName, int nWorkers, int nPs, String serviceName, String userName, String domain) { String commonEndpointSuffix = YarnServiceUtils .getDNSNameCommonSuffix(serviceName, userName, domain, 8000); TFConfigEnv tfConfigEnv = new TFConfigEnv(nWorkers, nPs, componentName, commonEndpointSuffix); return tfConfigEnv.toJson(); }
TensorFlowConfigEnvGenerator { public static String getTFConfigEnv(String componentName, int nWorkers, int nPs, String serviceName, String userName, String domain) { String commonEndpointSuffix = YarnServiceUtils .getDNSNameCommonSuffix(serviceName, userName, domain, 8000); TFConfigEnv tfConfigEnv = new TFConfigEnv(nWorkers, nPs, componentName, commonEndpointSuffix); return tfConfigEnv.toJson(); } }
TensorFlowConfigEnvGenerator { public static String getTFConfigEnv(String componentName, int nWorkers, int nPs, String serviceName, String userName, String domain) { String commonEndpointSuffix = YarnServiceUtils .getDNSNameCommonSuffix(serviceName, userName, domain, 8000); TFConfigEnv tfConfigEnv = new TFConfigEnv(nWorkers, nPs, componentName, commonEndpointSuffix); return tfConfigEnv.toJson(); }  }
TensorFlowConfigEnvGenerator { public static String getTFConfigEnv(String componentName, int nWorkers, int nPs, String serviceName, String userName, String domain) { String commonEndpointSuffix = YarnServiceUtils .getDNSNameCommonSuffix(serviceName, userName, domain, 8000); TFConfigEnv tfConfigEnv = new TFConfigEnv(nWorkers, nPs, componentName, commonEndpointSuffix); return tfConfigEnv.toJson(); }  static String getTFConfigEnv(String componentName, int nWorkers,
      int nPs, String serviceName, String userName, String domain); }
TensorFlowConfigEnvGenerator { public static String getTFConfigEnv(String componentName, int nWorkers, int nPs, String serviceName, String userName, String domain) { String commonEndpointSuffix = YarnServiceUtils .getDNSNameCommonSuffix(serviceName, userName, domain, 8000); TFConfigEnv tfConfigEnv = new TFConfigEnv(nWorkers, nPs, componentName, commonEndpointSuffix); return tfConfigEnv.toJson(); }  static String getTFConfigEnv(String componentName, int nWorkers,
      int nPs, String serviceName, String userName, String domain);  }