Vscoder with CUDA, jupyter token could not find in logs

Hi,

I am trying to use a version of VS code with CUDA. Why? Well, the final aim is to use:

  • htmd: to build molecular dynamic simulations (requires CUDA)
  • nglview: to see the molecules I build (Doesn’t work with jupyterlab, or at least all the variants I tried)

So, I decided to create a dockerfile with some copy-paste and StackOverflow comments. So far, I think I made some progress, but I believe I am stuck at the last step because the “token” ID/password doesn’t show up. Here is the dockerfile I created: gradient-code-server/vscode_docker at main · phisanti/gradient-code-server (github.com)
and here is the call to create the code-server in a notebook:

FROM phisanti/cuda-code-server

COPY run.sh /run.sh
EXPOSE 8888
ENTRYPOINT ["/run.sh"]

And then:

#!/bin/bash

# Entry point gradient
# Source: https://gist.github.com/earthgecko/3089509
# Generates a random alphanumeric string of length 48 (like a jupyter notebook token i.e. c8de56fa4deed24899803e93c227592aef6538f93025fe01)
if [ -z "$JUPYTER_TOKEN" ]; then
    JUPYTER_TOKEN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 48 | head -n 1)
fi

# Note: print mocked jupyter token so that we can run this container as if it is a notebook within Gradient V1
echo "http://localhost:8888/?token=${JUPYTER_TOKEN}"
echo "http://localhost:8888/\?token\=${JUPYTER_TOKEN}"

PASSWORD=${JUPYTER_TOKEN} /usr/bin/code-server --bind-addr "0.0.0.0:8888" .

This basically copies the original repository: Paperspace/gradient-coder: Run VSCode as a Gradient Notebook! (github.com). However, for some reason the image can build the token ID cannot be found on the logs. Any suggestions?

Alternative, a step-by-step guide on how to install CUDA on the VScode image would be also helpful. I also tried and failed there.

Turns out that I end up solving the issue!

Here is a link with the answer: Tutorial: How to use CUDA with VScode - Gradient° - Paperspace Community