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 a4ebeed..841f5ba 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 . } @@ -201,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() {