Skip to content

Commit 0230d35

Browse files
authored
[PRA-156] Add ARM support (#164)
* feat: Add ARM build platform * chore: Update matrix room * tests: Include platform in juju.deploy calls * chore: Fix tox refresh script * tests: Remove minio setup * ci: Bump actions * ci: Initial CI run on ARM * tests: Specify grafana-agent channel, remove cos arch * fix: Bump spark job OCI resources * ci: Add missing microceph step in refresh tests * ci: Install libpq-dev on arm * fix: Escape matrix link * ci: Extract inplace upgrade tests * ci: Rework GPU integration tests * tests: Use proper arm revisions for charms * ci: Disable GPU test on ARM * ci: Migrate back to microk8s for gpu testing * Partial revert "tests: Include platform in juju.deploy calls" This partially reverts commit 6badd74. * tests: Set arch in juju model constraints * tests: Set grafana-agent-k8s channel to 1/stable * ci: Fix broken release check due to multiple platforms * docs: Document job matrix exclusions * tests: Use common base for data-integrator charm
1 parent 8716d3e commit 0230d35

13 files changed

Lines changed: 328 additions & 294 deletions

.github/workflows/ci.yaml

Lines changed: 82 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,39 @@ jobs:
2424
timeout-minutes: 5
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2828
- name: Install tox
2929
run: pipx install tox
3030
- name: Run linters
3131
run: tox run -e lint
3232

33-
unit-test:
33+
unit-tests:
3434
name: Unit tests
3535
runs-on: ubuntu-latest
3636
timeout-minutes: 5
3737
steps:
3838
- name: Checkout
39-
uses: actions/checkout@v5
39+
uses: actions/checkout@v6
4040
- name: Install tox
4141
run: pipx install tox
4242
- name: Run tests
4343
run: tox run -e unit
4444

4545
build:
46-
strategy:
47-
matrix:
48-
path:
49-
- .
50-
name: Build charm | ${{ matrix.path }}
51-
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v35.0.2
46+
name: Build charm
47+
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v41.1.0
5248
with:
53-
path-to-charm-directory: ${{ matrix.path }}
49+
cache: false
5450

5551
integration-test:
5652
strategy:
5753
fail-fast: false
5854
matrix:
55+
system:
56+
- os: ubuntu-22.04
57+
arch: amd64
58+
- os: ubuntu-22.04-arm
59+
arch: arm64
5960
tox-environments:
6061
- integration-charm
6162
- integration-metastore
@@ -68,12 +69,34 @@ jobs:
6869
- integration-iceberg
6970
- integration-provider
7071
- integration-trust
71-
name: ${{ matrix.tox-environments }}
72+
73+
exclude:
74+
- tox-environments: integration-charm # TODO(zk-arm): Remove exclusion
75+
system:
76+
os: ubuntu-22.04-arm
77+
arch: arm64
78+
79+
- tox-environments: integration-observability # No ARM build for obs charms
80+
system:
81+
os: ubuntu-22.04-arm
82+
arch: arm64
83+
84+
- tox-environments: integration-ha # TODO(zk-arm): Remove exclusion
85+
system:
86+
os: ubuntu-22.04-arm
87+
arch: arm64
88+
89+
- tox-environments: integration-external-access # TODO(zk-arm): Remove exclusion
90+
system:
91+
os: ubuntu-22.04-arm
92+
arch: arm64
93+
94+
name: ${{ matrix.tox-environments }} (${{ matrix.system.arch }})
7295
needs:
7396
- lint
74-
- unit-test
97+
- unit-tests
7598
- build
76-
runs-on: ubuntu-22.04
99+
runs-on: ${{ matrix.system.os }}
77100
timeout-minutes: 120
78101
steps:
79102
- name: (GitHub hosted) Free up disk space
@@ -86,8 +109,17 @@ jobs:
86109
rm -r /opt/hostedtoolcache/
87110
printf '\nDisk usage after cleanup\n'
88111
df --human-readable
112+
113+
- name: Install build deps
114+
if: ${{ matrix.system.os == 'ubuntu-22.04-arm' }}
115+
shell: bash
116+
run: |
117+
sudo apt update
118+
sudo apt install build-essential
119+
sudo apt install libpq-dev
120+
89121
- name: Checkout
90-
uses: actions/checkout@v5
122+
uses: actions/checkout@v6
91123

92124
- name: Setup operator environment
93125
# TODO: Replace with custom image on self-hosted runner
@@ -98,7 +130,7 @@ jobs:
98130
provider: microk8s
99131
channel: 1.32-strict/stable
100132
microk8s-group: snap_microk8s
101-
microk8s-addons: "rbac hostpath-storage dns minio metallb:10.64.140.43-10.64.140.49"
133+
microk8s-addons: "rbac hostpath-storage dns metallb:10.64.140.43-10.64.140.49"
102134

103135
- name: Setup microceph
104136
id: microceph
@@ -108,10 +140,11 @@ jobs:
108140
sudo microceph disk add loop,1G,3
109141
sudo microceph enable rgw
110142
sudo microceph.radosgw-admin user create --uid test --display-name test --access-key=foo --secret-key=bar
111-
echo -e "S3_SERVER_URL=http://$(ip -4 -j route get 2.2.2.2 | jq -r '.[] | .prefsrc'):80/\nS3_ACCESS_KEY=foo\nS3_SECRET_KEY=bar" > .env
143+
export IP=$(ip -4 -j route get 2.2.2.2 | jq -r '.[] | .prefsrc')
144+
echo -e "S3_SERVER_URL=http://$IP:80/\nS3_ACCESS_KEY=foo\nS3_SECRET_KEY=bar" > .env
112145
113146
- name: Download packed charm(s)
114-
uses: actions/download-artifact@v5
147+
uses: actions/download-artifact@v7
115148
with:
116149
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
117150
merge-multiple: true
@@ -131,6 +164,7 @@ jobs:
131164
docker rmi $IMAGE
132165
rm image.tar
133166
done
167+
134168
- name: Select tests
135169
id: select-tests
136170
run: |
@@ -142,10 +176,12 @@ jobs:
142176
echo Skipping unstable tests
143177
echo "mark_expression=not unstable" >> $GITHUB_OUTPUT
144178
fi
179+
145180
- name: Run integration tests
146181
run: tox run -e ${{ matrix.tox-environments }} -- -m '${{ steps.select-tests.outputs.mark_expression }}' --keep-models
147182
env:
148183
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }}
184+
149185
- name: Collect logs if job failed
150186
if: ${{ failure() }}
151187
run: |
@@ -168,89 +204,36 @@ jobs:
168204
kubectl events -A
169205
echo "Done"
170206
171-
test-refresh:
172-
strategy:
173-
fail-fast: false
174-
matrix:
175-
multi: ["--refresh-multi-units", ""]
176-
tls: ["--refresh-tls", ""]
177-
image: ["--refresh-image", ""]
178-
metastore: ["--refresh-metastore", ""]
179-
name: Refresh ${{ matrix.multi }} ${{ matrix.tls }} ${{ matrix.image }} ${{ matrix.metastore }}
207+
integration-gpu-amd:
208+
name: GPU tests (amd64)
180209
needs:
181210
- lint
182-
- unit-test
211+
- unit-tests
183212
- build
184-
runs-on: ubuntu-22.04
185-
timeout-minutes: 120
186-
steps:
187-
- name: (GitHub hosted) Free up disk space
188-
shell: bash
189-
run: |
190-
printf '\nDisk usage before cleanup\n'
191-
df --human-readable
192-
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
193-
rm -r /usr/share/dotnet
194-
rm -r /opt/hostedtoolcache/
195-
printf '\nDisk usage after cleanup\n'
196-
df --human-readable
197-
- name: Checkout
198-
uses: actions/checkout@v5
199-
- name: Setup operator environment
200-
# TODO: Replace with custom image on self-hosted runner
201-
uses: charmed-kubernetes/actions-operator@main
202-
with:
203-
juju-channel: 3.6/stable
204-
bootstrap-options: "--agent-version 3.6.9"
205-
provider: microk8s
206-
channel: 1.32-strict/stable
207-
microk8s-group: snap_microk8s
208-
microk8s-addons: "rbac hostpath-storage dns minio"
209-
- name: Download packed charm(s)
210-
uses: actions/download-artifact@v5
211-
with:
212-
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
213-
merge-multiple: true
214-
- id: cache-images
215-
name: Cache Images Locally
216-
run: |
217-
# Download images for avoiding time out
218-
IMAGES=(
219-
$(yq '.resources.kyuubi-image.upstream-source' metadata.yaml)
220-
$(python3 -c "from src.constants import JOB_OCI_IMAGE;print(JOB_OCI_IMAGE, end='')")
221-
"ghcr.io/canonical/charmed-spark-kyuubi@sha256:e2029c6976fc5b9ee2865eced632ca42ce554039d9832af20dfa3e63113e00f7" # rev 112 charm OCI resource
222-
"ghcr.io/canonical/charmed-spark@sha256:f1f944369108c0b0112212fb0242f3c314dfad362926c234857029f13c5de2c0" # rev 112 job OCI resource
223-
)
224-
225-
for IMAGE in "${IMAGES[@]}"; do
226-
docker pull $IMAGE
227-
docker save $IMAGE -o image.tar
228-
sudo microk8s ctr images import --base-name $IMAGE image.tar
229-
docker rmi $IMAGE
230-
rm image.tar
231-
done
232-
- name: Run inplace upgrade tests
233-
run: tox run -e integration-refresh -- ${{ matrix.multi }} ${{ matrix.tls }} ${{ matrix.image }} ${{ matrix.metastore }} --keep-models
234-
env:
235-
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }}
236-
- name: Collect logs if job failed
237-
if: ${{ failure() }}
238-
run: |
239-
juju-crashdump
240-
241-
# get pods
242-
kubectl get pods -A
243-
244-
# replay juju-debug logs
245-
sudo snap install yq
246-
for model in $(juju models --format yaml | yq '.models[] | .name');
247-
do
248-
echo "Model: $model"
249-
if [[ ${model} != *"controller"* ]];then
250-
juju debug-log --model $model --replay
251-
fi
252-
done
213+
uses: ./.github/workflows/integration-gpu.yaml
214+
with:
215+
arch: amd64
216+
secrets: inherit
217+
218+
integration-gpu-arm:
219+
name: GPU tests (arm64)
220+
# TODO(zk-arm): Missing arm64 support for ZK
221+
# TODO(GH#165): Convert to Canonical K8s
222+
if: false
223+
needs:
224+
- lint
225+
- unit-tests
226+
- build
227+
uses: ./.github/workflows/integration-gpu.yaml
228+
with:
229+
arch: arm64
230+
secrets: inherit
253231

254-
# events
255-
kubectl events -A
256-
echo "Done"
232+
refresh-tests:
233+
name: Inplace upgrades
234+
needs:
235+
- lint
236+
- unit-tests
237+
- build
238+
uses: ./.github/workflows/refresh-tests.yaml
239+
secrets: inherit

0 commit comments

Comments
 (0)