diff --git a/README.md b/README.md index e4eabe7..a86aea3 100644 --- a/README.md +++ b/README.md @@ -74,4 +74,10 @@ utils: Some generic utility functions to transform data structures. ---------------------- Coming soon are LSTD and Policy Gradient Algorithms (the latter is motivated by the inability of the currently -implemented algorithms to handle continuous action spaces, eg: for the Portfolio Management example). \ No newline at end of file +implemented algorithms to handle continuous action spaces, eg: for the Portfolio Management example). + + +## Running on Docker +- `./bin/console.sh` will run a shell within docker + - has packages have been setup + - supports bash history diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..fb37b97 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +resources/bash_history diff --git a/bin/Dockerfile b/bin/Dockerfile new file mode 100644 index 0000000..caa4c7a --- /dev/null +++ b/bin/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.7-slim + +COPY resources/requirements.txt /tmp/requirements.txt + +RUN pip install -r /tmp/requirements.txt + +COPY resources/bashrc /root/.bashrc + +RUN mkdir /work + +WORKDIR /work diff --git a/bin/console.sh b/bin/console.sh new file mode 100755 index 0000000..539ce6e --- /dev/null +++ b/bin/console.sh @@ -0,0 +1,14 @@ +#!/bin/bash + + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT_ROOT=$SCRIPT_DIR/.. +TAG="mdp-dp-rl:oct18" + +set -x +set -e +cd $SCRIPT_DIR +touch resources/bash_history + +docker build -f $SCRIPT_DIR/Dockerfile -t $TAG . +docker run -it -v $PROJECT_ROOT/src:/work -v $SCRIPT_DIR/resources/bash_history:/root/.bash_history $TAG /bin/bash diff --git a/bin/resources/bashrc b/bin/resources/bashrc new file mode 100644 index 0000000..ef0a46d --- /dev/null +++ b/bin/resources/bashrc @@ -0,0 +1,9 @@ + +export PS1='\[[\e[m\]\[\e[1;34m\]console:\[\033[38;5;9m\]\w\[$(tput sgr0)\]\[\e[m\]]\$\] ' + +export HISTSIZE=100 +export HISTFILESIZE=500 +export HISTCONTROL=ignoredups:erasedups +shopt -s histappend + +export PYTHONPATH=/work:$PYTHONPATH diff --git a/bin/resources/requirements.txt b/bin/resources/requirements.txt new file mode 100644 index 0000000..9a635b9 --- /dev/null +++ b/bin/resources/requirements.txt @@ -0,0 +1 @@ +scipy