@Test(dependsOnMethods = "testCreateHelixCluster") public void testSetupAndSubmitApplication() throws Exception { this.clusterId = this.gobblinAwsClusterLauncher.setupGobblinCluster(); this.clusterIdTag.setValue(this.clusterId); }
@VisibleForTesting String setupGobblinCluster() throws IOException { final String uuid = UUID.randomUUID().toString(); final String securityGroupName = "GobblinSecurityGroup_" + uuid; this.awsSdkClient.createSecurityGroup(securityGroupName, "Gobblin cluster security group"); this.awsSdkClient.addPermissionsToSecurityGroup(securityGroupName, "0.0.0.0/0", "tcp", 0, 65535); final String keyName = "GobblinKey_" + uuid; final String material = this.awsSdkClient.createKeyValuePair(keyName); LOGGER.debug("Material is: " + material); FileUtils.writeStringToFile(new File(keyName + ".pem"), material); final List<AvailabilityZone> availabilityZones = this.awsSdkClient.getAvailabilityZones(); final String clusterId = launchClusterMaster(uuid, keyName, securityGroupName, availabilityZones.get(0)); launchWorkUnitRunners(uuid, keyName, securityGroupName, availabilityZones.get(0)); return clusterId; }
GobblinAWSClusterLauncher { @VisibleForTesting String setupGobblinCluster() throws IOException { final String uuid = UUID.randomUUID().toString(); final String securityGroupName = "GobblinSecurityGroup_" + uuid; this.awsSdkClient.createSecurityGroup(securityGroupName, "Gobblin cluster security group"); this.awsSdkClient.addPermissionsToSecurityGroup(securityGroupName, "0.0.0.0/0", "tcp", 0, 65535); final String keyName = "GobblinKey_" + uuid; final String material = this.awsSdkClient.createKeyValuePair(keyName); LOGGER.debug("Material is: " + material); FileUtils.writeStringToFile(new File(keyName + ".pem"), material); final List<AvailabilityZone> availabilityZones = this.awsSdkClient.getAvailabilityZones(); final String clusterId = launchClusterMaster(uuid, keyName, securityGroupName, availabilityZones.get(0)); launchWorkUnitRunners(uuid, keyName, securityGroupName, availabilityZones.get(0)); return clusterId; } }
GobblinAWSClusterLauncher { @VisibleForTesting String setupGobblinCluster() throws IOException { final String uuid = UUID.randomUUID().toString(); final String securityGroupName = "GobblinSecurityGroup_" + uuid; this.awsSdkClient.createSecurityGroup(securityGroupName, "Gobblin cluster security group"); this.awsSdkClient.addPermissionsToSecurityGroup(securityGroupName, "0.0.0.0/0", "tcp", 0, 65535); final String keyName = "GobblinKey_" + uuid; final String material = this.awsSdkClient.createKeyValuePair(keyName); LOGGER.debug("Material is: " + material); FileUtils.writeStringToFile(new File(keyName + ".pem"), material); final List<AvailabilityZone> availabilityZones = this.awsSdkClient.getAvailabilityZones(); final String clusterId = launchClusterMaster(uuid, keyName, securityGroupName, availabilityZones.get(0)); launchWorkUnitRunners(uuid, keyName, securityGroupName, availabilityZones.get(0)); return clusterId; } GobblinAWSClusterLauncher(Config config); }
GobblinAWSClusterLauncher { @VisibleForTesting String setupGobblinCluster() throws IOException { final String uuid = UUID.randomUUID().toString(); final String securityGroupName = "GobblinSecurityGroup_" + uuid; this.awsSdkClient.createSecurityGroup(securityGroupName, "Gobblin cluster security group"); this.awsSdkClient.addPermissionsToSecurityGroup(securityGroupName, "0.0.0.0/0", "tcp", 0, 65535); final String keyName = "GobblinKey_" + uuid; final String material = this.awsSdkClient.createKeyValuePair(keyName); LOGGER.debug("Material is: " + material); FileUtils.writeStringToFile(new File(keyName + ".pem"), material); final List<AvailabilityZone> availabilityZones = this.awsSdkClient.getAvailabilityZones(); final String clusterId = launchClusterMaster(uuid, keyName, securityGroupName, availabilityZones.get(0)); launchWorkUnitRunners(uuid, keyName, securityGroupName, availabilityZones.get(0)); return clusterId; } GobblinAWSClusterLauncher(Config config); void launch(); synchronized void stop(); static void main(String[] args); }
GobblinAWSClusterLauncher { @VisibleForTesting String setupGobblinCluster() throws IOException { final String uuid = UUID.randomUUID().toString(); final String securityGroupName = "GobblinSecurityGroup_" + uuid; this.awsSdkClient.createSecurityGroup(securityGroupName, "Gobblin cluster security group"); this.awsSdkClient.addPermissionsToSecurityGroup(securityGroupName, "0.0.0.0/0", "tcp", 0, 65535); final String keyName = "GobblinKey_" + uuid; final String material = this.awsSdkClient.createKeyValuePair(keyName); LOGGER.debug("Material is: " + material); FileUtils.writeStringToFile(new File(keyName + ".pem"), material); final List<AvailabilityZone> availabilityZones = this.awsSdkClient.getAvailabilityZones(); final String clusterId = launchClusterMaster(uuid, keyName, securityGroupName, availabilityZones.get(0)); launchWorkUnitRunners(uuid, keyName, securityGroupName, availabilityZones.get(0)); return clusterId; } GobblinAWSClusterLauncher(Config config); void launch(); synchronized void stop(); static void main(String[] args); static final String CLUSTER_NAME_ASG_TAG; static final String CLUSTER_ID_ASG_TAG; static final String ASG_TYPE_ASG_TAG; static final String ASG_TYPE_MASTER; static final String ASG_TYPE_WORKERS; static final String MASTER_ASG_NAME_PREFIX; static final String MASTER_LAUNCH_CONFIG_NAME_PREFIX; static final String WORKERS_ASG_NAME_PREFIX; static final String WORKERS_LAUNCH_CONFIG_PREFIX; }