snypy / snypy-docker

Docker setup for running SnyPy
MIT License
34 stars 3 forks source link

Add support for ARM64 #28

Open wearemassive opened 8 months ago

wearemassive commented 8 months ago

The app will currently not run on a ARM64 platform (raspberry pi), it errors out with a exec format error. I believe it's because the version of python used is not built with ARM support by default.

https://github.com/docker-library/python/issues/798 talks about the issue.

I'd love to run the project, but my little home-lab RPI is not able to join in the fun.

nezhar commented 6 months ago

I like the idea, did you try to build it locally? We will need to build all containers for this architecture in order to work properly.

nezhar commented 6 months ago

Adding this to the pipelines is still in progress.

Meanwhile you can test it using theese images:

You can define them directly into your local .env file

API_VERSION=test-multi-platform
API_REMOTE=ghcr.io/snypy/snypy-backend
STATIC_REMOTE=ghcr.io/snypy/snypy-static

UI_VERSION=test-multi-platform
UI_REMOTE=ghcr.io/snypy/snypy-frontend
nezhar commented 4 months ago

I wanted to test this with my raspberry pi, but it is appereantly running on arm7

pi@raspberrypi:~/snypy-docker $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:~/snypy-docker $ uname -a
Linux raspberrypi 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l GNU/Linux

I get however also some details after the docker compose pull

WARNING: Some service image(s) must be built from source by running:
    docker compose build static api ui
3 errors occurred:
    * no matching manifest for linux/arm/v7 in the manifest list entries
    * no matching manifest for linux/arm/v7 in the manifest list entries
    * no matching manifest for linux/arm/v7 in the manifest list entries

I will try to extend the supported builds using buildx, it should be possible however to run docker compose build locally.

nezhar commented 4 months ago

QEMU is also required on Linux in order to build arm/v6 and arm/v7

https://stackoverflow.com/a/71533008/5382179

nezhar commented 4 months ago

The new builds are now compatible with arm/v7

I was now able to run the all containers on my Raspberry Pi 3 Model B ARM-Cortex-A53

Here is also an exmaple docker-compose.override.yml

version: "3"

services:
  api:
    environment:
      ALLOWED_HOSTS: "192.168.178.34"
      SECRET_KEY: "changeme!"
      EMAIL_URL: "smtp://mail:1025"
      STATIC_URL: "http://192.168.178.34:8081"
      CORS_ORIGIN_WHITELIST: "http://192.168.178.34:8080"
      CSRF_TRUSTED_ORIGINS: "http://192.168.178.34"
      REGISTER_VERIFICATION_URL: "http://192.168.178.34:8080/verify-user/"
      RESET_PASSWORD_VERIFICATION_URL: "http://192.168.178.34:8080/set-password/"
      REGISTER_EMAIL_VERIFICATION_URL: "http://192.168.178.34:8080/verify-email/"
      SENTRY_ENABLED: "False"
    ports:
      - "8000:8000"
    volumes:
      - ./data/fixtures/:/fixtures/

  static:
    ports:
      - "8081:80"

  ui:
    environment:
      REST_API_URL: "http://192.168.178.34:8000"
    ports:
      - "8080:80"

  mail:
    image: msztolcman/sendria:v2.2.2.0
    ports:
      - "1080:1080"

We might need to look for an alternative to sendria that supports arm64 and arm/v7

nezhar commented 4 months ago

I was also able to run the containers on arm64 using an VPS 1000 ARM G11

Linux 6.1.0-21-arm64 #1 SMP Debian 6.1.90-1 (2024-05-03) aarch64 GNU/Linux
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"