Dear <@U02UAUGSQ22>, hoping you are okay, I'm writ...
# analog-design
v
Dear @Harald Pretl, hoping you are okay, I'm writing you this message because we've got a question that we thought you were the best person to answer it. Our big issue is with using Jupyter Notebook, as we want to execute bash commands with it to use the open-source tools. This is because we are using Docker, so we don't know how we would be able to use both, as we are running on a Windows platform. How would you approach this?
h
@Vicente Osorio Let’s see if I can help 🙂 I am not sure what the question is. You are using a Dockerized VM (ours?), and you want to run Jupyter notebooks in it? Or is the question how to generally execute Bash scripts out of Jupyter NB? (I am not very skilled in Jupyter NB, I have to admit.)
v
@Harald Pretl Yes, we are using your Docker (iic-osic-tools) and would like to use jupyter notebook in it 😅.
h
Ok. I will put it into our Docker image in the next release 🙂 Now, as a temporary workaround, you can try to: 1. Make sure that you have downloaded our latest Docker image (which I released just last night, tag
2023.01
and
latest
) 2. Start the VNC mode as root by using
CONTAINER_USER=0 CONTAINER_GROUP=0 ./start_vnc.sh
3. Inside the VM, open a terminal, enter
pip install jupyterlab
to install Jupyter Lab. 4. Then start it by typing
jupyter-lab --allow-root
5. This will show you a prompt with the URL of your local Jupyter server. 6. Open the browser with this URL. Kindly note that we removed Firefox due to its heavy footprint (and only availability via Snap, which we refuse for our Docker VM) and installed
surf
as a lightweight alternative to open a URL with surf type in a terminal
surf <http://whatever.com>
I just tested this recipe, it works here on a Linux system. For Windows, you have to adapt step nr. 2.
👍 2
v
Thank you very much @Harald Pretl!! 😁 We could install jupyter-lab but we encountered problems running Surf. It seems like it is not installed. We managed to install it ourselves but we ran into an error related to WebKitWebProcess.
h
Are you using the latest Docker image? A newer one should automatically be pulled, but to be sure, do a
docker image rm hpretl/iic-osic-tools:latest
. When you then start the script, it will definitely pull the latest one.
v
Just removed the docker image to make sure it pulled the last one and now it has surf installed, but the error keeps happening
h
Can you please do a
git pull
on the GitHub checkout? We had an issue with some crazy rights management in some Linux flavor earlier today, which we fixed. Maybe it helps with your issue as well.
v
I did
git pull
and made the same modification to the
.bat
file, and now the connection is not refused but it can't find a file/directory. I added a style file to see if the error was related to that, but it wasn't.
h
Interesting. @Georg Zachl Could you please take a look. Do you have an idea why this is not working?
g
Hey @Vicente Osorio , there are basically two workarounds: First one is, remove the "LIBGL_ALWAYS_INDIRECT" environment variable with
export -n LIBGL_ALWAYS_INDIRECT
. After this, you should be able to run the browser without crashing. At least that worked for me with the latest container. The second workaround, which stongly recommend (except if you have security concerns): Open the jupyter notebook in a browser outside the container. This should work as follows: First, check that you container is stopped and deleted. Then run
DRY_RUN=1 CONTAINER_USER=0 CONTAINER_GROUP=0 ./start_vnc.sh
which outputs a start command like:
docker run -d --user 0:0 --security-opt seccomp=unconfined -p 80:80 -p 5901:5901 -v /home/georg/eda/designs:/foss/designs:rw --name iic-osic-tools_xvnc_uid_1000 hpretl/iic-osic-tools:latest
Now you need to add the port-forwarding for the Jupyter Lab/Notebook. Place
-p 8888:8888
before
hpretl/iic-osic-tools:latest
. Then just follow Haralds install tutorial, but this time, start it with
jupyter lab --no-browser --ip="0.0.0.0" --allow-root
and open the lab in a browser on your host system with the link Jupyter prints out (the token is important for authentication) (Tip: open VNC in a VNC-Client with a shared clipboard so you don't have to type the whole token). A word of warning: this Jupyter Lab runs as root, which means, it is pretty dangerous to your container and probably to your host if the wrong person gets to it.
v
Thank you @Georg Zachl and @Harald Pretl!!! I tested the first workaround and it worked 😄 But when opening jupyter-lab, it works really slow (the visual refresh rate), I don't know why though 😟 I will try the second workaround later on today!
g
I guess this is coming from VNC, which struggles with the compression "rendered-to-pixel" images. That's why using the Jupyter on the host is for sure much more convenient!
v
@Georg Zachl I tested the second work around, effectively the problem is from VNC. The host web browser works smoothly, thank you very much 😄
👍 2
g
Great to hear. It is on our ToDo List to integrate the Lab in one of our next releases, probably also with a separate start script to run the container in "jupyter-only" mode.
😲 1
👍 1
a
@Alonso Rodríguez