-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support enabling SQLite extensions #30
Comments
@otoolep It's already possible to pass extra environment variables to rqlite with the chart using extraEnv:
- name: SQLITE_EXTENSIONS
value: sqlean icu And it's also easy to pass extra arguments to rqlite: extraArgs:
- -extensions-path=/opt/rqlite/extensions Do you think the chart should provide a specific abstraction for extensions, and just prepare extensions:
- sqlean
- icu |
TL;DR: I like your suggestion, but it's important to call out that it would only apply to extensions that are built-in to the Docker image. So this is my sense of what we should do:
|
I have this sense that these extensions are very useful, and will become more useful over time. So I think signal-boosting their existence via a dedicated |
Might extensions take custom configuration at some point? Can you anticipate future needs for extensions that could influence how we structure the chart values? That is, I'm wondering if extensions:
enabled:
- sqlean
- icu
config:
sqlean:
whoknows: 42 Or perhaps: extensions:
sqlean:
enabled: true
config:
whoknows:42
icu:
enabled: true If you have any plans for future enhancements that might influence this, we might avoid a future breaking change to the chart (or janky/unintuitive configuration). Possibly there's no need for extension-specific configuration, so this is over-complicated.
Is there a way to enable both built-in (baked into the official image) extensions and custom extensions? It actually sounds like that's not possible, given what you said. Perhaps if I see in the image each extension is a separate directory under /opt/extensions. The entrypoint script used by the chart could discover directories under /opt/extensions, and assemble an appropriate colon-delimited path string based on the enabled extensions in the Suppose the chart values has: extensions:
enabled:
- sqlite-vec
- icu
- myextension
customPaths:
- /lib/sqlite/extensions The chart's custom entrypoint would then figure out that it needs to pass
... without an internet-facing extensions registry (like we discussed over email a la Grafana's plugins) from which extensions could be fetched at startup, the way I would handle this is just to build my own custom rqlite image, doing a multistage build to first compile the extensions I want, and then another stage that bases off of docker.io/rqlite/rqlite and just copies my custom extensions to /opt/extensions/foo. Basically exactly the way rqlite's Dockerfile works, except basing off of rqlite's image instead of alpine. Pretty straightforward. Then there's no need for a custom path, because everything, whether stock or custom, is under /opt/extensions. So the custom entrypoint script built into the chart would find everything in the extensions list under there. |
From looking at the SQLite Extension loading C API, the only possible configuration option is an entry point (which has a sensible default). Right now I don't support it. But that entry point seems like the only possible config.
I was actually thinking of expanding (By the way, what are Helm best practises for adding flags, but ensuring someone is running a minimum version of, in this case rqlite, the software so the flags are supported by the application?" |
Probably not worth going out of our way to make this configurable then.
Colon as a delimiter in paths is more idiomatic, so I'd go with that.
Probably better the other way. Once rqlite supports multiple extension paths then I can do the ideal integration as pre-rqlite-launch scripting to setup
It's technically possible using JSON Schemas for validating chart values, which Helm supports for this kind of thing, but I'm not sure if it'd be really worth it in this particular case, since the when the chart adds the |
A colon is a file path element in Windows though, commas are not. So wouldn't colons be an issue on Windows? |
Fair enough. I'm always surprised to learn that people run anything like rqlite on Windows. :) Windows uses semicolons to separate components in the path env var, but then that's awkward on *nix, so I guess commas are the best compromise. |
@jtackaberry -- I'm proposing the following for the Docker container:
Now users can instead explicitly pass |
(Previous comment edited heavily) |
So an example invocation would be like this: docker run -p4001:4001 \
-e SQLITE_EXTENSIONS='sqlean misc'\
-e CUSTOM_SQLITE_EXTENSIONS_PATH='/rqlite/file/my_ext' \
rqlite/rqlite which would end launching inside the container: /bin/rqlited \
-extensions-path=/opt/extensions/sqlean,/opt/extensions/misc,/rqlite/file/my_ext \
data |
Space-delimited for the env vars but comma-delimited for the command line arguments -- I fear that violates the Principle of Least Astonishment, but I suppose you don't want to change
Would extensions located in custom extensions paths need to be included in
This seems fine to me. Typically command line arguments override env vars which override config files (the latter not being relevant in this case). This should be pretty straightforward to add to the chart. I should also add support for custom volume mounts as well, in case users want to put extensions on a persistent volume instead of baking their own custom container. |
Yeah, you're right. The spaces-vs-commas thing is not good. Let me see if I can do what you suggest. |
Yeah, I think allowing folks to avoid building their own image is important (unless they like that kind of thing) -- thanks. |
v8.29.0 has been released. I decided to go with the following:
Example invocation:
|
Thanks! Will take a look at incorporating this into the chart over the next few days. |
Cool, @jtackaberry -- bump to version v8.29.1 as v8.29.0 panicked with the |
Life zigged when I was expecting it to zag. I hope to begin work on Monday but it may not happen until later in the week. |
No worries, you should also set the default version to the latest release. v8.29.1 in particular introduced a fix for a panic. |
Yep, I always test $LATEST whenever I do a chart release :) |
The latest Docker images support enabling SQLite extensions which are part of the Docker image. Perhaps the Helm charts should support this?
See https://rqlite.io/docs/guides/extensions/#docker for more details.
The text was updated successfully, but these errors were encountered: