-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Move core into granular plugins #458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hooks aren't really any less stable than anything else in Dokku, which is covered by the README
core-install is the install/uninstall scripts; core-admin is the admin commands.
Since core-plugin-system provides the commands that run the install hooks in 00_core-install, it makes sense to put it closer to the top: however, there needs to be priority room for plugins before any core plugins with commands (so higher-priority plugins can wrap/deny access to them), which is why this is at 05 and not 00 itself.
I misinterpreted the purpose of these hooks: they belong with the plugin that defines the "delete" command.
This way, individual components of Dokku can be disabled or overridden without affecting the other commands.
|
Very interesting. Feedback? |
|
I'm unsure about moving the receive, build, release and deploy commands out of the base dokku file. This is the minimal core you need to run dokku, all the other stuff we moved to plugins. Maybe we envision different things for the project, but I see it as a great starter to play around with docker and git push based deployments. Right now if you're new to the project, you open up the dokku file and you can get a fair idea of what's going on. Maybe this is just a documentation issue though. ;) |
|
I'm not sure why the Travis build failed there - looks like pluginhook failed to allocate heap in the middle of a test for some reason. These changes don't do anything that should be causing drastically more memory usage. Maybe rerun the test? |
|
Yeah, there's some good stuff in here but I agree with @asm89's comments On Wed, Feb 19, 2014 at 4:35 PM, Stuart P. Bentley <notifications@github.com
Jeff Lindsay |
|
A 'how dokku works' flowchart/explanation could take care of that |
|
After rerunning tests a few time we have a passing mark |
|
I was midway through writing this change myself when I thought to look into the pull requests. I like this because you still get a dokku out of the box but it's easier to experiment with replacing core bits. I am building a toy CI, for example. |
|
@asm89, I agree that it's an important point to make it easy for people new to Dokku to be able to easily tell what's going on. To that point, moving every core command into a plugin makes it easier to dive into the Dokku code. Rather than sifting through which components are (rather arbitrarily) part of the base script, the "standard" plugin, or another plugin that comes with Dokku out-of-the-box, you can simply determine what each component does, and where it's implemented, by looking at Indeed, when I was hacking together the rethinkdb datastore plugin, I found that I was reading from this branch, rather than upstream/master, to determine the functionality of each component of Dokku, for exactly this reason of increased discoverability. The README I've added for each component helps here as well. It also makes Dokku significantly more hackable as a base for building other, similar tools (such as a CI / build server as described above). You can treat Dokku more as a framework for sshcommand-and-pluginhook-based services, that by default comes with a set of plugins to receive Git packages, build a Docker container for them according to Heroku buildpacks, and then virtual-host them through an nginx proxy. (Indeed, this is how we're drafting our MVP infrastructure to work using Dokku @hutpass.) |
|
I'm on board but I'll call in @plietar as well to provide his opinion |
|
Sorry I've been away lately. I don't like the While were at it, concering commands organization, ideas from #312 could be included (one script per command, commands are prefixed with the plugin name, use of aliases, automatic help messages which btw could be used to generate the man page, ...). This is a major compatibility break, so we would have to think about both schemes. Also the names can be simplified (again, I'm not a big fan of 20 char long plugin names)
etc .... |
|
I agree about ditching the "XX_core-" name components since none of the hooks really care about ordering. I do think that the slightly more verbose names ( EDIT: Just checked out #312. I'm going to tackle incorporating that idea into this system now. |
|
Okay, so I've thrown up an initial implementation of a version of the plugin system that supports scripts for individual commands a la #312.
|
|
Okay, here's what I'm thinking for handling
For example, this would be formatted as this when output by the This allows help files to be less redundant, and to permit renaming of the plugin. (Meanwhile, if a plugin, for some reason, implements commands at a fixed name outside its namespace, it can define those commands in |
The `commands` hook still does the base parameter validation and initialization, which is a little gauche, but not a major affront for right now.
I think bash still recognizes quoted bin names
|
By the way, is there a reason dokku runs commands in a loop rather than using pluginhook? |
|
I'm interested in having this be merged in some sense, so I'm re-opening to encourage some discussion :) |
|
Succeeded by #592 |
This is my proposed implementation for moving Dokku's commands into plugins as described in #457.
While I moved most of the commands from the root
dokkuscript and 00_dokku-standard out to their own plugins (and added individual documentation for each one), I moved the "version" command from 00_dokku-standard into the root script, as it seems wise to make that as plugin-independent as the "help" command (which I also left in the root script).With this new layout, plugins can be placed in front of (almost) any command in Dokku, and individual commands can be overridden, replaced, or disabled entirely. Some things this enables:
Since execution order never really matters for any of the core plugins relative to each other, I'm ambivalent about the "XX_" prefixes. I mostly kept them to follow the precedent set by "00_dokku-standard" and other projects that use similar conventions like GRUB.