Add ARM architecture to ec2 image and the related instance types

This commit is contained in:
Sergi Castro 2019-05-11 10:32:46 +02:00 committed by Ignasi Barrera
parent 92a3c68838
commit 3e855c26be
No known key found for this signature in database
GPG Key ID: 3D5414A0D959B94F
6 changed files with 124 additions and 5 deletions

View File

@ -1518,7 +1518,51 @@ public class EC2HardwareBuilder extends HardwareBuilder {
new VolumeBuilder().type(LOCAL).size(1920.0f).device("/dev/sdc").bootDevice(false).durable(false).build()))
.processors(ImmutableList.of(new Processor(128.0, 2.3)));
}
/**
* @see InstanceType#A1_MEDIUM
*/
public static EC2HardwareBuilder a1_medium() {
return new EC2HardwareBuilder(InstanceType.A1_MEDIUM).ram(2048)
.processors(ImmutableList.of(new Processor(1, 2.3))).rootDeviceType(RootDeviceType.EBS)
.virtualizationType(VirtualizationType.HVM);
}
/**
* @see InstanceType#A1_LARGE
*/
public static org.jclouds.ec2.compute.domain.EC2HardwareBuilder a1_large() {
return new EC2HardwareBuilder(InstanceType.A1_LARGE).ram(4096).processors(ImmutableList.of(new Processor(2, 2.3)))
.rootDeviceType(RootDeviceType.EBS).virtualizationType(VirtualizationType.HVM);
}
/**
* @see InstanceType#A1_XLARGE
*/
public static org.jclouds.ec2.compute.domain.EC2HardwareBuilder a1_xlarge() {
return new EC2HardwareBuilder(InstanceType.A1_XLARGE).ram(8192)
.processors(ImmutableList.of(new Processor(4, 2.3))).rootDeviceType(RootDeviceType.EBS)
.virtualizationType(VirtualizationType.HVM);
}
/**
* @see InstanceType#A1_2XLARGE
*/
public static org.jclouds.ec2.compute.domain.EC2HardwareBuilder a1_2xlarge() {
return new EC2HardwareBuilder(InstanceType.A1_2XLARGE).ram(16384)
.processors(ImmutableList.of(new Processor(8, 2.3))).rootDeviceType(RootDeviceType.EBS)
.virtualizationType(VirtualizationType.HVM);
}
/**
* @see InstanceType#A1_4XLARGE
*/
public static org.jclouds.ec2.compute.domain.EC2HardwareBuilder a1_4xlarge() {
return new EC2HardwareBuilder(InstanceType.A1_4XLARGE).ram(32768)
.processors(ImmutableList.of(new Processor(16, 2.3))).rootDeviceType(RootDeviceType.EBS)
.virtualizationType(VirtualizationType.HVM);
}
@SuppressWarnings("unchecked")
@Override
public Hardware build() {

View File

@ -123,7 +123,7 @@ public class Image implements Comparable<Image> {
}
public static enum Architecture {
I386, X86_64, UNRECOGNIZED;
I386, X86_64, ARM64, UNRECOGNIZED;
public String value() {
return name().toLowerCase();
}

View File

@ -1129,4 +1129,69 @@ public class InstanceType {
* </ul>
*/
public static final String X1_32XLARGE = "x1.32xlarge";
/**
* A1 Medium
* <ul>
* <li>Provider Id: a1.medium</li>
* <li>vCPU: 1</li>
* <li>Memory (GiB): 2</li>
* <li>No instance storage (EBS storage only)</li>
* <li>64-bit platform</li>
* <li>Network Performance: up to 10 Gigabit</li>
* </ul>
*/
public static final String A1_MEDIUM = "a1.medium";
/**
* A1 Large
* <ul>
* <li>Provider Id: a1.large</li>
* <li>vCPU: 2</li>
* <li>Memory (GiB): 4</li>
* <li>No instance storage (EBS storage only)</li>
* <li>64-bit platform</li>
* <li>Network Performance: up to 10 Gigabit</li>
* </ul>
*/
public static final String A1_LARGE = "a1.large";
/**
* A1 XLarge
* <ul>
* <li>Provider Id: a1.xlarge</li>
* <li>vCPU: 4</li>
* <li>Memory (GiB): 8</li>
* <li>No instance storage (EBS storage only)</li>
* <li>64-bit platform</li>
* <li>Network Performance: up to 10 Gigabit</li>
* </ul>
*/
public static final String A1_XLARGE = "a1.xlarge";
/**
* A1 2XLarge
* <ul>
* <li>Provider Id: a1.2xlarge</li>
* <li>vCPU: 8</li>
* <li>Memory (GiB): 16</li>
* <li>No instance storage (EBS storage only)</li>
* <li>64-bit platform</li>
* <li>Network Performance: up to 10 Gigabit</li>
* </ul>
*/
public static final String A1_2XLARGE = "a1.2xlarge";
/**
* A1 4XLarge
* <ul>
* <li>Provider Id: a1.4xlarge</li>
* <li>vCPU: 16</li>
* <li>Memory (GiB): 32</li>
* <li>No instance storage (EBS storage only)</li>
* <li>64-bit platform</li>
* <li>Network Performance: up to 10 Gigabit</li>
* </ul>
*/
public static final String A1_4XLARGE = "a1.4xlarge";
}

View File

@ -16,6 +16,11 @@
*/
package org.jclouds.aws.ec2.compute.suppliers;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.a1_medium;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.a1_large;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.a1_xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.a1_2xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.a1_4xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_medium;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_xlarge;
import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c3_2xlarge;
@ -233,6 +238,11 @@ public class AWSEC2HardwareSupplier extends EC2HardwareSupplier {
sizes.add(d2_8xlarge().build());
sizes.add(x1_32xlarge().build());
sizes.add(x1_16xlarge().build());
sizes.add(a1_medium().build());
sizes.add(a1_large().build());
sizes.add(a1_xlarge().build());
sizes.add(a1_2xlarge().build());
sizes.add(a1_4xlarge().build());
return sizes.build();
}

View File

@ -35,7 +35,7 @@ public class AWSEC2ComputeServiceApiMockTest extends BaseAWSEC2ApiMockTest {
protected String getDefaultSmallestInstanceType() {
// NOT t2.xxx because that requires a VPC
return "m3.medium";
return "a1.medium";
}
protected String getDefaultParavirtualInstanceType() {
@ -44,7 +44,7 @@ public class AWSEC2ComputeServiceApiMockTest extends BaseAWSEC2ApiMockTest {
}
protected String getDefaultImageId() {
return "be3adfd7";
return "7ea24a17";
}
public void launchVPCSpotInstanceSubnetId() throws Exception {

View File

@ -58,7 +58,7 @@ import com.squareup.okhttp.mockwebserver.MockWebServer;
import com.squareup.okhttp.mockwebserver.RecordedRequest;
/**
* Tests need to run {@code singleThreaded = true) as otherwise tests will clash on the regionToServers field.
* Tests need to run {@code singleThreaded = true} as otherwise tests will clash on the regionToServers field.
* Sharing the regionToServers field means less code to write.
*/
public class BaseAWSEC2ApiMockTest {