-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use case and question about adding OpenSSH to the docker image. #138
Comments
hey Hans, this sounds a reasonable tool to add to the Dockerfile -- as gonb usually is used with something else folks are using it with, and Just to clarify:
|
With ssh available one could even write a helper that setups up a private repository from a notebook. And you could set up port forwardings or fetch files. I think it could also be benefitting if rsync curl and maybe also wget are available. Another possibility would be to add |
Actually, Now about adding jovyan to Let me put together a PR. |
I also think that you can add |
I was thinking that when using Google Colab (colab.research.google) I was always able to I just checked in Colab and it runs in root by default. So I'll follow suit and add Yes, the original image is not destroyed in Docker, when it runs the image in a container, it forks it for the container (I think). Sry, I think I won't have the time to rebuild/test/deploy new docker tonight. But first thing tomorrow. |
What do you think of PR #140 ? I compromised by giving Something I was considering is if someone wants to include a library that users CGO, they will need to install |
LGTM One more thing: What if you add the possibility to execute a script when the container starts? I think this could be done by adding an This way one could add more stuff to the container on startup (I would install some of our internal tooling for example). This could also be used to adjust the UID/GID of the user or do the private repo setup and other stuff. |
And the script would be mounted from the host mounted directory ? Should it be run as root ? |
Yes, that is what I imagine. |
Took a little fiddling around but pls check it out:
Would you double check it works for you ? I tested here, and it seems to be working ... but let me make sure it works for your use case. cheers |
I will check that out asap. |
I just tried the new docker image. At first, I ran into problems because I had the container run with I think that is not really needed though. But one needs to watch out that all shared directories and files which docker (or the startup script) create have working access rights for The second difficulty arises when using There are different work around solutions I considered:
In tested all three and ended up updating the access rights (other stuff failed on me) This is my latest
|
Yes, the user that will run Jupyter is configured as Hmm, that situation in Go is wrong. What happens is that I set the Another problem is that I have to manually export stuff when running as "jovyan". The line used to run JupyterLab is:
I'll try to create a |
Ok, I think I got this working. Here how your updated #!/bin/bash
echo "Configuring system..."
#apt-get update
# I want vim
#apt-get install -y vim
# set German timezone (so time.Now() returns German time)
apt-get install -y tzdata
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
# some locale magic to make "date" answer with German format
echo 'de_DE.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen
echo 'LC_ALL="de_DE.utf8"' > /etc/default/locale
export LC_ALL="de_DE.UTF-8"
dpkg-reconfigure locales
# check if it worked
date
# Installing Go tools for $NB_USER
su -l "$NB_USER" -c "go install github.com/nats-io/natscli/nats@latest" This is the result in the notebook: |
Latest version uploaded again to Btw, thanks for checking it. |
I tried it and it works excellent! |
Nice, closing this one. After the other features are in I'll cut a new release. |
A quick question: Wouldn't it be better to add time.Local, err = time.LoadLocation("US/Pacific") // <- this only works with tzdata installed
if err != nil {
fmt.Printf("Error: %v\n",err)
}
now = time.Now() |
Oh, I was not aware of it. Yes, let me add it to the |
Done in #142 |
Included in the v0.10.6 release. Docker also already available. |
Hi @janpfeifer,
TL;DR: Would you consider adding OpenSSH to the Docker image to simplify the setup for private repositories?
Full Story:
I've been using the original gonb Docker image to create a 'gonb'-based hub with shared code and services for experimenting, sharing, and explaining code among colleagues.
This setup is essentially a Docker Compose configuration with multiple gonb containers (one for each user) that share some directories containing notebooks. It runs on one of our high-performance servers and also provides several services (like MariaDB, PostgreSQL, MSSQL, NATS, and Clickhouse) which we use for development.
I even wrote a crude REST API mirroring tool. Using this, I can share API services from any machine to another using NATS. In this case, I use it to share AI services from my Windows machine (running Ollama, SD-WebUI, Coqui TTS) with the gonb hub. To accomplish this, I run a server (written in Go) inside WSL 2 on the Windows RTX 3090 Ti machine and a Docker container for the API endpoint in the hub. This works surprisingly well given the minimal effort I've invested so far. It even runs Jupyter, although it's missing web sockets and currently doesn't support requests larger than the NATS message limit (2 MB in this case).
To integrate our private repositories, I created a shared OpenSSH token and added it as to a special gonb user in GITEA. I then used shared paths to add the necessary SSH and Git configuration files for private repo access into the original container. However, I encountered a problem: there is no
ssh
in the gonb container, and addingssh
from the host doesn't work due to glibc incompatibilities. I found a statically linked OpenSSH binary and currently add thessh
command from there into the container.I would prefer if the original gonb image had OpenSSH installed. Perhaps it could even set up private repository access when provided with certain environment variables. It could create the necessary files and run a key scan for the specified hosts.
Thank you for considering this suggestion!
The text was updated successfully, but these errors were encountered: