From ba530355a9e8e605755598daa1f2e23b39ea42c5 Mon Sep 17 00:00:00 2001 From: zmalkmus Date: Fri, 3 Nov 2023 15:52:57 -0400 Subject: [PATCH 1/2] Fixed Docker issue. Added ability to build different branches using ./go.sh build --- Dockerfile | 9 ++++++--- go.sh | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5fea50a..f5bf4e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Start with a base Python 3.10 image from the Debian Buster distribution FROM python:3.10-buster AS base +ARG BRANCH_NAME # Switch to the root user and set the working directory to /root USER root @@ -22,9 +23,6 @@ RUN apt update \ RUN python3 -m pip install \ kvxopt \ git+https://github.com/cuihantao/andes.git@develop \ - --no-cache-dir \ - && python3 -m pip install \ - git+https://github.com/CURENT/agvis.git@master \ --no-cache-dir # Create a new user named 'cui' and a work directory @@ -49,6 +47,11 @@ RUN git clone https://github.com/CURENT/dime.git && \ rm -rf dime \ && rm -rf /tmp/dime +RUN git clone --single-branch --branch ${BRANCH_NAME} https://github.com/CURENT/agvis.git && \ + cd agvis && \ + python3 -m pip install -e . && \ + cd .. + # Switch to the 'cui' user and set the working directory to the new user's work directory USER cui WORKDIR /home/cui/work diff --git a/go.sh b/go.sh index 7a3b1cb..5b0188b 100755 --- a/go.sh +++ b/go.sh @@ -20,6 +20,12 @@ piptrustedhost= [ -f env.sh ] && . env.sh build() { + # Set Agvis Branch + local BRANCH_NAME=master + if [ "$1" ]; then + BRANCH_NAME=$1 + fi + # Clone ANDES and DiME if they don't exist if [ ! -d "../andes" ]; then echo "Cloning ANDES repository..." @@ -41,6 +47,7 @@ build() { ${target:+--target $target} \ ${pipindex:+--build-arg PIP_INDEX_URL=$pipindex} \ ${piptrustedhost:+--build-arg PIP_TRUSTED_HOST=$piptrustedhost} \ + --build-arg BRANCH_NAME=$BRANCH_NAME \ -t $tag . } From 51c2c92e8c8f28e6a59f87ff389aece097861d89 Mon Sep 17 00:00:00 2001 From: zmalkmus Date: Tue, 7 Nov 2023 09:33:21 -0500 Subject: [PATCH 2/2] Removed all syntax errors relating to an extra ! at the end --- go.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go.sh b/go.sh index 5b0188b..841f5ba 100755 --- a/go.sh +++ b/go.sh @@ -187,7 +187,7 @@ dev-benchmark() { } dev() { - google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null &! + google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null & tmux split-window -v tmux split-window -v @@ -208,11 +208,11 @@ dime-cygwin() { #################################################################################################### # dev-cygwin() { -# google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null &! +# google-chrome --incognito http://localhost:8810/ 2> /dev/null > /dev/null & -# mintty --exec "docker run --rm -t -v C:/cygwin64/`pwd`/static:/srv -p 8810:8810 $tag python3 -m http.server -d /srv $((port+0))" &! -# mintty --exec "docker run --rm -t -p 5000:5000 -p 8818:8818 $tag dime -vv -l tcp:5000 -l ws:$((port+8))" &! -# #mintty --exec "docker run --rm -t $tag andes -v 10 run /home/cui/wecc_vis.xlsx --dime tcp://127.0.0.1:5000 -r tds" &! +# mintty --exec "docker run --rm -t -v C:/cygwin64/`pwd`/static:/srv -p 8810:8810 $tag python3 -m http.server -d /srv $((port+0))" & +# mintty --exec "docker run --rm -t -p 5000:5000 -p 8818:8818 $tag dime -vv -l tcp:5000 -l ws:$((port+8))" & +# #mintty --exec "docker run --rm -t $tag andes -v 10 run /home/cui/wecc_vis.xlsx --dime tcp://127.0.0.1:5000 -r tds" & # } # http-cygwin() {