Skip to content

Commit

Permalink
Import 1.50.x series code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschneider committed Jun 28, 2017
1 parent 6d56181 commit c5f6032
Show file tree
Hide file tree
Showing 207 changed files with 36,317 additions and 10,640 deletions.
39 changes: 39 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 1.0.{build}

environment:

global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\continuous-integration\\appveyor\\run_with_env.cmd"

platform:
- x64


install:
- mkdir %userprofile%\.mujoco
- curl %MUJOCO_FOR_WINDOWS% -o %userprofile%\.mujoco\mjpro.tar.gz
- curl https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN64.zip -o %userprofile%\glfw.zip
- cd %userprofile%\.mujoco\
- tar -zxvf mjpro.tar.gz
- echo "%PYTHON_VERSION% C:\Miniconda35-x64 %userprofile%"
- set PATH=C:\Miniconda35-x64;C:\Miniconda35-x64\Scripts;%PATH%
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test-environment python=3.5 numpy scipy
- activate test-environment
- SET PATH=%userprofile%\.mujoco\mjpro150\bin;%PATH%;
- SET RENDERING_OFF=1
- cd C:\projects\pymj
- pip install -r requirements.txt
- pip install -r requirements.dev.txt

build: off

test_script:
- pytest -s --verbose --durations=10 --instafail


49 changes: 49 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
generated_cymj*
_pyxbld*
dist
cache
.idea/*
*~
.*~
*#*#
*.o
*.dat
*.prof
*.lprof
*.local
.realsync
.DS_Store
**/*.egg-info
.cache
*.ckpt
*.log
.ipynb_checkpoints
venv/
.vimrc
*.settings
*.svn
.project
.pydevproject
tags
*sublime-project
*sublime-workspace
# Intermediate outputs
__pycache__
**/__pycache__
*.pb.*
*.pyc
*.swp
*.swo
# generated data
*.rdb
*.db
*.avi
# mujoco outputs
MUJOCO_LOG.TXT
model.txt
.window_data
.idea/*.xml
outputfile
tmp*
cymj.c
**/.git
105 changes: 45 additions & 60 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,64 +1,49 @@
generated_cymj*
_pyxbld*
dist
cache
.idea/*
*~
.*~
*#*#
*.o
*.dat
*.prof
*.lprof
*.local
.realsync
.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
**/*.egg-info
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.ckpt
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/


gcc-dylibs
MANIFEST
/tmp
.ipynb_checkpoints
venv/
.vimrc
*.settings
*.svn
.project
.pydevproject
tags
*sublime-project
*sublime-workspace
# Intermediate outputs
__pycache__
**/__pycache__
*.pb.*
*.pyc
*.swp
*.swo
# generated data
*.rdb
*.db
*.avi
# mujoco outputs
MUJOCO_LOG.TXT
model.txt
.window_data
.idea/*.xml
outputfile
tmp*
cymj.c
**/.git
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.5.2/envs/pymj
29 changes: 7 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
dist: trusty
sudo: required
cache:
apt: true
language: python
addons:
apt:
packages:
- python-dev
python:
- "2.7"
- "3.5"
install: pip install tox-travis
script: tox
language: generic
dist: trusty

before_install:
- Xvfb :12 -screen 0 800x600x24 +extension RANDR &
- mkdir -p ~/.mujoco
- curl https://openai-public.s3-us-west-2.amazonaws.com/mujoco/$MUJOCO_KEY_BUNDLE.tar.gz | tar xz -C ~/.mujoco
env:
- DISPLAY=:12
- curl $MUJOCO_FOR_LINUX | tar -xz ./mjkey.txt
- docker build -t image-under-test .

notifications:
slack:
secure: h/Mxm8K+avH/2W0818zCHmLloRPMFN4NJL01+VShvAkH80/acfjeq/+mMdWXXPL/oOB6kSHDk+GDhwR6+s03ZcPMn5INTFvFYqUc6UWmT+NXtOPxGTN0xda6MdYUkWQUKaMyjFrweZQOMOASFBIzPOq4XeVbM5aB8s4EJhnfAcYZhp/idwKbToVihN4KZgxlvZIFc8iEp1o9uSl5qrsaeYYYXRkb6mauacAwOo4/Chu+cOnoLUOnvhBFE3rV3doDNrbnoalO8XiExtgx5CIAYWrlMni7r2Q+LlzgwdyTH19ZtybPxJTZIIWSBQ2UtcoYdIEDcc36GcUwz1VUGg32mLJJnY2xw80CWR4ixFPpLwwP5Y99WTn8v094B4nmFTWOwNWXp3EkqtTN9XcJoRBqXB5ArucIPqrx57dOCljSKx22gL6WaF2p3stSAxIGFektGyGnisaELrFZG1C63aHoUPicj3gUlijmAoUmYaDRf6P1wnpXqBpKDAWWhAMSatvx1ekmEJgR7OQklQnnfjx9kENDUygNUWS4IQwN2qYieuzHFL3of7/30mTM43+Vt/vWN8GI7j01BXu6FNGGloHxjH1pt3bLP/+uj5BJsT2HWF+Z8XR4VE6cyVuKsQAFgCXwOkoDHALbcwsspONDIt/9ixkesgh1oFt4CzU3UuU5wYs=
on_success: change
script:
- docker run --rm image-under-test
81 changes: 51 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
FROM ubuntu:14.04
# We need the CUDA base dockerfile to enable GPU rendering
# on hosts with GPUs.
FROM nvidia/cuda:8.0-devel-ubuntu16.04

RUN apt-get update && apt-get install -y \
python2.7 \
python2.7-dev \
python-pip \
unzip \
xorg-dev \
RUN apt-get update -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
git \
libgl1-mesa-dev \
xvfb \
libxinerama1 \
libxcursor1 \
libglu1-mesa \
cmake \
gfortran \
libblas-dev \
libatlas-dev \
liblapack-dev \
libjpeg62 \
libjpeg62-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt /mujoco-py/requirements.txt
RUN pip install -r /mujoco-py/requirements.txt

COPY . /mujoco-py

ENV PYTHONPATH=/mujoco-py
WORKDIR /mujoco-py
ENTRYPOINT ["bin/docker-entrypoint.sh"]
CMD ["nosetests", "tests/"]
libgl1-mesa-glx \
libosmesa6-dev \
python3-pip \
python3-numpy \
python3-scipy \
unzip \
vim \
wget \
xpra \
xserver-xorg-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
&& chmod +x /usr/local/bin/patchelf

ENV LANG C.UTF-8

RUN mkdir -p /root/.mujoco \
&& wget https://www.roboti.us/download/mjpro150_linux.zip -O mujoco.zip \
&& unzip mujoco.zip -d /root/.mujoco \
&& rm mujoco.zip
COPY ./mjkey.txt /root/.mujoco/
ENV LD_LIBRARY_PATH /root/.mujoco/mjpro150/bin:$LD_LIBRARY_PATH

COPY vendor/Xdummy /usr/local/bin/Xdummy
RUN chmod +x /usr/local/bin/Xdummy

# Workaround for https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-375/+bug/1674677
COPY ./vendor/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json

WORKDIR /mujoco_py
# Copy over just requirements.txt at first. That way, the Docker cache doesn't
# expire until we actually change the requirements.
COPY ./requirements.txt /mujoco_py/
COPY ./requirements.dev.txt /mujoco_py/
RUN pip3 install -r requirements.txt
RUN pip3 install -r requirements.dev.txt

# Delay moving in the entire code until the very end.
ENTRYPOINT ["/mujoco_py/vendor/Xdummy-entrypoint"]
CMD ["pytest"]
COPY . /mujoco_py
RUN python3 setup.py install
17 changes: 16 additions & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# mujoco-py

The MIT License

Copyright (c) 2016 OpenAI (http://openai.com)
Copyright (c) 2017 OpenAI (http://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,3 +21,16 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

# Mujoco models
This work is derived from [MuJuCo models](http://www.mujoco.org/forum/index.php?resources/) used under the following license:
```
This file is part of MuJoCo.
Copyright 2009-2015 Roboti LLC.
Mujoco :: Advanced physics simulation engine
Source : www.roboti.us
Version : 1.31
Released : 23Apr16
Author :: Vikash Kumar
Contacts : [email protected]
```
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include requirements.txt
include requirements.dev.txt
recursive-include mujoco_py *.h *.py *.pyx *.pxd *.pxi *.xml *.c *.so
include mujoco_py/gl/*.c
include setup.py
36 changes: 34 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
.PHONY: all clean build test mount_shell shell upload check-env

MUJOCO_LICENSE_PATH ?= ~/.mujoco/mjkey.txt

all: test

clean:
rm -rf mujoco_py.egg-info
rm -rf */__pycache__
rm -rf */*/__pycache__
rm -rf mujoco_py/generated/_pyxbld*
rm -rf mujoco_py/generated_cymj*
rm -rf mujoco_py/cythonlock_*.pyc
rm -rf dist
rm -rf build

build: check-license
cp $(MUJOCO_LICENSE_PATH) mjkey.txt
docker build -t mujoco_py . || rm mjkey.txt && rm mjkey.txt

test: build
# run it interactive mode so we can abort with CTRL+C
docker run --rm -i mujoco_py pytest

mount_shell:
docker run --rm -it -v `pwd`:/dev mujoco_py /bin/bash -c "pip uninstall -y mujoco_py; rm -rf /mujoco_py; (cd /dev; /bin/bash)"

shell:
docker run --rm -it mujoco_py /bin/bash

upload:
rm -rf dist
python setup.py sdist
twine upload dist/*

test:
nose2
check-license:
ifeq ("","$(wildcard $(MUJOCO_LICENSE_PATH))")
$(error "License key not found at location $(MUJOCO_LICENSE_PATH). Use MUJOCO_LICENSE_PATH to specify its path")
endif
Loading

0 comments on commit c5f6032

Please sign in to comment.