From 5464195f2f67f40f0cddd10165e888c4089e3b16 Mon Sep 17 00:00:00 2001
From: P-E Rethore <pe@retho.re>
Date: Thu, 21 Jun 2018 11:37:11 +0200
Subject: [PATCH] Adding the installation of Topfarm to the Dockerfile

---
 docker/Dockerfile        | 32 +++++++++++++++++++++++---------
 docker/requirements2.txt |  5 +++++
 2 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index bb1d17ac..910592f9 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -90,15 +90,14 @@ RUN chmod +x /usr/bin/tini
 RUN apt-get clean \
  && apt-get autoremove -y
 
-RUN apt-get install lazarus -y 
- 
-#RUN mkdir /install
-#RUN mkdir /install/source
-#RUN mkdir /install/FugaLib
-#WORKDIR   /install
-#COPY topfarm/cost_models/fuga/Colonel/source/*.pas /install/source/
-#COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpr /install/FugaLib/
-#COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpi /install/FugaLib
+RUN apt-get install lazarus -y
+
+RUN mkdir /install/source
+RUN mkdir /install/FugaLib
+WORKDIR   /install
+COPY topfarm/cost_models/fuga/Colonel/source/*.pas /install/source/
+COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpr /install/FugaLib/
+COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpi /install/FugaLib
 
 ## Build
 RUN lazbuild /install/FugaLib/FugaLib.lpi
@@ -107,6 +106,19 @@ RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
 RUN apt-get update -y && apt-get install -y nodejs
 
 
+## Install TOPFARM
+RUN mkdir /topfarm
+COPY topfarm /topfarm/topfarm
+COPY setup.py /topfarm/
+WORKDIR /topfarm
+RUN cp /install/FugaLib/libfugalib.so /topfarm/topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.so
+RUN pip install -e .
+
+# Install python library requirements to run the notebooks
+WORKDIR /install
+COPY docker/requirements2.txt /install
+RUN pip install -r /install/requirements2.txt
+
 #RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager \
 # && jupyter labextension install jupyterlab_bokeh
 
@@ -121,3 +133,5 @@ CMD bash
      #      --notebook-dir=/notebooks \
      #      --config=/install/jupyter_notebook_config.py \
      #      --allow-root
+
+     #jupyter notebook  --notebook-dir=/topfarm  --allow-root --port=8898 --ip='*'
diff --git a/docker/requirements2.txt b/docker/requirements2.txt
index 2aec8357..82d118c4 100644
--- a/docker/requirements2.txt
+++ b/docker/requirements2.txt
@@ -1,4 +1,9 @@
 -e git+https://github.com/FUSED-Wind/windIO.git#egg=windio
 -e git+https://github.com/OpenMDAO/OpenMDAO.git#egg=openmdao
+-e git+https://github.com/FUSED-Wind/FUSED-Wake.git#egg=fusedwake
 bokeh==0.12.14
 ipywidgets
+msgpack
+pytest
+pytest-cov
+matplotlib
-- 
GitLab