-
Notifications
You must be signed in to change notification settings - Fork 123
remove specload plugin #4444
Comments
What exactly makes the symbol mode support #4442 better? Does the "file" mode make any sense if we remove the override/modification features? |
The "file" mode still make sense, if somebody doesn't want to embed the whole spec into the application because of size concerns (e.g. embedded system with separate storage for executables (small) and data (large)). If you use |
Which advantage would the file mode of specload have compared to a normal quickdump mountpoint?
So it is simply about replacing the interface execv with dlopen to get the spec? It might be faster but then the executable also must be a shared-lib/exe hybrid, which is afaik, not implemented in every libc (musl etc?). Is there any advantage except of a (not benchmarked) speed gain? |
That's true, without the special modification checks, the "file" mode is probably no longer needed.
AFAICT from I haven't actually tested how well this works, but if it works well in some cases, I don't see why we shouldn't support it. It certainly makes things a lot simpler. In case it didn't come across, "symbol" mode would work without the dependency on |
I am still not convinced that we should get rid of the modifications/overrides feature. It sounds so harmless to give admins a way to have their own description/notes/other docu for their config settings. Adding more type information, should be also be ok as our type system only allows to make checks more and more strict. Which problems do we have with this feature? Is it so difficult to implement correctly?
Now I understand what you mean. Yes, this makes sense. So it is not a type to be used for mounting the specload plugin but it is exclusively for usage with |
This mode yes. But it would be easy to add an option do specify a library name, then you could use the "symbol" mode for mounting too. Like you said, you'd either needed a special shared object & executable file or you need a separate shared object that exports the spec, which is linked into the main executable. We don't have to add this. I just mentioned it, because it would be pretty easy to do.
IIRC there were some possible problems with modifying types. Even one of the simplest cases of going from We could keep allowing modifications to comments etc., but IMO it's not worth the added complexity.
If |
Ok, so we agree. To make specload simpler:
Then there are two config options for specload: symbol and executable (I like this name much more than app). Alternatively, we could use "file", which is required and specifies either an exe or a lib. The config option "symbol" is then optional and to be used together with "file". Using "file" to specify the file would have the advantage that the mounting code for file-based-backends would work for the specload backend. @hannes99 Are you interested in implementing this? @kodebach Can you update the top-post? |
Not necessarily. This depends on what else the mounting code does. But I wouldn't really worry about that. This new |
Without knowing how exactly mounting tooling will look like, I wouldn't say anything about how much effort is needed to write tooling for a new backend plugin. I hope our tooling handles the "file-resolving" and "noresolver" backends without any code. But let us see what @flo91 proposes. |
Since
With so few options, I'm quite confident writing any tooling code should be very manageable. However, what I was really referring to is, that plugins/backend/name = specload
definition/mode = symbol
definition/symbol = loadSpec
definition/symbol/library = libmyapp-spec.so or plugins/backend/name = specload
definition/mode = executable
definition/executable = /usr/bin/myapp
Ideally, the foundation of the mount tooling would be based on this kind of import but do some extra validation. For example: echo 'plugins/backend/name = specload
definition/mode = executable
definition/executable = /usr/bin/myapp' | kdb mount --raw=ni spec:/mymountpoint This
With this foundation, any backend plugin can be mounted immediately without any special code. In most cases it would be quite annoying to do, but it would be possible. To make things more user friendly, backend plugins could export functions that are used to extend the Most importantly, I think, |
@hannes99 as discussed, specload should be removed. |
May I ask why you want to remove entirely remove the plugin? IMO (a biased opinion of course) the changes outlined at the top of this issue would have a fairly good use case and would also further the backend plugin system. If the reason is simply time constraints, I would suggest excluding the plugin from packages and libelektra/scripts/cmake/Modules/LibAddPlugin.cmake Lines 650 to 653 in ef00c96
The flag could be used for other unmaintained plugins too. |
Simply removing non-maintained parts, if @hannes99 will use it in ckdb we can also keep it. |
Seems like ckdb internally has spec, then it makes sense to keep it. (@hannes99) |
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. |
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
The current
specload
plugin is not really recommended, but it could be improved on thenew-backend
branch.I propose 3 changes:
specload
into a standalone backend pluginfile
modesymbol
mode, in addition toapp
/"executable" modeStandalone backend plugin
Instead of being a storage plugin for the file-based backend plugin
backend
, thespecload
plugin should be backend plugin itself. This makes the various restrictions it imposes a lot more natural and gets rid of some problems, e.g. in relation to the resolver.To do this we need to do a few things:
specload
should be a very minimal and restricted backend plugin similar tomodules
.specload
can only be mounted onspec:/
parent keys.init
instead ofopen
.Remove modifications/overrides
specload
will be read-only, i.e. likemodules
it doesn't provide aset
function at all. All code related to modifications or the override file shall be removed.The functionality implemented by
specload
should only be:open
create an instance of the pluginclose
free all resourcesinit
parse the mountpoint definition (previously done from config inopen
) and returnELEKTRA_PLUGIN_STATUS_NO_UPDATE
(read-only)get
:resolver
phase: returnELEKTRA_PLUGIN_STATUS_SUCCESS
without doing anythingstorage
phase: load the spec as configured in the mountpoint definition and returnELEKTRA_PLUGIN_STATUS_NO_UPDATE
without doing anythingRemove
file
modeRemove
file
mode since, without the modifications feature, it doesn't provide any benefit over a normal file-based backend withquickdump
as storage.New
symbol
modeThe existing modes of the
specload
plugin are:system:/app
is called with the arguments defined insystem:/app/args/#
. The spec is read inquickdump
format from thestdout
of this executable.specload
directly instructsquickdump
to load the file defined insystem:/file
(removed above).To better support the mode where an application loads it's own spec, I propose adding a new "symbol" mode. In this mode,
system:/symbol
defines the name of a symbol exported by the current program or by a library defined insystem:/symbol/library
. More specifically, this symbol must be a zero-arg function that returns aKeySet *
.specload
will then use something like this to load the spec data:For an example of using this see #4442. The basic idea is that a standalone application would export the symbol and then use the
kdbOpen
contract to define the mountpoint. To make the spec externally accessible aspecload
mountpoint in "executable" mode would be created that calls the application with a special command-line argument. If an application consists of one (or more) shared libraries in addition to the main executable, then the same mountpoint could be used internally and externally. Both would setsystem:/symbol/library
to the library that contains the exported symbol.The text was updated successfully, but these errors were encountered: