Mattermost-server: Raspberry Pi 3 Model B / 64-Bit-ARMv8-CPU

Created on 29 Jul 2017  路  20Comments  路  Source: mattermost/mattermost-server

Summary

Tried to get mattermost run on a recent Raspberry (Jessie based, 64 Bit I believe)

Steps to reproduce

Could install all required software such as MySQL 5.7, Docker, gcc-6/g++6 but not Mattermost

Expected behavior

Expected Mattermost to run easily on Raspberry making it a nice choice for a collaboration server.

Observed behavior (that appears unintentional)

Precompiled images where x86 only and I could not find make instructions for arm anywhere.

Is there any kind of timeline for this?


Refs: https://github.com/mattermost/platform/issues/918, https://github.com/mattermost/platform/issues/1185, https://github.com/mattermost/platform/issues/3278

Most helpful comment

Compiling it on travis-ci.org might work too:

$ file mattermost/bin/platform
mattermost/bin/platform: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

Want to act as guniea pig for something unofficial, untested and eventually unsafe? Please click here.
Pull requests and forks welcome.

All 20 comments

@ionas While there is no official ARM build, Mattermost seems to build correctly on ARM (I have not tested on a Raspberry Pi though).
You can start by reading this: https://docs.mattermost.com/developer/dev-setup-compiling.html

(work account) Do I need docker if I compile it myself?

It think the make commands from the documentation use Docker.

But you can totally build it and run it manually with something like this:

cd webapp
npm install
npm run build
cd ..
go run ./cmd/platform/*.go

Not sure how big the RAM/CPU penalty for the pseudo-vm docker is, is... but the rasp is a bit weak especially in terms of RAM (1GB). But I can start with docker too.

Hi @ionas @Rudloff

Circling back on whether your issue has been resolved and whether it's ok to close off this issue?

I will soon try again; again from scratch; sadly I read the build instructions above only after I killed the whole rasp-box cause I then had no use and wanted to gift it away (only bought it for mattermost + mumble server). I would love to have semi-official build instructions.

Hi @ionas

You mentioned that Raspberry is Jessie-based... I'm not sure whether this document will help?

Yes I followed that one to install the dependencies and then looked for 3rd party resources because not everything was "copy-paste"-easy, after I had all the dependencies Installed I stuck at that Mattermost is distributed as an x86 package.

Hi @inoas,

I'm sorry, I've just heard that we don't actually support Raspberry PI (unless a community member has built a version for it)...

There is this recent issue which I believe is similar to yours.

make package worked for me, on a Raspberry Pi 2 running Debian stretch with the mattermost 4.2.0 release.

Grab your sledgehammer and:

  • Follow the developer part to setup a build environment.
    (I did not bother installing docker and used go from stretch-backports.)
  • grep -r amd64 | cut -d: -f1 | grep -v Binary | xargs sed -i '' -e 's amd64 arm g'
  • Modify the build target to exclude build-windows and build-osx.
  • Modify the package target (below PLATFORM SPECIFIC) to skip non-linux stuff.
  • Build make package | tee "mattermost-$(date --iso=minutes).log".
  • Install (see next steps for justification): libjpeg-turbo-progs pngquant gifsicle optipng
  • Once the build failed find all binaries in webapp/node_modules.
    (Distributing binaries in git repos - why?) Let the ENOENT guide you.
  • Binary replacement strategy: If a vendor folder is missing create it and add a link to the binary that resembles the module name (e.g. inside pngquant-bin/vendor ln -s $(which pngquant) .). If the vendor folder is present and contains a binary replace the binary with a link to $(which $binary_name).
  • If you have trouble with TARGA you can prevent them by changing line 80 in webapp/node_modules/image-webpack-loader/index.js to callback(null, content);.
  • Build again. This time it should work - hopefully. :wink:

The dist/ folder should contain your mattermost build. Use it to follow the administrator guide.

Notes

  • You might want to setup a swap space.
  • You might want to build on a disk with fast read/write.

Considering that arm is unsupported this went really well.
Thanks for working on mattermost!

Hi @ionas !

Have you tried @SmartHoneybee 's steps, did you succeed?

Asking because me being inexperienced in this stuff, I'm struggling with it, and it's probably something very obvious mistake.

I am probably in the same camp. I could get the dependencies running with jessie but did not try debian stretch and did not try building mattermost against a different arch manually, yet. I spend one day to realize that mattermost ships for arch x86 64 bit only and then gave up and reset my PI.

I will report back when I try again using @SmartHoneybee 's notes

I'm struggling with it, and it's probably something very obvious mistake.

@kincsespeti, based on the information provided I am unable to help you. Please consider describing your problem as detailed as possible. (If you feel like reading, have a look at the five Ws and smart questions.) Doing so will allow those willing to help to determine if they are able to help.

I am aware that my previous post is incomprehensible no detailed step-by-step guide. Feel free to start writing such a guide or to question my muttering notes. If you describe where/how you struggle, I (and hopefully others) can try to help you along the way.

Thanks for your feedback. :smiley:

@SmartHoneybee

Yeah, I know, it was intentional :P
By now I managed to finish compiling based on your guide.

It seems to work, aside from the fact that I get 404 error on the default 8065 port. Debug level logging in Mattermost shows the request for '/' and for any webpage that I manually add to the URL.

edit: for some reason I'm missing files (including the root.html) from the client folder, webapp build failed?

I'm back.

Managed to get it done.

Here are my 2 cents:

My main issue was, that the pi did not have enough ram (nor swap for that matter) and the webapp build failed without emitting a clear error message.
solution: add more swap

The webapp build did have missing dependencies, the gifsicle and the cjpeg ones.

Also got the targa error, which indeed can be solved by modifying a line in /node_modules/image-webpack-loader/index.js to callback(null, content); the only problem is that in 4.3, the lines changed and it is no longer the 80th one you need.

This is what I did and seemed to work:

      .buffer(content, {
        plugins
      })
      .then(data => {
        callback(null, data);
      })
      .catch(err => {
        //callback(err);
        callback(null,content);
      });

I used a pendrive instead of the sdcard, but other than yes, edited /etc/dphys-swapfile, ran dphys-swapfile setup and then ran dphys-swapfile swapon (I added 1GB, and measured around 350MB swap usage)

Compiling it on travis-ci.org might work too:

$ file mattermost/bin/platform
mattermost/bin/platform: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

Want to act as guniea pig for something unofficial, untested and eventually unsafe? Please click here.
Pull requests and forks welcome.

@SmartHoneybee Thanks a lot for the binaries you saved me a lot of time.
I have tested on Ubuntu 16.04 with an Odroid XU4 and it seems to works fine.

@SmartHoneybee thanks for the ARM specific packages, made our life one hell of a lot easier this afternoon.

Was this page helpful?
0 / 5 - 0 ratings