From 35cbece25a891c0c352456ec1ba98d8592069b68 Mon Sep 17 00:00:00 2001 From: Ned Bingham Date: Mon, 26 Sep 2022 10:33:59 -0400 Subject: [PATCH] connecting up technology server --- Dockerfile | 72 ++++++++++++++++++++++++++----------------------- Makefile | 5 +++- README.md | 9 ++++++- bcli-develop.sh | 8 +++++- 4 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 98a28a1..97b9beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,14 +64,6 @@ RUN cp hseplot/plot /opt/cad/bin RUN cp hsesim/hsesim /opt/cad/bin RUN cp hseenc/hseenc /opt/cad/bin -# install prspice -WORKDIR /toolsrc -RUN git clone https://github.com/nbingham1/prspice.git -WORKDIR prspice -RUN git checkout xyce -RUN make -RUN cp prdbase prspice /opt/cad/bin - # install ACT-06 RUN apt-get install -y libedit-dev zlib1g-dev m4 git gcc g++ make WORKDIR /toolsrc @@ -80,28 +72,6 @@ WORKDIR act-06 RUN XYCE_INSTALL="/usr/local" make RUN cp prsim/prsim chan.py measure.py sim2vcd.py tlint/tlint spi2act/spi2act.py v2act/v2act /opt/cad/bin -# install pr -WORKDIR /toolsrc -RUN --mount=type=secret,id=user --mount=type=secret,id=token git clone https://$(cat /run/secrets/user):$(cat /run/secrets/token)@git.broccolimicro.io/Broccoli/pr.git -RUN cp pr/* /opt/cad/bin - -# install OpenRoad -WORKDIR /toolsrc -RUN git clone https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git -WORKDIR OpenROAD-flow-scripts - -# install gaw -WORKDIR /toolsrc -RUN --mount=type=secret,id=user --mount=type=secret,id=token git clone https://$(cat /run/secrets/user):$(cat /run/secrets/token)@git.broccolimicro.io/Broccoli/waveview.git -WORKDIR waveview -RUN ./configure -RUN make -RUN cp src/gaw /opt/cad/bin - -# TODO(edward.bingham) setup vnc - -# TODO(edward.bingham) setup network mounted tech folder - # install go WORKDIR /toolsrc RUN apt-get -y install wget @@ -112,18 +82,52 @@ RUN tar -C /opt -xzf go1.19.1.linux-amd64.tar.gz RUN apt-get install -y python3 pip # install editors -RUN apt-get install -y vim - -# setup home directory template and install vim plugins WORKDIR "/" ADD home template +RUN apt-get install -y vim RUN mkdir -p /template/.vim/pack/plugins/start RUN git clone https://github.com/fatih/vim-go.git /template/.vim/pack/plugins/start/vim-go RUN git clone https://tpope.io/vim/fugitive.git /template/.vim/pack/plugins/start/fugitive RUN git clone https://github.com/preservim/nerdtree.git /template/.vim/pack/plugins/start/nerdtree +# install gaw +RUN apt-get update --fix-missing; apt-get install -y libgtk-3-dev libcanberra-gtk3-module +WORKDIR /toolsrc +RUN --mount=type=secret,id=user --mount=type=secret,id=token git clone https://$(cat /run/secrets/user):$(cat /run/secrets/token)@git.broccolimicro.io/Broccoli/waveview.git +WORKDIR waveview +RUN ./configure +RUN make +RUN make install + +# install magic layout tool +WORKDIR /toolsrc +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tcsh m4 csh libx11-dev tcl-dev tk-dev libcairo2-dev mesa-common-dev libglu1-mesa-dev libncurses-dev +RUN git clone https://github.com/RTimothyEdwards/magic.git +WORKDIR magic +RUN ./configure +RUN make +RUN make install + +# install prspice +WORKDIR /toolsrc +RUN git clone https://github.com/nbingham1/prspice.git +WORKDIR prspice +RUN git checkout xyce +RUN make +RUN cp prdbase prspice /opt/cad/bin + +# install pr +WORKDIR /toolsrc +RUN --mount=type=secret,id=user --mount=type=secret,id=token git clone https://$(cat /run/secrets/user):$(cat /run/secrets/token)@git.broccolimicro.io/Broccoli/pr.git +RUN cp pr/* /opt/cad/bin + +# install OpenRoad +#WORKDIR /toolsrc +#RUN git clone https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git +#WORKDIR OpenROAD-flow-scripts + # Clean up source code folder -RUN rm -rf /toolsrc +#RUN rm -rf /toolsrc # Connect user home directory of host machine RUN mkdir "/host" diff --git a/Makefile b/Makefile index 49b5853..48b59a4 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,5 @@ all: - DOCKER_BUILDKIT=1 docker build . --secret id=user,src=.secret/user --secret id=token,src=.secret/token -t git.broccolimicro.io/broccoli/development-environment:latest + DOCKER_BUILDKIT=1 docker build --secret id=user,src=.secret/user --secret id=token,src=.secret/token -t git.broccolimicro.io/broccoli/development-environment:latest . + +local: + DOCKER_BUILDKIT=1 docker build --secret id=user,src=.secret/user --secret id=token,src=.secret/token -t git.broccolimicro.io/broccoli/development-environment:latest --add-host=git.broccolimicro.io:10.0.0.65 . diff --git a/README.md b/README.md index 9551b1a..b3827c0 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ Setup the broccoli command line interface with the following command. source bcli-develop.sh ``` +Set up your ssh connection to the technology node server, it is preferrable to set up an ssh key. +``` +export BROCCOLI_USER="nbingham" +bcli mount +``` + Download the developement environment and boot it up in docker ``` bcli up @@ -30,7 +36,8 @@ Finally, vim is fully set up for both golang and act vim file.act ``` -When you are done, you can shut down the development environment. +When you are done, you can shut down the development environment and disconnect the technology server. ``` bcli down +bcli unmount ``` diff --git a/bcli-develop.sh b/bcli-develop.sh index 6d4e7f6..d9ac9dd 100644 --- a/bcli-develop.sh +++ b/bcli-develop.sh @@ -1,10 +1,16 @@ bcli() { if [ "$1" = "up" ]; then - docker run -d -v $HOME:/host --rm --name "bcli-develop" -h "bcli-develop" -e USER=$USER -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) git.broccolimicro.io/broccoli/development-environment:latest > /dev/null + docker run -d -v $HOME:/host --rm --name "bcli-develop" -h "bcli-develop" -e USER=$USER -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -e DISPLAY=$DISPLAY -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" git.broccolimicro.io/broccoli/development-environment:latest > /dev/null echo "bcli-develop started" elif [ "$1" = "down" ]; then docker stop bcli-develop > /dev/null echo "bcli-develop stopped" + elif [ "$1" = "mount" ]; then + mkdir -p $HOME/tech + sshfs $BROCCOLI_USER@broccolimicro.io:/opt/tech $HOME/tech/ + elif [ "$1" = "unmount" ]; then + umount $HOME/tech + rmdir $HOME/tech else docker exec -u $(id -u):$(id -g) -it bcli-develop /bin/bash fi