-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Identify, implement, and document a way to extend our Docker images #9944
Comments
Jenkins suggests building derived images: https://github.com/jenkinsci/docker/blob/jenkins-docker-packaging-2.235.1/README.md#installing-more-tools. They define a location for you to dump files ( |
As alluded to in #6660 (comment) and again mentioned in #synapse-dev, @clokep noted that we could define a mountpoint for a directory outside the container which maps into the container's |
Spitballing after some discussion with @reivilibre some time ago and @DMRobertson just now: There's an argument to be made about grouping all of the Synapse modules under matrix-org into a monorepo; mostly that it would improve maintainability (in that we can share and update CI more easily, we'd run CI more often on all modules, and we wouldn't need to maintain a list of every module we maintain just so we can remember them). If we do this, it might also solve the issue with using modules with Docker to some extent, in that we could automatically build and publish a Docker image built on top of the Synapse one including all of these modules (and users could then configure Synapse to use any module in that list). It's nice in that it prevents the user from having to (re)build their own Docker image when they want to use our modules (or to update them, or Synapse), but it also has a couple drawbacks:
I think saying that if someone is in one of these cases then it's probably too custom for us to support (especially the second one) and they should build their own image would be appropriate, but maybe I'm underestimating how much of a hurdle building and maintaining a custom image for your specific deployment is. Some alternatives:
|
I think this negates one of the main reasons that a module API exists: it allows people other than the Synapse development team to extend Synapse. |
I am neigher a Python expert nor do I know how the module loading system works exactly. But wouldn't it be enough to allow an administrator to define an additional module directory in the homeserver.yaml? The Docker image has already access to the volume folder (/data/...). Maybe the administrator could place his modules in /data/modules. The actual loading happens in synapse\util\module_loader.py:
The real magic seems to happen in importlib.import_module (https://docs.python.org/3/library/importlib.html#importlib.import_module), which has a second parameter which might be useful.
|
Something like this would likely work, but we might need to extend the Python path so that Python could find it (to import it). |
In the process of splitting the Account Validity feature into its own module we've run up against a roadblock: we don't have a well-defined path for people to add extension modules to our Docker images.
We need to survey prior art, pick a solution, and then implement and document it.
The text was updated successfully, but these errors were encountered: