-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt DPsim to deploy it in Mybinder #323
Draft
pipeacosta
wants to merge
15
commits into
master
Choose a base branch
from
mybinder
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f3d3c4c
binder: install dependencies via apt-get
stv0g 7c599d3
add setup.py to binder directory
stv0g b7e46b1
next-try
stv0g f1012e2
use history
stv0g 16c0f34
Add requirements.txt to binder folder.
pipeacosta b7f891e
Move environment.yml to binder directory.
pipeacosta 99546d7
Add apt.txt.
pipeacosta 81ec793
Copy Dockerfile to root folder.
pipeacosta 7b46586
Remove binder directory.
pipeacosta 82b6e9e
Use Dockerfile.dev instead of Dockerfile
pipeacosta c26d7fa
Rename Dockerfile
pipeacosta cf34fd6
Adapt Dockerfile for mybinder.
pipeacosta c4d8fd3
Add MSP exercises submodule.
pipeacosta abacc21
Update Dockerfile.
pipeacosta a46cc07
Use symlink to Dockerfile.
pipeacosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "examples/Notebooks/MSP-lecture"] | ||
path = examples/Notebooks/MSP-lecture | ||
url = https://git.rwth-aachen.de/acs/public/teaching/msp/notebooks.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./packaging/Docker/Dockerfile.mybinder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
gcc | ||
gcc-c++ | ||
clang | ||
make | ||
cmake | ||
pkgconfig | ||
cppcheck |
Submodule MSP-lecture
added at
628f94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
FROM fedora:36 AS base | ||
|
||
ARG CIM_VERSION=CGMES_2.4.15_16FEB2016 | ||
ARG VILLAS_VERSION=411b0ad49e2629ad41c6918d2a6c51e9a72220b4 | ||
|
||
ARG CMAKE_OPTS | ||
ARG MAKE_OPTS=-j4 | ||
|
||
ARG NotebookApp.default_url | ||
ARG ip | ||
ARG port | ||
|
||
LABEL \ | ||
org.opencontainers.image.title="DPsim" \ | ||
org.opencontainers.image.licenses="MPL 2.0" \ | ||
org.opencontainers.image.url="http://dpsim.fein-aachen.org/" \ | ||
org.opencontainers.image.source="https://github.com/sogno-platform/dpsim" | ||
|
||
RUN dnf -y update | ||
|
||
# Toolchain | ||
RUN dnf -y install \ | ||
gcc gcc-c++ clang \ | ||
git \ | ||
rpmdevtools rpm-build \ | ||
make cmake pkgconfig \ | ||
python3-pip \ | ||
cppcheck | ||
|
||
# Tools needed for developement | ||
RUN dnf -y install \ | ||
doxygen graphviz \ | ||
gdb \ | ||
procps-ng | ||
|
||
# Dependencies | ||
RUN dnf --refresh -y install \ | ||
python3-devel \ | ||
eigen3-devel \ | ||
libxml2-devel \ | ||
graphviz-devel \ | ||
spdlog-devel \ | ||
fmt-devel | ||
|
||
# Install some debuginfos | ||
RUN dnf -y debuginfo-install \ | ||
python3 | ||
|
||
# Build & Install sundials | ||
RUN cd /tmp && \ | ||
git clone --branch v3.2.1 --recurse-submodules --depth 1 https://github.com/LLNL/sundials.git && \ | ||
mkdir -p sundials/build && cd sundials/build && \ | ||
cmake ${CMAKE_OPTS} .. \ | ||
-DCMAKE_BUILD_TYPE=Release && \ | ||
make ${MAKE_OPTS} install | ||
|
||
# CIMpp and VILLASnode are installed here | ||
ENV LD_LIBRARY_PATH="/usr/local/lib64:${LD_LIBRARY_PATH}" | ||
|
||
# Install minimal VILLASnode dependencies | ||
RUN dnf -y install \ | ||
openssl-devel \ | ||
libuuid-devel \ | ||
libcurl-devel \ | ||
jansson-devel \ | ||
libwebsockets-devel | ||
|
||
# Install optional VILLASnode dependencies | ||
RUN dnf -y install \ | ||
mosquitto-devel \ | ||
libconfig-devel \ | ||
libnl3-devel | ||
|
||
# Python dependencies | ||
ADD requirements.txt . | ||
RUN pip3 install --upgrade wheel build | ||
RUN pip3 install -r requirements.txt | ||
|
||
# Install CIMpp from source | ||
RUN cd /tmp && \ | ||
git clone --recurse-submodules --depth 1 https://github.com/cim-iec/libcimpp.git && \ | ||
mkdir -p libcimpp/build && cd libcimpp/build && \ | ||
cmake ${CMAKE_OPTS} ..\ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 \ | ||
-DUSE_CIM_VERSION=${CIM_VERSION} \ | ||
-DBUILD_ARABICA_EXAMPLES=OFF && \ | ||
make ${MAKE_OPTS} install && \ | ||
rm -rf /tmp/libcimpp | ||
|
||
# Install VILLASnode from source | ||
RUN cd /tmp && \ | ||
git clone --recurse-submodules https://github.com/VILLASframework/node.git villas-node && \ | ||
mkdir -p villas-node/build && cd villas-node/build && \ | ||
git checkout ${VILLAS_VERSION} && \ | ||
cmake ${CMAKE_OPTS} .. \ | ||
-DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 \ | ||
-DDOWNLOAD_GO=OFF && \ | ||
make ${MAKE_OPTS} install && \ | ||
rm -rf /tmp/villas-node | ||
|
||
RUN pip3 install --no-cache \ | ||
jupyter \ | ||
jupyterlab \ | ||
jupyter_contrib_nbextensions \ | ||
nbconvert \ | ||
nbformat | ||
|
||
ARG NB_USER=jovyan | ||
ARG NB_UID=1000 | ||
ENV USER ${NB_USER} | ||
ENV NB_UID ${NB_UID} | ||
ENV HOME /home/${NB_USER} | ||
|
||
RUN adduser \ | ||
--comment "Default user" \ | ||
--uid ${NB_UID} \ | ||
${NB_USER} | ||
|
||
COPY . ${HOME}/dpsim | ||
USER root | ||
RUN chown -R ${NB_UID} ${HOME} | ||
USER ${NB_USER} | ||
RUN rm -rf ${HOME}/dpsim/build && mkdir ${HOME}/dpsim/build | ||
WORKDIR ${HOME}/dpsim | ||
|
||
RUN python3 -m build --wheel | ||
RUN python3 -m pip install ./dist/dpsim* |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / SonarCloud
Prefer COPY over ADD for copying local resources Low