Skip to content
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

Added a Docker console #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
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
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resources/bash_history
11 changes: 11 additions & 0 deletions bin/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions bin/console.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions bin/resources/bashrc
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions bin/resources/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scipy