Skip to content

Commit a71984e

Browse files
authored
Support Arm64 w/Multi-Platform Builds (#36)
1 parent e24db4e commit a71984e

32 files changed

+969
-385
lines changed

.devcontainer/Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ FROM mcr.microsoft.com/vscode/devcontainers/rust
22

33
RUN sudo apt-get update -y \
44
&& sudo apt-get upgrade -y \
5-
&& sudo apt-get install zip musl-tools ltrace -y
5+
&& sudo apt-get install -y zip ltrace
66

77
RUN rustup update \
8-
&& rustup target add x86_64-unknown-linux-musl
8+
&& rustup target add aarch64-unknown-linux-gnu
99

10-
RUN sudo apt-get install -y nodejs
10+
RUN sudo apt-get install -y \
11+
qemu \
12+
binfmt-support \
13+
qemu-user-static
1114

1215
RUN cd /tmp \
1316
&& curl -L https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip > aws-sam-cli-linux-x86_64.zip \

.devcontainer/devcontainer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
"ghcr.io/devcontainers/features/aws-cli:latest": {},
88
"ghcr.io/devcontainers/features/ruby:latest": {},
99
"ghcr.io/devcontainers/features/node:latest": {},
10-
"ghcr.io/devcontainers/features/php:latest": {},
10+
"ghcr.io/shyim/devcontainers-features/php:latest": {
11+
"installComposer": false
12+
}, // https://github.com/devcontainers/features/issues/262
1113
"ghcr.io/devcontainers/features/python:latest": {},
1214
"ghcr.io/devcontainers/features/docker-in-docker:latest": {},
15+
"ghcr.io/customink/codespaces-features/docker-log-level": {},
1316
"ghcr.io/devcontainers/features/sshd:latest": {}
1417
},
15-
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
1618
"customizations": {
1719
"vscode": {
1820
"settings": {

.devcontainer/postCreate

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/sh
22
set -e
33

4-
mv /usr/local/php/current/ini/conf.d/xdebug.ini /usr/local/php/current/ini/conf.d/xdebug.ini.bak
4+
docker run \
5+
--rm \
6+
--privileged \
7+
multiarch/qemu-user-static \
8+
--reset -p yes

.github/workflows/release.yml

+63-28
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,88 @@
11
name: "Release"
22
on:
3-
push:
4-
tags:
5-
- "v*"
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: "Example: 1.1.0"
7+
required: true
8+
type: string
69
jobs:
7-
build:
8-
name: Create Release
9-
runs-on: ubuntu-latest
10+
image:
11+
name: Image
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: docker/login-action@v2
16+
with:
17+
registry: ghcr.io
18+
username: ${{ github.repository_owner }}
19+
password: ${{ secrets.GITHUB_TOKEN }}
20+
- uses: devcontainers/[email protected]
21+
with:
22+
push: always
23+
imageName: ghcr.io/customink/crypteia-ci
24+
cacheFrom: ghcr.io/customink/crypteia-ci
25+
runCmd: echo DONE!
26+
debian:
27+
name: Debian x86_64/arm64
28+
runs-on: ubuntu-20.04
29+
needs: image
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: docker/login-action@v2
33+
with:
34+
registry: ghcr.io
35+
username: cink-continuous-integration
36+
password: ${{ secrets.PUBLIC_GITHUB_TOKEN_PACKAGES }}
37+
- uses: devcontainers/[email protected]
38+
env:
39+
CRYPTEIA_VERSION: ${{ github.event.inputs.version }}
40+
with:
41+
push: never
42+
cacheFrom: ghcr.io/customink/crypteia-ci
43+
env: |
44+
CRYPTEIA_VERSION
45+
runCmd: ./package/deploy-image-debian
46+
amzn:
47+
name: AmazonLinux2 x86_64/arm64
48+
runs-on: ubuntu-20.04
49+
needs: image
1050
steps:
11-
- name: Get version from tag
12-
id: tag_name
13-
run: |
14-
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
15-
shell: bash
16-
- name: Checkout
17-
uses: actions/checkout@v2
18-
- name: Login to GitHub Container Registry
19-
uses: docker/login-action@v2
51+
- uses: actions/checkout@v3
52+
- uses: docker/login-action@v2
2053
with:
2154
registry: ghcr.io
2255
username: cink-continuous-integration
2356
password: ${{ secrets.PUBLIC_GITHUB_TOKEN_PACKAGES }}
24-
- name: Build & Run Development Container
25-
uses: devcontainers/[email protected]
57+
- uses: devcontainers/[email protected]
58+
env:
59+
CRYPTEIA_VERSION: ${{ github.event.inputs.version }}
2660
with:
2761
push: never
28-
cacheFrom: ghcr.io/customink/crypteia-devcontainer
29-
runCmd: |
30-
./bin/setup
31-
./amzn/setup
32-
- name: Get CHANGELOG Entry
62+
cacheFrom: ghcr.io/customink/crypteia-ci
63+
env: |
64+
CRYPTEIA_VERSION
65+
runCmd: ./package/deploy-image-amzn
66+
release:
67+
name: Create Release
68+
runs-on: ubuntu-20.04
69+
needs: [debian, amzn]
70+
steps:
71+
- name: CHANGELOG Entry
3372
id: changelog_reader
3473
uses: mindsers/[email protected]
3574
with:
3675
validation_level: warn
37-
version: ${{ steps.tag_name.outputs.current_version }}
76+
version: ${{ github.event.inputs.version }}
3877
path: ./CHANGELOG.md
3978
- name: Create Release
4079
uses: ncipollo/release-action@v1
4180
with:
4281
allowUpdates: true
43-
artifact: "./build/*.zip"
82+
artifacts: false
4483
tag: ${{ steps.changelog_reader.outputs.version }}
4584
name: Release ${{ steps.changelog_reader.outputs.version }}
4685
body: ${{ steps.changelog_reader.outputs.changes }}
4786
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
4887
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
4988
token: ${{ secrets.GITHUB_TOKEN }}
50-
- name: Push Container Package(s)
51-
run: |
52-
CRYPTEIA_VERSION=${{ steps.changelog_reader.outputs.version }} ./package/deploy-images
53-
CRYPTEIA_VERSION=latest ./package/deploy-images

.github/workflows/test.yml

+71-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
name: Test
22
on: [push]
33
jobs:
4-
test:
5-
runs-on: ubuntu-latest
4+
image:
5+
name: Image
6+
runs-on: ubuntu-20.04
67
steps:
7-
- name: Checkout
8-
uses: actions/checkout@v2
9-
- name: Login to GitHub Container Registry
10-
uses: docker/login-action@v2
8+
- uses: actions/checkout@v3
9+
- uses: docker/login-action@v2
1110
with:
1211
registry: ghcr.io
1312
username: ${{ github.repository_owner }}
1413
password: ${{ secrets.GITHUB_TOKEN }}
14+
- uses: devcontainers/[email protected]
15+
with:
16+
push: always
17+
imageName: ghcr.io/customink/crypteia-ci
18+
cacheFrom: ghcr.io/customink/crypteia-ci
19+
runCmd: echo DONE!
20+
debian-x86-64:
21+
name: Debian x86_64
22+
runs-on: ubuntu-20.04
23+
needs: image
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
1527
- name: Configure AWS
1628
uses: aws-actions/configure-aws-credentials@v1
1729
with:
1830
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
1931
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
2032
aws-region: us-east-1
21-
- name: Build & Run Development Container
33+
- name: Test
2234
uses: devcontainers/[email protected]
2335
with:
24-
push: always
25-
imageName: ghcr.io/customink/crypteia-devcontainer
26-
cacheFrom: ghcr.io/customink/crypteia-devcontainer
36+
push: never
37+
cacheFrom: ghcr.io/customink/crypteia-ci
2738
env: |
2839
AWS_ACCESS_KEY_ID
2940
AWS_SECRET_ACCESS_KEY
@@ -33,27 +44,63 @@ jobs:
3344
runCmd: |
3445
./bin/setup
3546
./bin/test
36-
- name: Build & Run Development Container (w/Amazon Linux)
47+
debian-arm64:
48+
name: Debian arm64
49+
runs-on: ubuntu-20.04
50+
needs: image
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v3
54+
- name: Test
3755
uses: devcontainers/[email protected]
3856
with:
39-
push: always
40-
imageName: ghcr.io/customink/crypteia-devcontainer
41-
cacheFrom: ghcr.io/customink/crypteia-devcontainer
57+
push: never
58+
cacheFrom: ghcr.io/customink/crypteia-ci
59+
runCmd: |
60+
./debian/setup-arm64
61+
./debian/test-arm64
62+
amazon-x86-64:
63+
name: AmazonLinux2/x86_64
64+
runs-on: ubuntu-20.04
65+
needs: image
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v3
69+
- name: Test
70+
uses: devcontainers/[email protected]
71+
with:
72+
push: never
73+
cacheFrom: ghcr.io/customink/crypteia-ci
4274
runCmd: |
4375
./amzn/setup
4476
./amzn/test
45-
- name: Build & Run Development Container (w/ Python)
77+
amazon-arm64:
78+
name: AmazonLinux2 arm64
79+
runs-on: ubuntu-20.04
80+
needs: image
81+
steps:
82+
- name: Checkout
83+
uses: actions/checkout@v3
84+
- name: Test
4685
uses: devcontainers/[email protected]
4786
with:
48-
push: always
49-
imageName: ghcr.io/customink/crypteia-devcontainer
50-
cacheFrom: ghcr.io/customink/crypteia-devcontainer
51-
env: |
52-
AWS_ACCESS_KEY_ID
53-
AWS_SECRET_ACCESS_KEY
54-
AWS_SESSION_TOKEN
55-
AWS_DEFAULT_REGION
56-
AWS_REGION
87+
push: never
88+
cacheFrom: ghcr.io/customink/crypteia-ci
89+
runCmd: |
90+
./amzn/setup-arm64
91+
./amzn/test-arm64
92+
ubuntu-py27:
93+
name: Ubuntu x86_64 (Python27)
94+
runs-on: ubuntu-20.04
95+
needs: image
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v3
99+
- name: Test
100+
uses: devcontainers/[email protected]
101+
with:
102+
push: never
103+
cacheFrom: ghcr.io/customink/crypteia-ci
57104
runCmd: |
58105
./py27/setup
59106
./py27/test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ outputs.json
77
python/crypteia/build
88
python/crypteia/src/*.egg-info
99
runteststest
10+
.DS_Store

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10-
...
10+
## [1.1.0] - 2023-01-18
11+
12+
- Add arm64 support.
1113

1214
## [1.0.0] - 2022-10-26
1315

0 commit comments

Comments
 (0)