Skip to content

Commit 5756cd3

Browse files
authored
Upgrade enclave dependency versions (#115)
1 parent 9d46317 commit 5756cd3

File tree

10 files changed

+87
-23
lines changed

10 files changed

+87
-23
lines changed

.github/workflows/docker-bake.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: docker bake
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
15+
env:
16+
RUST_BACKTRACE: 1
17+
CARGO_TERM_COLOR: never
18+
19+
jobs:
20+
docker:
21+
if: github.repository_owner == 'aws-samples'
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: Set up Docker buildx
27+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
28+
- name: Build
29+
uses: docker/bake-action@3fc70e1131fee40a422dd8dd0ff22014ae20a1f3 # v5.11.0
30+
env:
31+
SOURCE_DATE_EPOCH: 0
32+
with:
33+
push: false

.github/workflows/rust.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: rust tests
22

33
on:
44
push:
@@ -14,15 +14,17 @@ concurrency:
1414

1515
env:
1616
RUST_BACKTRACE: 1
17-
CARGO_TERM_COLOR: always
17+
CARGO_TERM_COLOR: never
1818

1919
jobs:
2020
test:
2121
if: github.repository_owner == 'aws-samples'
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
25-
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2
24+
- name: Checkout
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: Cache
27+
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
2628
- name: Format
2729
run: cargo fmt --all -- --check --verbose
2830
- name: Build

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/dependencies/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aws-lambda-powertools[tracer,parser]==3.3.0
1+
aws-lambda-powertools[tracer,parser]==3.4.0
22
cryptography==43.0.3
33
hpke==0.3.2
44
pksuid==1.1.2

api/requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
black==24.10.0
2-
aws-lambda-powertools[all,aws-sdk]==3.3.0
3-
boto3-stubs[dynamodb,kms]==1.35.81
2+
aws-lambda-powertools[all,aws-sdk]==3.4.0
3+
boto3-stubs[dynamodb,kms]

canary/dependencies/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aws-lambda-powertools==3.3.0
1+
aws-lambda-powertools==3.4.0

canary/requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
black==24.10.0
2-
aws-lambda-powertools[all,aws-sdk]==3.3.0
3-
boto3-stubs[dynamodb,kms]==1.35.81
2+
aws-lambda-powertools[all,aws-sdk]==3.4.0
3+
boto3-stubs[dynamodb,kms]

docker-bake.hcl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
group "default" {
2+
targets = ["parent", "enclave"]
3+
}
4+
5+
target "parent" {
6+
context = "./parent"
7+
dockerfile = "Dockerfile"
8+
args = {
9+
TARGETPLATFORM = "x86_64-unknown-linux-gnu"
10+
}
11+
tags = ["parent-vault:latest"]
12+
cache-to = ["type=gha,ignore-error=true,mode=max,scope=parent"]
13+
cache-from = ["type=gha,scope=parent"]
14+
}
15+
16+
target "enclave" {
17+
context = "./enclave"
18+
dockerfile = "Dockerfile"
19+
args = {
20+
TARGETPLATFORM = "x86_64-unknown-linux-musl"
21+
}
22+
tags = ["enclave-vault:latest"]
23+
cache-to = ["type=gha,ignore-error=true,mode=max,scope=enclave"]
24+
cache-from = ["type=gha,scope=enclave"]
25+
}

enclave/Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
##
77
## based on https://github.com/aws/aws-nitro-enclaves-acm/blob/main/env/enclave/Dockerfile
88
####################################################################################################
9-
FROM public.ecr.aws/docker/library/rust:alpine as kmstool
9+
FROM public.ecr.aws/docker/library/rust:alpine AS kmstool
1010

1111
ARG TARGETPLATFORM
1212
ENV RUSTFLAGS="-C target-feature=-crt-static"
@@ -32,7 +32,7 @@ RUN ln -s /usr/lib /usr/lib64
3232
WORKDIR /tmp/crt-builder
3333

3434
# Build AWS libcrypto
35-
RUN git clone --depth 1 -b v1.12.0 https://github.com/awslabs/aws-lc.git
35+
RUN git clone --depth 1 -b v1.41.1 https://github.com/awslabs/aws-lc.git
3636
RUN cmake \
3737
-DCMAKE_PREFIX_PATH=/usr \
3838
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -123,7 +123,7 @@ RUN cmake \
123123
RUN cmake --build aws-c-auth/build --parallel $(nproc) --target install
124124

125125
# JSON-C library
126-
RUN git clone --depth 1 -b json-c-0.16-20220414 https://github.com/json-c/json-c.git
126+
RUN git clone --depth 1 -b json-c-0.18-20240915 https://github.com/json-c/json-c.git
127127
RUN cmake \
128128
-DCMAKE_PREFIX_PATH=/usr \
129129
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -134,6 +134,7 @@ RUN cmake --build json-c/build --parallel $(nproc) --target install
134134

135135
# NSM LIB
136136
RUN git clone --depth 1 -b v0.4.0 "https://github.com/aws/aws-nitro-enclaves-nsm-api"
137+
RUN rustup target add $TARGETPLATFORM
137138
RUN cd aws-nitro-enclaves-nsm-api \
138139
&& PATH="$PATH:/root/.cargo/bin" cargo build --release --target $TARGETPLATFORM --jobs $(nproc) -p nsm-lib \
139140
&& mv target/$TARGETPLATFORM/release/libnsm.so /usr/lib/ \
@@ -152,22 +153,25 @@ RUN cmake --build aws-nitro-enclaves-sdk-c/build --parallel $(nproc) --target in
152153
####################################################################################################
153154
## Chef image
154155
####################################################################################################
155-
FROM public.ecr.aws/docker/library/rust:alpine as chef
156+
FROM public.ecr.aws/docker/library/rust:alpine AS chef
157+
ARG TARGETPLATFORM
158+
156159
WORKDIR /app
157160
RUN apk add --no-cache build-base
161+
RUN rustup target add $TARGETPLATFORM
158162
RUN cargo install cargo-chef --locked
159163

160164
####################################################################################################
161165
## Planner image
162166
####################################################################################################
163-
FROM chef as planner
167+
FROM chef AS planner
164168
COPY . .
165169
RUN cargo chef prepare --recipe-path recipe.json
166170

167171
####################################################################################################
168172
## Builder image
169173
####################################################################################################
170-
FROM chef as builder
174+
FROM chef AS builder
171175
ARG TARGETPLATFORM
172176

173177
COPY --from=planner /app/recipe.json recipe.json

parent/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
####################################################################################################
55
## Chef image
66
####################################################################################################
7-
FROM public.ecr.aws/docker/library/rust:latest as chef
7+
FROM public.ecr.aws/docker/library/rust:latest AS chef
88
ARG TARGETPLATFORM
99

1010
WORKDIR /app
@@ -15,14 +15,14 @@ RUN cargo install cargo-chef --locked
1515
####################################################################################################
1616
## Planner image
1717
####################################################################################################
18-
FROM chef as planner
18+
FROM chef AS planner
1919
COPY . .
2020
RUN cargo chef prepare --recipe-path recipe.json
2121

2222
####################################################################################################
2323
## Builder image
2424
####################################################################################################
25-
FROM chef as builder
25+
FROM chef AS builder
2626
ARG TARGETPLATFORM
2727

2828
COPY --from=planner /app/recipe.json recipe.json

0 commit comments

Comments
 (0)