Skip to content

Commit 42d15ba

Browse files
ensure that al2 image is actually al2 (#313)
1 parent 31307c8 commit 42d15ba

File tree

7 files changed

+145
-35
lines changed

7 files changed

+145
-35
lines changed

.github/docker-images/al2-x64/Dockerfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazonlinux:latest
1+
FROM amazonlinux:2
22

33

44
###############################################################################
@@ -14,14 +14,11 @@ RUN yum -y update \
1414
python3-devel \
1515
python3-pip \
1616
make \
17-
cmake3 \
1817
gcc \
1918
gcc-c++ \
2019
which \
2120
&& yum clean all \
22-
&& rm -rf /var/cache/yum \
23-
&& cmake --version \
24-
&& ctest --version
21+
&& rm -rf /var/cache/yum
2522

2623
###############################################################################
2724
# Python/AWS CLI
@@ -37,6 +34,7 @@ WORKDIR /tmp
3734
RUN curl -sSL https://d19elf31gohf1l.cloudfront.net/_binaries/cmake/cmake-3.13-manylinux1-x64.tar.gz -o cmake.tar.gz \
3835
&& tar xvzf cmake.tar.gz -C /usr/local \
3936
&& cmake --version \
37+
&& ctest --version \
4038
&& rm -f /tmp/cmake.tar.gz
4139

4240
###############################################################################
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM amazonlinux:2023
2+
3+
4+
###############################################################################
5+
# Install prereqs
6+
###############################################################################
7+
RUN yum -y update \
8+
&& yum -y install \
9+
tar \
10+
git \
11+
sudo \
12+
# Python
13+
python3 \
14+
python3-devel \
15+
python3-pip \
16+
make \
17+
gcc \
18+
gcc-c++ \
19+
which \
20+
&& yum clean all \
21+
&& rm -rf /var/cache/yum
22+
23+
###############################################################################
24+
# Python/AWS CLI
25+
###############################################################################
26+
RUN python3 -m pip install setuptools virtualenv \
27+
&& python3 -m pip install --upgrade awscli \
28+
&& aws --version
29+
30+
###############################################################################
31+
# Install pre-built CMake
32+
###############################################################################
33+
WORKDIR /tmp
34+
RUN curl -sSL https://d19elf31gohf1l.cloudfront.net/_binaries/cmake/cmake-3.13-manylinux1-x64.tar.gz -o cmake.tar.gz \
35+
&& tar xvzf cmake.tar.gz -C /usr/local \
36+
&& cmake --version \
37+
&& ctest --version \
38+
&& rm -f /tmp/cmake.tar.gz
39+
40+
###############################################################################
41+
# Install entrypoint
42+
###############################################################################
43+
ADD entrypoint.sh /usr/local/bin/builder
44+
RUN chmod a+x /usr/local/bin/builder
45+
ENTRYPOINT ["/usr/local/bin/builder"]

.github/workflows/create-channel.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@ on:
1616

1717
env:
1818
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
19-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
20-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21-
AWS_REGION: 'us-east-1'
19+
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
20+
AWS_DEFAULT_REGION: us-east-1
21+
22+
permissions:
23+
id-token: write # This is required for requesting the JWT
2224

2325
# nothing
2426
jobs:
2527
package:
2628
name: Package builder app
27-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04
2830

2931
steps:
32+
- uses: aws-actions/configure-aws-credentials@v4
33+
with:
34+
role-to-assume: ${{ env.CRT_CI_ROLE }}
35+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
36+
3037
- name: Checkout Source
3138
uses: actions/checkout@v4
3239

@@ -54,7 +61,7 @@ jobs:
5461

5562
standard-images:
5663
name: ${{ matrix.variant.name }}
57-
runs-on: ubuntu-latest
64+
runs-on: ubuntu-24.04
5865
strategy:
5966
fail-fast: false
6067
matrix:
@@ -68,6 +75,7 @@ jobs:
6875
- name: musllinux-1-1-x64
6976
- name: al2012-x64
7077
- name: al2-x64
78+
- name: al2023-x64
7179
- name: ubuntu-18-x64
7280
- name: ubuntu-20-x64
7381
- name: ubuntu-20-aarch64
@@ -89,6 +97,11 @@ jobs:
8997
- name: openwrt-x64-openjdk8
9098

9199
steps:
100+
- uses: aws-actions/configure-aws-credentials@v4
101+
with:
102+
role-to-assume: ${{ env.CRT_CI_ROLE }}
103+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
104+
92105
- name: Checkout Sources
93106
uses: actions/checkout@v4
94107

@@ -109,8 +122,9 @@ jobs:
109122
uses: whoan/docker-build-with-cache-action@v8
110123
with:
111124
registry: ${{ secrets.AWS_ECR_REPO }}
112-
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
113-
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
125+
username: ${{ steps.creds.outputs.aws-access-key-id }}
126+
password: ${{ steps.creds.outputs.aws-secret-access-key }}
127+
session: ${{ steps.creds.outputs.aws-session-token }}
114128
image_name: aws-crt-${{ matrix.variant.name }}
115129
image_tag: ${{ steps.tag.outputs.release_tag }}
116130
context: .github/docker-images/${{ matrix.variant.name }}

.github/workflows/create-release.yml

+32-9
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,30 @@ on:
66
types: [published]
77
workflow_dispatch:
88

9-
109
env:
1110
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
12-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
13-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
14-
AWS_REGION: 'us-east-1'
11+
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
12+
AWS_DEFAULT_REGION: us-east-1
13+
14+
permissions:
15+
id-token: write # This is required for requesting the JWT
1516

1617
jobs:
1718
package:
1819
name: Package builder app
19-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
2021

2122
steps:
23+
- uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
role-to-assume: ${{ env.CRT_CI_ROLE }}
26+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
27+
28+
- uses: aws-actions/configure-aws-credentials@v4
29+
with:
30+
role-to-assume: ${{ env.CRT_CI_ROLE }}
31+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
32+
2233
- name: Checkout Source
2334
uses: actions/checkout@v4
2435

@@ -48,7 +59,7 @@ jobs:
4859

4960
export-linux-images:
5061
name: Release aws-crt-${{ matrix.variant }}
51-
runs-on: ubuntu-latest
62+
runs-on: ubuntu-24.04
5263
strategy:
5364
fail-fast: false
5465
matrix:
@@ -62,6 +73,7 @@ jobs:
6273
- name: musllinux-1-1-x64
6374
- name: al2012-x64
6475
- name: al2-x64
76+
- name: al2023-x64
6577
- name: ubuntu-18-x64
6678
- name: ubuntu-20-x64
6779
- name: ubuntu-20-aarch64
@@ -83,6 +95,11 @@ jobs:
8395
- name: openwrt-x64-openjdk8
8496

8597
steps:
98+
- uses: aws-actions/configure-aws-credentials@v4
99+
with:
100+
role-to-assume: ${{ env.CRT_CI_ROLE }}
101+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
102+
86103
- name: Checkout Sources
87104
uses: actions/checkout@v4
88105

@@ -100,8 +117,9 @@ jobs:
100117
uses: whoan/docker-build-with-cache-action@v8
101118
with:
102119
registry: ${{ secrets.AWS_ECR_REPO }}
103-
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
104-
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
120+
username: ${{ steps.creds.outputs.aws-access-key-id }}
121+
password: ${{ steps.creds.outputs.aws-secret-access-key }}
122+
session: ${{ steps.creds.outputs.aws-session-token }}
105123
image_name: aws-crt-${{ matrix.variant.name }}
106124
image_tag: ${{ steps.tag.outputs.release_tag }}
107125
context: .github/docker-images/${{ matrix.variant.name }}
@@ -134,9 +152,14 @@ jobs:
134152
135153
upload-ci-script:
136154
name: Upload container ci script
137-
runs-on: ubuntu-latest
155+
runs-on: ubuntu-2024
138156

139157
steps:
158+
- uses: aws-actions/configure-aws-credentials@v4
159+
with:
160+
role-to-assume: ${{ env.CRT_CI_ROLE }}
161+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
162+
140163
- name: Checkout Source
141164
uses: actions/checkout@v4
142165

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
autopep8:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1111

1212
steps:
1313
- name: Checkout Source

.github/workflows/sanity-test.yml

+38-12
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ on:
1212

1313
env:
1414
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
15-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
16-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
17-
AWS_REGION: 'us-east-1'
15+
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
16+
AWS_DEFAULT_REGION: us-east-1
17+
18+
permissions:
19+
id-token: write # This is required for requesting the JWT
1820

1921
jobs:
2022
cleanup:
2123
name: Clean up previous branch jobs
22-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-24.04
2325
steps:
2426
- name: Clean up previous branch jobs
2527
uses: rokroskar/workflow-run-cleanup-action@master
@@ -28,7 +30,7 @@ jobs:
2830

2931
unit_test:
3032
name: Unit Tests
31-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-24.04
3234
steps:
3335
- name: Checkout Source
3436
uses: actions/checkout@v4
@@ -38,9 +40,14 @@ jobs:
3840

3941
package:
4042
name: Package builder app
41-
runs-on: ubuntu-latest
43+
runs-on: ubuntu-24.04
4244

4345
steps:
46+
- uses: aws-actions/configure-aws-credentials@v4
47+
with:
48+
role-to-assume: ${{ env.CRT_CI_ROLE }}
49+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
50+
4451
- name: Checkout Source
4552
uses: actions/checkout@v4
4653

@@ -78,7 +85,7 @@ jobs:
7885
strategy:
7986
fail-fast: false
8087
matrix:
81-
host: [ubuntu-22.04, macos-12, macos-13, macos-14, windows-2022]
88+
host: [ubuntu-22.04, macos-13, macos-14, windows-2022]
8289
needs: package
8390
runs-on: ${{ matrix.host }}
8491
steps:
@@ -137,7 +144,7 @@ jobs:
137144
138145
# Make sure cross compiling works
139146
cross_compile:
140-
runs-on: ubuntu-latest
147+
runs-on: ubuntu-24.04
141148
needs: [package]
142149
strategy:
143150
matrix:
@@ -204,6 +211,10 @@ jobs:
204211
compiler: [gcc-8, clang-9]
205212
std: [c++11, c++14, c++17, c++2a]
206213
steps:
214+
- uses: aws-actions/configure-aws-credentials@v4
215+
with:
216+
role-to-assume: ${{ env.CRT_CI_ROLE }}
217+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
207218
- name: Checkout Source
208219
uses: actions/checkout@v4
209220

@@ -227,7 +238,7 @@ jobs:
227238
- aws-iot-device-sdk-python-v2
228239

229240
needs: package
230-
runs-on: ubuntu-latest
241+
runs-on: ubuntu-24.04
231242
steps:
232243
- name: Install builder
233244
uses: actions/download-artifact@v4
@@ -254,6 +265,11 @@ jobs:
254265
needs: package
255266
runs-on: ubuntu-20.04
256267
steps:
268+
- uses: aws-actions/configure-aws-credentials@v4
269+
with:
270+
role-to-assume: ${{ env.CRT_CI_ROLE }}
271+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
272+
257273
- name: Checkout Source
258274
uses: actions/checkout@v4
259275

@@ -281,8 +297,13 @@ jobs:
281297
- musllinux-1-1-x64
282298

283299
needs: package
284-
runs-on: ubuntu-latest
300+
runs-on: ubuntu-24.04
285301
steps:
302+
- uses: aws-actions/configure-aws-credentials@v4
303+
with:
304+
role-to-assume: ${{ env.CRT_CI_ROLE }}
305+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
306+
286307
- name: Checkout Source
287308
uses: actions/checkout@v4
288309

@@ -314,8 +335,13 @@ jobs:
314335
- swift-5-al2-x64
315336

316337
needs: package
317-
runs-on: ubuntu-latest
338+
runs-on: ubuntu-24.04
318339
steps:
340+
- uses: aws-actions/configure-aws-credentials@v4
341+
with:
342+
role-to-assume: ${{ env.CRT_CI_ROLE }}
343+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
344+
319345
- name: Checkout Source
320346
uses: actions/checkout@v4
321347

@@ -334,7 +360,7 @@ jobs:
334360
335361
sanity-tests-passed:
336362
name: All Sanity Tests passed
337-
runs-on: ubuntu-latest
363+
runs-on: ubuntu-24.04
338364
needs:
339365
- unit_test
340366
- sanity_test

builder/core/host.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ def current_host():
7070
def _discover_host():
7171
platform = current_os()
7272
if platform == 'linux':
73-
if _file_contains('/etc/system-release', 'Amazon Linux release 2'):
73+
# Note: that AL2 and AL2023 have the same substring. Check for AL2023 explicitly.
74+
# And also check that AL2 has "2 (", which is common to all base distributions of AL2
75+
if _file_contains('/etc/system-release', 'Amazon Linux release 2023'):
76+
return 'al2023'
77+
if _file_contains('/etc/system-release', 'Amazon Linux release 2 ('):
7478
return 'al2'
7579
if _file_contains('/etc/system-release', 'Bare Metal') or _file_contains('/etc/system-release', 'Amazon Linux AMI'):
7680
return 'al2012'

0 commit comments

Comments
 (0)