From ab6254da6b011637a8c4675ec0491726ea11ced2 Mon Sep 17 00:00:00 2001 From: yyan7223 <22B305016@stu.hit.edu.cn> Date: Mon, 23 Sep 2024 23:45:56 -0700 Subject: [PATCH] Has fixed hardcoded path and updated run_mac_docker.sh --- launchUI.py | 2 +- run_mac_docker.sh | 27 +++++++-------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/launchUI.py b/launchUI.py index 98e36ae..183b33f 100644 --- a/launchUI.py +++ b/launchUI.py @@ -2143,7 +2143,7 @@ def create_layout_pannel(master, x, width, height): def clickDisplayLayout(): # Hardcodes the related path, will fix later. - flow_basePath = "/WORK_REPO/CGRA-Flow/tools/OpenROAD-flow-scripts/flow/" + flow_basePath = os.path.dirname(os.path.abspath(__file__)) + "/tools/OpenROAD-flow-scripts/flow/" layout_path = flow_basePath + "layout.png" odb_path = flow_basePath + "results/nangate45/gcd/base/6_final.odb" cmd_path = flow_basePath + "cmd.tcl" diff --git a/run_mac_docker.sh b/run_mac_docker.sh index 476e16a..40c3c16 100644 --- a/run_mac_docker.sh +++ b/run_mac_docker.sh @@ -1,28 +1,15 @@ #!/usr/bin/env bash -CONTAINER=cgra/cgra-flow:demo -COMMAND=/bin/bash -NIC=en0 +IMAGE=cgra/cgra-flow:demo -# Grab the ip address of this box -IPADDR=$(ifconfig $NIC | grep "inet " | awk '{print $2}') - -DISP_NUM=$(jot -r 1 100 200) # random display number between 100 and 200 - -PORT_NUM=$((6000 + DISP_NUM)) # so multiple instances of the container won't interfer with eachother - -socat TCP-LISTEN:${PORT_NUM},reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" 2>&1 > /dev/null & +CONTAINER=CGRA-Flow-OpenRoad XSOCK=/tmp/.X11-unix -XAUTH=/tmp/.docker.xauth.$USER.$$ -touch $XAUTH -xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge - -docker run \ +sudo docker run \ -it \ - --rm \ + --name=$CONTAINER \ -v $XSOCK:$XSOCK:rw \ - -v $XAUTH:$XAUTH:rw \ - -e DISPLAY=$IPADDR:$DISP_NUM \ - -e XAUTHORITY=$XAUTH \ - $CONTAINER + -e DISPLAY=unix$DISPLAY \ + $IMAGE +