forked from Kismuz/btgym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker configuration and instructions - CPU edition
- Loading branch information
1 parent
c816e89
commit 99f049a
Showing
12 changed files
with
136 additions
and
0 deletions.
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,43 @@ | ||
FROM debian:stretch | ||
|
||
# Install git, supervisor, VNC, & X11 packages | ||
RUN set -ex; \ | ||
apt-get update; \ | ||
apt-get install -y \ | ||
bash \ | ||
fluxbox \ | ||
git \ | ||
net-tools \ | ||
novnc \ | ||
supervisor \ | ||
x11vnc \ | ||
xterm \ | ||
xvfb \ | ||
vim \ | ||
python3 \ | ||
python3-tk \ | ||
python3-pip \ | ||
lsof \ | ||
git \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev \ | ||
byobu \ | ||
chromium | ||
|
||
RUN python3 -m pip install tornado tensorflow==1.12.0 opencv-python==3.4.4.19 gym==0.10.11 backtrader==1.9.74.123 pyzmq==17.1.2 matplotlib==2.0.2 pillow numpy==1.16.4 scipy==1.3.0 pandas==0.23.4 ipython==7.2.0 psutil==5.4.8 logbook==1.4.1 jupyter jupyter_http_over_ws>=0.0.1a3 | ||
|
||
# Setup demo environment variables | ||
ENV HOME=/root \ | ||
DEBIAN_FRONTEND=noninteractive \ | ||
LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US.UTF-8 \ | ||
LC_ALL=C.UTF-8 \ | ||
DISPLAY=:0.0 \ | ||
DISPLAY_WIDTH=1800 \ | ||
DISPLAY_HEIGHT=900 \ | ||
RUN_XTERM=yes \ | ||
RUN_FLUXBOX=yes | ||
COPY . /app | ||
CMD ["/app/entrypoint.sh"] | ||
EXPOSE 8888 8080 6007 |
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,23 @@ | ||
# btgym docker for CPU only | ||
|
||
## To Build | ||
- sudo docker image build -t btgym . | ||
|
||
## To Run | ||
- docker container run -p 8080:8080 -p 6006:6006 -p 8888:8888 btgym | ||
|
||
### To link local directory | ||
- add "-v /local_dir:/container_dir" | ||
|
||
### To use your own copy of btgym | ||
- comment out the following line in entrypoint.sh | ||
exec git clone https://github.com/Kismuz/btgym.git /workspace & | ||
|
||
## Notes | ||
The container starts with chromium opening the jupyter nootbook authorization, select the file nbserver-#-open.html to access the notbook server. | ||
|
||
##### Original credits to: | ||
- https://github.com/theasp/docker | ||
|
||
##### Which was based on: | ||
- https://github.com/psharkey/docker/tree/master/novnc |
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 @@ | ||
[program:chromium] | ||
command=chromium --no-sandbox file:///root/.local/share/jupyter/runtime/ > /dev/null | ||
autorestart=true |
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 @@ | ||
[program:fluxbox] | ||
command=fluxbox | ||
autorestart=true |
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 @@ | ||
[program:jupyter] | ||
command=jupyter notebook --notebook-dir=/workspace/ --ip 0.0.0.0 --allow-root --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0 | ||
autorestart=true |
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 @@ | ||
[program:websockify] | ||
command=websockify --web /usr/share/novnc 8080 localhost:5900 | ||
autorestart=true |
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 @@ | ||
[program:x11vnc] | ||
command=x11vnc -forever -shared | ||
autorestart=true |
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 @@ | ||
[program:xterm] | ||
command=xterm | ||
autorestart=true |
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 @@ | ||
[program:xvfb] | ||
command=Xvfb :0 -screen 0 "%(ENV_DISPLAY_WIDTH)s"x"%(ENV_DISPLAY_HEIGHT)s"x24 -listen tcp -ac | ||
autorestart=true |
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,22 @@ | ||
version: '2' | ||
services: | ||
ide: | ||
image: psharkey/intellij:latest | ||
environment: | ||
- DISPLAY=novnc:0.0 | ||
depends_on: | ||
- novnc | ||
networks: | ||
- x11 | ||
novnc: | ||
image: theasp/novnc:latest | ||
environment: | ||
# Adjust to your screen size | ||
- DISPLAY_WIDTH=1600 | ||
- DISPLAY_HEIGHT=968 | ||
ports: | ||
- "8080:8080" | ||
networks: | ||
- x11 | ||
networks: | ||
x11: |
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,22 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
RUN_FLUXBOX=${RUN_FLUXBOX:-yes} | ||
RUN_XTERM=${RUN_XTERM:-yes} | ||
|
||
case $RUN_FLUXBOX in | ||
false|no|n|0) | ||
rm -f /app/conf.d/fluxbox.conf | ||
;; | ||
esac | ||
|
||
case $RUN_XTERM in | ||
false|no|n|0) | ||
rm -f /app/conf.d/xterm.conf | ||
;; | ||
esac | ||
exec git clone https://github.com/Kismuz/btgym.git /workspace & | ||
exec jupyter serverextension enable --py jupyter_http_over_ws & | ||
exec tensorboard --logdir=/workspace/btgym/logdir & | ||
exec jupyter notebook --notebook-dir=/workspace/ --ip 0.0.0.0 --allow-root --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0 & | ||
exec supervisord -c /app/supervisord.conf |
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,5 @@ | ||
[supervisord] | ||
nodaemon=true | ||
|
||
[include] | ||
files = /app/conf.d/*.conf |