Skip to content
Snippets Groups Projects
Commit d54b5fc4 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Docker] add argument and port-forward for Netron as well

parent 2f38e45c
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ ARG UNAME ...@@ -32,6 +32,7 @@ ARG UNAME
ARG UID ARG UID
ARG PASSWD ARG PASSWD
ARG JUPYTER_PORT ARG JUPYTER_PORT
ARG NETRON_PORT
RUN groupadd -g $GID $GNAME RUN groupadd -g $GID $GNAME
RUN useradd -M -u $UID $UNAME -g $GNAME RUN useradd -M -u $UID $UNAME -g $GNAME
...@@ -45,4 +46,5 @@ USER $UNAME ...@@ -45,4 +46,5 @@ USER $UNAME
RUN echo "source \$VIVADO_PATH/settings64.sh" >> /home/$UNAME/.bashrc RUN echo "source \$VIVADO_PATH/settings64.sh" >> /home/$UNAME/.bashrc
RUN echo "PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '" >> /home/$UNAME/.bashrc RUN echo "PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '" >> /home/$UNAME/.bashrc
EXPOSE $JUPYTER_PORT EXPOSE $JUPYTER_PORT
EXPOSE $NETRON_PORT
WORKDIR /home/$UNAME/finn WORKDIR /home/$UNAME/finn
...@@ -16,6 +16,7 @@ DOCKER_RND=$(shuf -i0-32768 -n1) ...@@ -16,6 +16,7 @@ DOCKER_RND=$(shuf -i0-32768 -n1)
DOCKER_TAG="finn_${DOCKER_UNAME}" DOCKER_TAG="finn_${DOCKER_UNAME}"
DOCKER_INST_NAME="finn_${DOCKER_UNAME}_${DOCKER_RND}" DOCKER_INST_NAME="finn_${DOCKER_UNAME}_${DOCKER_RND}"
: ${JUPYTER_PORT=8888} : ${JUPYTER_PORT=8888}
: ${NETRON_PORT=8081}
# Absolute path to this script, e.g. /home/user/bin/foo.sh # Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0") SCRIPT=$(readlink -f "$0")
...@@ -60,6 +61,7 @@ echo "Mounting $SCRIPTPATH/PYNQ-HelloWorld into /workspace/PYNQ-HelloWorld" ...@@ -60,6 +61,7 @@ echo "Mounting $SCRIPTPATH/PYNQ-HelloWorld into /workspace/PYNQ-HelloWorld"
echo "Mounting $BUILD_LOCAL into $BUILD_LOCAL" echo "Mounting $BUILD_LOCAL into $BUILD_LOCAL"
echo "Mounting $VIVADO_PATH into $VIVADO_PATH" echo "Mounting $VIVADO_PATH into $VIVADO_PATH"
echo "Port-forwarding for Jupyter $JUPYTER_PORT:$JUPYTER_PORT" echo "Port-forwarding for Jupyter $JUPYTER_PORT:$JUPYTER_PORT"
echo "Port-forwarding for Netron $NETRON_PORT:$NETRON_PORT"
if [ "$1" = "test" ]; then if [ "$1" = "test" ]; then
echo "Running test suite" echo "Running test suite"
...@@ -80,6 +82,7 @@ docker build --tag=$DOCKER_TAG \ ...@@ -80,6 +82,7 @@ docker build --tag=$DOCKER_TAG \
--build-arg UID=$DOCKER_UID \ --build-arg UID=$DOCKER_UID \
--build-arg PASSWD=$DOCKER_PASSWD \ --build-arg PASSWD=$DOCKER_PASSWD \
--build-arg JUPYTER_PORT=$JUPYTER_PORT \ --build-arg JUPYTER_PORT=$JUPYTER_PORT \
--build-arg NETRON_PORT=$NETRON_PORT \
. .
# Launch container with current directory mounted # Launch container with current directory mounted
docker run -t --rm --name $DOCKER_INST_NAME -it \ docker run -t --rm --name $DOCKER_INST_NAME -it \
...@@ -99,4 +102,5 @@ docker run -t --rm --name $DOCKER_INST_NAME -it \ ...@@ -99,4 +102,5 @@ docker run -t --rm --name $DOCKER_INST_NAME -it \
-e FINN_INST_NAME=$DOCKER_INST_NAME \ -e FINN_INST_NAME=$DOCKER_INST_NAME \
-e FINN_ROOT="/workspace/finn" \ -e FINN_ROOT="/workspace/finn" \
-p $JUPYTER_PORT:$JUPYTER_PORT \ -p $JUPYTER_PORT:$JUPYTER_PORT \
-p $NETRON_PORT:$NETRON_PORT \
$DOCKER_TAG bash -c "$DOCKER_CMD" $DOCKER_TAG bash -c "$DOCKER_CMD"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment