dockernel icon indicating copy to clipboard operation
dockernel copied to clipboard

How to mount a local directory?

Open hning86 opened this issue 4 years ago • 4 comments

How can I mount a local directory to the kernel? Normally I'd use the "docker run -v" switch. But how to do this with dockernel? Thx.

hning86 avatar Nov 20 '21 05:11 hning86

Seems like this is not being updated anymore. May I help? 🙋 I can have a look, because atm it is something I would highly appreciate given the fact that I am using a rapidly changing code base which is mounted into my docker. Without an attachment these do not get updated. Thus everytime the code base is updated I need to ➡️ delete the kernel ➡️ build a new docker image ➡️ register new image as jupyter kernel using dockernel.

Something else annoying is, that the display_name may be set correctly, but not the file name. This means that I have to delete a generic id in the jupyter kernelspec list and therefore cannot simply automate this process.

Cheers and thx @MrMino for the nice tool!

FalcoWeich avatar Jun 13 '23 09:06 FalcoWeich

Nevermind my comment on "cannot simply automate". For the moment I am using this .sh bash script ⤵️

#!/bin/bash

# remove all the kernels that have a number in their name
old_kernels=$(jupyter kernelspec list | grep -E '\b\w*[0-9]\w*[0-9]+\w*\b')
for kernel in $old_kernels
do
    jupyter kernelspec uninstall $kernel -y
done

# Update the docker image
docker build -t "docker_image" .

dockernel install docker_image --name docker_image_dockernel

jupyter lab

FalcoWeich avatar Jun 13 '23 10:06 FalcoWeich

@FalcoAlitiq You are free to send PRs :)

But I cannot vouch for when I'll have time to review. The simpler the changes are - the higher the probability I'll be able to do something sensible with this project.

At the moment I don't have the time this project would need / deserve.

MrMino avatar Jun 13 '23 20:06 MrMino

IIRC adding this feature requires adding the -v to the cli args in the kernelspec. Afterwards, the bigger question would be how to make this configurable.

MrMino avatar Jun 13 '23 20:06 MrMino