Skip to content

Commit 55a8c1c

Browse files
authored
Merge pull request #4 from codecentric/arm-testing
Fixes related to testing on M1/ARM Mac
2 parents 682bf0b + a9a939d commit 55a8c1c

File tree

8 files changed

+36
-22
lines changed

8 files changed

+36
-22
lines changed

.github/workflows/build-docker.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
version:
88
required: true
99
type: string
10+
platforms:
11+
required: false
12+
type: string
13+
default: "linux/amd64,linux/arm64"
1014
working-dir:
1115
required: true
1216
type: string
@@ -24,28 +28,32 @@ jobs:
2428
steps:
2529
- name: ⬇️ Checkout
2630
uses: actions/checkout@v2
27-
- name: Download artifact
31+
- name: 📦 Download artifact
2832
uses: actions/download-artifact@v2
2933
if: inputs.artifact-name && inputs.artifact-path
3034
with:
3135
name: ${{ inputs.artifact-name }}
3236
path: ${{ inputs.artifact-path }}
37+
- name: 🦤 Set up qemu
38+
uses: docker/setup-qemu-action@v1
39+
- name: 🐳 Set up docker buildx
40+
uses: docker/setup-buildx-action@v1
3341
- name: 🧰 Build container image
42+
if: github.ref != 'refs/heads/main' || inputs.version == 'dev'
3443
working-directory: ${{ inputs.working-dir }}
35-
run: |
36-
docker build \
37-
-t "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:latest" \
38-
-t "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:$(git rev-parse --short HEAD)" \
39-
-t "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:${{ inputs.version }}" .
44+
run: docker buildx build --platform "${{ inputs.platforms }}" .
4045
- name: 🔑 Login to GitHub Container registry
46+
if: github.ref == 'refs/heads/main' && inputs.version != 'dev'
4147
uses: docker/login-action@v1
4248
with:
4349
registry: ghcr.io
4450
username: ${{ github.actor }}
4551
password: ${{ secrets.GITHUB_TOKEN }}
46-
- name: ⬆️ Push container image
52+
- name: 🧰 ⬆️ Build and push container image
4753
if: github.ref == 'refs/heads/main' && inputs.version != 'dev'
54+
working-directory: ${{ inputs.working-dir }}
4855
run: |
49-
docker push "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:latest"
50-
docker push "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:$(git rev-parse --short HEAD)"
51-
docker push "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:${{ inputs.version }}"
56+
docker buildx build --push --platform "${{ inputs.platforms }}" \
57+
-t "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:latest" \
58+
-t "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:$(git rev-parse --short HEAD)" \
59+
-t "ghcr.io/codecentric/habitcentric/${{ inputs.image-name }}:${{ inputs.version }}" .

services/habit/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ ext {
6666
springfox : '2.9.2',
6767
liquibase : '4.4.3',
6868
pactProvider : '3.6.12',
69-
springCloudVersion: 'Greenwich.SR6'
69+
springCloudVersion: 'Greenwich.SR6',
70+
jna : '5.8.0'
7071
]
7172
}
7273
// override the version the spring boot dependency-management plugin would enforce
7374
ext['junit-jupiter.version'] = versions.junitJupiter
75+
ext['jna.version'] = versions.jna // Required for Docker on ARM
7476

7577
dependencies {
7678
implementation 'org.springframework.boot:spring-boot-starter-actuator'

services/habit/helm/habit/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Return the proper habitcentric init image name
3232
{{- define "habit.init.image" -}}
3333
{{- $registryName := .Values.init.image.registry -}}
3434
{{- $repositoryName := .Values.init.image.repository -}}
35-
{{- $tag := .Values.image.tag | toString -}}
35+
{{- $tag := .Values.init.image.tag | toString -}}
3636
{{/*
3737
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
3838
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.

services/report/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ plugins {
55
id("com.github.jk1.dependency-license-report") version "1.16"
66
id("org.springframework.boot") version "2.2.5.RELEASE"
77
id("com.diffplug.spotless") version "5.14.3"
8-
kotlin("jvm") version "1.5.30"
9-
kotlin("kapt") version "1.5.30"
10-
kotlin("plugin.spring") version "1.5.30"
8+
kotlin("jvm") version "1.6.10"
9+
kotlin("kapt") version "1.6.10"
10+
kotlin("plugin.spring") version "1.6.10"
1111
// we should switch to the plugin but enabling it causes warnings for the openapi generator
1212
//id("io.freefair.lombok") version "6.2.0"
1313
}

services/track/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ ext {
6363
testcontainers : '1.15.3',
6464
reflections : '0.9.12',
6565
postgresql : '42.2.23',
66-
springCloudVersion: 'Greenwich.SR6'
66+
springCloudVersion: 'Greenwich.SR6',
67+
jna : '5.8.0'
6768
]
6869
}
6970
// override the version the spring boot dependency-management plugin would enforce
7071
ext['junit-jupiter.version'] = versions.junitJupiter
72+
ext['jna.version'] = versions.jna // Required for Docker on ARM
7173

7274
dependencies {
7375
implementation 'org.springframework.boot:spring-boot-starter-actuator'

services/track/helm/track/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Return the proper habitcentric init image name
3232
{{- define "track.init.image" -}}
3333
{{- $registryName := .Values.init.image.registry -}}
3434
{{- $repositoryName := .Values.init.image.repository -}}
35-
{{- $tag := .Values.image.tag | toString -}}
35+
{{- $tag := .Values.init.image.tag | toString -}}
3636
{{/*
3737
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
3838
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.

test/lpt-locust/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM locustio/locust:1.2.3
1+
FROM locustio/locust:2.8.4
22
RUN pip3 install kubernetes
33
COPY src /locust-config
44
ENV LOCUST_LOCUSTFILE /locust-config/locustfile.py

test/lpt-locust/requirements.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ click==8.0.4
66
ConfigArgParse==1.5.3
77
Flask==2.0.3
88
Flask-BasicAuth==0.2.0
9+
Flask-Cors==3.0.10
910
gevent==21.12.0
1011
geventhttpclient==1.5.3
11-
google-auth==2.6.0
12+
google-auth==2.6.2
1213
greenlet==1.1.2
1314
idna==3.3
14-
itsdangerous==2.1.0
15+
itsdangerous==2.1.1
1516
Jinja2==3.0.3
16-
kubernetes==11.0.0
17-
locust==1.2.3
17+
kubernetes==23.3.0
1818
MarkupSafe==2.1.0
1919
msgpack==1.0.3
2020
oauthlib==3.2.0
@@ -28,8 +28,10 @@ PyYAML==6.0
2828
pyzmq==22.3.0
2929
requests==2.27.1
3030
requests-oauthlib==1.3.1
31+
roundrobin==0.0.2
3132
rsa==4.8
3233
six==1.16.0
34+
typing_extensions==4.1.1
3335
urllib3==1.26.8
3436
websocket-client==1.3.1
3537
Werkzeug==2.0.3

0 commit comments

Comments
 (0)