Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Add snapcraft packaging information#6084

Merged
richvdh merged 2 commits intomatrix-org:developfrom
digitalrane:add-snapcraft
Oct 10, 2019
Merged

Add snapcraft packaging information#6084
richvdh merged 2 commits intomatrix-org:developfrom
digitalrane:add-snapcraft

Conversation

@digitalrane
Copy link
Copy Markdown
Contributor

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 number 1.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.

@digitalrane
Copy link
Copy Markdown
Contributor Author

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 synctl

@richvdh
Copy link
Copy Markdown
Member

richvdh commented Sep 23, 2019

I'm afraid we've dismissed this in the past: #4484

@richvdh richvdh closed this Sep 23, 2019
@richvdh
Copy link
Copy Markdown
Member

richvdh commented Sep 23, 2019

(but thank you for the contribution!)

@digitalrane
Copy link
Copy Markdown
Contributor Author

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:

  • Support burden
  • GitHub credentials
  • Maintenance of the snapcraft packaging metadata
  • Docker

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.

@richvdh
Copy link
Copy Markdown
Member

richvdh commented Sep 23, 2019

ok, I'll reopen this and we can reconsider.

@richvdh richvdh reopened this Sep 23, 2019
Comment thread .gitignore Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would need to be in the 'filename patterns' section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a revised commit that moves this in amongst the file globs - thanks for the guidance, I managed to miss that structure!

@digitalrane digitalrane changed the title Add snapcraft packaging informaiton Add snapcraft packaging information Sep 24, 2019
@richvdh richvdh requested a review from a team October 3, 2019 11:31
Copy link
Copy Markdown
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@richvdh richvdh merged commit 0aee490 into matrix-org:develop Oct 10, 2019
@digitalrane
Copy link
Copy Markdown
Contributor Author

Thanks, greats news.
If I wanted to help in supporting any snapcraft-related issues, what would be the best way to get involved?
Also, if I wanted to publish this myself on the snap store, would there be any objection or conditions you would like to place around that?

@digitalrane digitalrane deleted the add-snapcraft branch February 26, 2020 05:18
babolivier pushed a commit that referenced this pull request Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants