Closed sterin closed 3 years ago
This is excellent and something I've wanted for a while, thank you @sterin!
I do have one question. Is there a way we can also make it easy to use a local clone or copy of the bootcamp content so that the user's work is saved? I get that it's saved in a Docker container if you don't pass the --rm
command, but I don't think that's quite what we want. I'm thinking like using a volume or mount so that the files being modified live on the host machine rather than inside the container.
I tried it out by modifying the command to mount my local clone over the /home/bootcamp
directory (docker run -it --rm -p 8888:8888 -v $PWD:/home/bootcamp sterin/chisel-bootcamp
). It seemed to mount correctly, but Jupyter can't find the Scala kernel (presumably because I'm lacking local setup). Perhaps we could just change the directory structure of this repo, putting all of the .ipynb
files into a subdirectory, and then mount that. We could then provide a script that runs the correct tag of the docker container to ensure it is synced with the version of the content.
Any thoughts?
I've moved the bootcamp to /chisel-bootcamp
and now it's possible to mount it as a volume.
docker run -it --rm -p 8888:8888 -v $PWD:/chisel-bootcamp sterin/chisel-bootcamp
Note that you might need to get the latest version of the image using
docker pull sterin/chisel-bootcamp
It's still not ideal because the UID/GID of the bootcamp
user are probably different from the user running docker. Files written by the container would be have the wrong permissions. I'll check what is the standard way of handling this.
I've made a few additional changes. The packages are installed into a global directory and so are the Jupyter config files. It seems to work with local files using a command similar to:
docker run -it --rm -p 8888:8888 -v $PWD:/chisel-bootcamp -u $(id -u ${USER}):$(id -g ${USER}) sterin/chisel-bootcamp
Testing this on Windows was discussed at the dev meeting today, and I was able to get this to work on Windows by:
docker run -it --rm -p 8888:8888 -v %cd%:/chisel-bootcamp sterin/chisel-bootcamp
and navigate a browser to the displayed link. It seemed fine without the -u
flag, I don't know how actually necessary that is. Both Scala and Chisel functionality seem to work.I am having issues with using the -u
stuff, but I think this is in a good enough state that we should merge (with changes to have it publish to ucb-bar
Dockerhub). We can work on enhancing the -v
and -u
workflow later.
Hi,
On machines with Docker installed, it is much easier to run a docker image than to follow the instructions to locally install the bootcamp.
I've prepared a Dockerfile and A GitHub action that builds the docker image and pushes it to Docker Hub on each update to the GitHub repository.
If this is of interest, It would probably be better to push the image to your own account on Docker Hub. The required changes are:
DOCKER_HUB_USERNAME
andDOCKER_HUB_ACCESS_TOKEN
sterin/chisel-bootcamp
to the newusername/chisel-bootcamp
in both install.md and .github/workflows/build-push-docker-iamge.yaml