Installing GridAPPS-D¶
This document is work in progress.
Bootstrap¶
It is recommended to start with a linux platform such as Ubuntu and a ‘gridappsd’ user created. The bootstrap scripts should be run as root.
apt install -y git (you may need to run apt update first)
git clone https://github.com/GRIDAPPSD/Bootstrap.git
cd Bootstrap
chmod a+x *.sh
./bootstrap.sh
Pre-Requisite¶
If the bootstrap doesn’t work, or you wish to install manually you will need the following prerequisites.
apt upgrade -y (as root user)
GridAPPS-D Dependencies - Use apt install for the following dependencies
apt install -y vim git mysql-server automake default-jdk g++ gcc python python-pip libtool apache2 gradle nodejs-legacy npm curl
- vim
- Git
- Mysql-server (I set the root pw as gridappsd1234)
- Automake
- Default-jdk
- G++
- Gcc
- Python (v 2.x)
- Python-pip
- Libtool
- Apache2
- Gradle
- nodejs-legacy
- npm
- curl
Then apply the following pip installs
pip install –upgrade pip
pip install stomp.py pip install pyyaml
- pip install –upgrade pip
- pip install stomp.py
- pip install pyyaml
As well as the following npm packages
- npm install -g express
- npm install -g ejs
- npm install -g typescript
- npm install -g typings
- npm install -g webpack
The following structure should be set up to enable the run scripts to execute correctly.
- Griddapps-project
- builds/
- sources/
You will also need to install FNCS and GridLAB-D
FNCS
# FNCS
## Overview FNCS is the co-simulation engine used by GridAPP-D’s simulation manager class to facilitating real-time synchonization and message passing between the GridLAB-D simulation and the GOSS message bus.
## Source Code FNCS is maintained by PNNL. The repository is located at https://github.com/FNCS/fncs. GridAPPS-D is using the latest release of FNCS which is v2.3.2.
## FNCS Documentation The documentation for FNCS is located at https://github.com/FNCS/fncs/wiki.
## Building and Installing the Source ### Linux #### Prerequisites FNCS requires both the ZeroMQ and CZMQ libraries. For the purposes of the tutorial FNCS and it’s prerequisites will be installed a custom location refered to by $FNCS_INSTALL. All source code is downloaded to the $HOME directory.
```bash # download and install ZeroMQ :~$ wget http://download.zeromq.org/zeromq-3.2.4.tar.gz # if you do not have wget, use # curl -O http://download.zeromq.org/zeromq-3.2.4.tar.gz
# unpack zeromq, change to its directory :~$ tar -xzf zeromq-3.2.4.tar.gz :~$ cd zeromq-3.2.4
# configure, make, and make install :~/zeromq-3.2.4$ ./configure –prefix=$FNCS_INSTALL :~/zeromq-3.2.4$ make :~/zeromq-3.2.4$ make install
# download and install CZMQ :~/zeromq-3.2.4$ cd $HOME
:~$ wget http://download.zeromq.org/czmq-3.0.0-rc1.tar.gz # if you do not have wget, use # curl -O http://download.zeromq.org/czmq-3.0.0-rc1.tar.gz
# unpack czmq, change to its directory :~$ tar -xzf czmq-3.0.0-rc1.tar.gz :~$ cd czmq-3.0.0
# configure, make, and make install :~/czmq-3.0.0$ ./configure –prefix=$FNCS_INSTALL –with-libzmq=$FNCS_INSTALL :~/czmq-3.0.0$ make :~/czmq-3.0.0$ make install ```
#### Building FNCS In this tutorial FNCS source code will be downloaded using git to the $HOME directory. The code will be installed at t/FNCShe loacation $FNCS_INSTALL. ```bash # download FNCS :~$ git clone https://github.com/FNCS/fncs.git
# change to FNCS directory :~$ cd fncs
# configure, make, and make install :~/fncs$ ./configure –prefix=$FNCS_INSTALL –with-zmq=$FNCS_INSTALL :~/fncs$ make :~/fncs$ make install ```
#### Environment Setup In order for GridAPPS-D to be able to run FNCS and for GridLAB-D to be built with FNCS The following environment variables need to be setup: * $PATH must contain $FNCS_INSTALL/bin * $LD_LIBRARY_PATH must contain $FNCS_INSTALL/lib
GridLAB-D
# GridLAB-D
## Overview
GridLAB-D is a steady-state Distribution System simulation tool. It solves full three phase unbalanced network power flows and provides highly detailed enduse load models. It is part of GridAPPS-D’s Simulation Engine. It serves for providing the real world distribution system environment for third party GridAPPS-D applications to monitor and control in real time.
## Source Code GridLAB-D is maintained by Pacific Northwest National Laboratories in GitHub. The repository is located at https://github.com/gridlab-d/gridlab-d. GridAPPS-D uses the 4.0 release which is in release candidate currently and located on branch release/RC4.0.
## GridLAB-D Documentation GridLAB-D’s Documentation is located at http://gridlab-d.shoutwiki.com/wiki/Main_Page
## Building and Installing the Source
### Linux
#### Prerequisites
The following packages are needed in order to build GridLAB-D.
`bash
:~$ sudo apt-get install \
gcc \
g++ \
automake \
libtool \
git
`
For GridAPPS-D GridLAB-D will need to be compiled with the FNCS shared Library so FNCS will need to be installed. For instructions on building and installing FNCS, please go [here](). For the purposes of this document the location of where you installed FNCS will be known as $FNCS_INSTALL.
#### Building GridLAB-D
For the purposes of this instruction set, the location to where you download the repository will be known as $GLD_INSTALL.
`bash
#download the release/RC4.0 branch repository
:$GLD_INSTALL$ git clone https://github.com/gridlab-d/gridlab-d.git -b release/RC4.0 --single-branch
#build and install xerces located in the third_party folder of the repository
:$GLD_INSTALL$ cd gridlab-d/third_party
:$GLD_INSTALL/gridlab-d/third_party$ tar -xzf xerces-c-3.1.1.tar.gz
:$GLD_INSTALL/gridlab-d/third_party$ cd xerces-c-3.1.1
:$GLD_INSTALL/gridlab-d/third_party/xerces-c-3.1.1$ ./configure
:$GLD_INSTALL/gridlab-d/third_party/xerces-c-3.1.1$ sudo make
:$GLD_INSTALL/gridlab-d/third_party/xerces-c-3.1.1$ sudo make install
#build and install GridLAB-D with FNCS
:$GLD_INSTALL/gridlab-d/third_party/xerces-c-3.1.1$ cd ../../
:$GLD_INSTALL/gridlab-d$ autoreconf -if
:$GLD_INSTALL/gridlab-d$ ./configure --prefix=$GLD_INSTALL/install --with-fncs=$FNCS_INSTALL --enable-silent-rules 'CFLAGS=-g -O0 -w' 'CXXFLAGS=-g -O0 -w' 'LDFLAGS=-g -O0 -w'
#before performing make. Make sure the envirionment variable $LD_LIBRARY_PATH contains the path $FNCS_INSTALL/lib if it doesn't then it will need to be added to $LD_LIBRARY_PATH
:$GLD_INSTALL/gridlab-d$ make
:$GLD_INSTALL/gridlab-d$ install
`
#### Environment Setup In order for GridAPPS-D to be able to run GridLAB-D The following environment variables need to be setup: * $PATH must contain $GLD_INSTALL/install/bin and $FNCS_INSTALL/bin * $GLPATH must contain $GLD_INSTALL/install/lib/gridlabd and $GLD_INSTALL/install/share/gridlabd * $CXXFLAGS must contain $GLD_INSTALL/install/share/gridlabd * $LD_LIBRARY_PATH must contain $FNCS_INSTALL/lib
Download¶
You will need to clone the GOSS-GridAPPS-D and viz repositories and build each
- GOSS-GridAPPS-D
- git clone https://github.com/GRIDAPPSD/GOSS-GridAPPS-D.git
- cd GOSS-GridAPPS-D
- ./build-goss-test.sh
- mkdir -p $GRIDAPPSD_INSTALL/builds/log
- Vizualization
- git clone https://github.com/GRIDAPPSD/viz.git
- cd viz
- npm install
- webpack
- Blazegraph
- wget https://downloads.sourceforge.net/project/bigdata/bigdata/2.1.1/blazegraph.jar -O $GRIDAPPSD_INSTALL/builds/lib/blazegraph.jar
Activate Environment¶
You will need to populate the mysql database with the ieee8500 model
wget https://github.com/GRIDAPPSD/Bootstrap/raw/master/gridappsd_mysql_dump.sql
mysql -u root -p < gridappsd_mysql_dump.sql
- To populate Blazegraph with the ieee8500 model
- Download https://github.com/GRIDAPPSD/Powergrid-Models/blob/master/CIM/ieee8500.xml
- java -Dbigdata.propertyFile=$GRIDAPPSD_INSTALL/builds/lib/conf/rwstore.properties -jar $GRIDAPPSD_INSTALL/builds/lib/blazegraph.jar >> $GRIDAPPSD_INSTALL/builds/log/blazegraph.log 2>&1 &
- Go to http://localhost:9999
- Click on the Update tab
- Choose the ieee8500 model file and change the format to RDF/XML
- Click Update
Start Platform¶
To start the platform, open two terminal windows:
- To start GridAPPS-D, this should also start the web visualization
- cd gridappsd_project/sources/GOSS-GridAPPS-D
- ./run-goss-test.sh
- In a browser go to http://localhost:8082/ieee8500
Testing¶
Testing information will be added later