Skip to content
Snippets Groups Projects
Commit a3bb03b1 authored by auphelia's avatar auphelia
Browse files

Merge branch 'feature/jenkins' into feature/checksum

parents 829e05a3 b9efbb5b
No related branches found
No related tags found
No related merge requests found
......@@ -109,50 +109,24 @@ RUN pip install -e /workspace/finn-base
RUN git clone https://github.com/fastmachinelearning/qonnx.git /workspace/qonnx
RUN git -C /workspace/qonnx checkout $QONNX_COMMIT
RUN pip install --no-dependencies -e /workspace/qonnx
# extra dependencies from other FINN deps
# installed in Docker image to make entrypoint script go faster
# finn-experimental
RUN git clone https://github.com/Xilinx/finn-experimental.git /workspace/finn-experimental
RUN git -C /workspace/finn-experimental checkout $FINN_EXP_COMMIT
RUN pip install -e /workspace/finn-experimental
RUN pip install deap==1.3.1
RUN pip install mip==1.13.0
RUN pip install networkx==2.8
# brevitas
RUN git clone https://github.com/Xilinx/brevitas.git /workspace/brevitas
RUN git -C /workspace/brevitas checkout $BREVITAS_COMMIT
RUN pip install -e /workspace/brevitas
RUN pip install future-annotations==1.0.0
RUN pip install dependencies==2.0.1
RUN pip install tokenize-rt==4.2.1
# pyverilator
RUN git clone https://github.com/maltanar/pyverilator.git /workspace/pyverilator
RUN git -C /workspace/pyverilator checkout $PYVERILATOR_COMMIT
RUN pip install -e /workspace/pyverilator
# other git-based dependencies (non-Python)
# cnpy
RUN git clone https://github.com/rogersce/cnpy.git /workspace/cnpy
RUN git -C /workspace/cnpy checkout $CNPY_COMMIT
# finn-hlslib
RUN git clone https://github.com/Xilinx/finn-hlslib.git /workspace/finn-hlslib
RUN git -C /workspace/finn-hlslib checkout $HLSLIB_COMMIT
# oh-my-xilinx
RUN git clone https://github.com/maltanar/oh-my-xilinx.git /workspace/oh-my-xilinx
RUN git -C /workspace/oh-my-xilinx checkout $OMX_COMMIT
# board files
RUN cd /tmp; \
wget -q https://github.com/cathalmccabe/pynq-z1_board_files/raw/master/pynq-z1.zip; \
wget -q https://dpoauwgwqsy2x.cloudfront.net/Download/pynq-z2.zip; \
unzip -q pynq-z1.zip; \
unzip -q pynq-z2.zip; \
mkdir /workspace/board_files; \
mv pynq-z1/ /workspace/board_files/; \
mv pynq-z2/ /workspace/board_files/; \
rm pynq-z1.zip; \
rm pynq-z2.zip; \
git clone https://github.com/Avnet/bdf.git /workspace/avnet-bdf; \
git -C /workspace/avnet-bdf checkout $AVNET_BDF_COMMIT; \
mv /workspace/avnet-bdf/* /workspace/board_files/;
RUN pip install tclwrapper==0.0.1
# extra environment variables for FINN compiler
ENV VIVADO_IP_CACHE "/tmp/vivado_ip_cache"
ENV PATH "${PATH}:/workspace/oh-my-xilinx"
ENV OHMYXILINX "/workspace/oh-my-xilinx"
WORKDIR /workspace/finn
ENV PATH "${PATH}:${FINN_ROOT}/deps/oh-my-xilinx"
ENV OHMYXILINX "${FINN_ROOT}/deps/oh-my-xilinx"
COPY docker/finn_entrypoint.sh /usr/local/bin/
COPY docker/quicktest.sh /usr/local/bin/
......
......@@ -28,7 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
export FINN_ROOT=/workspace
export HOME=/tmp/home_dir
export SHELL=/bin/bash
export LANG="en_US.UTF-8"
......@@ -54,12 +53,23 @@ recho () {
echo -e "${RED}ERROR: $1${NC}"
}
if [ -f "$FINN_ROOT/finn/setup.py" ];then
# finn-base
pip install --user -e ${FINN_ROOT}/deps/finn-base
# Install qonnx without dependencies, currently its only dependency is finn-base
pip install --user --no-dependencies -e ${FINN_ROOT}/deps/qonnx
# finn-experimental
pip install --user -e ${FINN_ROOT}/deps/finn-experimental
# brevitas
pip install --user -e ${FINN_ROOT}/deps/brevitas
# pyverilator
pip install --user -e ${FINN_ROOT}/deps/pyverilator
if [ -f "${FINN_ROOT}/setup.py" ];then
# run pip install for finn
pip install --user -e $FINN_ROOT/finn
pip install --user -e ${FINN_ROOT}
else
recho "Unable to find FINN source code in $FINN_ROOT/finn"
recho "Ensure you have passed -v <path-to-finn-repo>:/workspace/finn to the docker run command"
recho "Unable to find FINN source code in ${FINN_ROOT}"
recho "Ensure you have passed -v <path-to-finn-repo>:<path-to-finn-repo> to the docker run command"
exit -1
fi
......
......@@ -103,3 +103,16 @@ fetch_repo $OMX_URL $OMX_COMMIT $OMX_DIR
fetch_repo $AVNET_BDF_URL $AVNET_BDF_COMMIT $AVNET_BDF_DIR
# TODO download extra Pynq board files and extract if needed
# cd /tmp; \
# wget -q https://github.com/cathalmccabe/pynq-z1_board_files/raw/master/pynq-z1.zip; \
# wget -q https://dpoauwgwqsy2x.cloudfront.net/Download/pynq-z2.zip; \
# unzip -q pynq-z1.zip; \
# unzip -q pynq-z2.zip; \
# mkdir ${FINN_ROOT}/deps/board_files; \
# mv pynq-z1/ ${FINN_ROOT}/deps/board_files/; \
# mv pynq-z2/ ${FINN_ROOT}/deps/board_files/; \
# rm pynq-z1.zip; \
# rm pynq-z2.zip; \
# git clone https://github.com/Avnet/bdf.git ${FINN_ROOT}/deps/avnet-bdf; \
# git -C ${FINN_ROOT}/deps/avnet-bdf checkout $AVNET_BDF_COMMIT; \
# mv ${FINN_ROOT}/deps/avnet-bdf/* ${FINN_ROOT}/deps/board_files/;
......@@ -168,6 +168,8 @@ gecho "Using default PYNQ board $PYNQ_BOARD"
# Build the FINN Docker image
if [ "$FINN_DOCKER_PREBUILT" = "0" ]; then
# ensure git-based deps are checked out at correct commit
./fetch-repos.sh
# Need to ensure this is done within the finn/ root folder:
OLD_PWD=$(pwd)
cd $SCRIPTPATH
......@@ -180,10 +182,11 @@ fi
DOCKER_EXEC="docker run -t --rm $DOCKER_INTERACTIVE --tty --init "
DOCKER_EXEC+="--hostname $DOCKER_INST_NAME "
DOCKER_EXEC+="-e SHELL=/bin/bash "
DOCKER_EXEC+="-v $SCRIPTPATH:/workspace/finn "
DOCKER_EXEC+="-w $SCRIPTPATH "
DOCKER_EXEC+="-v $SCRIPTPATH:$SCRIPTPATH "
DOCKER_EXEC+="-v $FINN_HOST_BUILD_DIR:$FINN_HOST_BUILD_DIR "
DOCKER_EXEC+="-e FINN_BUILD_DIR=$FINN_HOST_BUILD_DIR "
DOCKER_EXEC+="-e FINN_ROOT="/workspace" "
DOCKER_EXEC+="-e FINN_ROOT="$SCRIPTPATH" "
DOCKER_EXEC+="-e LOCALHOST_URL=$LOCALHOST_URL "
DOCKER_EXEC+="-e VIVADO_IP_CACHE=$VIVADO_IP_CACHE "
DOCKER_EXEC+="-e PYNQ_BOARD=$PYNQ_BOARD "
......
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