Skip to content

Commit dc723b9

Browse files
authored
[PRA-156] Add ARM support (#16)
* feat: Enable ARM support * ci: Use shared workflows to build & release rock
1 parent 87f46f5 commit dc723b9

File tree

6 files changed

+76
-201
lines changed

6 files changed

+76
-201
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 77 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v6
17+
- name: Install yamllint
18+
run: python3 -m pip install yamllint
19+
- name: YAML Lint
20+
run: |
21+
yamllint -d "{extends: relaxed, rules: {line-length: {max: 250}}}" \
22+
--no-warnings rockcraft.yaml
23+
- name: Install tox
24+
run: pipx install tox
25+
- name: Run linters
26+
run: tox run -e lint
27+
28+
unit-test:
29+
name: Unit tests
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v6
35+
- name: Install tox
36+
run: pipx install tox
37+
- name: Run tests
38+
run: tox run -e unit
39+
40+
build:
41+
name: Build rock
42+
uses: canonical/data-platform-workflows/.github/workflows/build_rock.yaml@v41.1.0

.github/workflows/publish.yaml

Lines changed: 0 additions & 114 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release to GHCR
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- 3/edge
11+
12+
jobs:
13+
build:
14+
name: Build rock
15+
uses: canonical/data-platform-workflows/.github/workflows/build_rock.yaml@v41.1.0
16+
17+
release:
18+
name: Release rock
19+
needs:
20+
- build
21+
uses: canonical/data-platform-workflows/.github/workflows/release_rock.yaml@v41.1.0
22+
with:
23+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
24+
permissions:
25+
packages: write # Needed to publish to GitHub Container Registry
26+
contents: write # Needed to create git tags
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
spark.kubernetes.container.image=ghcr.io/canonical/charmed-spark:3.4-22.04_edge
1+
spark.kubernetes.container.image=ghcr.io/canonical/charmed-spark:3.5.5-22.04_edge

rockcraft.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ base: ubuntu@22.04
1111

1212
platforms:
1313
amd64:
14+
arm64:
1415

1516
run_user: _daemon_
1617

@@ -30,7 +31,6 @@ services:
3031
SPARK_PROPERTIES_FILE: /etc/hub/conf/spark-defaults.conf
3132
SA_ALLOWLIST: /etc/hub/conf/allowlist
3233

33-
3434
parts:
3535
spark8t:
3636
plugin: nil
@@ -55,8 +55,8 @@ parts:
5555
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
5656
cd $CRAFT_PART_INSTALL/usr/local/bin
5757
KUBECTL_VERSION=$(wget -qO- https://dl.k8s.io/release/stable.txt)
58-
wget -q "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
59-
wget -q "https://dl.k8s.io/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256"
58+
wget -q "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/$CRAFT_ARCH_BUILD_FOR/kubectl"
59+
wget -q "https://dl.k8s.io/$KUBECTL_VERSION/bin/linux/$CRAFT_ARCH_BUILD_FOR/kubectl.sha256"
6060
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
6161
if [[ $? -ne 0 ]]
6262
then
@@ -70,11 +70,11 @@ parts:
7070

7171
hub-files:
7272
plugin: dump
73-
after: [ spark8t]
73+
after: [spark8t]
7474
source: files
7575
organize:
76-
scripts/monitor_sa.py : opt/hub/scripts/monitor_sa.py
77-
bin/monitor_sa.sh : opt/hub/bin/monitor_sa.sh
76+
scripts/monitor_sa.py: opt/hub/scripts/monitor_sa.py
77+
bin/monitor_sa.sh: opt/hub/bin/monitor_sa.sh
7878
spark/conf/spark-defaults.conf: etc/hub/conf/spark-defaults.conf
7979
stage:
8080
- opt/hub/scripts/monitor_sa.py
@@ -83,7 +83,7 @@ parts:
8383

8484
user-setup:
8585
plugin: nil
86-
after: [ hub-files ]
86+
after: [hub-files]
8787
overlay-packages:
8888
- python3
8989

@@ -100,5 +100,3 @@ parts:
100100
101101
chown -R ${HUB_GID}:${HUB_UID} etc/
102102
chmod -R 750 etc/
103-
104-

0 commit comments

Comments
 (0)