Skip to content
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

Cant view spotlight in docker image #20

Open
superfabio02 opened this issue Jul 25, 2024 · 3 comments
Open

Cant view spotlight in docker image #20

superfabio02 opened this issue Jul 25, 2024 · 3 comments

Comments

@superfabio02
Copy link

I can't access the spotlight viewer with the explore button with a docker image, on my machine with the venv environment works fine.

@druzsan
Copy link
Collaborator

druzsan commented Jul 26, 2024

Hi @superfabio02, we aren't using Spotlight in Docker, that's why this way of interacting is not yet supported out of the box.

There are some small adjustments though you have to do to achieve this.

  1. Install renumics-spotlight in Docker container (adjust line 13 in Dockerfile to RUN poetry install --all-extras --sync --without=dev). Otherwise, you'll see a warning message instead of the Explore button.
  2. At the moment, Spotlight starts on a random port. In the assistant/app.py file, at the end of the get_or_create_spotlight_viewer function, add e.g. port=8001 to the spotlight.show arguments.

From now on, you have two options.

3.1. The simple option is to start container as docker run -p 8000:8000 -p 8001:8001 --network=host <...>. You should be then able to reach Spotlight at the URL localhost:8001 (Explore button won't work from container). Obviously, this won't work for non-local users.
3.2. The truly "right" one is to generate a TLS certificate and give it to the Spotlight by adding the following arguments to spotlight.show: host="0.0.0.0", ssl_keyfile="path/to/keyfile", ssl_certfile="path/to/certfile", ssl_keyfile_password="...". After running docker run -p 8000:8000 -p 8001:8001 <...>, you should be able to navigate to Spotlight at URL 0.0.0.0:8001 (again, Explore button won't work from container). If you reach the page but you only see a blank page, check the console at F12. If you see TypeError: crypto.randomUUID is not a function, then your TLS didn't work.

I wish you good luck with your experiments.

We will try to integrate the solution above into the repository.

@druzsan
Copy link
Collaborator

druzsan commented Jul 26, 2024

Related Spotlight issue: Renumics/spotlight#457

@druzsan
Copy link
Collaborator

druzsan commented Jul 30, 2024

Hi @superfabio02, our fix is now merged (https://github.com/Renumics/renumics-rag/pull/21/files). It includes steps 1 and 2. Step 3.1 is included in Makefile (make run-image-openai and make run-image-azure), for step 3.2 you have to generate certificate yourself.
Looking forward to your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants