tensorflow version unpined, tensorboard support, home variable fix

main
ziembla 2017-12-04 11:33:16 +01:00
parent 107de89304
commit ddb9784176
4 changed files with 18 additions and 10 deletions

View File

@ -9,20 +9,19 @@ RUN apt-get update && apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
RUN conda install -y -c conda-forge \
tensorflow=1.0.0 \
tensorflow \
jupyter_contrib_nbextensions
ARG username
ARG userid
ARG home=/home/${username}
ARG workdir=${home}/handson-ml
RUN adduser ${username} --uid ${userid} --gecos '' --disabled-password \
&& echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} \
&& chmod 0440 /etc/sudoers.d/${username}
ENV HOME /home/${username}
ARG workdir=${HOME}/handson-ml
WORKDIR ${workdir}
RUN chown ${username}:${username} ${workdir}
@ -58,7 +57,7 @@ COPY docker/nbdime-*.patch /tmp/
USER root
WORKDIR /
RUN patch -d /opt/conda/lib/python3.6/site-packages -p1 --forward --reject-file=- < \
/tmp/nbdime-2-toc.patch || true \
/tmp/nbdime-1-details.patch || true \
&& patch -d /opt/conda/lib/python3.6/site-packages -p1 --forward --reject-file=- < \
/tmp/nbdime-2-toc.patch || true
RUN rm /tmp/nbdime-*.patch
@ -67,7 +66,7 @@ WORKDIR ${workdir}
COPY docker/bashrc /tmp/bashrc
RUN cat /tmp/bashrc >> ${HOME}/.bashrc
RUN cat /tmp/bashrc >> ${home}/.bashrc
RUN sudo rm /tmp/bashrc
# INFO: Uncomment the RUN command below to disable git diff paging
@ -81,6 +80,6 @@ RUN sudo rm /tmp/bashrc
# from notebook.auth import passwd
# passwd()
# and take the hash from the output
#RUN mkdir -p ${HOME}/.jupyter && \
#RUN mkdir -p ${home}/.jupyter && \
# echo 'c.NotebookApp.password = u"sha1:c6bbcba2d04b:f969e403db876dcfbe26f47affe41909bd53392e"' \
# >> ${HOME}/.jupyter/jupyter_notebook_config.py
# >> ${home}/.jupyter/jupyter_notebook_config.py

View File

@ -32,7 +32,9 @@ You can close the server just by pressing `Ctrl-C` in terminal window.
Run `make exec` (or `docker-compose exec handson-ml bash`) while the server is running to run an additional `bash` shell inside the `handson-ml` container. Now you're inside the environment prepared within the image.
One of the usefull things that can be done there may be comparing versions of the notebooks using the `nbdiff` command if you haven't got `nbdime` installed locally (it is **way** better than plain `diff` for notebooks). See [Tools for diffing and merging of Jupyter notebooks](https://github.com/jupyter/nbdime) for more details.
One of the usefull things that can be done there would be starting TensorBoard (for example with simple `tb` command, see bashrc file).
Another one may be comparing versions of the notebooks using the `nbdiff` command if you haven't got `nbdime` installed locally (it is **way** better than plain `diff` for notebooks). See [Tools for diffing and merging of Jupyter notebooks](https://github.com/jupyter/nbdime) for more details.
You can see changes you made relative to the version in git using `git diff` which is integrated with `nbdiff`.

View File

@ -10,3 +10,9 @@ nbd() {
# echo "How change $CHECKPOINT_COPY into $WORKING_COPY"
nbdiff "$CHECKPOINT_COPY" "$WORKING_COPY" --ignore-details
}
tb() {
python -m tensorboard.main --logdir=tf_logs
}
alias tensorboard="python -m tensorboard.main"

View File

@ -15,6 +15,7 @@ services:
max-size: 50m
ports:
- "8888:8888"
- "6006:6006"
volumes:
- ../:/home/devel/handson-ml
command: /opt/conda/bin/jupyter notebook --ip='*' --port=8888 --no-browser