Beispiel #1
0
 def testNetworkSpec(self):
     zone = 'us-west-1a'
     spec = aws_network.AwsNetworkSpec(zone)
     self.assertEqual(zone, spec.zone)
     self.assertIsNone(spec.vpc_id)
     self.assertIsNone(spec.subnet_id)
     self.assertIsNone(spec.cidr_block)
Beispiel #2
0
    def __init__(self, spec):
        super(EksCluster, self).__init__(spec)
        self.zones = sorted(FLAGS.eks_zones)
        self.zone = ','.join(self.zones)
        self.region = util.GetRegionFromZone(self.zones[0])

        self.networks = [
            aws_network.AwsNetwork.GetNetworkFromNetworkSpec(
                aws_network.AwsNetworkSpec(zone)) for zone in self.zones
        ]
        self.eks_control_plane = _EksControlPlane(self.name, self.region,
                                                  self.networks)
        self.eks_workers = _EksWorkers('%s-worker-nodes' % self.name,
                                       self.region)
 def __init__(self, dpb_service_spec):
     super(AwsDpbEmr, self).__init__(dpb_service_spec)
     self.dpb_service_type = AwsDpbEmr.SERVICE_TYPE
     self.project = None
     self.cmd_prefix = list(util.AWS_PREFIX)
     if self.dpb_service_zone:
         region = util.GetRegionFromZone(self.dpb_service_zone)
         self.cmd_prefix += ['--region', region]
         self.network = aws_network.AwsNetwork.GetNetworkFromNetworkSpec(
             aws_network.AwsNetworkSpec(zone=self.dpb_service_zone))
     else:
         raise errors.Setup.InvalidSetupError(
             'dpb_service_zone must be provided, for provisioning.')
     self.bucket_to_delete = None
     self.dpb_version = FLAGS.dpb_emr_release_label
Beispiel #4
0
 def testNetworkSpecWithVpcId(self):
     zone = 'us-west-1a'
     vpc_id = 'vpc-1234'
     subnet_id = 'subnet-1234'
     cidr = '10.0.0.0/24'
     res = {
         'Subnets': [{
             'VpcId': vpc_id,
             'SubnetId': subnet_id,
             'CidrBlock': cidr
         }]
     }
     util.IssueRetryableCommand.return_value = json.dumps(res), None
     spec = aws_network.AwsNetworkSpec(zone, vpc_id)
     self.assertEqual(zone, spec.zone)
     self.assertEqual(vpc_id, spec.vpc_id)
     self.assertEqual(subnet_id, spec.subnet_id)
     self.assertEqual(cidr, spec.cidr_block)
 def __init__(self, dpb_service_spec):
     super(AwsDpbEmr, self).__init__(dpb_service_spec)
     self.dpb_service_type = AwsDpbEmr.SERVICE_TYPE
     self.project = None
     self.cmd_prefix = list(util.AWS_PREFIX)
     if self.dpb_service_zone:
         self.region = util.GetRegionFromZone(self.dpb_service_zone)
     else:
         raise errors.Setup.InvalidSetupError(
             'dpb_service_zone must be provided, for provisioning.')
     self.cmd_prefix += ['--region', self.region]
     self.network = aws_network.AwsNetwork.GetNetworkFromNetworkSpec(
         aws_network.AwsNetworkSpec(zone=self.dpb_service_zone))
     self.storage_service = s3.S3Service()
     self.storage_service.PrepareService(self.region)
     self.persistent_fs_prefix = 's3://'
     self.bucket_to_delete = None
     self.dpb_version = FLAGS.dpb_emr_release_label or self.dpb_version
     self._cluster_create_time = None
     if not self.dpb_version:
         raise errors.Setup.InvalidSetupError(
             'dpb_service.version must be provided.')
Beispiel #6
0
 def network(self):
     network_spec = aws_network.AwsNetworkSpec(self.zone)
     return aws_network.AwsNetwork.GetNetworkFromNetworkSpec(network_spec)