Skip to content

Commit 7d8e0d6

Browse files
authored
[feat] Graviton support (#194)
1 parent 7010750 commit 7d8e0d6

9 files changed

Lines changed: 21 additions & 25 deletions

File tree

.github/workflows/docker-bake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121
docker:
2222
if: github.repository_owner == 'aws-samples'
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04-arm
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121
test:
2222
if: github.repository_owner == 'aws-samples'
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04-arm
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/security_audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '**/Cargo.lock'
99
jobs:
1010
security_audit:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04-arm
1212
if: github.repository_owner == 'aws-samples'
1313
permissions:
1414
issues: write

ci_template.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Resources:
431431
Properties:
432432
BaseCapacity: 1
433433
ComputeType: BUILD_GENERAL1_SMALL
434-
EnvironmentType: LINUX_CONTAINER
434+
EnvironmentType: ARM_CONTAINER
435435

436436
rPermissionsBoundary:
437437
Type: "AWS::IAM::ManagedPolicy"
@@ -1121,9 +1121,6 @@ Resources:
11211121
Environment:
11221122
ComputeType: BUILD_GENERAL1_SMALL
11231123
EnvironmentVariables:
1124-
- Name: ARCH
1125-
Type: PLAINTEXT
1126-
Value: x86_64
11271124
- Name: INSTANCE_ROLE_ARN
11281125
Type: PLAINTEXT
11291126
Value: !GetAtt rInstanceRole.Arn
@@ -1140,10 +1137,10 @@ Resources:
11401137
- cUseCodeBuildFleet
11411138
- FleetArn: !Ref rCodeBuildFleet
11421139
- !Ref "AWS::NoValue"
1143-
Image: aws/codebuild/amazonlinux-x86_64-standard:5.0
1140+
Image: aws/codebuild/amazonlinux-aarch64-standard:3.0
11441141
ImagePullCredentialsType: CODEBUILD
11451142
PrivilegedMode: true
1146-
Type: LINUX_CONTAINER
1143+
Type: ARM_CONTAINER
11471144
LogsConfig:
11481145
CloudWatchLogs:
11491146
Status: ENABLED

docker-bake.hcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ target "parent" {
66
context = "./parent"
77
dockerfile = "Dockerfile"
88
args = {
9-
TARGETPLATFORM = "x86_64-unknown-linux-gnu"
9+
TARGETPLATFORM = "aarch64-unknown-linux-gnu"
1010
}
11-
platforms = ["linux/amd64"]
11+
platforms = ["linux/arm64"]
1212
tags = ["parent-vault:latest"]
1313
cache-to = ["type=gha,ignore-error=true,mode=max,scope=parent"]
1414
cache-from = ["type=gha,scope=parent"]
@@ -18,9 +18,9 @@ target "enclave" {
1818
context = "./enclave"
1919
dockerfile = "Dockerfile"
2020
args = {
21-
TARGETPLATFORM = "x86_64-unknown-linux-musl"
21+
TARGETPLATFORM = "aarch64-unknown-linux-musl"
2222
}
23-
platforms = ["linux/amd64"]
23+
platforms = ["linux/arm64"]
2424
tags = ["enclave-vault:latest"]
2525
cache-to = ["type=gha,ignore-error=true,mode=max,scope=enclave"]
2626
cache-from = ["type=gha,scope=enclave"]

enclave/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: build build-docker build-enclave run-enclave create-private-key clean
22

3-
ARCH := x86_64
4-
# ARCH := aarch64
3+
# ARCH := x86_64
4+
ARCH := aarch64
55

66
RUST_DIR := $(shell readlink -m $(shell dirname $(firstword $(MAKEFILE_LIST))))
77

parent/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: build build-docker clean
22

3-
ARCH := x86_64
4-
# ARCH := aarch64
3+
# ARCH := x86_64
4+
ARCH := aarch64
55

66
RUST_DIR := $(shell readlink -m $(shell dirname $(firstword $(MAKEFILE_LIST))))
77

parent/src/constants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ pub const ENCLAVE_PREFIX: &str = "enclave-vault";
77
pub const ENCLAVE_PORT: u32 = 5050;
88
/// https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-considerations
99
/// one enclave is consumed for the Nitro ACM service
10-
pub const MAX_ENCLAVES_PER_INSTANCE: usize = 3;
10+
pub const MAX_ENCLAVES_PER_INSTANCE: usize = 2;
1111
pub const RUN_ENCLAVE_EIF_PATH: &str = "/home/ec2-user/enclave-vault.eif";
12-
pub const RUN_ENCLAVE_CPU_COUNT: &str = "2";
12+
pub const RUN_ENCLAVE_CPU_COUNT: &str = "1";
1313
pub const RUN_ENCLAVE_MEMORY_SIZE: &str = "512";
1414
pub const REFRESH_ENCLAVES_INTERVAL: Duration = Duration::from_secs(10);
1515
pub const IMDS_TOKEN_TTL: Duration = Duration::from_secs(300); // 5 minutes

vault_template.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Resources:
239239
memory_mib: 4096
240240
#
241241
# How many CPUs to reserve for enclaves.
242-
cpu_count: 6
242+
cpu_count: 3
243243
#
244244
# Alternatively, the exact CPUs to be reserved for the enclave can be explicitly
245245
# configured by using `cpu_pool` (like below), instead of `cpu_count`.
@@ -629,8 +629,7 @@ Resources:
629629
BareMetal: excluded
630630
BurstablePerformance: excluded
631631
CpuManufacturers:
632-
- intel
633-
- amd
632+
- amazon-web-services
634633
ExcludedInstanceTypes:
635634
- "a1*"
636635
- "c6g*"
@@ -648,10 +647,10 @@ Resources:
648647
InstanceGenerations:
649648
- current
650649
MemoryMiB:
651-
Min: 8192
650+
Min: 4096
652651
VCpuCount:
653-
Min: 8
654-
ImageId: "{{resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-6.12-x86_64}}"
652+
Min: 4
653+
ImageId: "{{resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-6.12-arm64}}"
655654
MetadataOptions:
656655
HttpEndpoint: enabled
657656
HttpPutResponseHopLimit: 1

0 commit comments

Comments
 (0)