From 8877a2032bc4767be456ce1ca61051c3d2f577c1 Mon Sep 17 00:00:00 2001
From: auphelia <jakobapk@web.de>
Date: Tue, 29 Oct 2019 12:13:00 +0000
Subject: [PATCH] [run-docker(_jpk).sh] Added separate run docker file to work
 around sudo problems

---
 run-docker_jpk.sh | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100755 run-docker_jpk.sh

diff --git a/run-docker_jpk.sh b/run-docker_jpk.sh
new file mode 100755
index 000000000..45225a88d
--- /dev/null
+++ b/run-docker_jpk.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Absolute path to this script, e.g. /home/user/bin/foo.sh
+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
+ /tools/xgs/bin/sudo rm -rf .eggs tests/__pycache__/
+
+echo "Mounting $SCRIPTPATH into /workspace/finn"
+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_cnv_lfc:/workspace/brevitas_cnv_lfc \
+finn bash
-- 
GitLab