Skip to content
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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.6

# prepare a build environment
RUN apt-get update
RUN apt-get install -y --no-install-recommends\
git bash gcc g++ gfortran libblas-dev liblapack-dev libpng-dev libffi-dev libfreetype6 libjpeg-dev libhdf5-dev

WORKDIR /root
# if we don't build numpy first scipy complains
RUN pip install numpy
RUN git clone https://github.com/openai/gym && cd gym && pip install .
RUN git clone https://github.com/jvmancuso/ai-safety-gridworlds && cd ai-safety-gridworlds && pip install .
RUN git clone https://github.com/david-lindner/safe-grid-gym && cd safe-grid-gym && pip install .
RUN pip install tensorflow tensorboard torch

COPY setup.py README.md run.sh main.py /root/
COPY safe_grid_agents /root/safe_grid_agents
RUN pip install .

EXPOSE 6006

ENTRYPOINT ["/bin/bash", "run.sh"]
CMD ["-dc", "-E", "1000", "-V", "100", "-EE", "50", "corners", "ppo-cnn", "-l", ".2", "-r", "32", "-e", "2", "-cc", ".2", "-eb", ".1"]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ runs.
Given a log directory `<logs>`, simply run `tensorboard --logdir <logs>`
to visualize an agent's learning.

## Docker

Alternatively the agent can be ran in a docker container. To do this run

``` {.bash}
docker build . -t safe_grid_agents
docker run -p 6006:6006 safe_grid_agents <args>
```

where `<args>` are the arguments you would normally pass to the main script.
This does not use GPUs.

# Development

## Code style
Expand Down
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BASE_DIRECTORY=`dirname "${BASH_SOURCE[0]}"`
LOGDIR=$BASE_DIRECTORY/`hostname`-`date +%F_%H%M`
python $BASE_DIRECTORY/main.py --log-dir $LOGDIR $@ &
tensorboard --logdir $LOGDIR