System tests are not runnable on mac M3
Our system tests are not currently runnable on the mac silicon. A while ago we modified the demo-specific docker files to emulate x86_64 architecture but it is not sufficient for running the system tests. The following error is produced:
! server The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
it seems that the remedy can be to explicitly add platform: linux/amd64
entry into the dockerfile. For example:
diff --git a/tests/system/docker-compose.yaml b/tests/system/docker-compose.yaml
index 90edb5001..dc8fb5dd3 100644
--- a/tests/system/docker-compose.yaml
+++ b/tests/system/docker-compose.yaml
@@ -3,6 +3,7 @@ version: '3'
services:
server-base:
restart: always
+ platform: linux/amd64
build:
context: .
dockerfile: $PWD/docker/images/stork.Dockerfile
@@ -35,11 +36,13 @@ services:
server:
extends: server-base
+ platform: linux/amd64
depends_on:
- postgres
server-non-debug:
extends: server-base
+ platform: linux/amd64
build:
target: server
volumes:
@@ -87,6 +90,7 @@ services:
agent-kea-base:
restart: always
+ platform: linux/amd64
hostname: agent-kea
build:
context: .
@@ -370,6 +374,7 @@ services:
perfdhcp:
extends: agent-kea-base
+ platform: linux/amd64
entrypoint: /usr/sbin/perfdhcp
hostname: perfdhcp
networks:
@@ -430,6 +435,7 @@ services:
postgres:
image: postgres:${POSTGRES_VERSION:-16}
+ platform: linux/amd64
command: -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
networks:
storknet:
It enables the emulation correctly but there are other issues.
The emulated programs run through Rosetta wrapper. The system tests, however run the server (and probably agent too) through Delve debugger. It effectively means that the debugger executes Rosetta wrapper rather than the actual Stork binary. It causes Rosetta/Stork to hang and the tests fail due to the timeout.
It could be remedied by not running the server through Delve:
diff --git a/tests/system/config/supervisor/stork-server.conf b/tests/system/config/supervisor/stork-server.conf
index 29b975d26..e4a3df99a 100644
--- a/tests/system/config/supervisor/stork-server.conf
+++ b/tests/system/config/supervisor/stork-server.conf
@@ -1,5 +1,5 @@
[program:stork-server]
-command=rake run:server_debug HEADLESS=true UI_MODE=none
+command=rake run:server HEADLESS=true UI_MODE=none
but we should discuss the implications.