-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Plugins management #1425
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
Plugins management #1425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I did this since I think outputting only the name of the plugins is more useful than the complete path. I might be wrong 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably will need to change with plugn, right @michaelshobbs ?
|
I did not look at the tests at all since I don’t know where we’re going exactly 😁 |
|
Looks like a good start to my dokku-n00b eyes :) And not that you've gotten there yet, but just so it's mentioned here, the upgrade process would obviously need to delete existing core plugins in the old plugins path, and probably move any non-core plugins into the new custom path. |
|
@michaelshobbs how much of this would be affected by the |
|
There is significant overlap. One of you guys should really take a look at plugn and that branch before going too far down this path. I'd hate for you to waste your time. |
|
@jimeh 👍 @michaelshobbs I looked at your PR and I don’t think there’s a real problem here. I’m pretty sure (but I didn’t check) that we could replicate what I do here with Also the goal of this PR isn’t the same than yours. Here we try to give a solution (that seems pretty clean to me) to the problem in issue #1205. Another important point I think is that plugin compatibility is not affected at all by this PR. |
|
Just found a bug: |
|
Really? Shouldn't |
|
well it won’t work with |
|
So we’ll need to use |
|
Ah, yeah you're right. The Seems symlinks for custom plugins isn't going to work then. But I just did some basic testing and seems custom plugins will work if they simply live in the folder relative to the I tested a folder structure like this locally with some mock plugins: It's mostly just the And on a side-note, the example I have above would mean even less backwards compatibility issues, as even installation instructions in existing plugins would still be correct when they instruct you to copy/clone/extract the plugin to As for why |
|
Just convention. If you guys want to make a separate pr that uses |
|
@jimeh yes I think your solution will work and if we want to keep plugin compatibility we don’t really have a choice. @josegonzalez we could then we’ll have to update (almost) all community plugins too 😁 I’m not sure it’s worth the effort. |
|
I think it's worth to change core plugins to use |
As briefly discussed in dokku#1425, source the `common/functions` file via an absolute path, rather than determining the relative path by using `dirname`. 3rd-party plugins should follow suit and use the new `$PLUGIN_PATH` convention too.
|
Ok since you seem to be motivated, I’ll wait for you PR. Meanwhile, I’ll patch my plugins and forks 😉 |
|
PR is in, but I don't think we can rely on or assume all 3rd party plugins will be updated any time soon. So plugin management is still probably best done via moving them back and forth. But at least new plugins will hopefully follow the new convention and make life easier for everyone in the future. |
|
Yes but it’s sad. We can update and submit PR to a lot of them. There’s also a lot of plugins which aren’t active/maintained anymore 😕 Since we’ll need an upgrade script with the new plugins management, we could check for |
|
or better yet, replace automatically the line with the new one but still print a warning message to update plugin (or report the error to the author). |
|
That's one solution, although when/how would that check be executed? I'm assuming as part of And come to think of it, the enable/disable thing is nice, but if we use the move solution the benefit is that there's ZERO difference in how things work now. Plugins are enabled by default, they don't run as part of dokku installation, and you can disable plugins via a simple command instead of manually deleting or moving the directory on the server. The symlink solution feels nicer to me from a architectural point of view, but does alter how the end user installs plugins. An extra step isn't much, but it's still different. Don't know which one you prefer @Flink, nor am I fully sure which one I prefer, just wanted to point things out for clarity's sake :) P.S. As a nod towards moving plugins around, OSX actually handles user-installed fonts that way. User fonts live in |
|
Well I think I’m like you on this one, the symlink solution seems “better” but what you say is also very true. Moving plugins instead of symlinking them and changing the directory structure will be better from a user point of view. |
We had an issue with third party plugins installing things via apt while already installing dokku itself via apt. To resolve this, `plugins-install` and `plugins-install-dependencies` now can take a `--core` flag allowing to execute the install hook only on core plugins and not on third party plugins. Another feature with this modification is the ability to disable/enable plugins. Two new commands now exist: * `plugins:enable <name>` to enable a previously disabled plugin * `plugins:disable <name>` to disable an installed plugin. This won’t work on core plugins.
|
Ok I think this PR is done now and should work as expected. I used the approach suggested by @jimeh with directories and |
|
If we're good with this I'd like to merge it into the plugn branch and merge them both into master via that PR; unless we want this in before 0.4.0. Though I didn't think we were releasing another 0.3.x. |
|
Well it fixes the issue with debian installation so it can be merged in a 0.3.x branch. But I personally don’t have a preference :) |
|
I don't mind either :)... Personally I worked around the installation issue by having the chef cookbook disable/enable plugins itself before installation/upgrade, so I don't mind waiting till 0.4.x for a fix. |
|
We are not doing another 0.3.x release. |
|
Ok so it settled ;) @michaelshobbs Why not merge this in master and then rebase your PR? |
|
We're not rebasing plugn anymore. |
|
@Flink 6 of one have a dozen of the other. Hence me saying I'd like to do it this way. Just a preference. |
|
Ok I was just asking 😅 If it’s easier for you like that then there’s no problem (I don’t really mind 😁) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this should all be done via plugn, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but if we're going to have two enabled places then we'll need to manage the plugin path ourselves somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still some unknowns for me about how this plays along with plugn. Another reason I'd like to pull it into the plugn branch and play around with it. Anyone opposed to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
|
Yeah no worries at all. It's probably all the same but my thinking was just that if we're going to overhaul plugins then let's just do it in one go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never changed in the debian packaging, so we can't merge this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so? Why couldn’t you update the Makefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the debian packaging doesn't use a makefile...
|
Okay I'm going to close this PR. Please redo the PR and target the |
As discussed in #1205, I tried a way to manage plugins and be able to do a
dokku plugins-installonly on core ones.This PR is here to discuss the features and the details of the implementation.
It’s pretty basic for now but it works as intended :)
So we have three subdirectories in
/var/lib/dokku/plugins,core,customandenabled. Plugins are now divided in two categories: core ones and other ones.The
enableddirectory only links to plugins (either incoreorenableddirectories). The core plugins are enabled automatically when installing dokku and cannot be disabled.There are two new commands:
dokku plugins:enable <name>to enable a third party plugin.dokku plugins:disable <name>to disable a third party plugin. Core plugins cannot be disabled by this command.plugins-installandplugins-install-dependenciesnow take an optional argument--corewhich when set will instruct those commands to only refer to the core plugins. This should resolve the issue #1205.This happens by setting PLUGIN_PATH to
/var/lib/dokku/plugins/coreinstead of the default/var/lib/dokku/plugins/enabledwhen--coreis set./cc @josegonzalez @michaelshobbs @jimeh