forked from energiacte/CTE_OpenStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
90 lines (81 loc) · 2.52 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
runnrel:
xhost local:root && \
docker run -it \
--rm \
--net=host \
-e DISPLAY \
-e QT_GRAPHICSSYSTEM='native' \
-e QT_X11_NO_MITSHM=1 \
--device=/dev/dri/card0 \
-v /tmp/X11-unix:/tmp/X11-unix:ro \
-v /etc/machine-id:/etc/machine-id:ro \
-v /var/run/dbus:/var/run/dbus \
-v ${HOME}/openstudio:/var/simdata/openstudio \
-v ${HOME}/openstudio/Measures:/root/OpenStudio/Measures \
-v /mnt/vegacte/03-CTE_en_curso/salaSert/git/OSCTEModels:/root/OpenStudio/Models \
nrel/openstudio \
bash
# Hay artefactos de dibujado en QT5 con docker por funcionar como root. Se solucionan ejecutando QT_GRAPHICSSYSTEM=native OpenStudio
# aunque por alguna razón no funciona al pasarlo en el entorno...
run:
xhost local:root && \
docker run -it \
--rm \
--net=host \
-e DISPLAY \
-e QT_GRAPHICSSYSTEM='native' \
-e QT_X11_NO_MITSHM=1 \
--device=/dev/dri/card0 \
-v /tmp/X11-unix:/tmp/X11-unix:ro \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/machine-id:/etc/machine-id:ro \
-v /var/run/dbus:/var/run/dbus \
-v ${HOME}/openstudio:/openstudio \
-v ${HOME}/openstudio/Measures:/root/OpenStudio/Measures \
openstudio:1.12 \
OpenStudio
# A veces falla DNS en red, probar a ver qué servidor está configurado con:
# $ nmcli dev show | grep 'IP4.DNS'
# y añadir esos servidores, junto con uno público al final (e.g. 8.8.8.8) en /etc/daemon.json:
# {
# "dns": ["161.111.10.3", "161.111.80.11", "8.8.8.8"]
# }
# y luego $ sudo service docker restart
#
runbash:
xhost local:root && \
docker run -it \
--rm \
--net=host \
-e DISPLAY \
-e QT_GRAPHICSSYSTEM='native' \
-e QT_X11_NO_MITSHM=1 \
--device=/dev/dri/card0 \
-v /tmp/X11-unix:/tmp/X11-unix:ro \
-v /etc/machine-id:/etc/machine-id:ro \
-v /var/run/dbus:/var/run/dbus \
-v ${HOME}/openstudio:/openstudio \
-v ${HOME}/openstudio/Measures:/root/OpenStudio/Measures \
openstudio:1.12 \
bash
create:
docker build -t openstudio:1.12 .
pullnrel:
docker pull nrel/openstudio
exportimage:
docker save -o openstudioimg.tgz openstudio:1.12
importimage:
docker load -i openstudioimg.tgz
installdocker:
sysctl net.ipv4.conf.all.forwarding=1
xhost +
sudo aptitude install docker.io
sudo usermod -aG docker `whoami`
# cd /usr/local/share/openstudio-1.12.0/Ruby/openstudio/
# /usr/local/share/openstudio-1.12.0/Ruby/openstudio/examples/RunAllOSMs.rb
test:
cd ./CTE_Model/tests/ && ruby *.rb
cd ./CTE_Workspace/tests/ && ruby *.rb
cd ./CTE_InformeDBHE/tests/ && ruby *.rb
cd ./CTE_EPBDcalc/tests/ && ruby *.rb
cd ./OS_Report_SI/tests/ && ruby *.rb