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

[Docker] mount all deps from host, rm tmp files, run test

parent e0649957
No related branches found
No related tags found
No related merge requests found
......@@ -3,21 +3,19 @@ MAINTAINER Yaman Umuroglu <yamanu@xilinx.com>
ARG PYTHON_VERSION=3.6
WORKDIR /workspace
RUN git clone https://github.com/maltanar/brevitas_cnv_lfc.git
# Assume brevitas is cloned on host and mounted, see below.
#RUN git clone --branch feature/finn_onnx_export https://github.com/Xilinx/brevitas
#RUN cd brevitas; pip install .
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN rm requirements.txt
# Note that we expect the cloned finn directory on the host to be
# mounted on /workspace/finn -- see run-docker.sh for an example
# of how to do this.
# This branch assumes the same for brevitas and brevitas_cnv_lfc for easier
# co-development.
ENV PYTHONPATH "${PYTHONPATH}:/workspace/finn/src"
ENV PYTHONPATH "${PYTHONPATH}:/workspace/brevitas_cnv_lfc/training_scripts"
# And this branch assumes the same for brevitas for easier co-development.
ENTRYPOINT pip install -e /workspace/brevitas && /bin/bash
WORKDIR /workspace/finn
ENTRYPOINT pip install -e /workspace/brevitas && python setup.py test; /bin/bash
......@@ -4,12 +4,28 @@
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")
BREVITAS_REPO=https://github.com/Xilinx/brevitas.git
EXAMPLES_REPO=https://github.com/maltanar/brevitas_cnv_lfc.git
BREVITAS_LOCAL=$SCRIPTPATH/brevitas
EXAMPLES_LOCAL=$SCRIPTPATH/brevitas_cnv_lfc
# clone dependency repos
git clone --branch feature/finn_onnx_export $BREVITAS_REPO $BREVITAS_LOCAL || git -C "$BREVITAS_LOCAL" pull
git clone $EXAMPLES_REPO $EXAMPLES_LOCAL || git -C "$EXAMPLES_LOCAL" pull
# remove possible temp files created from previous execution
sudo rm -rf .eggs tests/__pycache__/
echo "Mounting $SCRIPTPATH into /workspace/finn"
echo "Mounting $SCRIPTPATH/../brevitas into /workspace/brevitas"
echo "Mounting $SCRIPTPATH/brevitas into /workspace/brevitas"
echo "Mounting $SCRIPTPATH/brevitas_cnv_lfc into /workspace/brevitas_cnv_lfc"
# Build the FINN Docker image
docker build --tag=finn .
# Launch container with current directory mounted
docker run --rm --name finn_dev -it \
-v $SCRIPTPATH:/workspace/finn \
-v $SCRIPTPATH/../brevitas:/workspace/brevitas \
-v $SCRIPTPATH/brevitas:/workspace/brevitas \
-v $SCRIPTPATH/brevitas_cnv_lfc:/workspace/brevitas_cnv_lfc \
finn bash
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