Skip to content

Commit 41157fc

Browse files
authored
Merge pull request #23 from getditto/ditto/enable-flatcar-arm-builds
Add arm64 flatcar builds [PLA-651]
2 parents 27e2852 + e2bb358 commit 41157fc

File tree

10 files changed

+34
-29
lines changed

10 files changed

+34
-29
lines changed

.github/workflows/image-ami-builds.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ on:
1111
k8s_version:
1212
description: "Specify the Kubernetes version"
1313
required: false
14-
default: "1.31.4"
15-
options:
16-
- "1.31.4"
17-
- "1.31.5"
14+
default: "1.31.13"
1815
make_public:
1916
description: "Include step to make AMIs public. Useful to disable when testing, so we don't pollute our public AMI list or bloat our quota limit."
2017
type: boolean
@@ -138,7 +135,7 @@ jobs:
138135
- name: Build Ubuntu AMI
139136
env:
140137
AWS_PROFILE: ditto-prod-primary
141-
K8S_VERSION: ${{ github.event.inputs.k8s_version || '1.31.4' }}
138+
K8S_VERSION: ${{ github.event.inputs.k8s_version }}
142139
run: |
143140
AWS_REGION=${{ env.AWS_REGION }} \
144141
./images/capi/update_k8s_version.sh && \
@@ -151,9 +148,13 @@ jobs:
151148
run: |
152149
153150
build-aws-flatcar-ami:
154-
name: Build and Publish Flatcar AMI
151+
name: Build and Publish Flatcar AMI (${{ matrix.arch }})
155152
runs-on: ubuntu-latest
156153
if: ${{ github.event.inputs.build_target == 'all' || github.event.inputs.build_target == 'flatcar-only' || github.event.inputs.build_target == '' }}
154+
strategy:
155+
fail-fast: false
156+
matrix:
157+
arch: [amd64, arm64]
157158
env:
158159
CLOUD: "aws"
159160
FLATCAR_CHANNEL: "stable"
@@ -187,11 +188,15 @@ jobs:
187188
- name: Build Flatcar AMI
188189
env:
189190
AWS_PROFILE: ditto-prod-primary
190-
K8S_VERSION: ${{ github.event.inputs.k8s_version || '1.31.4' }}
191+
K8S_VERSION: ${{ github.event.inputs.k8s_version }}
191192
TARGET_OS: flatcar
192193
run: |
193194
./images/capi/update_k8s_version.sh && \
194-
make build-ami-flatcar
195+
if [ "${{ matrix.arch }}" = "amd64" ]; then
196+
make build-ami-flatcar
197+
else
198+
make build-ami-flatcar-${{ matrix.arch }}
199+
fi
195200
196201
- name: Make Flatcar AMI Public
197202
if: ${{ github.event.inputs.make_public == 'true' }}
@@ -237,7 +242,7 @@ jobs:
237242
238243
- name: Build Ubuntu GCP Images
239244
env:
240-
K8S_VERSION: ${{ github.event.inputs.k8s_version || '1.31.4' }}
245+
K8S_VERSION: ${{ github.event.inputs.k8s_version }}
241246
PKR_VAR_google_access_token: "${{ steps.gcp-auth.outputs.access_token }}"
242247
run: |
243248
./images/capi/update_k8s_version.sh && \

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.vscode/
22
.idea/
33
.venv/
4+
.envrc

images/capi/ansible/roles/node/tasks/main.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,12 @@
8989

9090
- name: Configure auditd rules for containerd
9191
ansible.builtin.copy:
92-
src: etc/audit/rules.d/containerd.rules
92+
src: "etc/audit/rules.d/containerd.rules{{ '-flatcar' if ansible_os_family == 'Flatcar' else '' }}"
9393
dest: /etc/audit/rules.d/containerd.rules
9494
owner: root
9595
group: root
9696
mode: "0644"
97-
when: ansible_os_family != "Flatcar" and enable_containerd_audit
98-
99-
- name: Configure auditd rules for containerd (Flatcar)
100-
ansible.builtin.copy:
101-
src: etc/audit/rules.d/containerd.rules-flatcar
102-
dest: /etc/audit/rules.d/containerd.rules
103-
owner: root
104-
group: root
105-
mode: "0644"
106-
when: ansible_os_family == "Flatcar" and enable_containerd_audit
97+
when: enable_containerd_audit|default(false)|bool
10798

10899
- name: Ensure reverse packet filtering is set as strict
109100
ansible.posix.sysctl:

images/capi/ansible/roles/python/defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
---
16-
pypy_python_version: "3.6"
17-
pypy_version: 7.2.0
16+
pypy_python_version: "3.9"
17+
pypy_version: 7.3.16
1818
pypy_download_path: /tmp/pypy.tar.bz2
1919
pypy_install_path: /opt

images/capi/ansible/roles/python/tasks/flatcar.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
when:
2121
- pypy_installed.stdout_lines[0] == "false"
2222
vars:
23-
pypy_url_base: https://github.com/squeaky-pl/portable-pypy/releases/download/pypy{{ pypy_python_version }}-{{ pypy_version }}
24-
pypy_url_path: pypy{{ pypy_python_version }}-{{ pypy_version }}-linux_x86_64-portable.tar.bz2
23+
pypy_url_base: https://downloads.python.org/pypy
24+
pypy_url_path: pypy{{ pypy_python_version }}-v{{ pypy_version }}-linux64.tar.bz2
2525
block:
2626
- name: Download pypy archive
2727
ansible.builtin.raw: curl {{ pypy_url_base }}/{{ pypy_url_path }} -L --output {{ pypy_download_path }}
2828
- name: Extract archive
2929
ansible.builtin.raw: tar -xjf {{ pypy_download_path }} -C {{ pypy_install_path }}
3030
- name: Rename pypy folder
31-
ansible.builtin.raw: mv {{ pypy_install_path }}/pypy{{ pypy_python_version }}-{{ pypy_version }}-linux_x86_64-portable/ {{ pypy_install_path }}/pypy
31+
ansible.builtin.raw: mv {{ pypy_install_path }}/pypy{{ pypy_python_version }}-v{{ pypy_version }}-linux64/ {{ pypy_install_path }}/pypy
3232
- name: Delete downloaded archive
3333
ansible.builtin.raw: rm -f {{ pypy_download_path }}

images/capi/ansible/roles/sysprep/tasks/debian.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
path: /etc/apt/sources.list.d/{{ item | basename }}
3131
state: absent
3232
loop: "{{ extra_repos.split() }}"
33-
when: remove_extra_repos and extra_repos != ""
33+
when:
34+
- remove_extra_repos|default(false)|bool
35+
- extra_repos != ""
3436

3537
- name: Find disabled repo files
3638
ansible.builtin.find:

images/capi/ansible/roles/sysprep/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
ansible.builtin.file:
3838
path: /etc/pip.conf
3939
state: absent
40-
when: remove_extra_repos and pip_conf_file != ""
40+
when:
41+
- remove_extra_repos|default(false)|bool
42+
- pip_conf_file != ""
4143

4244
- name: Truncate machine id
4345
ansible.builtin.file:

images/capi/ansible/roles/sysprep/tasks/rpm_repos.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
path: /etc/yum.repos.d/{{ item | basename }}
1818
state: absent
1919
loop: "{{ extra_repos.split() }}"
20-
when: remove_extra_repos and extra_repos != ""
20+
when:
21+
- remove_extra_repos|default(false)|bool
22+
- extra_repos != ""
2123

2224
- name: Find disabled repo files
2325
ansible.builtin.find:

images/capi/packer/ami/flatcar-arm64.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"arch": "arm64",
88
"build_name": "flatcar-{{env `FLATCAR_CHANNEL`}}",
99
"builder_instance_type": "t4g.small",
10+
"containerd_arch": "arm64",
1011
"crictl_arch": "arm64",
1112
"crictl_source_type": "http",
1213
"distribution": "flatcar",

images/capi/packer/ami/packer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@
204204
"aws_session_token": "",
205205
"build_timestamp": "{{timestamp}}",
206206
"builder_instance_type": "m6a.xlarge",
207+
"containerd_arch": "amd64",
207208
"containerd_gvisor_runtime": "false",
208209
"containerd_gvisor_version": "latest",
209210
"containerd_sha256": null,
210-
"containerd_url": "https://github.com/containerd/containerd/releases/download/v{{user `containerd_version`}}/cri-containerd-cni-{{user `containerd_version`}}-linux-amd64.tar.gz",
211+
"containerd_url": "https://github.com/containerd/containerd/releases/download/v{{user `containerd_version`}}/cri-containerd-cni-{{user `containerd_version`}}-linux-{{user `containerd_arch`}}.tar.gz",
211212
"containerd_version": null,
212213
"crictl_url": "https://github.com/kubernetes-sigs/cri-tools/releases/download/v{{user `crictl_version`}}/crictl-v{{user `crictl_version`}}-linux-amd64.tar.gz",
213214
"crictl_version": null,

0 commit comments

Comments
 (0)