From 0a7bc8f540d7f942aa76796062c2e9288655a558 Mon Sep 17 00:00:00 2001 From: kengz Date: Tue, 11 Apr 2017 18:17:48 -0400 Subject: [PATCH 01/15] fix one-go installation with an uninstall of box2d-py --- .gitignore | 1 + requirements.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index d95db30..c9b7d96 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ htmlcov/ .coverage venv/ ENV/ +.env/ node_modules/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c20ec00 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,20 @@ +six +h5py +numpy>=1.12 +scipy>=0.18 +matplotlib==1.4.3 +seaborn>=0.7.1 +pandas>=0.18.1 +atari_py>=0.0.18 +Pillow>=3.3.1 +PyOpenGL>=3.1.0 +glances>=2.6.2 +mem_top==0.1.5 +pytest-cov>=2.3.1 +pytest-xdist>=1.15.0 +codacy-coverage>=1.3.3 +tensorflow>=1.0.0 +Theano>=0.8.2 +Keras>=1.2.2,<2.0.0 +-e git+https://github.com/pybox2d/pybox2d#egg=pybox2d +-e git+https://github.com/openai/gym.git#egg=gym[all] From 31ef9573411225eb9b3a18cb25de64f7ab597bca Mon Sep 17 00:00:00 2001 From: kengz Date: Tue, 11 Apr 2017 23:07:23 -0400 Subject: [PATCH 02/15] working installation from kengz fork --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c20ec00..5cbcca5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,5 +16,4 @@ codacy-coverage>=1.3.3 tensorflow>=1.0.0 Theano>=0.8.2 Keras>=1.2.2,<2.0.0 --e git+https://github.com/pybox2d/pybox2d#egg=pybox2d --e git+https://github.com/openai/gym.git#egg=gym[all] +-e git+https://github.com/kengz/gym.git#egg=gym[all] From 8d2ea17ab1b556d57d89c326c805e8aa20563b61 Mon Sep 17 00:00:00 2001 From: kengz Date: Wed, 12 Apr 2017 07:34:50 -0400 Subject: [PATCH 03/15] split setup binaries by os, easier to read --- bin/setup | 118 ++++++++--------------------------------------- bin/setup_macOS | 60 ++++++++++++++++++++++++ bin/setup_ubuntu | 52 +++++++++++++++++++++ 3 files changed, 131 insertions(+), 99 deletions(-) create mode 100755 bin/setup_macOS create mode 100644 bin/setup_ubuntu diff --git a/bin/setup b/bin/setup index afca0d0..90ba73b 100755 --- a/bin/setup +++ b/bin/setup @@ -5,110 +5,30 @@ set -e trap "exit" INT -# copy keys file if not already exist -BIN_DIR=`pwd`/bin -$BIN_DIR/copy-config - -# install system dependencies -if [ $(uname) == "Darwin" ]; then - if which brew >/dev/null; then - echo "Brew is already installed" - else - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - fi -else - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update - sudo apt-get install -y gcc-4.9 g++-4.9 libhdf5-dev libopenblas-dev git -fi - -# install python -if which python3 >/dev/null; then - echo "Python3 is already installed" -else - if [ $(uname) == "Darwin" ]; then - brew install python3 - else - sudo apt-get -y install python3-dev python3-pip python3-setuptools - fi -fi - -# install nodejs (for npm and file watcher) -if which node >/dev/null; then - echo "Nodejs is already installed" -else - if [ $(uname) == "Darwin" ]; then - brew install node - else - curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - - sudo apt-get install -y nodejs - fi -fi -# install npm modules -if [ -d ./node_modules ]; then - echo "Npm modules already installed" -else - npm install - sudo npm i -g grunt-cli -fi +echo " +================================================ -# install noti -if [ $(uname) == "Darwin" ]; then - curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.darwin-amd64.tar.gz | tar -xz - sudo mv noti /usr/local/bin/ -else - curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.linux-amd64.tar.gz | tar -xz - sudo mv noti /usr/bin/ -fi +Welcome to the OpenAI Lab setup script; +please run this as sudo, +or inspect bin/setup_ubuntu or bin/setup_macOS and run the lines manually. -# install common dependencies from from -sudo python3 -m pip install -U pip -sudo python3 -m pip install six -sudo python3 -m pip install h5py -sudo python3 -m pip install numpy -sudo python3 -m pip install scipy -sudo python3 -m pip install matplotlib -sudo python3 -m pip install seaborn -sudo python3 -m pip install pandas -sudo python3 -m pip install atari_py -sudo python3 -m pip install Pillow -sudo python3 -m pip install PyOpenGL -sudo python3 -m pip install glances -sudo python3 -m pip install mem_top -sudo python3 -m pip install pytest-cov -sudo python3 -m pip install pytest-xdist -sudo python3 -m pip install codacy-coverage +================================================ +" -# install tensorflow -if [ $(uname) == "Darwin" ]; then - sudo python3 -m pip install tensorflow -else - sudo python3 -m pip install tensorflow-gpu -fi -python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" -# install theano -if which clang >/dev/null; then - echo "clang is already installed" -else - if [ $(uname) == "Darwin" ]; then - brew install --with-clang llvm - fi -fi -# sudo pip3 install --upgrade --no-deps git+git://github.com/Theano/Theano.git -sudo python3 -m pip install theano==0.8.2 -python3 -c "import theano; print('theano version:'); print(theano.__version__)" +# copy keys file if not already exist +BIN_DIR=`pwd`/bin +$BIN_DIR/copy-config -# install keras -sudo python3 -m pip install keras -# install full openai gym -if [ $(uname) == "Darwin" ]; then - brew install cmake boost boost-python sdl2 swig wget -else - sudo apt-get install -y cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig +# determine if is Mac OSX, or Linux; then run accordingly +if [ $(uname) == "Darwin" ]; +# Mac runs below +then ( + $BIN_DIR/setup_macOS; + ); +else ( + $BIN_DIR/setup_ubuntu; + ); fi -git clone https://github.com/openai/gym.git && cd gym && sudo python3 -m pip install -e .[all] && cd .. -git clone https://github.com/pybox2d/pybox2d && cd pybox2d/ && sudo python3 setup.py clean && sudo python3 setup.py build && sudo python3 setup.py install && cd .. -python3 -c "import gym; gym.make('LunarLander-v2')" -python3 -c "import gym; gym.make('SpaceInvaders-v0')" diff --git a/bin/setup_macOS b/bin/setup_macOS new file mode 100755 index 0000000..f921896 --- /dev/null +++ b/bin/setup_macOS @@ -0,0 +1,60 @@ +#!/bin/bash +# This script sets up OpenAI Lab for macOS + +# Fail on the first error; killable by SIGINT +set -e +trap "exit" INT + +# install system dependencies +if which brew >/dev/null; then + echo "Brew is already installed" +else + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +fi + +if which clang >/dev/null; then + echo "clang is already installed" +else + brew install --with-clang llvm +fi + +# system dependencies for full openai gym +brew install cmake boost boost-python sdl2 swig wget + +# install noti for auto-notification +curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.darwin-amd64.tar.gz | tar -xz +sudo mv noti /usr/local/bin/ + +# install nodejs (for npm and file watcher) +if which node >/dev/null; then + echo "Nodejs is already installed" +else + brew install node +fi +npm install +sudo npm i -g grunt-cli + +# install python3 +if which python3 >/dev/null; then + echo "Python3 is already installed" +else + brew install python3 +fi + +# install python dependencies +sudo python3 -m pip install -r requirements.txt + +echo " +================================================ + +Setup done. +Running basic installation checks. + +================================================ +" + +# post-installation checks +python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" +python3 -c "import theano; print('theano version:'); print(theano.__version__)" +python3 -c "import gym; gym.make('LunarLander-v2')" +python3 -c "import gym; gym.make('SpaceInvaders-v0')" diff --git a/bin/setup_ubuntu b/bin/setup_ubuntu new file mode 100644 index 0000000..f4a29ae --- /dev/null +++ b/bin/setup_ubuntu @@ -0,0 +1,52 @@ +#!/bin/bash +# This script sets up OpenAI Lab for Linux Ubuntu + +# Fail on the first error; killable by SIGINT +set -e +trap "exit" INT + +# install system dependencies +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update +sudo apt-get install -y gcc-4.9 g++-4.9 libhdf5-dev libopenblas-dev git + +# system dependencies for full openai gym +sudo apt-get install -y cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig + +# install noti for auto-notification +curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.linux-amd64.tar.gz | tar -xz + sudo mv noti /usr/bin/ + +# install nodejs (for npm and file watcher) +if which node >/dev/null; then + echo "Nodejs is already installed" +else + curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - + sudo apt-get install -y nodejs +fi +npm install +sudo npm i -g grunt-cli + +# install python3 +if which python3 >/dev/null; then + echo "Python3 is already installed" +else + sudo apt-get -y install python3-dev python3-pip python3-setuptools +fi + +# install python dependencies +sudo python3 -m pip install -r requirements.txt + +echo " +================================================ + +Setup done. +Running basic installation checks. + +================================================ +" + +# post-installation checks +python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" +python3 -c "import theano; print('theano version:'); print(theano.__version__)" +python3 -c "import gym; gym.make('LunarLander-v2')" +python3 -c "import gym; gym.make('SpaceInvaders-v0')" From 9bf292d9b75158aea7d19c138893713655352939 Mon Sep 17 00:00:00 2001 From: kengz Date: Wed, 12 Apr 2017 07:35:28 -0400 Subject: [PATCH 04/15] add instruction --- bin/setup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/setup b/bin/setup index 90ba73b..a1e6ccf 100755 --- a/bin/setup +++ b/bin/setup @@ -1,5 +1,7 @@ #!/bin/bash # This script runs the same sequence as the CircleCI build +# Run this as: +# bin/setup # Fail on the first error; killable by SIGINT set -e From 594aef89e90cb966109bf09c1dd112e0b12590aa Mon Sep 17 00:00:00 2001 From: kengz Date: Wed, 12 Apr 2017 07:55:07 -0400 Subject: [PATCH 05/15] improve setup --- bin/setup | 35 ++++++++++++++++++++++++++++++----- bin/setup_macOS | 37 +++++++++++++++++-------------------- bin/setup_ubuntu | 30 ++++++++++++------------------ 3 files changed, 59 insertions(+), 43 deletions(-) diff --git a/bin/setup b/bin/setup index a1e6ccf..b6f9e9e 100755 --- a/bin/setup +++ b/bin/setup @@ -8,22 +8,22 @@ set -e trap "exit" INT -echo " +read -p " ================================================ Welcome to the OpenAI Lab setup script; -please run this as sudo, -or inspect bin/setup_ubuntu or bin/setup_macOS and run the lines manually. +This will invoke sudo; alternatively, +inspect bin/setup_ubuntu or bin/setup_macOS and run the lines manually. + +Press enter to continue, Ctrl+c to quit: ================================================ " - # copy keys file if not already exist BIN_DIR=`pwd`/bin $BIN_DIR/copy-config - # determine if is Mac OSX, or Linux; then run accordingly if [ $(uname) == "Darwin" ]; # Mac runs below @@ -34,3 +34,28 @@ else ( $BIN_DIR/setup_ubuntu; ); fi + + +echo " +================================================ + +Setup done. +Running basic installation checks. + +================================================ +" + +# post-installation checks +python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" +python3 -c "import theano; print('theano version:'); print(theano.__version__)" +python3 -c "import gym; gym.make('LunarLander-v2')" +python3 -c "import gym; gym.make('SpaceInvaders-v0')" + + +echo " +================================================ + +Installation complete. + +================================================ +" \ No newline at end of file diff --git a/bin/setup_macOS b/bin/setup_macOS index f921896..1bd1002 100755 --- a/bin/setup_macOS +++ b/bin/setup_macOS @@ -19,11 +19,18 @@ else fi # system dependencies for full openai gym -brew install cmake boost boost-python sdl2 swig wget +hb_list=(cmake boost boost-python sdl2 swig wget) +for item in "${hb_list[@]}"; do + brew info "${item}" | grep --quiet 'Not installed' && brew install "${item}" +done # install noti for auto-notification -curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.darwin-amd64.tar.gz | tar -xz -sudo mv noti /usr/local/bin/ +if which noti >/dev/null; then + echo "Noti is already installed" +else + curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.darwin-amd64.tar.gz | tar -xz + sudo mv noti /usr/local/bin/ +fi # install nodejs (for npm and file watcher) if which node >/dev/null; then @@ -31,8 +38,13 @@ if which node >/dev/null; then else brew install node fi -npm install -sudo npm i -g grunt-cli +# install npm modules +if [ -d ./node_modules ]; then + echo "Npm modules already installed" +else + npm install + sudo npm i -g grunt-cli +fi # install python3 if which python3 >/dev/null; then @@ -43,18 +55,3 @@ fi # install python dependencies sudo python3 -m pip install -r requirements.txt - -echo " -================================================ - -Setup done. -Running basic installation checks. - -================================================ -" - -# post-installation checks -python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" -python3 -c "import theano; print('theano version:'); print(theano.__version__)" -python3 -c "import gym; gym.make('LunarLander-v2')" -python3 -c "import gym; gym.make('SpaceInvaders-v0')" diff --git a/bin/setup_ubuntu b/bin/setup_ubuntu index f4a29ae..c93ba29 100644 --- a/bin/setup_ubuntu +++ b/bin/setup_ubuntu @@ -13,8 +13,12 @@ sudo apt-get install -y gcc-4.9 g++-4.9 libhdf5-dev libopenblas-dev git sudo apt-get install -y cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig # install noti for auto-notification -curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.linux-amd64.tar.gz | tar -xz +if which noti >/dev/null; then + echo "Noti is already installed" +else + curl -L https://github.com/variadico/noti/releases/download/v2.5.0/noti2.5.0.linux-amd64.tar.gz | tar -xz sudo mv noti /usr/bin/ +fi # install nodejs (for npm and file watcher) if which node >/dev/null; then @@ -23,8 +27,13 @@ else curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - sudo apt-get install -y nodejs fi -npm install -sudo npm i -g grunt-cli +# install npm modules +if [ -d ./node_modules ]; then + echo "Npm modules already installed" +else + npm install + sudo npm i -g grunt-cli +fi # install python3 if which python3 >/dev/null; then @@ -35,18 +44,3 @@ fi # install python dependencies sudo python3 -m pip install -r requirements.txt - -echo " -================================================ - -Setup done. -Running basic installation checks. - -================================================ -" - -# post-installation checks -python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" -python3 -c "import theano; print('theano version:'); print(theano.__version__)" -python3 -c "import gym; gym.make('LunarLander-v2')" -python3 -c "import gym; gym.make('SpaceInvaders-v0')" From 84bb5b547e7015c5b348ba52b4a8bed8cc19701d Mon Sep 17 00:00:00 2001 From: kengz Date: Wed, 12 Apr 2017 07:58:35 -0400 Subject: [PATCH 06/15] remove theano from auto install --- bin/setup | 2 +- bin/setup_macOS | 6 ------ requirements.txt | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/bin/setup b/bin/setup index b6f9e9e..bd28a81 100755 --- a/bin/setup +++ b/bin/setup @@ -3,6 +3,7 @@ # Run this as: # bin/setup + # Fail on the first error; killable by SIGINT set -e trap "exit" INT @@ -47,7 +48,6 @@ Running basic installation checks. # post-installation checks python3 -c "import tensorflow; print('tensorflow version:'); print(tensorflow.__version__)" -python3 -c "import theano; print('theano version:'); print(theano.__version__)" python3 -c "import gym; gym.make('LunarLander-v2')" python3 -c "import gym; gym.make('SpaceInvaders-v0')" diff --git a/bin/setup_macOS b/bin/setup_macOS index 1bd1002..4d93d50 100755 --- a/bin/setup_macOS +++ b/bin/setup_macOS @@ -12,12 +12,6 @@ else ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi -if which clang >/dev/null; then - echo "clang is already installed" -else - brew install --with-clang llvm -fi - # system dependencies for full openai gym hb_list=(cmake boost boost-python sdl2 swig wget) for item in "${hb_list[@]}"; do diff --git a/requirements.txt b/requirements.txt index 5cbcca5..c78cb96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,5 @@ pytest-cov>=2.3.1 pytest-xdist>=1.15.0 codacy-coverage>=1.3.3 tensorflow>=1.0.0 -Theano>=0.8.2 Keras>=1.2.2,<2.0.0 -e git+https://github.com/kengz/gym.git#egg=gym[all] From d6c7bec16b7390276b27b4248796c2126e3c15ce Mon Sep 17 00:00:00 2001 From: kengz Date: Wed, 12 Apr 2017 08:41:19 -0400 Subject: [PATCH 07/15] shorten node setup --- bin/setup_macOS | 3 +-- bin/setup_ubuntu | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/setup_macOS b/bin/setup_macOS index 4d93d50..c82fe1e 100755 --- a/bin/setup_macOS +++ b/bin/setup_macOS @@ -36,8 +36,7 @@ fi if [ -d ./node_modules ]; then echo "Npm modules already installed" else - npm install - sudo npm i -g grunt-cli + npm install; sudo npm i -g grunt-cli fi # install python3 diff --git a/bin/setup_ubuntu b/bin/setup_ubuntu index c93ba29..e2c0973 100644 --- a/bin/setup_ubuntu +++ b/bin/setup_ubuntu @@ -31,8 +31,7 @@ fi if [ -d ./node_modules ]; then echo "Npm modules already installed" else - npm install - sudo npm i -g grunt-cli + npm install; sudo npm i -g grunt-cli fi # install python3 From 3ee9e1703c5e543106d155a82a5ef633bc4f0787 Mon Sep 17 00:00:00 2001 From: lgraesser Date: Wed, 12 Apr 2017 23:32:21 -0400 Subject: [PATCH 08/15] Adding conda .yml file --- environment.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 environment.yml diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..879d27d --- /dev/null +++ b/environment.yml @@ -0,0 +1,23 @@ +name: openai_lab +channels: + - conda-forge +dependencies: +- python>=3.5 +- anaconda +- six +- h5py +- matplotlib==1.4.3 +- seaborn>=0.7.1 +- Pillow>=3.3.1 +- PyOpenGL>=3.1.0 +- glances>=2.6.2 +- pytest-cov>=2.3.1 +- pytest-xdist>=1.15.0 +- pip: + - codacy-coverage>=1.3.3 + - mem_top==0.1.5 + - atari_py>=0.0.18 + - cmake==0.6.0 + - tensorflow>=1.0.0 + - Keras>=1.2.2,<2.0.0 + - "--editable=git+https://github.com/kengz/gym.git#egg=gym[all]" \ No newline at end of file From 515ff8c8091fecd92ca640f76803cd4d5d5a3072 Mon Sep 17 00:00:00 2001 From: kengz Date: Thu, 13 Apr 2017 08:04:32 -0400 Subject: [PATCH 09/15] add quickstart_dqn spec for doc --- config/example-default.json | 3 +-- rl/spec/classic_experiment_specs.json | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/config/example-default.json b/config/example-default.json index c3bc399..9d94fcd 100644 --- a/config/example-default.json +++ b/config/example-default.json @@ -3,7 +3,6 @@ "NOTI_SLACK_DEST": "#rl-monitor", "NOTI_SLACK_TOK": "GET_SLACK_BOT_TOKEN_FROM_https://my.slack.com/services/new/bot", "experiments": [ - "dev_dqn", - "dqn" + "quickstart_dqn" ] } diff --git a/rl/spec/classic_experiment_specs.json b/rl/spec/classic_experiment_specs.json index 58fe583..3658017 100644 --- a/rl/spec/classic_experiment_specs.json +++ b/rl/spec/classic_experiment_specs.json @@ -1,4 +1,27 @@ { + "quickstart_dqn": { + "problem": "CartPole-v0", + "Agent": "DQN", + "HyperOptimizer": "GridSearch", + "Memory": "LinearMemoryWithForgetting", + "Optimizer": "AdamOptimizer", + "Policy": "BoltzmannPolicy", + "PreProcessor": "NoPreProcessor", + "param": { + "lr": 0.02, + "gamma": 0.99, + "hidden_layers": [64], + "hidden_layers_activation": "sigmoid", + "exploration_anneal_episodes": 10 + }, + "param_range": { + "lr": [0.001, 0.01], + "hidden_layers": [ + [32], + [64] + ] + } + }, "dqn_epsilon": { "problem": "CartPole-v0", "Agent": "DQN", From ffba9a1c221c0333ca156dfe4ede2d99131bed98 Mon Sep 17 00:00:00 2001 From: kengz Date: Thu, 13 Apr 2017 08:10:50 -0400 Subject: [PATCH 10/15] update gitignore for env files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c9b7d96..fad75a6 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,8 @@ htmlcov/ venv/ ENV/ .env/ +openai_lab/ +src/ node_modules/ From 8f9ac812879616d00905b9336eb1eaa86502b4d2 Mon Sep 17 00:00:00 2001 From: kengz Date: Thu, 13 Apr 2017 08:40:56 -0400 Subject: [PATCH 11/15] update circle.yml build to use the latest install --- circle.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/circle.yml b/circle.yml index e7529bd..4f42175 100644 --- a/circle.yml +++ b/circle.yml @@ -6,13 +6,10 @@ dependencies: pre: - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update - sudo apt-get install -y gcc-4.9 g++-4.9 libhdf5-dev libopenblas-dev git python3-dev python3-setuptools + - sudo apt-get install -y cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig - pip install -U pip - - pip install six h5py numpy scipy matplotlib seaborn pandas atari_py Pillow PyOpenGL glances mem_top pytest-cov pytest-xdist codacy-coverage override: - - pip install tensorflow - - pip install theano - - pip install keras - - git clone https://github.com/openai/gym.git && cd gym && pip install -e .[all] && cd .. + - pip install -r requirements.txt - mkdir ~/.keras && cp ./config/keras.json ~/.keras/ test: override: From eed26092d06be3f5bc76e4e8164a289b7cc96884 Mon Sep 17 00:00:00 2001 From: kengz Date: Thu, 13 Apr 2017 17:59:30 -0400 Subject: [PATCH 12/15] reactivate lunar test --- test/test_advanced.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_advanced.py b/test/test_advanced.py index 8056d23..eec9607 100644 --- a/test/test_advanced.py +++ b/test/test_advanced.py @@ -33,8 +33,6 @@ def test_mountain_dqn(cls): data_df = run('mountain_dqn') assert isinstance(data_df, pd.DataFrame) - @unittest.skipIf(environ.get('CI'), - "OpenAI Gym Box2D swigconstant error, issue #100") @classmethod def test_lunar_dqn(cls): data_df = run('lunar_dqn') From c59514006298ad5ab93f1bc02d5f5c41d0c7f8d6 Mon Sep 17 00:00:00 2001 From: kengz Date: Thu, 13 Apr 2017 20:32:18 -0400 Subject: [PATCH 13/15] add tkagg dependencies --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 4f42175..ee2f616 100644 --- a/circle.yml +++ b/circle.yml @@ -5,7 +5,7 @@ machine: dependencies: pre: - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update - - sudo apt-get install -y gcc-4.9 g++-4.9 libhdf5-dev libopenblas-dev git python3-dev python3-setuptools + - sudo apt-get install -y gcc-4.9 g++-4.9 libhdf5-dev libopenblas-dev git python3-tk tk-dev python3-dev python3-setuptools - sudo apt-get install -y cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig - pip install -U pip override: From eb84ca7b1ae40519a81fd237067b0a965febbb3c Mon Sep 17 00:00:00 2001 From: kengz Date: Fri, 14 Apr 2017 08:32:28 -0400 Subject: [PATCH 14/15] stylefix environment.yml --- environment.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/environment.yml b/environment.yml index 879d27d..b3bd707 100644 --- a/environment.yml +++ b/environment.yml @@ -14,10 +14,10 @@ dependencies: - pytest-cov>=2.3.1 - pytest-xdist>=1.15.0 - pip: - - codacy-coverage>=1.3.3 - - mem_top==0.1.5 - - atari_py>=0.0.18 - - cmake==0.6.0 - - tensorflow>=1.0.0 - - Keras>=1.2.2,<2.0.0 - - "--editable=git+https://github.com/kengz/gym.git#egg=gym[all]" \ No newline at end of file + - codacy-coverage>=1.3.3 + - mem_top==0.1.5 + - atari_py>=0.0.18 + - cmake==0.6.0 + - tensorflow>=1.0.0 + - Keras>=1.2.2,<2.0.0 + - "--editable=git+https://github.com/kengz/gym.git#egg=gym[all]" From aa930f5033db0921bbe864d39c63e93da3ac59fb Mon Sep 17 00:00:00 2001 From: kengz Date: Sat, 15 Apr 2017 17:30:00 -0400 Subject: [PATCH 15/15] integrate conda and virtualenv into grunt cmd --- Gruntfile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d12f7bc..4c5b879 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -110,9 +110,11 @@ module.exports = function(grunt) { eStr = resumeExperimentStr(eStr) } + const envCmd = 'if (conda env list | grep --quiet "openai_lab"); then echo "activating conda"; source activate openai_lab; elif [ -d ./.env ]; then echo "activating virtualenv"; source .env/bin/activate; else echo "using system python"; fi;' + // override with custom command if has 'python' - var pyCmd = _.includes(eStr, 'python') ? eStr : `python3 main.py${bestCmd()}${debugCmd()}${quietCmd()} -t 5 -e ${eStr}` - const cmd = `${remoteCmd()} ${pyCmd} | tee ./data/terminal.log; ${notiCmd(eStr)}` + const pyCmd = _.includes(eStr, 'python') ? eStr : `python3 main.py${bestCmd()}${debugCmd()}${quietCmd()} -t 5 -e ${eStr}` + const cmd = `${remoteCmd()} ${envCmd} ${pyCmd} | tee ./data/terminal.log; ${notiCmd(eStr)}` grunt.log.ok(`Composed command: ${cmd}`) return cmd }