-
Notifications
You must be signed in to change notification settings - Fork 17
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
Is there any way to use duckdb ui in offline environment? #62
Comments
Hi @coloraven this is not possible at the moment, but something we are thinking about adding. Stay tuned :-) |
There are a few ways to achieve offline mode right now. One of them involves traffic capture/replay. Here's my short guide on how to use the DuckDB UI without internet access. Install mitmproxy. Start mitmdump --mode reverse:https://ui.duckdb.org -w hatchling.dump Start the DuckDB UI in a different terminal: ui_remote_url=http://localhost:8080 duckdb -ui -unsigned Click around the UI to make sure that all assets are loaded. Press Ctrl+C to stop Once captured, you can replay the traffic forever, even offline: mitmdump --mode reverse:https://ui.duckdb.org \
--set server_replay=hatchling.dump \
--set server_replay_reuse=true \
--set connection_strategy=lazy Just remember to always start the DuckDB UI like this: ui_remote_url=http://localhost:8080 duckdb -ui -unsigned ( |
Thanks for this! We are researching ways to accomplish this more easily & robustly, but this may be a reasonable workaround in the meantime. Please note that, when using the above, some features may not work properly, and you will not get updates & fixes unless/until you refresh your capture. |
That might be an option in a small shop or in a private environment, but in a corp environment, especially in the finance sector, well... |
Since we're considering the best way to support this feature, which aspects of the above approach do you think would be a problem for a corporate environment? @nojetlag |
The best in my environment is a single download that contains all required files, resources etc. So i can go to an isolated download station, get the package, bring it inside, have it approved via security checks and then install it in an isolated environment that has no internet access at all. duckdb -ui would be used in a development environment to work with data and part of duckdb is also used in a python context in testing, integration and production environments, which are strictly separated and also don't have any direct internet access. I hope i can give you an idea. For me it is always surprising to hear that nowadays there still seam to be large corps where people can access internet from any machine. At home, sure, but at work. |
Thanks for the context! There are indeed many different environments with varying constraints. The one you describe - where the machine is never connected to the Internet - is a particularly challenging one. |
I think even if you find scenarios where a machine has internet access often they will have browser isolation nowadays. Totally agree that makes things very complicated but that is today's work environments. |
I'm curious if you've actually tried using duckdb in such a locked-down environment (without the UI). DuckDB downloads extensions from the internet; I'm curious if you've encountered that and whether you've worked around it somehow. |
I have tried it on an offline machine.
Then, duckdb can auto download extensions. |
@im5h Just a quick tip: you may not need a local extension repo as |
It seems strange to me that the UI is not included within the extension itself. Perhaps because it's not open source yet? The docs state:
But I'd be quite happy if they just updated when I update my local copy of the extension with |
I use it with python, getting python packages is more or less easy with an internal mirror repo (yes sometimes packages get blocked due to know vulnerabilities, but in most cases such an approach works). However everything from duckdb that doesn't come with the python package is a challenge as described above. |
It is challenging to make the UI work in such locked-down environments, given both the architecture of DuckDB (which downloads extensions dynamically) and the UI itself (which was originally built for the web, and later adapted for this local use case). But it's useful to hear about these constraints. We do plan to support offline mode, and we'll try to support as many environments as possible - but we can't promise we'll be able to make them all work well. |
There are several reasons for this:
Of course, it would be possible to accomplish many of the above while still including a (perhaps outdated) copy of the UI in the extension. But this doesn't seem like a good cost/benefit tradeoff, given the above. Our current thinking is to support offline mode by saving (to disk) the UI assets that are fetched by the extension. So you'd have to be online for the initial download, just as you have to be online to download the extension itself initially. But, once downloaded, the files (both the extension and the UI assets) could be moved to another environment if desired (e.g. by copying the (Since the UI was originally built for the web, it depends on some dynamic endpoints that are not simple files. So, making it run using a set of downloaded files is not as easy as it might sound. It's possible, but it'll take some work. That's why this isn't supported yet.) |
The local HTTP server fetches the files for the UI from a remote HTTP server(https://ui.duckdb.org/) so they can be kept up-to-date.
But I need to use it in an offline environment.
Is there any way to achieve this?
The text was updated successfully, but these errors were encountered: