Closed russellb closed 5 years ago
Hey @russellb , the editable pip install makes a lot of sense but I'm wondering if you often prefer to make changes to source in the container or if it makes more sense to do something like this:
# Local copy of repo to do development on
LOCAL_REPO_DIR=$HOME/repos/flowdec
# Linked volume in container
CONTAINER_REPO_DIR=/repos/flowdec
nvidia-docker run -ti -p 8888:8888 -v $LOCAL_REPO_DIR:$CONTAINER_REPO_DIR flowdec
Then in the Dockerfile:
RUN cd /repos/flowdec/python && pip install -e .
Do you think it would be better this way so that you can edit the repo in a local directory (i.e. outside of the container) or do you find that there are advantages to doing the development within the container? I've been something like this lately instead so that I can point something like PyCharm at a repo on my host and know that changes will be available in the container right away, and that the copy of the repo I'm working on will be available when the container is down.
Let me know if that's a workflow you'd be interested in or if you prefer it the other way. I don't have a strong opinion regardless but I thought I'd probe to see if there are some interesting pros/cons of the two approaches.
Your suggestion makes more sense to me. Thanks! I'll update this to reflect something like that.
I pushed an update. It's mostly doc updates to reflect using a bind mount for even more convenient editing. The one caveat is that a new image will need to be built or "pip install -e" will need to be run again if the structure of the source tree changes.
The existing Dockerfiles build an image based on the latest master branch of flowdec. This variation lets you build a docker image based on the current local copy of the source.