-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from kengz/installation
Installation update
- Loading branch information
Showing
11 changed files
with
211 additions
and
106 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 |
---|---|---|
|
@@ -34,6 +34,9 @@ htmlcov/ | |
.coverage | ||
venv/ | ||
ENV/ | ||
.env/ | ||
openai_lab/ | ||
src/ | ||
|
||
node_modules/ | ||
|
||
|
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
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 |
---|---|---|
@@ -1,114 +1,61 @@ | ||
#!/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 | ||
trap "exit" INT | ||
|
||
|
||
read -p " | ||
================================================ | ||
Welcome to the OpenAI Lab setup script; | ||
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 | ||
|
||
# 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 | ||
# 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 | ||
|
||
# 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 | ||
echo " | ||
================================================ | ||
# install npm modules | ||
if [ -d ./node_modules ]; then | ||
echo "Npm modules already installed" | ||
else | ||
npm install | ||
sudo npm i -g grunt-cli | ||
fi | ||
Setup done. | ||
Running basic installation checks. | ||
# 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 | ||
================================================ | ||
" | ||
|
||
# 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 | ||
# post-installation checks | ||
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__)" | ||
|
||
# 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 | ||
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')" | ||
|
||
|
||
echo " | ||
================================================ | ||
Installation complete. | ||
================================================ | ||
" |
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,50 @@ | ||
#!/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 | ||
|
||
# system dependencies for full openai gym | ||
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 | ||
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 | ||
echo "Nodejs is already installed" | ||
else | ||
brew install node | ||
fi | ||
# 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 | ||
echo "Python3 is already installed" | ||
else | ||
brew install python3 | ||
fi | ||
|
||
# install python dependencies | ||
sudo python3 -m pip install -r requirements.txt |
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,45 @@ | ||
#!/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 | ||
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 | ||
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 | ||
# 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 | ||
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 |
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
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
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 @@ | ||
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]" |
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,18 @@ | ||
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 | ||
Keras>=1.2.2,<2.0.0 | ||
-e git+https://github.com/kengz/gym.git#egg=gym[all] |
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
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