Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
Docker/
*.md
build_docker.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ src/__pycache__/
# Timing logs:
src/Example/logs/*.log

*tar.gz
MLModels/

88 changes: 88 additions & 0 deletions Docker/parallel.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
FROM ubuntu:focal as xyce_build

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y git cmake build-essential gcc g++ ninja-build gfortran make bison flex libfl-dev libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool autoconf automake libopenmpi-dev openmpi-bin

RUN git clone --branch Release-7.4.0 --depth 1 https://github.com/Xyce/Xyce.git

RUN git clone --branch trilinos-release-12-12-1 --depth 1 https://github.com/trilinos/Trilinos.git

WORKDIR /Trilinos

RUN mkdir build && cd build && cmake -GNinja -DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_Fortran_COMPILER=mpif77 \
-DCMAKE_CXX_FLAGS="-O3 -fPIC" \
-DCMAKE_C_FLAGS="-O3 -fPIC" \
-DCMAKE_Fortran_FLAGS="-O3 -fPIC" \
-DCMAKE_MAKE_PROGRAM="ninja" \
-DCMAKE_INSTALL_PREFIX="/opt/trilinos_parallel" \
-DTrilinos_ENABLE_NOX=ON \
-DNOX_ENABLE_LOCA=ON \
-DTrilinos_ENABLE_EpetraExt=ON \
-DEpetraExt_BUILD_BTF=ON \
-DEpetraExt_BUILD_EXPERIMENTAL=ON \
-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON \
-DTrilinos_ENABLE_TrilinosCouplings=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DTrilinos_ENABLE_Isorropia=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Belos=ON \
-DTrilinos_ENABLE_Teuchos=ON \
-DTrilinos_ENABLE_COMPLEX_DOUBLE=ON \
-DTrilinos_ENABLE_Amesos=ON \
-DAmesos_ENABLE_KLU=ON \
-DTrilinos_ENABLE_Amesos2=ON \
-DAmesos2_ENABLE_KLU2=ON \
-DAmesos2_ENABLE_Basker=ON \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_Stokhos=ON \
-DTrilinos_ENABLE_Kokkos=ON \
-DTrilinos_ENABLE_Zoltan=ON \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF \
-DTrilinos_ENABLE_CXX11=ON \
-DTPL_ENABLE_AMD=ON \
-DAMD_LIBRARY_DIRS="/usr/lib" \
-DTPL_AMD_INCLUDE_DIRS="/usr/include/suitesparse" \
-DTPL_ENABLE_BLAS=ON \
-DTPL_ENABLE_LAPACK=ON \
-DTPL_ENABLE_MPI=ON ..

RUN cd build && cmake --build . && ninja install

WORKDIR /Xyce

RUN ./bootstrap && mkdir build && cd build && \
../configure CXXFLAGS="-O3" ARCHDIR="/opt/trilinos_parallel" CPPFLAGS="-I/usr/include/suitesparse" -enable-mpi \
CXX=mpicxx \
CC=mpicc \
F77=mpif77 \
--enable-stokhos \
--enable-amesos2 \
--prefix=/opt/XyceInstall/Parallel && \
make -j $(nproc) && make install

FROM ubuntu:focal

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y nano vim python-is-python3 python3-pip gfortran bison flex libfl-dev libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool libopenmpi-dev openmpi-bin
WORKDIR /
COPY --from=xyce_build /opt /opt

ENV PATH /opt/XyceInstall/Parallel/bin:$PATH

RUN useradd -ms /bin/bash pact

WORKDIR /home/pact

COPY ./requirements.txt requirements.txt

USER pact

RUN pip3 install -r requirements.txt

COPY --chown=pact:pact . ./

CMD ["/bin/bash"]
80 changes: 80 additions & 0 deletions Docker/serial.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM ubuntu:focal as xyce_build

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y gcc g++ git build-essential ninja-build gfortran make cmake bison flex libfl-dev libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool automake autoconf

RUN git clone --branch Release-7.4.0 --depth 1 https://github.com/Xyce/Xyce.git

RUN git clone --branch trilinos-release-12-12-1 --depth 1 https://github.com/trilinos/Trilinos.git

WORKDIR /Trilinos

ARG FLAGS="-O3 -fPIC"

RUN mkdir build && cd build && cmake -GNinja \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_CXX_FLAGS="$FLAGS" \
-DCMAKE_C_FLAGS="$FLAGS" \
-DCMAKE_Fortran_FLAGS="$FLAGS" \
-DCMAKE_INSTALL_PREFIX="/opt/trilinos_serial" \
-DCMAKE_MAKE_PROGRAM="ninja" \
-DTrilinos_ENABLE_NOX=ON \
-DNOX_ENABLE_LOCA=ON \
-DTrilinos_ENABLE_EpetraExt=ON \
-DEpetraExt_BUILD_BTF=ON \
-DEpetraExt_BUILD_EXPERIMENTAL=ON \
-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON \
-DTrilinos_ENABLE_TrilinosCouplings=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DTrilinos_ENABLE_Isorropia=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Belos=ON \
-DTrilinos_ENABLE_Teuchos=ON \
-DTeuchos_ENABLE_COMPLEX=ON \
-DTrilinos_ENABLE_Amesos=ON \
-DAmesos_ENABLE_KLU=ON \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_Kokkos=OFF \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF \
-DTrilinos_ENABLE_CXX11=OFF \
-DTPL_ENABLE_AMD=ON \
-DAMD_LIBRARY_DIRS="/usr/lib" \
-DTPL_AMD_INCLUDE_DIRS="/usr/include/suitesparse" \
-DTPL_ENABLE_BLAS=ON \
-DTPL_ENABLE_LAPACK=ON ..

RUN cd build && cmake --build . && ninja install

WORKDIR /Xyce

RUN ./bootstrap && mkdir build && cd build && \
../configure CXXFLAGS="-O3" ARCHDIR="/opt/trilinos_serial" CPPFLAGS="-I/usr/include/suitesparse" \
--prefix=/opt/XyceInstall/Serial && \
make -j $(nproc) && make install

FROM ubuntu:focal

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y nano vim python-is-python3 python3-pip gfortran bison flex libfl-dev libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool && rm -rf /var/lib/apt/lists/*
WORKDIR /
COPY --from=xyce_build /opt /opt

ENV PATH /opt/XyceInstall/Serial/bin:$PATH

RUN useradd -ms /bin/bash pact

WORKDIR /home/pact

COPY ./requirements.txt requirements.txt

USER pact

RUN pip3 install -r requirements.txt

COPY --chown=pact:pact . ./

CMD ["/bin/bash"]
7 changes: 7 additions & 0 deletions build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -l

#docker build --pull --rm -f "Docker\parallel.dockerfile" -t pact:latest-parallel . <-- not currently working

###TODO: check if models are already downloaded before building docker image, get them if not

docker build --pull --rm -f "Docker\serial.dockerfile" -t pact:latest-serial .
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy==1.14.5
pandas==0.23.3
scipy==1.1.0
configparser==3.5.0
numpy==1.22.0
pandas==1.4.3
scipy==1.8.1
configparser==3.5.0