Add snapcraft packaging information#6084
Conversation
9914393 to
a189e55
Compare
|
Just pushed a new revision of these changes removing the redundant snap wrapper I had inadvertently checked in. The snapper isn't required as the commands to start and stop Synapse can easily be added to the snapcraft.yaml in the case of Synapse, given the availability of |
|
I'm afraid we've dismissed this in the past: #4484 |
|
(but thank you for the contribution!) |
|
Is there any opportunity to reopen this as a discussion around publishing synapse as a snap package? I have reviewed the previous PR, and given it was back in January, a fair bit has changed around snapcraft and snaps. I think at least having the packaging files present in the repo would be useful for folks. As I see it, the main issues boiled down to:
As you will see by reviewing the snapcraft I have put together, I have tried to write the package in the most minimal way possible. This snap is calling synctl, which mirrors the upstream guidance on how to stop and start synapse directly. This thin shim gets placed into a systemd unit on the host, and the commands are executed inside the snap's overlay filesystem. Snaps, unlike Docker, are not a container - think of them more as a package that runs in a chroot (like many common daemons, postfix, for example). There is some additional isolation that is configured, but there is no support burden of this, as this snap exposes the network and network-bin plugs, which are automatically connected on install. Connecting a plug is like granting a permission, it's not an ongoing item that requires support, and as these are autoconnected plugs, the user does not have to do anything other thant 'sudo snap install matrix-synapse'. From the perspective of support burden, I would be more than happy to take over all snapcraft related inquiries and support questions, as well as maintaining the snapcraft package if required to keep up with changes. None of these would be surprising in my opinion, as any change that would break snapcraft would be very likely to break most if not all other packaging mechanisms supported today. As to the GitHub question, that is only for automatic publishing. And there are no credentials to maintain - the snapcraft store authorizes as a GitHub 'application' and then monitors the repository using its read access so it can build and publish snaps (this does not require any additional infrastructure for the Matrix project) automatically as commits are pushed. I have structured the snapcraft in such a way that the existing git metadata will automatically be used to set versions. Providing this snapcraft metadata and hopefully discussing the use of snaps is part of a larger goal of mine, as I would like to make Matrix and the appservice bridges as easy for people to install and keep up to date as possible - and snapd fits that well. I am also in the process writing a Juju Charm to aid in installing and configuring a Matrix homeserver for folks, which I think will help the adoption of Matrix, a very important goal in my mind. Anyhow, thanks for reading this. I hope you'll reconsider and we can have a discussion about this - but either way, I wanted to make sure the decision was being made with up to date information and my offer to take up any support related inquiries. |
|
ok, I'll reopen this and we can reconsider. |
There was a problem hiding this comment.
this would need to be in the 'filename patterns' section.
There was a problem hiding this comment.
I've pushed a revised commit that moves this in amongst the file globs - thanks for the guidance, I managed to miss that structure!
a189e55 to
a3ddbf2
Compare
Signed-off-by: James Hebden <[email protected]>
a3ddbf2 to
e2dc913
Compare
richvdh
left a comment
There was a problem hiding this comment.
Thanks for contributing this! We've decided we're happy to merge it for people to use as they wish, but don't plan to create an official snap store account.
|
Thanks, greats news. |
Signed-off-by: James Hebden [email protected]
This PR adds packaging metadata to allow snaps (https://snapcraft.io) to be built automatically and published to the snap store, where people can install Synapse by running
sudo snap install matrix-synapse. In addition to this being merged, to enable automatic publishing (the snap can still be built locally and installed with--devmode) someone with access to this repository will have to enable this repo to be monitored by the snapcraft store, so that it can automatically build and publish new versions as new commits are merged into master. The version to be published to the store will be calculated based on the projects existing git tags - I have tested this with the current develop branch, which generates the version number1.3.1.I am also happy to assist in the publishing of this package to the store, and maintaining any snap-related matters in regard to any part of the Matrix ecosystem.