Skip to content

Commit

Permalink
Merge pull request #29 from rdnfn/dev/general
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
rdnfn authored Mar 28, 2022
2 parents 61668bd + 5869c49 commit 27fdc4f
Show file tree
Hide file tree
Showing 57 changed files with 1,631 additions and 508 deletions.
8 changes: 5 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
COPY requirements/dev_requirements.txt requirements/doc_requirements.txt /tmp/pip-tmp/
RUN pip3 install --upgrade pip
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev_requirements.txt \
-r /tmp/pip-tmp/doc_requirements.txt \
&& rm -rf /tmp/pip-tmp

# Install nvidia container runtime
RUN wget -O tmp/nvidia-container-toolkit.deb https://nvidia.github.io/libnvidia-container/stable/debian10/amd64/nvidia-container-toolkit_1.7.0-1_amd64.deb \
# [Optional] install nvidia container runtime (custom to beobench, this enables gpu-using containers within devcontainer)
ARG NVIDIA_SUPPORT="none"
RUN if [ "${NVIDIA_SUPPORT}" != "none" ]; then wget -O tmp/nvidia-container-toolkit.deb https://nvidia.github.io/libnvidia-container/stable/debian10/amd64/nvidia-container-toolkit_1.7.0-1_amd64.deb \
&& wget -O tmp/nvidia-container-tools.deb https://nvidia.github.io/libnvidia-container/stable/debian10/amd64/libnvidia-container-tools_1.7.0-1_amd64.deb \
&& wget -O tmp/libnvidia-container.deb https://nvidia.github.io/libnvidia-container/stable/debian10/amd64/libnvidia-container1_1.7.0-1_amd64.deb \
&& dpkg --install --recursive tmp \
&& rm tmp/nvidia-container-toolkit.deb
&& rm tmp/nvidia-container-toolkit.deb; fi



Expand Down
29 changes: 16 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/python-3
{
"name": "beobench dev (python3.10)",
"name": "beobench_devcontainer",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.8",
// Note: ray[rllib] is not available on debian 11 (bullseye)
"VARIANT": "3.9-bullseye",
// Options
"NODE_VERSION": "none"
"NODE_VERSION": "none",
"NVIDIA_SUPPORT": "none"
}
},
"workspaceFolder": "/workspace",
"workspaceFolder": "/beobench",
// "workspaceMount": "source=remote-workspace,target=/workspace,type=volume",
// ADAPT: the mount must be adapted to cloned repo location
"workspaceMount": "source=/home/rdnfn-docker/main/repos/github/beobench/,target=/workspace/beobench/,type=bind,consistency=cached",
"workspaceMount": "source=${localWorkspaceFolder},target=/beobench,type=bind,consistency=cached",
// ADAPT: the mount must be adapted to the gitconfig location on the remote machine
"mounts": [
"source=/home/rdnfn-docker/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached",
"source=/home/rdnfn-docker/main/repos/github/beobench_contrib,target=/workspace/beobench_contrib/,type=bind,consistency=cached"
],
"postCreateCommand": "cd ./beobench && pip install -e .",
//"mounts": [
// "source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached",
//],
//"initializeCommand": "export DOCKER_BUILDKIT=0 && export COMPOSE_DOCKER_CLI_BUILD=0",
"postCreateCommand": "pip install -e .",
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
Expand Down Expand Up @@ -52,7 +54,8 @@
"ms-azuretools.vscode-docker",
"trond-snekvik.simple-rst",
"lextudio.restructuredtext",
"njpwerner.autodocstring"
"njpwerner.autodocstring",
"donjayamanne.githistory",
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
Expand All @@ -65,7 +68,7 @@
"docker-in-docker": "20.10"
},
"runArgs": [
"--shm-size=32gb",
"--gpus=all"
//"--shm-size=32gb",
//"--gpus=all",
]
}
74 changes: 74 additions & 0 deletions .devcontainer/remote/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/python-3
{
"name": "beobench_devcontainer_remote",
"build": {
"dockerfile": "../../Dockerfile",
"context": "../../..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.9",
// Options
"NODE_VERSION": "none",
"NVIDIA_SUPPORT": "True",
}
},
"workspaceFolder": "/beobench",
// "workspaceMount": "source=remote-workspace,target=/workspace,type=volume",
// ADAPT: the mount must be adapted to cloned repo location
"workspaceMount": "source=/home/rdnfn-docker/main/repos/github/beobench/,target=/beobench/,type=bind,consistency=cached",
// ADAPT: the mount must be adapted to the gitconfig location on the remote machine
"mounts": [
"source=/home/rdnfn-docker/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached",
],
"postCreateCommand": "pip install -e .",
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"files.trimTrailingWhitespace": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"editor.rulers": [
88
]
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"trond-snekvik.simple-rst",
"lextudio.restructuredtext",
"njpwerner.autodocstring"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode",
"features": {
"git": "latest",
"docker-in-docker": {
"version": "latest",
"moby": true
}
},
"runArgs": [
"--shm-size=32gb",
"--gpus=all",
]
}
13 changes: 3 additions & 10 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
* beobench version:
* Python version:
* Operating System:

### Description
### Problem

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

### What I Did
### Potential Solution

```
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```
Describe a potential solution to the problem, if you have any.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "beobench_contrib"]
path = beobench_contrib
url = https://github.com/rdnfn/beobench_contrib.git
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ python:
install:
- method: pip
path: .
- requirements: requirements/doc_requirements.txt
- requirements: requirements/doc_requirements.txt

# Ensure the beobench_contrib submodule is included
submodules:
include: all
17 changes: 4 additions & 13 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
=======
Credits
=======

Development Lead
----------------

* rdnfn <->

Contributors
------------

None yet. Why not be the first?
Code Contributors
-----------------
* Arduin Findeis (https://github.com/rdnfn)
* Scott Jeen (https://github.com/enjeeneer)
30 changes: 10 additions & 20 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,28 @@ Get Started!

Ready to contribute? Here's how to set up `beobench` for local development.

1. Fork the `beobench` repo on GitHub.
2. Clone your fork locally::
1. Follow :doc:`this guide <guides/dev_env>` to fork the repo and setup the development environment.

$ git clone git@github.com:your_name_here/beobench.git
2. Inside the devcontainer just set up, create a branch for local development::

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv beobench
$ cd beobench/
$ python setup.py develop

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature
$ git checkout -b dev/name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
3. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::

$ flake8 beobench tests
$ python setup.py test or pytest
$ python setup.py test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::
4. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.
5. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------
Expand All @@ -102,8 +91,9 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
https://travis-ci.com/rdnfn/beobench/pull_requests
.. 3. The pull request should work for Python 3.6, 3.7, 3.8 and 3.9.
.. Check https://travis-ci.com/rdnfn/beobench/pull_requests
and make sure that the tests pass for all supported Python versions.
Tips
Expand Down
12 changes: 12 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
History
=======

0.4.0 (2022-03-28)
------------------

* Make dependencies that are only used inside experiment/gym containers optional (for all dependencies install via ``pip install beobench[extended]``)
* Add two part experiment image build process so that there is shared beobench installation dockerfile
* Add support for yaml config files (!)
* Overhaul of documentation, including new envs page and new theme
* Enable RLlib free experiment containers when not required
* Add beobench_contrib as submodule
* Simplify Pypi readme file
* Remove GPU requirement for devcontainer

0.3.0 (2022-02-14)
------------------

Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
recursive-include beobench/experiment/definitions *

recursive-exclude docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
83 changes: 1 addition & 82 deletions PYPI_README.rst
Original file line number Diff line number Diff line change
@@ -1,84 +1,3 @@
.. image:: https://github.com/rdnfn/beobench/raw/master/docs/_static/beobench_logo.png
:align: center
:width: 300 px
:alt: Beobench

.. start-in-sphinx-docs
.. image:: https://img.shields.io/pypi/v/beobench.svg
:target: https://pypi.python.org/pypi/beobench

.. image:: https://readthedocs.org/projects/beobench/badge/?version=latest
:target: https://beobench.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status

.. image:: https://img.shields.io/badge/License-MIT-blue.svg
:target: https://opensource.org/licenses/MIT
:alt: License

A toolbox for benchmarking reinforcement learning (RL) algorithms on building energy optimisation (BEO) problems. Beobench tries to make working on RL for BEO easier: it provides simple access to existing libraries defining BEO problems (such as `BOPTEST <https://github.com/ibpsa/project1-boptest>`_) and provides a large set of pre-configured RL algorithms. Beobench is *not* a gym library itself - instead it leverages the brilliant work done by many existing gym-type projects and makes their work more easily accessible.

Features
--------

*Some of the features are work in progress*

Main features

- *RL algorithm collection:* what's the best RL method for your BEO problem? Building on `Ray RLlib <https://github.com/ray-project/ray/tree/master/rllib>`_, beobench provides a large collection of pre-configured RL algorithm experiments that can be easily applied to your new BEO problem.
- *Problem collection:* beobench provides ready-to-use docker containers for popular BEO gym-type problem libraries. By enforcing a strict OpenAI ``gym.Env`` it makes testing your method on different libraries easy.

Additional features

- *Experiment logging:* log experiment results in a reproducible and shareable manner via `Weights and Biases`_.
- *Hyperparameter tuning:* easily tune hyperparameters using the extensive `Ray Tune Search API <https://docs.ray.io/en/master/tune/index.html>`_.
- *Simple installation:* beobench can be installed via pip and only requires docker as an additional non-python dependency.
- *Easily extendable:* beobench is designed for the user to add both environments and methods.

.. _Weights and Biases: https://wandb.ai/

.. end-in-sphinx-docs
.. start-quickstart
Quickstart
----------

Run your first beobench experiment in three steps:

1. `Install docker <https://docs.docker.com/get-docker/>`_ on your machine (if on Linux, check the `additional installation steps <https://beobench.readthedocs.io/en/latest/guides/installation_linux.html>`_)
2. Install *beobench* using:

.. code-block:: console
pip install beobench
3. Finally, start your first experiment using:

.. code-block:: console
python -m beobench.experiment.scheduler
Done, you have just started your first experiment... congrats! Check out the `full getting started guide in the documentation <https://beobench.readthedocs.io/en/latest/guides/getting_started.html>`_ for the next steps.

.. end-quickstart
Documentation
-------------
https://beobench.readthedocs.io

License
-------
MIT license



Credits
-------

This package was originally created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

For more information go to the `documentation <https://beobench.readthedocs.io/>`_ and the `GitHub code repository <https://github.com/rdnfn/beobench>`_.
Loading

0 comments on commit 27fdc4f

Please sign in to comment.