Mattermost-server: Snaps package for Mattermost

Created on 15 Nov 2016  路  24Comments  路  Source: mattermost/mattermost-server

Opening a ticket for contributors interested in creating a snaps package for Mattermost to install on Ubuntu 16.04.

We had a great meeting with Michael Hall and Alan Pope today from Canonical and seeking contributors interested in bringing together snaps and Mattermost.

Please reply back if you have interest? If you're on our discussion server, please feel free to bring this up in the Installers and Images channel

Notes from Snaps discussion

Problem:

  • Mattermost ships stable releases 6 times a year and updating deb package archives is going to be problematic

How Snaps helps:

  • Snaps enables the Mattermost open source project to manage versions distributed by Snaps (users can subscribe to stable, beta, edge builds, etc.)

    • If we're going to make a deb package for Ubuntu 16.04, we might as well make it Snaps

    • Snaps is being integrated into Fedora, and will make its way to CentOS over time (need to figure out what versions), as well as to Ubuntu 14.04

    • Ubuntu has large share of Linux market (70% of AWS, 70% of Google Cloud, 50% of Azure runs Linux and of that 80% is Ubuntu, 80% of private clouds run Ubuntu)

  • Bonus:

    • Snaps makes Mattermost easy to discover from Snaps AppStore

    • Could potentially replace Docker Preview as the easiest way to try out Mattermost

What is Snaps?

  • Replacement for deb packages for installing solutions (not for installing libraries or for orchestration)
  • AppStore version of packages managed by open source project (rather than archive maintainer)
  • More info at http://snapcraft.io/

Questions:

  • To what extent will Snaps be available in CentOS 6.6 and 7.1 (current versions supported by Mattermost)?

Next steps:

AreInstaller Hard Help Wanted

Most helpful comment

FYI: The desktop app is being snapped by snapcrafters here: https://github.com/snapcrafters/mattermost-desktop/

All 24 comments

this is still relevant? if yes how can I help here?

@cpanato Hey hey! Totally still relevant from my point of view :) Being able to snap install mattermost just like you can now snap install rocketchat-server would be a great addition.

If you have some time to get started on a mattermost snap, I'd love to help you! We have docs and tutorials if you've not used snaps and snapcraft before. We also have a forum where the snap developers hang out.

Yes, a great place to start.

FYI: The desktop app is being snapped by snapcrafters here: https://github.com/snapcrafters/mattermost-desktop/

If this is still relevant then I'd like to help with this! :smile:

Great @BK1603!

@BK1603 awesome - do let me know if I can help! I'm popey in most places, #snapcraft on freenode included.

@popey actually, i am kinda stuck with snapcraft, everytime i try and run it, it says it can't connect to /run/multipass_socket
configure read/write access

So i tried adding read write permissions to the file (chmod 766) but that ended up in wierd errors too

I tried building with lxc containers but then read that they need wired connections and i don't have one, so, a little help? :sweat_smile:

I am running Debian buster testing x86_64
And would gladly provide any other information that may be necessary :smiley:

Edit: Also sudo <snap-name> doesn't work, is the $PATH variable different for sudo vs simple commands?

Sorry for such a long delay :sweat_smile: I got a bit busy with other stuff, but I am back now and will continue from where I left off, shouldn't take that long now.

I need a little help, since a running instance of MySQL or PostgreSQL is required for mattermost server to work, I am thinking of mentioning them as dependencies in the snap package, but
How do I specify package dependencies in the snapcraft.yaml file? I found ways of adding build dependencies (parts) but I don't think these would qualify as build-time dependencies.

And,
In the installation section of the mattermost documentation, there is a choice in between MySQL and PostgreSQL, what should I specify as the dependency in the snap package?

Thanks in advance for the help!

Yes, you can indeed add mysql or whatever other components are required as stage packages. Alternatively they might need to be specified as separate parts. Might be worth taking a look at the (rather complex) NextCloud Server snap, which will have some similar components as you'd need for Mattermost Server. Here's the yaml. Note that there's more to it in terms of plugins and additional stuff over and above the yaml itself. https://github.com/nextcloud/nextcloud-snap

I don't think I will be able to complete this anytime soon :sweat_smile: The past week I was busy with a fest in my college and a project that we had to submit, and the next month I have my finals, so if anyone has an eye on this they can work on this, if not then I'd gladly work on it but it will take some time. Sorry :sweat_smile:

Hey @BK1603,

No problem. Thank you very much for working on this issue! :+1:

Do you have some code to share so a new contributor would have an easier starting point?

Any update on this?

@hanzei I am back on this! Also I didn't have a lot of code to share from back then, it was just a basic template which I copy pasted from the docs. Also I know it's been a long time :sweat_smile:, but this time I intend on fixing this!

Hey @BK1603,

Thanks for coming back to this! Looking forward to a snap package :tada:

@popey
A question, I was going through the next-cloud snap, and if I specify mysql as a part in the snapcraft.yaml file, will it always install mysql before installing Mattermost? As in even if the user already had a mysql server instance running on their server?

Also status regarding work: I am curently working on making a script for setting up mysql, to use it as a hook

Currently using mysql for the database, after I am able to make this one, maybe we can have two packages? One with mysql and one with postgresql? I am sure after one is made, getting the other one up shouldn't be that much of a problem.

The current snap is at https://github.com/BK1603/Mattermost-Snap

Status of the snap:
It installs but the binary doesn't run, shows a few folders missing, I guess snapcraft does away with the source after building an executable, so the folders i18n and config aren't present in the snap.
It sets up the mysql database and the user succesfully (got that from the nextcloud snap).

I am still working on it, will post further progress here.

Hello, I would like to distinguish between Mattermost Enterprise server (the paid version), and Mattermost Team server (the free version).

I, for one, would prefer if the snap was named accordingly, such that these two different versions don't get mistakenly chosen.

Please make it clear whether the snap will install Enterprise, or Team version.

After spending hours and hours trying to understand mattermost's current build process, I posted several technical insights over here, with links. @BK1603 , you might find some of those notes helpful.

@esbeeb Thanks a lot for the info, I actually got stuck with the snap sometime ago and am very guilty of not working a lot on this as a result. I have read the insights and your concerns regarding the package. I will get back to it again immediately.

What about sudo snap install mattermost-server? Would be awesome.

What about "sudo snap install mattermost-team-server", and "sudo snap install mattermost-enterprise-server"? If you just want to call it "mattermost-server", that will almost certainly just mean the Enterprise server, and the Team server will very likely get left out in the cold.

Was this page helpful?
0 / 5 - 0 ratings