|
| 1 | +set -ex |
| 2 | + |
| 3 | +export LC_ALL=C |
| 4 | +export DEBIAN_FRONTEND=noninteractive |
| 5 | +export PIP_DISABLE_PIP_VERSION_CHECK=1 |
| 6 | + |
| 7 | +# Set timezone information |
| 8 | +ln -fs /usr/share/zoneinfo/America/Denver /etc/localtime |
| 9 | + |
| 10 | +apt-get install -y apt-utils |
| 11 | + |
| 12 | +# Install Man Pages |
| 13 | +apt-get install -y man-db manpages-dev |
| 14 | + |
| 15 | +# Install the OT-Sim/PandaPower APT Requirements |
| 16 | +apt-get install -y python3 python3-pip python2.7-dev python3-setuptools build-essential cmake libboost-dev libczmq-dev libxml2-dev libzmq5-dev pkg-config python3-dev python3-pip software-properties-common git |
| 17 | + |
| 18 | +# Install Go lang 1.21.8 |
| 19 | +wget -O go.tgz https://golang.org/dl/go1.21.8.linux-amd64.tar.gz && tar -C /usr/local -xzf go.tgz && rm go.tgz && ln -s /usr/local/go/bin/* /usr/local/bin |
| 20 | + |
| 21 | +# Make move to /opt and git clone the ot-sim project |
| 22 | +cd /opt |
| 23 | +git clone https://github.com/patsec/ot-sim.git |
| 24 | + |
| 25 | +# Move into ot-sim |
| 26 | +cd /opt/ot-sim |
| 27 | + |
| 28 | +# Compile OT Sim |
| 29 | +cmake -S . -B build && sudo cmake --build build -j$(nproc) --target install && sudo ldconfig && sudo make -C src/go install |
| 30 | + |
| 31 | +# Compile OT Sim Python |
| 32 | +sudo python3 -m pip install src/python |
| 33 | + |
| 34 | +# Install Hivemind |
| 35 | +wget -O hivemind.gz https://github.com/DarthSim/hivemind/releases/download/v1.1.0/hivemind-v1.1.0-linux-amd64.gz |
| 36 | +gunzip hivemind.gz |
| 37 | +sudo mv hivemind /usr/local/bin/hivemind |
| 38 | +sudo chmod +x /usr/local/bin/hivemind |
| 39 | + |
| 40 | +# Install MBPoll |
| 41 | +wget -O- http://www.piduino.org/piduino-key.asc | sudo apt-key add - |
| 42 | +sudo add-apt-repository 'deb http://apt.piduino.org xenial piduino' |
| 43 | +sudo apt update |
| 44 | +sudo apt install mbpoll -y |
| 45 | + |
| 46 | +# Install OpenDSS |
| 47 | +sudo python3 -m pip install opendssdirect.py~=0.8.4 |
| 48 | + |
| 49 | +# Install PandaPower Requirements |
| 50 | +sudo python3 -m pip install pandapower==2.14.11 |
| 51 | +sudo python3 -m pip install pandas==2.0.3 |
| 52 | +sudo python3 -m pip install numba==0.58.1 |
| 53 | + |
| 54 | +# Change root password |
| 55 | +echo "root:SiaSd3te" | chpasswd |
| 56 | + |
| 57 | +# Add "sceptre" user set their login shell to bash |
| 58 | +adduser sceptre --UID 1001 --gecos "" --shell /bin/bash --disabled-login || true |
| 59 | +echo "sceptre:sceptre" | chpasswd |
| 60 | + |
| 61 | +#Ensure /etc is owned by root |
| 62 | +chown -R root:root /etc |
| 63 | + |
| 64 | +## Clean APT install |
| 65 | +apt-get -y clean || true |
0 commit comments