ad-freiburg / qlever-control

Apache License 2.0
20 stars 12 forks source link

Running qlever as a windows user #45

Open rmfranken opened 2 months ago

rmfranken commented 2 months ago

Hi there,

Was very impressed with qlever demo at Zazuko KG forum, so wanted to give it a try locally. I run windows 10 and am running into the following problems in using your examples.

Trying to stick closely to your readme, I created an olympics folder and pip installed as instructed. After, I run the first command: qlever setup-config olympics


PS C:\Users\franken\olympics> qlever setup-config olympics

To enable autocompletion, run the following command, and consider adding it to your `.bashrc` or `.zshrc`:

eval "$(register-python-argcomplete qlever)" && export QLEVER_ARGCOMPLETE_ENABLED=1

Command: setup-config

cat C:\Users\franken\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\qlever\Qleverfiles\Qleverfile.olympics | sed -E 's/(^ACCESS_TOKEN.*)/\1_3VQ9JObGWqIj/'> Qleverfile

'cat' is not recognized as an internal or external command,
operable program or batch file.
Could not copy "Qleverfile" to current directory: Command 'cat C:\Users\franken\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\qlever\Qleverfiles\Qleverfile.olympics | sed -E 's/(^ACCESS_TOKEN.*)/\1_3VQ9JObGWqIj/'> Qleverfile' returned non-zero exit status 255.

As I am running from powershell (the default shell for vscode on windows) I receive this error. Running the same command in bash works: A qlever config file is created in the directory.

Moving to the second command (all other commands ran in bash from now on):

$ qlever get-data 

To enable autocompletion, run the following command, and consider adding it to your `.bashrc` or `.zshrc`:

eval "$(register-python-argcomplete qlever)" && export QLEVER_ARGCOMPLETE_ENABLED=1

Command: get-data

curl -sLo olympics.zip -C - https://github.com/wallscope/olympics-rdf/raw/master/data/olympics-nt-nodup.zip && unzip -q -o olympics.zip && rm olympics.zip

Problem executing "curl -sLo olympics.zip -C - https://github.com/wallscope/olympics-rdf/raw/master/data/olympics-nt-nodup.zip && unzip -q -o olympics.zip && rm olympics.zip": /c/Program: Files\Git\usr\bin\bash.EXE: No such file or directory

I could solve this by running the curl command straight in my bash terminal: curl -sLo olympics.zip -C - https://github.com/wallscope/olympics-rdf/raw/master/data/olympics-nt-nodup.zip && unzip -q -o olympics.zip && rm olympics.zip

Command: qlever index same problem, but I can run the bash command behind it. However, that returns an error:

 $ echo '{ "ascii-prefixes-only": false, "num-triples-per-batch": 100000 }' > olympics.settings.json
 $ docker run --rm -u $(id -u):$(id -g) -v /etc/localtime:/etc/localtime:ro -v $(pwd):/index -w /index --init --entrypoint bash --name qlever.index.olympics docker.io/adfreiburg/qlever:latest -c 'cat olympics.nt | IndexBuilderMain -F ttl -f - -i olympics -s olympics.settings.json --stxxl-memory 5G | tee olympics.index-log.txt'
ics -s olympics.settings.json --stxxl-memory 5G | tee olympics.index-log.txt';f6c20852-7d26-4426-be22-57b27d48fd4adocker: Error response from daemon: mkdir C:\Program Files\Git\etc\localtime;C: Access is denied.

That is currently where I get stuck. I'm not sure how to allow access here. In any case, if the goal is to make it easy to run qlever for windows users that are maybe not full on developers/docker engineers, I would really need a bit more/better documentation. Some way of running it without requirement for root privileges/giving Docker permission to run with root privileges without asking would also be great regardless of OS.

Please let me know if I can give you more detail somewhere. I'm looking forward to using a fully SPARQL 1.1 compliant blazingly fast open source SPARQL engine!

Kind regards, Robin

joka921 commented 2 months ago

Hi Robin, The QLever binaries natively support Linux and MacOS. The control script is also a tailored to more POSIX-like shells and tools (which you already figured out). The preferred way to use QLever on Windows is to run it inside the Windows Subsystem for Linux (WSL) (multiple of our developers including myself use this approach). In particular, also run the control script inside WSL. If you are not comfortable running QLever inside Docker, you can alternatively use Podman which is an almost drop-in replacement for Docker and only requires ordinary user privileges. You can specify in the QLeverfile which you get after setup-config, which system you want to use (Docker, Podman, or native binaries, but the latter one is advanced, as you have to compile QLever from scratch).

Thanks for reporting this, we should definitely add a note about the support for Windows somewhere. Let us know if you need further help

Best regards Johannes

rmfranken commented 2 months ago

Thanks Johannes. I have in the meanwhile gotten almost everything to work by running on Ubuntu (my system is dual boot) to try and avoid the windows question completely. The only left-over hurdle is getting the ui to work. Maybe I'm alone in this, but when I try to run the qlever ui command, I am told I have insufficient permission. However, I'm using a conda environment for qlever, and I cannot sudo inside of it, so I can't sudo run the command behind it (let alone sudo qlever ui that doesn't work in any scenario).

If I sudo run all the commands it looks like it should work - I see a ui, but the ui cannot connect to the backend even though I receive this after running the 3 seperate commands in sudo behind "qlever ui":

Make backend olympics the default and set URL to http://IC-SDSC-LPC14:7019 ...
Hide all other backends (set sort key to 0) ...

image

It looks like there is something going on at this port - otherwise I would receive a 404 I guess... image

Please note, docker is absolutely not my expertise : I'm just a simple rdf guy.

I have tried the whole thing also with "podman" instead of "docker" in the qlever file. Hope I'm missing something simple! :)

Qup42 commented 2 months ago

The message Unknown path is from the backend. So that means that the backend is up and reachable outside of the container. Do you get any errors in the Console of the Developer Tools and what is the status of the request to the Backend (/?cmd=stats is requested to check if the backend is up and load some basic information) in the Network Inspector of the Developer Tools? In most browsers the Developer Tools can be openend with Ctrl+Shift+C. Then you just have to find the right tab.

Qup42 commented 2 months ago

Another failure mode that can occur but is not the problem here: It can also happens that VPNs claim Dockers Subnet(s) for routing. The Subnets are then masked and containers will not be reachable. The container will be running and from inside the container everything works as fine but the container is not reachable from the host.