Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM Support #333

Closed
quaintdev opened this issue Apr 16, 2022 · 12 comments
Closed

ARM Support #333

quaintdev opened this issue Apr 16, 2022 · 12 comments

Comments

@quaintdev
Copy link

Hi

Thanks for making Pinry.

I was hoping to run Pinry on Raspberry Pi but I could not find an ARM image on the docker hub. Do you plan to support ARM? If not, any suggestions for me?

@cleaverm
Copy link
Contributor

I have it working on a Pi4 running 64-bit Pi OS - at the moment you need to build the Docker image on the Pi itself. I haven't tried it on 32-bit but there's a good chance it will work.

With Docker Compose you should be able to try with this (assuming I didn't make a mistake adapting my compose file):

# docker-compose.yml
version: "3.9"
services:
  pinry:
    image: pinry-local-build
    build:
      context: pinry-repo
      dockerfile: Dockerfile.autobuild
    restart: always
    volumes:
      - pinry-data:/data
      # make sure local_settings.py exists alongside docker-compose.yml
      # (copy from pinry-repo/pinry/settings/local_settings.example.py)
      - ./local_settings.py:/data/local_settings.py:ro
      - ./local_settings.py:/pinry/pinry/settings/local_settings.py:ro

volumes:
  pinry-data:

Put the files on the Pi alongside the cloned repo and docker-compose up should build and run the image.

$ ls -la
total 24
drwxr-xr-x  3 pi pi 4096 Apr 16 20:57 .
drwxr-xr-x 10 pi pi 4096 Apr 15 12:06 ..
-rw-rw-r--  1 pi pi  617 Apr 15 19:49 docker-compose.yml
-rw-rw-r--  1 pi pi  931 Apr 15 19:49 local_settings.py
drwxr-xr-x 12 pi pi 4096 Apr 15 19:49 pinry-repo

$ docker-compose up -d
... (go make a coffee)

You don't actually have to mount local_settings.py into the container - there are some scripts that will create one inside the /data folder if it doesn't exist. I just prefer things this way (it's mounted in two places to work around the script that does the automatic setup, just in case).

I submitted a change to Dockerfile.autobuild that was only merged today, so make sure you have the latest version of master or it probably won't build (I just happened to try Pinry on a Raspberry Pi for the first time yesterday).

If you run into problems I might be able to help... but if you're on 32-bit you might be on your own, I don't have a spare Pi running a 32-bit OS on which to test.

I suspect we can probably help get an ARM image published to Docker Hub - I guess it's not there because there was nobody that needed it, and therefore nobody to test it... so no reason to try publishing one.

@quaintdev
Copy link
Author

I was hoping for pre-built images because last time I tried to build on Pi for another app, my SD gave up. Anyways I will see if I can cross compile for ARM on my desktop.

Thanks

@cleaverm
Copy link
Contributor

Fair point, I remember trying to build an image on an ARM NAS a few years ago and ultimately giving up.

@winkidney do you know what needs to be done to get the autobuild publishing an ARM image to Docker Hub? Does someone need to configure something on the Docker Hub side (i.e. not just in this repo)? I would be happy to test/QA the built image.

@winkidney
Copy link
Member

Fair point, I remember trying to build an image on an ARM NAS a few years ago and ultimately giving up.

@winkidney do you know what needs to be done to get the autobuild publishing an ARM image to Docker Hub? Does someone need to configure something on the Docker Hub side (i.e. not just in this repo)? I would be happy to test/QA the built image.

I'd like to investigate it.
I have an OpenWRT device with ARM CPU.

I may have time to do this this weekend.

And, thanks for your help!

@winkidney
Copy link
Member

@winkidney
Copy link
Member

@cleaverm I've made a simple PR to make ARM build done (not fully tested, only tested for ARMv8) https://github.com/pinry/pinry/pull/335/files

@winkidney
Copy link
Member

ARM support is ready, please just run docker pull getpinry/pinry on your ARM device.
I've test it on my OpenWRT device and it works well.

@cleaverm @quaintdev

@quaintdev
Copy link
Author

Thanks you! I know what I am doing this weekend. 👍🏼

@cleaverm
Copy link
Contributor

Thanks for putting time into this. I can confirm getpinry/pinry:2.1.9 works on aarch64. I guess the image was pushed "manually" to Docker Hub, since there are still issues with the Actions - I don't see any green ones in the list?

Even though I thought I could see code changes from 2.1.9 in some of the files in the image (e.g. i18n-related changes), the UI changes from the translation switcher aren't there when using the app. At first I thought it was something to do with my setup or the service worker caching, since I've never updated the image before. But then I rebuilt from 2.1.9 source using Dockerfile.autobuild and the new UI element appeared. So I think the image on Docker Hub isn't quite 2.1.9 after all (maybe it has the source files but doesn't build the SPA?). But it's late, maybe I missed something. In any case, I'm happy rebuilding from source when I need to but will check back here in case I can help out with the builds somehow. I'm still mostly just poking around now and then when I have a spare minute.

@winkidney
Copy link
Member

Thanks for putting time into this. I can confirm getpinry/pinry:2.1.9 works on aarch64. I guess the image was pushed "manually" to Docker Hub, since there are still issues with the Actions - I don't see any green ones in the list?

Even though I thought I could see code changes from 2.1.9 in some of the files in the image (e.g. i18n-related changes), the UI changes from the translation switcher aren't there when using the app. At first I thought it was something to do with my setup or the service worker caching, since I've never updated the image before. But then I rebuilt from 2.1.9 source using Dockerfile.autobuild and the new UI element appeared. So I think the image on Docker Hub isn't quite 2.1.9 after all (maybe it has the source files but doesn't build the SPA?). But it's late, maybe I missed something. In any case, I'm happy rebuilding from source when I need to but will check back here in case I can help out with the builds somehow. I'm still mostly just poking around now and then when I have a spare minute.

Yes, the latest image has not been built since the tag v2.1.9 created.
We may create a new tag for i18n feature.
The auto-build doesn't work currently and I have enough free time to make it done.

I'll build a new version of image now and make the auto-build done once I have time.

@winkidney
Copy link
Member

I've add "--no-cache" for docker build and rebuilding the images v2.1.9, will be pushed later.

@winkidney
Copy link
Member

I've add "--no-cache" for docker build and rebuilding the images v2.1.9, will be pushed later.

Will be done late tonight maybe, have some other works to be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants