Skip to content

Commit

Permalink
Update to use OpenDSS version 9
Browse files Browse the repository at this point in the history
This updates all files to use OpenDSS version 9

Signed-off-by: Ed Beroset <[email protected]>
  • Loading branch information
beroset committed Nov 7, 2023
1 parent 94b1590 commit 02fe764
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 176 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye AS builder
FROM debian:bookworm AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

Expand All @@ -10,16 +10,12 @@ RUN apt-get -y update && \
apt-get install -y subversion git make cmake g++ fpc
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss

COPY work/remove_obsolete_agent_calls.diff .
RUN cd epri/electric-dss && \
svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

COPY work/Makefile Makefile
RUN make

FROM debian:bullseye-slim
FROM debian:bookworm-slim
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
COPY --from=builder /tmp/opendsscmd /bin/opendsscmd
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ The code currently supports Fedora, Debian, Ubuntu, Arch, OpenSUSE and Alpine di

|base | image size (MB) | build command | notes |
| ----- | ---------- | ------------- | --------------------- |
|Alpine | 12.6 | podman build -f=work/Dockerfile.alpine work | no issues |
|Arch | 432 | podman build -f=work/Dockerfile.arch work | no issues |
|Debian | 87.9 | podman build -f=work/Dockerfile.debian work | no issues |
|Fedora | 163 | podman build -f=work/Dockerfile.fedora work | no issues |
|openSUSE | 112 | podman build -f=work/Dockerfile.opensuse work | no issues |
|Ubuntu | 79.4 | podman build -f=work/Dockerfile.ubuntu work | no issues |
|Alpine | 15.6 | podman build -f=work/Dockerfile.alpine work | no issues |
|Arch | 449 | podman build -f=work/Dockerfile.arch work | no issues |
|Debian | 82.7 | podman build -f=work/Dockerfile.debian work | no issues |
|Fedora | 187 | podman build -f=work/Dockerfile.fedora work | no issues |
|openSUSE | 123 | podman build -f=work/Dockerfile.opensuse work | no issues |
|Ubuntu | 85.2 | podman build -f=work/Dockerfile.ubuntu work | no issues |

## Using OpenDSS in a container image
To run OpenDSS in a container image requires only the previously created `beroset/opendss` image. Because OpenDSS takes files as input and (often) creates files as output, we need to share a *volume* with the container to allow this, since ordinarily, the container image has no interaction with the host system's storage. To do this, we can use a simple `bash` script:
Expand Down Expand Up @@ -85,7 +85,7 @@ As before, the `shared` subdirectory under the host's (your *real* computer's) c
For convenience, this is also put into a shell script `tryme.sh`.

## Testing
An overall test suite has been included within the project. It is in the bash script `testall.sh`. With a single command, all containers can be built and sanity-tested. Be aware, however, that this requires an internet connection and may take considerable time - on a 3.4GHz i7 with gigabit fiber internet connection, the full test suite takes over 36 minutes to complete.
An overall test suite has been included within the project. It is in the bash script `testall.sh`. With a single command, all containers can be built and sanity-tested. Be aware, however, that this requires an internet connection and may take considerable time - on a 3.4GHz i7 with gigabit fiber internet connection, the full test suite takes about 23 minutes to complete.

Usage: testall.sh [OPTION]
--help print this help and exit
Expand Down
10 changes: 5 additions & 5 deletions checksums
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
983dbfcea28dda1782e48844ca6ab4f78436e47cc2e9ee5cce5786e9db3ccf10963246432869d90c94f5ef8630356df123c72472fe652be3ade05124a261d948 shared/Stevenson_Convergence.TXT
76cc735e2838620eeb791fa981672b178ffb658481bb0b7b26e3c7b5c76e027f535b5b79b4f3f0906b5619002cc94d34f676cd2b3424ced3da4fd5eb5c49b75b shared/Stevenson_NodeMismatch.Txt
6a21d7cdd813a3c54f4367472bb149f2025f768bbe135c9a464bbe3798be90db9162431d5cfde0b2ec2578fff368d9c5c7c67b21851ce9df4d8622b80574ead5 shared/Stevenson_Convergence.TXT
495fa04d3890914a44bef68a898705ac27702afcd916a90a41917b32ef2d5e8156d5d95992a37fb9593b6bc8b58a3f342849b0c81b6e2dd2731231a14ce0dd1e shared/Stevenson_NodeMismatch.Txt
07affba9d405432613db090d991808ec295b193b85dfc04fd88a24f8529b7ac26d437d8af08fb6692e5d6fcbdc9b4d8d321dd3668df16217fe8e069be5cd2493 shared/StevensonPflow-3ph.dss
6e570bbe925573d4cd352bdfb678a7e4a50f544ee3ed103b5a70515cd6ffaf7711518a7e9beb7fd8124c72f47086062467c4ba3e2244195e586ea5ab11360d12 shared/Stevenson_Power_elem_MVA.txt
b257a90483ab3974d2847b22a4af1c1842bd98a16720264f7cbefcdbc0501f495cb8b703b0f04b81dddbd3f224eaf4ac61f3aa9346260b94f086cde3235dd029 shared/Stevenson_Power_seq_MVA.txt
b33ca55c553be5a47603e8d08350a2fcc881dca91e58a06d680679973976c4319cc2124bcf0c5441e96d65fbbdabee73b3bf4a137b774f00c7e40ddce41ee597 shared/Stevenson_VLN_Node.Txt
8136152c5029b27820d78b6225434b61601ffb75a11b62349da812a11b9df19345258b746538366432e1c07283703057e83d1620e34bc0c96a5606a5eaa131cc shared/Stevenson_Power_elem_MVA.txt
58cb7829fe032a94dd5c695eaf3becbe445eb9a952d5eff2caf2737507e93cbf535c35783db2b11a2fb0a9c9c20087f1da8e8a2a4a6e2410b049a7ace12cfb3a shared/Stevenson_Power_seq_MVA.txt
4d094041c193c5b8dad4878a3b0b0e0307188e20af050646a17d411d1738d42d050de24f5786a092e2acfc0edd9ba21ea5ef05d140023f89966796d42debc5bf shared/Stevenson_VLN_Node.Txt
15 changes: 6 additions & 9 deletions work/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
FROM alpine:3.16.2 AS builder
FROM alpine:3.18.4 AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

ENV FPC_VERSION="3.2.0" \
ENV FPC_VERSION="3.2.2" \
FPC_ARCH="x86_64-linux"

WORKDIR /tmp/
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p epri && \
apk --no-cache add cmake make make g++ git subversion libc6-compat
RUN wget "ftp://ftp.hu.freepascal.org/pub/fpc/dist/${FPC_VERSION}/${FPC_ARCH}/fpc-${FPC_VERSION}-${FPC_ARCH}.tar" -O fpc.tar
RUN wget "http://downloads.freepascal.org/fpc/dist/${FPC_VERSION}/${FPC_ARCH}/fpc-${FPC_VERSION}.${FPC_ARCH}.tar" -O fpc.tar
RUN tar xf "fpc.tar"
WORKDIR "fpc-${FPC_VERSION}-${FPC_ARCH}"
WORKDIR "fpc-${FPC_VERSION}.${FPC_ARCH}"
RUN echo -e '/usr\nN\nN\nN\n' | sh ./install.sh
WORKDIR /tmp/
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN export LC_CTYPE=en_US.UTF8 && svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss
RUN export LC_CTYPE=en_US.UTF8 && svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

#COPY remove_obsolete_agent_calls.diff .
COPY Makefile Makefile
WORKDIR /tmp/epri/electric-dss
#RUN svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
WORKDIR /tmp/

RUN make

FROM alpine:3.16.2
FROM alpine:3.18.4
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
RUN apk --no-cache add libc6-compat libstdc++
Expand Down
10 changes: 3 additions & 7 deletions work/Dockerfile.arch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM archlinux:base-20221030.0.98412 AS builder
FROM archlinux:base-20231105.0.189722 AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

Expand All @@ -9,16 +9,12 @@ RUN mkdir -p epri
RUN pacman --noconfirm -Sy svn git make cmake gcc fpc
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss

COPY remove_obsolete_agent_calls.diff .
RUN cd epri/electric-dss && \
svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

COPY Makefile Makefile
RUN make

FROM archlinux:base-20221030.0.98412
FROM archlinux:base-20231105.0.189722
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
COPY --from=builder /tmp/opendsscmd /bin/opendsscmd
Expand Down
10 changes: 3 additions & 7 deletions work/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye AS builder
FROM debian:bookworm AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

Expand All @@ -10,16 +10,12 @@ RUN apt-get -y update && \
apt-get install -y subversion git make cmake g++ fpc
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss

COPY remove_obsolete_agent_calls.diff .
RUN cd epri/electric-dss && \
svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

COPY Makefile Makefile
RUN make

FROM debian:bullseye-slim
FROM debian:bookworm-slim
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
COPY --from=builder /tmp/opendsscmd /bin/opendsscmd
Expand Down
10 changes: 3 additions & 7 deletions work/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:35 AS builder
FROM fedora:39 AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

Expand All @@ -10,16 +10,12 @@ RUN dnf update -y && \
dnf install -y gcc gcc-c++ libcxx-static fpc svn make git cmake
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss

COPY remove_obsolete_agent_calls.diff .
RUN cd epri/electric-dss && \
svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

COPY Makefile Makefile
RUN make

FROM fedora:35
FROM fedora:39
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
COPY --from=builder /tmp/opendsscmd /bin/opendsscmd
Expand Down
21 changes: 4 additions & 17 deletions work/Dockerfile.opensuse
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM opensuse/leap:15.2 AS builder

ENV CMAKE_VERSION="3.19" \
CMAKE_BUILD="7"
FROM opensuse/leap:15.5 AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

Expand All @@ -10,25 +7,15 @@ ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p epri
RUN zypper --non-interactive refresh && \
zypper --non-interactive install -y gcc gcc-c++ fpc subversion make git wget tar gzip openssl-devel
zypper --non-interactive install -y gcc gcc-c++ fpc subversion make git cmake
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.${CMAKE_BUILD}.tar.gz && \
tar -xzvf cmake-${CMAKE_VERSION}.${CMAKE_BUILD}.tar.gz && \
cd cmake-${CMAKE_VERSION}.${CMAKE_BUILD}/ && \
./bootstrap && \
make && \
make install
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss

COPY remove_obsolete_agent_calls.diff .
RUN cd epri/electric-dss && \
svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

COPY Makefile Makefile
RUN make

FROM opensuse/leap:15.2
FROM opensuse/leap:15.5
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
COPY --from=builder /tmp/opendsscmd /bin/opendsscmd
Expand Down
28 changes: 4 additions & 24 deletions work/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal AS builder
FROM ubuntu:jammy AS builder

LABEL maintainer="Ed Beroset <[email protected]>"

Expand All @@ -7,35 +7,15 @@ ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p epri
RUN apt-get -y update && \
apt-get install -y subversion git make g++ fpc wget libssl-dev
# Install cmake=3.19.7 from source bc ubuntu package repo does not have version>=3.18
# Install requires wget and libssl-dev
RUN version=3.19 && \
build=7 && \
mkdir ~/temp && \
cd ~/temp && \
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz && \
tar -xzvf cmake-$version.$build.tar.gz && \
cd cmake-$version.$build/ && \
./bootstrap && \
make -j$(nproc) && \
make install
apt-get install -y subversion git make g++ fpc cmake
RUN git clone https://github.com/pnnl/linenoise-ng.git
RUN svn checkout https://svn.code.sf.net/p/klusolve/code/ KLUSolve
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version7/Source epri/electric-dss

# Rm -vm6058 flag from linuxopts.cfg for ubuntu.
# Ubuntu fpc verson (3.0.2) does not include 6058 message and throws an error
RUN sed -i -e 's/\(6058,\|,6058\)//g' /tmp/epri/electric-dss/CMD/linuxopts.cfg

COPY remove_obsolete_agent_calls.diff .
RUN cd epri/electric-dss && \
svn patch --non-interactive /tmp/remove_obsolete_agent_calls.diff
RUN svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source epri/electric-dss

COPY Makefile Makefile
RUN make

FROM ubuntu:focal
FROM ubuntu:jammy
WORKDIR /root/
RUN mkdir -p /root/Documents/OpenDSSCmd
COPY --from=builder /tmp/opendsscmd /bin/opendsscmd
Expand Down
5 changes: 2 additions & 3 deletions work/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ epri/electric-dss/CMD/test/opendsscmd : KLUSolve/Lib/libklusolve.a linenoise-ng/
cd epri/electric-dss/CMD && fpc @linuxopts.cfg -k-L"$(STATIC_LIBDIR)" "$(FPC_EXTRA)" opendsscmd.lpr

linenoise-ng/build/liblinenoise.so : linenoise-ng/build/Makefile
cd linenoise-ng/build && make
cd linenoise-ng && cmake --build build

linenoise-ng/build/Makefile : linenoise-ng/CMakeLists.txt
mkdir -p linenoise-ng/build
cd linenoise-ng/build && cmake -DCMAKE_BUILD_TYPE=Release ..
cd linenoise-ng && cmake -DCMAKE_BUILD_TYPE=Release -S . -B build

KLUSolve/Lib/libklusolve.a: KLUSolve/Makefile
mkdir -p KLUSolve/Lib
Expand Down
83 changes: 0 additions & 83 deletions work/remove_obsolete_agent_calls.diff

This file was deleted.

0 comments on commit 02fe764

Please sign in to comment.