Skip to content

Commit c5f6032

Browse files
Import 1.50.x series code
1 parent 6d56181 commit c5f6032

File tree

207 files changed

+36317
-10640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+36317
-10640
lines changed

.appveyor.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 1.0.{build}
2+
3+
environment:
4+
5+
global:
6+
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
7+
# /E:ON and /V:ON options are not enabled in the batch script intepreter
8+
# See: http://stackoverflow.com/a/13751649/163740
9+
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\continuous-integration\\appveyor\\run_with_env.cmd"
10+
11+
platform:
12+
- x64
13+
14+
15+
install:
16+
- mkdir %userprofile%\.mujoco
17+
- curl %MUJOCO_FOR_WINDOWS% -o %userprofile%\.mujoco\mjpro.tar.gz
18+
- curl https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN64.zip -o %userprofile%\glfw.zip
19+
- cd %userprofile%\.mujoco\
20+
- tar -zxvf mjpro.tar.gz
21+
- echo "%PYTHON_VERSION% C:\Miniconda35-x64 %userprofile%"
22+
- set PATH=C:\Miniconda35-x64;C:\Miniconda35-x64\Scripts;%PATH%
23+
- conda config --set always_yes yes --set changeps1 no
24+
- conda update -q conda
25+
- conda info -a
26+
- conda create -q -n test-environment python=3.5 numpy scipy
27+
- activate test-environment
28+
- SET PATH=%userprofile%\.mujoco\mjpro150\bin;%PATH%;
29+
- SET RENDERING_OFF=1
30+
- cd C:\projects\pymj
31+
- pip install -r requirements.txt
32+
- pip install -r requirements.dev.txt
33+
34+
build: off
35+
36+
test_script:
37+
- pytest -s --verbose --durations=10 --instafail
38+
39+

.dockerignore

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
generated_cymj*
2+
_pyxbld*
3+
dist
4+
cache
5+
.idea/*
6+
*~
7+
.*~
8+
*#*#
9+
*.o
10+
*.dat
11+
*.prof
12+
*.lprof
13+
*.local
14+
.realsync
15+
.DS_Store
16+
**/*.egg-info
17+
.cache
18+
*.ckpt
19+
*.log
20+
.ipynb_checkpoints
21+
venv/
22+
.vimrc
23+
*.settings
24+
*.svn
25+
.project
26+
.pydevproject
27+
tags
28+
*sublime-project
29+
*sublime-workspace
30+
# Intermediate outputs
31+
__pycache__
32+
**/__pycache__
33+
*.pb.*
34+
*.pyc
35+
*.swp
36+
*.swo
37+
# generated data
38+
*.rdb
39+
*.db
40+
*.avi
41+
# mujoco outputs
42+
MUJOCO_LOG.TXT
43+
model.txt
44+
.window_data
45+
.idea/*.xml
46+
outputfile
47+
tmp*
48+
cymj.c
49+
**/.git

.gitignore

100644100755
+45-60
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,49 @@
1+
generated_cymj*
2+
_pyxbld*
3+
dist
4+
cache
5+
.idea/*
6+
*~
7+
.*~
8+
*#*#
9+
*.o
10+
*.dat
11+
*.prof
12+
*.lprof
13+
*.local
14+
.realsync
115
.DS_Store
2-
3-
# Byte-compiled / optimized / DLL files
4-
__pycache__/
5-
*.py[cod]
6-
*$py.class
7-
8-
# Distribution / packaging
9-
.Python
10-
env/
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
*.egg-info/
23-
.installed.cfg
24-
*.egg
25-
26-
# PyInstaller
27-
# Usually these files are written by a python script from a template
28-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29-
*.manifest
30-
*.spec
31-
32-
# Installer logs
33-
pip-log.txt
34-
pip-delete-this-directory.txt
35-
36-
# Unit test / coverage reports
37-
htmlcov/
38-
.tox/
39-
.coverage
40-
.coverage.*
16+
**/*.egg-info
4117
.cache
42-
nosetests.xml
43-
coverage.xml
44-
*,cover
45-
.hypothesis/
46-
47-
# Translations
48-
*.mo
49-
*.pot
50-
51-
# Django stuff:
18+
*.ckpt
5219
*.log
53-
54-
# Sphinx documentation
55-
docs/_build/
56-
57-
# PyBuilder
58-
target/
59-
60-
61-
gcc-dylibs
62-
MANIFEST
63-
/tmp
20+
.ipynb_checkpoints
21+
venv/
22+
.vimrc
23+
*.settings
24+
*.svn
25+
.project
26+
.pydevproject
27+
tags
28+
*sublime-project
29+
*sublime-workspace
30+
# Intermediate outputs
31+
__pycache__
32+
**/__pycache__
33+
*.pb.*
34+
*.pyc
35+
*.swp
36+
*.swo
37+
# generated data
38+
*.rdb
39+
*.db
40+
*.avi
41+
# mujoco outputs
6442
MUJOCO_LOG.TXT
43+
model.txt
44+
.window_data
45+
.idea/*.xml
46+
outputfile
47+
tmp*
48+
cymj.c
49+
**/.git

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.5.2/envs/pymj

.travis.yml

+7-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
dist: trusty
21
sudo: required
3-
cache:
4-
apt: true
5-
language: python
6-
addons:
7-
apt:
8-
packages:
9-
- python-dev
10-
python:
11-
- "2.7"
12-
- "3.5"
13-
install: pip install tox-travis
14-
script: tox
2+
language: generic
3+
dist: trusty
4+
155
before_install:
16-
- Xvfb :12 -screen 0 800x600x24 +extension RANDR &
17-
- mkdir -p ~/.mujoco
18-
- curl https://openai-public.s3-us-west-2.amazonaws.com/mujoco/$MUJOCO_KEY_BUNDLE.tar.gz | tar xz -C ~/.mujoco
19-
env:
20-
- DISPLAY=:12
6+
- curl $MUJOCO_FOR_LINUX | tar -xz ./mjkey.txt
7+
- docker build -t image-under-test .
218

22-
notifications:
23-
slack:
24-
secure: h/Mxm8K+avH/2W0818zCHmLloRPMFN4NJL01+VShvAkH80/acfjeq/+mMdWXXPL/oOB6kSHDk+GDhwR6+s03ZcPMn5INTFvFYqUc6UWmT+NXtOPxGTN0xda6MdYUkWQUKaMyjFrweZQOMOASFBIzPOq4XeVbM5aB8s4EJhnfAcYZhp/idwKbToVihN4KZgxlvZIFc8iEp1o9uSl5qrsaeYYYXRkb6mauacAwOo4/Chu+cOnoLUOnvhBFE3rV3doDNrbnoalO8XiExtgx5CIAYWrlMni7r2Q+LlzgwdyTH19ZtybPxJTZIIWSBQ2UtcoYdIEDcc36GcUwz1VUGg32mLJJnY2xw80CWR4ixFPpLwwP5Y99WTn8v094B4nmFTWOwNWXp3EkqtTN9XcJoRBqXB5ArucIPqrx57dOCljSKx22gL6WaF2p3stSAxIGFektGyGnisaELrFZG1C63aHoUPicj3gUlijmAoUmYaDRf6P1wnpXqBpKDAWWhAMSatvx1ekmEJgR7OQklQnnfjx9kENDUygNUWS4IQwN2qYieuzHFL3of7/30mTM43+Vt/vWN8GI7j01BXu6FNGGloHxjH1pt3bLP/+uj5BJsT2HWF+Z8XR4VE6cyVuKsQAFgCXwOkoDHALbcwsspONDIt/9ixkesgh1oFt4CzU3UuU5wYs=
25-
on_success: change
9+
script:
10+
- docker run --rm image-under-test

Dockerfile

+51-30
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
1-
FROM ubuntu:14.04
1+
# We need the CUDA base dockerfile to enable GPU rendering
2+
# on hosts with GPUs.
3+
FROM nvidia/cuda:8.0-devel-ubuntu16.04
24

3-
RUN apt-get update && apt-get install -y \
4-
python2.7 \
5-
python2.7-dev \
6-
python-pip \
7-
unzip \
8-
xorg-dev \
5+
RUN apt-get update -q \
6+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
7+
curl \
8+
git \
99
libgl1-mesa-dev \
10-
xvfb \
11-
libxinerama1 \
12-
libxcursor1 \
13-
libglu1-mesa \
14-
cmake \
15-
gfortran \
16-
libblas-dev \
17-
libatlas-dev \
18-
liblapack-dev \
19-
libjpeg62 \
20-
libjpeg62-dev \
21-
&& apt-get clean \
22-
&& rm -rf /var/lib/apt/lists/*
23-
24-
COPY requirements.txt /mujoco-py/requirements.txt
25-
RUN pip install -r /mujoco-py/requirements.txt
26-
27-
COPY . /mujoco-py
28-
29-
ENV PYTHONPATH=/mujoco-py
30-
WORKDIR /mujoco-py
31-
ENTRYPOINT ["bin/docker-entrypoint.sh"]
32-
CMD ["nosetests", "tests/"]
10+
libgl1-mesa-glx \
11+
libosmesa6-dev \
12+
python3-pip \
13+
python3-numpy \
14+
python3-scipy \
15+
unzip \
16+
vim \
17+
wget \
18+
xpra \
19+
xserver-xorg-dev \
20+
&& apt-get clean \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
RUN curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
24+
&& chmod +x /usr/local/bin/patchelf
25+
26+
ENV LANG C.UTF-8
27+
28+
RUN mkdir -p /root/.mujoco \
29+
&& wget https://www.roboti.us/download/mjpro150_linux.zip -O mujoco.zip \
30+
&& unzip mujoco.zip -d /root/.mujoco \
31+
&& rm mujoco.zip
32+
COPY ./mjkey.txt /root/.mujoco/
33+
ENV LD_LIBRARY_PATH /root/.mujoco/mjpro150/bin:$LD_LIBRARY_PATH
34+
35+
COPY vendor/Xdummy /usr/local/bin/Xdummy
36+
RUN chmod +x /usr/local/bin/Xdummy
37+
38+
# Workaround for https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-375/+bug/1674677
39+
COPY ./vendor/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
40+
41+
WORKDIR /mujoco_py
42+
# Copy over just requirements.txt at first. That way, the Docker cache doesn't
43+
# expire until we actually change the requirements.
44+
COPY ./requirements.txt /mujoco_py/
45+
COPY ./requirements.dev.txt /mujoco_py/
46+
RUN pip3 install -r requirements.txt
47+
RUN pip3 install -r requirements.dev.txt
48+
49+
# Delay moving in the entire code until the very end.
50+
ENTRYPOINT ["/mujoco_py/vendor/Xdummy-entrypoint"]
51+
CMD ["pytest"]
52+
COPY . /mujoco_py
53+
RUN python3 setup.py install

LICENSE LICENSE.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# mujoco-py
2+
13
The MIT License
24

3-
Copyright (c) 2016 OpenAI (http://openai.com)
5+
Copyright (c) 2017 OpenAI (http://openai.com)
46

57
Permission is hereby granted, free of charge, to any person obtaining a copy
68
of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +21,16 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1921
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2022
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2123
THE SOFTWARE.
24+
25+
# Mujoco models
26+
This work is derived from [MuJuCo models](http://www.mujoco.org/forum/index.php?resources/) used under the following license:
27+
```
28+
This file is part of MuJoCo.
29+
Copyright 2009-2015 Roboti LLC.
30+
Mujoco :: Advanced physics simulation engine
31+
Source : www.roboti.us
32+
Version : 1.31
33+
Released : 23Apr16
34+
Author :: Vikash Kumar
35+
36+
```

MANIFEST.in

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include requirements.txt
2+
include requirements.dev.txt
3+
recursive-include mujoco_py *.h *.py *.pyx *.pxd *.pxi *.xml *.c *.so
4+
include mujoco_py/gl/*.c
5+
include setup.py

Makefile

+34-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1+
.PHONY: all clean build test mount_shell shell upload check-env
2+
3+
MUJOCO_LICENSE_PATH ?= ~/.mujoco/mjkey.txt
4+
5+
all: test
6+
7+
clean:
8+
rm -rf mujoco_py.egg-info
9+
rm -rf */__pycache__
10+
rm -rf */*/__pycache__
11+
rm -rf mujoco_py/generated/_pyxbld*
12+
rm -rf mujoco_py/generated_cymj*
13+
rm -rf mujoco_py/cythonlock_*.pyc
14+
rm -rf dist
15+
rm -rf build
16+
17+
build: check-license
18+
cp $(MUJOCO_LICENSE_PATH) mjkey.txt
19+
docker build -t mujoco_py . || rm mjkey.txt && rm mjkey.txt
20+
21+
test: build
22+
# run it interactive mode so we can abort with CTRL+C
23+
docker run --rm -i mujoco_py pytest
24+
25+
mount_shell:
26+
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)"
27+
28+
shell:
29+
docker run --rm -it mujoco_py /bin/bash
30+
131
upload:
232
rm -rf dist
333
python setup.py sdist
434
twine upload dist/*
535

6-
test:
7-
nose2
36+
check-license:
37+
ifeq ("","$(wildcard $(MUJOCO_LICENSE_PATH))")
38+
$(error "License key not found at location $(MUJOCO_LICENSE_PATH). Use MUJOCO_LICENSE_PATH to specify its path")
39+
endif

0 commit comments

Comments
 (0)