Hi there,
I am unable to connect to tensorboard from a JupyterLab session on limited.renku. I am using a chrome browser, but the error persists in firefox. I am on renku version 1.0.5.
I spin up a terminal and run
tensorboard --logdir logs/fit --bind_all
I added the --bind_all flag as it is suggested when running without it (because we’re in a docker image?)
The output is as follows:
NOTE: Using experimental fast data loading logic. To disable, pass
"--load_fast=false" and report issues on GitHub. More details:
https://github.com/tensorflow/tensorboard/issues/4784
TensorBoard 2.8.0 at http://rwagner-das-2doa-2dssl-d45848ac-0.rwagner-das-2doa-2dssl-d45848ac.renku.svc.cluster.local:6006/ (Press CTRL+C to quit)
This URL does not direct me to tensorboard but localhost refuses to connect (“This site can’t be reached” in chrome and “Hmm. We’re having trouble finding that site” in firefox).
No matter which port I choose or if I pass the host flag or not; I’ll get the same result.
Apparently as a new renku user I cannot paste more than two screenshots; so I hope you can infer which error page I mean.
If instead I try to load tensorboard from within the notebook itself I get the following error:
How do I manage to bring up tensorboard from JupyterLab?
Any support is appreciated.
Hi @rwagner thanks for posting the question here! In order to get tensorboard to work you need to install a few additional pieces. You need jupyter tensorboard as well as the jupyterlab tensorboard. These dependencies are a little complicated because they don’t seem to be maintained very well, but I managed to get a working version in an example project of mine.
If you put these two lines into your requirements.txt
you should be good to go:
git+https://github.com/cliffwoolley/jupyter_tensorboard.git@tb-2.2-compat
git+https://github.com/twalcari/jupyterlab_tensorboard.git
You can run a session from my project - if you open up and run the tensorboard-demo.ipynb
notebook, you can then click on the Tensorboard icon from the launcher:
Hope that helps!
Hi there, sorry for responding late.
I tried your approach but it didn’t work. I added the two lines to my requirements.txt, pushed the changes, spun up a new session but I still cannot see the tensorboard icon on the launcher. If I use your session everything works as expected. Haven’t figured out where the difference lies though.
This is the content of my requirements.txt file:
git+https://github.com/cliffwoolley/jupyter_tensorboard.git@tb-2.2-compat
git+https://github.com/twalcari/jupyterlab_tensorboard.git
This is my launcher (tensorboard icon missing)
Am I missing something? Thanks a lot for any pointers.
Hi @rwagner sorry it took me a bit to respond - are you sure you are launching from the commit that should have those packages installed? When you are in this session, could you check the requirements.txt
file just to be verify?
Hi @rrrrrok
No worries, I figured it out. I had to add the commands into my dockerfile. See screenshot attached.
It’s working fine now. Thanks for your help.
RUN /opt/conda/bin/pip install git+https://github.com/cliffwoolley/jupyter_tensorboard.git@tb-2.2-compat
RUN /opt/conda/bin/pip install git+https://github.com/twalcari/jupyterlab_tensorboard.git
1 Like
Oh nice, glad you figured it out. Though normally (if you are using one of Renku templates for your project) the requirements.txt
should get installed automatically in the Dockerfile
as well. Can you share the Dockerfile
you are using?
Sorry, it tells me that I am not allowed to post more than two links as I am a new user. There are more than two links in my dockerfile.
I cannot attach the file as only image extensions are allowed. Can you remove this limit for me?
# For finding latest versions of the base image see
# https://github.com/SwissDataScienceCenter/renkulab-docker
# ARG RENKU_BASE_IMAGE=renku/renkulab-py:3.9-0.11.0
ARG RENKU_BASE_IMAGE=renku/renkulab-cuda-tf:11.2-tf-2.7-0.11.0
FROM ${RENKU_BASE_IMAGE}
# Add VSCode support for a more pleasant coding and debugging experience for .py files. More details about issues, comments, and automatically installing extensions on https://renku.discourse.group/t/using-visual-studio-code-in-renkulab-interactive-sessions/249.
RUN curl -s https://raw.githubusercontent.com/SwissDataScienceCenter/renkulab-docker/master/scripts/install-vscode.sh | bash
# Uncomment and adapt if code is to be included in the image
# COPY src /code/src
# Uncomment and adapt if your R or python packages require extra linux (ubuntu) software
# e.g. the following installs apt-utils and vim; each pkg on its own line, all lines
# except for the last end with backslash '\' to continue the RUN line
#
# USER root
# RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# apt-utils \
# vim
# USER ${NB_USER}
# install the python dependencies
COPY requirements.txt environment.yml /tmp/
RUN conda env update -q -f /tmp/environment.yml && \
/opt/conda/bin/pip install -r /tmp/requirements.txt && \
conda clean -y --all && \
conda env export -n "root"
# add extension in visual studio code using the unique identifier
RUN code-server --install-extension GitHub.vscode-pull-request-github
#RUN code-server --install-extension huangbaoshan.comment-aligner # fails
RUN code-server --install-extension shardulm94.trailing-spaces
# RUN code-server --install-extension ms-python.python # fails
# Install pyoat library for OA forward transform and backward projections
RUN /opt/conda/bin/pip install git+https://github.com/berkanlafci/pyoat.git
# Install packages that allow to use Tensorboard on Jupyterlab
RUN /opt/conda/bin/pip install git+https://github.com/cliffwoolley/jupyter_tensorboard.git@tb-2.2-compat
RUN /opt/conda/bin/pip install git+https://github.com/twalcari/jupyterlab_tensorboard.git
# RENKU_VERSION determines the version of the renku CLI
# that will be used in this image. To find the latest version,
# visit https://pypi.org/project/renku/#history.
ARG RENKU_VERSION=1.0.5
########################################################
# Do not edit this section and do not add anything below
# Install renku from pypi or from github if it's a dev version
RUN if [ -n "$RENKU_VERSION" ] ; then \
source .renku/venv/bin/activate ; \
currentversion=$(renku --version) ; \
if [ "$RENKU_VERSION" != "$currentversion" ] ; then \
pip uninstall renku -y ; \
gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(rc[[:digit:]]\+\)*\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\4/p") ; \
if [ -n "$gitversion" ] ; then \
pip install --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\
else \
pip install --force renku==${RENKU_VERSION} ;\
fi \
fi \
fi
########################################################
I’d like to ask a follow-up question regarding my Dockerfile if you don’t mind.
When I am trying to install the python debugging extension (Python - Visual Studio Marketplace) in visual studio code on renku I get a server 404 error.
As you can see in my Dockerfile above I commented out the respective line:
# RUN code-server --install-extension ms-python.python # fails
The log from my failed docker build points us to the server error (see below). I haven’t figured out how to resolve it, there was an open git issue https://github.com/microsoft/vscode/issues/99699 regarding this problem but it has been closed in 2020. I am running VS Code v1.60.0 so this fix should have been integrated.
Hope you could advise me on how to add the debugging functionality to VSC on Renku.
Cheers
code-server: v3.12.0
VS Code: v1.60.0
Commit: 4cd55f94c0a72f05c18cea070e10b969996614d2
Date: 2021-09-15T19:34:37Z (7 mos ago)
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
This is the log:
Step 9/14 : RUN code-server --install-extension ms-python.python
56 —> Running in 18700867c63c
57Installing extensions…
58Server returned 404
59[2022-04-17T08:26:04.771Z] error vscode Failed Installing Extensions: ms-python.python
60[2022-04-17T08:26:04.775Z] error vscode Error: Failed Installing Extensions: ms-python.python
61 at E.installExtensions (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/server/entry.js:19:42)
62 at processTicksAndRejections (internal/process/task_queues.js:95:5)
63 at async /home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/server/entry.js:42:72320
64 at async G (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/server/entry.js:42:75753)
65 at async process. (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/server/entry.js:42:85792)
66The command ‘/bin/bash -c code-server --install-extension ms-python.python’ returned a non-zero code: 1
68Cleaning up file based variables00:01
70ERROR: Job failed: exit code 1
This is the log I get when trying to manually install the same extension from within my renku session in visual studio code → extensions:
[2022-04-17 10:36:18.758] [window] [error] Not Found: Error: Not Found
at https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/base/worker/workerMain.js#languageDetectionWorkerService:3:12892
[2022-04-17 10:36:20.138] [window] [error] a text search provider for the scheme ‘file’ is already registered: Error: a text search provider for the scheme ‘file’ is already registered
at _.registerTextSearchProvider (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:12674)
at _registerEHSearchProviders (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:113:11365)
at _.$enableExtensionHostSearch (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:113:11238)
at i._doInvokeHandler (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:98:13542)
at i._invokeHandler (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:98:13226)
at i._receiveRequest (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:98:11888)
at i._receiveOneMessage (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:98:10566)
at /home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:98:8662
at c.fire (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:66:1712)
at a.fire (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:74:15781)
at /home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:113:30364
at c.fire (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:66:1712)
at a.fire (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:74:15781)
at r._receiveMessage (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:74:21079)
at /home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:74:17929
at c.fire (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:66:1712)
at p.acceptChunk (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:74:13142)
at /home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:74:12490
at c.fire (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:66:1712)
at E._acceptChunk (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:113:19362)
at /home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:113:15775
at Socket.w (/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/services/extensions/node/extensionHostProcess.js:113:13350)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at Socket.Readable.push (internal/streams/readable.js:204:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
[2022-04-17 10:36:28.248] [window] [error] Not Found: Error: Not Found
at https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/base/worker/workerMain.js#languageDetectionWorkerService:3:12892
[2022-04-17 10:36:32.444] [window] [error] Not Found: Error: Not Found
at https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/base/worker/workerMain.js#languageDetectionWorkerService:3:12892
[2022-04-17 10:36:57.949] [window] [error] Not Found: Error: Not Found
at https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/base/worker/workerMain.js#languageDetectionWorkerService:3:12892
[2022-04-17 10:36:59.867] [window] [error] Not Found: Error: Not Found
at https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/base/worker/workerMain.js#languageDetectionWorkerService:3:12892
[2022-04-17 10:37:01.357] [window] [error] Not Found: Error: Not Found
at https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/base/worker/workerMain.js#languageDetectionWorkerService:3:12892
[2022-04-17 10:37:22.699] [window] [error] Error: Server returned 404
at w (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:609:154456)
at $.getManifest (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:614:31038)
at async f.installFromGallery (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:2853:113974)
at async ls.installFromGallery (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:2848:19846)
[2022-04-17 10:37:22.733] [window] [error] Server returned 404: Error: Server returned 404
at w (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:609:154456)
at $.getManifest (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:614:31038)
at async f.installFromGallery (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:2853:113974)
at async ls.installFromGallery (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:2848:19846)
[2022-04-17 10:37:22.910] [window] [error] Error: Server returned 404
at w (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:609:154456)
at $.getManifest (https://limited.renku.ch/sessions/rwagner-das-2doa-2dssl-ab135b42/vscode/static/4cd55f94c0a72f05c18cea070e10b969996614d2/home/jovyan/.local/lib/code-server-3.12.0/vendor/modules/code-oss-dev/out/vs/workbench/workbench.web.api.js:614:31038)
I just tried this Dockerfile with the two packages in requirements.txt
but commented out the RUN /opt/conda/bin/pip install
lines, and I get Tensorboard in there… so not sure what is going on in your case. If you leave out the two extra install lines in the Dockerfile
and then run pip freeze
in the terminal, do you see the two packages?
We can close the issue regarding Tensorflow, this is working fine now.
All that’s left open is the debugging extension in visual studio code which cannot be installed. If you want, I’ll open a new issue for it.
Best,
Raphaela
Hi @rwagner I’m looking into the vscode python extension problem now - could you open an issue in Issues · SwissDataScienceCenter/renkulab-docker · GitHub? Thanks for letting us know it was broken!
actually it looks like the fix is quite easy. In your Dockerfile could you add this line just after the comment # Add VSCode support...
, i.e. before RUN curl -s https://raw.githubusercontent.com...
ENV VSCODE_VERSION 4.3.0
Looks like they stopped supporting extensions for the version of the vscode server we were using. You can also remove the lines installing the python extension from your Dockerfile
since that’s actually done by the script that installs vscode already. If you can confirm that this works for you as expected, I’ll make a change in the script so that this is the default version which gets installed.
Hi, thanks for your answer! I’m about to try it and will let you know if it works.
Cheers!