-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
pyinstaller-based binary for ARM (raspberry pi) #1018
Comments
|
Not sure if creating a single-file binary is possible with pyinstaller, someone with a raspberry pi 1 would have to check. The development section of the docs describes how this is usually done, the Vagrantfile has some practically tested code. Maybe these binaries could be also useful on other ARM based hardware, where installing borg otherwise is difficult to impossible (like some NAS devices). |
|
BTW, a note about running on low-memory systems: borg needs quite some memory for the dedup hashtable and also for the files cache, so be careful. There's a formula in the docs to estimate RAM needs. |
|
As a side note, I've run borg backup on arch on the raspberry pi, without major issues, backing up a fairly small set of files (< 2GB). |
|
I removed all comments from this ticket dealing with the raspian package - dist packages are what #105 deals with. |
I was able to successfully build a pyinstaller based armhf-binary of the 1.0.3 release 🎉 . You can download it here: borg-armhf (9.0MB) ⬇️ I did a quick test (only the basic commands) that showed the binary works on a raspberry pi without Python 3. The linked libraries seem to be the ARM versions of what the official binaries are linked against: I built this binary on my Raspberry Pi so I was unable to use vagrant to build the binary (seems like using QEMU with vagrant wouldn't be a good idea 😯 ). The process was pretty straight-forward, although quite slow due to the limited amount of processing power and the need to compile most of the dependencies (including Python itself). I guess the goal is to have official ARM binaries on the release page so the following issues need to be addressed:
Any ideas? |
|
While Vagrant + QEMU is probably not viable, Linux-on-QEMU should be. We used it before for powerpc (although that's very slow, but we got dedicated hardware now). Some more exotic tests (ie. not on Travis) tests are run here, if the speed of QEMU is feasible I might add it there. One can also run a subset of the tests against a compiled Borg binary. It must be named borg.exe and be on the PATH for this. This is what the Vagrantfile also does. I'm not sure if precompiled ARM binaries make a lot of sense, there are many ARM flavours. Since Borg is in Debian and most people seem to use that on RPis those should have packages available? |
|
@enkore I'm assuming you're passing |
|
Sounds good, I think builds could also be produced on scaleway's ARM servers if QEMU turns out to be too slow. |
|
So the only issue that's left is finding a way to use the logic from the Vagrantfile without using Vagrant. As the syntax seems to be Ruby, maybe a Ruby script could be written? |
|
Why exactly can't we use Vagrant? vagrant-libvirt is a thing (libvirt is a qemu manager). |
|
That project seems not to be stable yet and I couldn't find any ARM image for it. |
Of course, with a Raspberry Pi you can just install python3, pip and then borg (it seems not to be included in Raspbian Jessie). My goal is to ultimately use borg on a NAS that's running a custom (Linux based) OS built by the hardware producer. There is no easy way to install python3 on that device and I don't want to break things by trying it. I agree that that is probably an edge-case and most people who want to backup to such a device could just resort to rsync or even sftp. But you will probably agree that borg will outperform possible alternatives 😉 As to the different ARM flavours, most NAS seem to use armel, Raspberry Pi uses armhf. I guess those would make the most sense to have binaries for. |
|
@bauerj before discovering this I spent an hour trying to roll my own pyinstaller binary, but couldn't get the resulting bin to work correctly. Could you post your version of pyinstaller and the command line you used? |
|
Sure. I'm using PyInstaller 3.1.1, this is essentially what I executed: I hope that helps. |
|
I'd like to test on armv7, banana pi. I installed open media vault, which only has python 3.2 support. Can I cross compile from another computer, or do you have such a binary yet? Thanks. |
|
You can test this binary here: https://bauerj.eu/borg-armhf Please report whether it worked or not. |
|
Sadly, it did not. ldd: Thanks for your efforts so far! |
|
Try pyenv. I use it on the odroid C2 running the ARM64 tests. It compiles on the machine it's running, so it'll take a while. |
I'm not sure this is what I want. It takes a lot of time, upgrading is much more complicated. I'll see into it anyway. |
|
Well, as long as there are no official ARM binary builds it would be even harder to update the binary 😉 |
I see what you mean. Especially on such weakly devices one would really rather have binary (Python, Borg) packages available. If that's not the case, though, then there are not that many options. I guess it's possible to cross-compile python, but it probably takes longer to setup the cross-compiling environment than just building it on the ARM. iirc Python 3.x took about an hour or so on the C2 to build. |
|
Pyenv and pip install took a while. Anyway, can I somehow provide a standalone binary to others? |
|
Sure! Here are the commands I used to create a binary on the Raspberry Pi (of course you can skip the pyenv part). It would have worked on your device too if it wasn't for the old glibc version your OS uses. |
|
@bauerj You were missing a Other than that, Banana Pi is armv7l. Please try this binary found in this folder. Please give me some information if this works for others: https://goo.gl/rEI49A. |
|
@bmhm Your linked 1.0.6 armv7l build is the only one I've found that will run on my Synology DS416, thanks for that. Any chance you could create a new one for borg 1.0.7, that would mean I could avoid positional argument warnings. |
|
@kzar It would be nice if you could test the 1.0.7 binary here: https://borg.bauerj.eu/ (armv6 should hopefully work for you) ➡️ ➡️ ➡️ There will also be future versions avaiable here: 📂 https://borg.bauerj.eu/ ⬅️ ⬅️ ⬅️ |
|
@bauerj Wow, that's service! Thanks it seems to be running fine, my first borg backup is now underway. I'll let you know if it completes (will likely be some hours unfortunately). |
|
@bauerj Well it keeps stalling when I attempt to do my first backup. It starts off happily and at some point silently stops transferring. I then have to C-c the process. It's likely nothing to do with your build, I'm planning to investigate a little more tomorrow to see if I can get it working. |
|
@baurej My problem looks unrelated to your Borg build, rather issue #636. (I could reproduce the problem with just SCP too, it reliably drops after about 1gig has transferred.) I've not been able to do a big test with your build therefore, but it did at least run and work initially. Thanks again for the help, Dave. |
|
If it happens with scp as well, then it's likely an issue outside of Borg. Wild speculation:
|
|
OK so I found that if I connect via my VPN the connection doesn't drop, don't ask me why. @bauerj Your build seems to be working nicely so far. |
|
Great! 🎉 Thanks for testing. |
|
@bauerj https://github.com/borgbackup/borg/pull/2076/files this change will be in 1.0.10*. As you are building for ARM, you likely will compile the pyinstaller bootloader on your own (thus the inclusion of the fixed x64/x86 bootloaders makes no difference for you). But please make sure that the bootloader source you use has the same fixes. It might be also worthwile doing an additional binary made with pyinstaller 3.2.1. |
|
Thanks for the heads-up! I don't know how to interpret the last sentence though. Should I do another 1.0.9 binary with pyinstaller 3.2.1 or should I do two releases (one with your fork and one with pyinstaller 3.2.1) for 1.0.10? |
|
I meant the upcoming 1.0.10 release (likely in a few days). |
|
FWIW you could always cross-compile for ARM using something like this. |
|
Any chance of a 1.1.X build @bauerj? |
|
There you go: https://borg.bauerj.eu/ |
|
Awesome, thanks. Seems to work so far, doing a backup now. |
|
Just to let everybody here know, that I've managed to set up a docker solution for building binaries for all types of architectures. Take a look here: https://git.feneas.org/noplanman/borg-binary-builder I'm also looking into a solution for providing signed binaries directly, without requiring to do the whole docker operation for every new version. |
|
as the arm binaries are linked from the docs now, the borg-binary-builder from community repo, i guess there is nothing left to do for this ticket. |
Hi,
The pyinstaller-based binaries for borg are very useful. However, it would be nice if the was one available for the raspberry pi. (armv6l)
Glen
The text was updated successfully, but these errors were encountered: