Skip to content

Commit 257a40e

Browse files
authored
Add Gitlab CI (#12)
* Test gitlab-ci * Try different image * Add pytest and doc build * Fix command * Fix image used for CI * Seperate pytest builds * Fix weird seg fault in docker image due to FakeImageEnv * Fix make command * [ci skip] Add space in the badges * Fix CI failures * Re-install opencv * Use opencv-headless * Test with new docker image
1 parent a06c4a7 commit 257a40e

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

.gitlab-ci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
image: stablebaselines/stable-baselines3-cpu:0.6.0a7
2+
3+
type-check:
4+
script:
5+
- make type
6+
7+
pytest:
8+
script:
9+
# MKL_THREADING_LAYER=GNU to avoid MKL_THREADING_LAYER=INTEL incompatibility error
10+
- MKL_THREADING_LAYER=GNU make pytest
11+
12+
doc-build:
13+
script:
14+
- make doc

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ COPY ./stable_baselines3/version.txt ${CODE_DIR}/stable-baselines3/stable_baseli
3232
RUN \
3333
cd ${CODE_DIR}/stable-baselines3 3&& \
3434
pip install -e .[extra,tests,docs] && \
35+
# Use headless version for docker
36+
pip install opencv-python-headless && \
3537
rm -rf $HOME/.cache/pip
3638

3739

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<img src="docs/\_static/img/logo.png" align="right" width="40%"/>
22

3-
<!-- [![Build Status](https://travis-ci.com/hill-a/stable-baselines.svg?branch=master)](https://travis-ci.com/hill-a/stable-baselines)
4-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3bcb4cd6d76a4270acb16b5fe6dd9efa)](https://www.codacy.com/app/baselines_janitors/stable-baselines?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=hill-a/stable-baselines&amp;utm_campaign=Badge_Grade)
5-
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/3bcb4cd6d76a4270acb16b5fe6dd9efa)](https://www.codacy.com/app/baselines_janitors/stable-baselines?utm_source=github.com&utm_medium=referral&utm_content=hill-a/stable-baselines&utm_campaign=Badge_Coverage) -->
3+
[![pipeline status](https://gitlab.com/araffin/stable-baselines3/badges/master/pipeline.svg)](https://gitlab.com/araffin/stable-baselines3/-/commits/master) [![Documentation Status](https://readthedocs.org/projects/stable-baselines/badge/?version=master)](https://stable-baselines3.readthedocs.io/en/master/?badge=master) [![coverage report](https://gitlab.com/araffin/stable-baselines3/badges/master/coverage.svg)](https://gitlab.com/araffin/stable-baselines3/-/commits/master)
64

7-
[![Documentation Status](https://readthedocs.org/projects/stable-baselines/badge/?version=master)](https://stable-baselines3.readthedocs.io/en/master/?badge=master)
85

96
**WARNING: Stable Baselines3 is currently in a beta version, breaking changes may occur before 1.0 is released**
107

docs/misc/changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Bug Fixes:
2222
^^^^^^^^^^
2323
- Fixed a bug that prevented model trained on cpu to be loaded on gpu
2424
- Fixed version number that had a new line included
25+
- Fixed weird seg fault in docker image due to FakeImageEnv by reducing screen size
2526

2627
Deprecations:
2728
^^^^^^^^^^^^^

stable_baselines3/common/identity_env.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ class FakeImageEnv(Env):
121121
:param discrete: (bool)
122122
"""
123123
def __init__(self, action_dim: int = 6,
124-
screen_height: int = 210,
125-
screen_width: int = 160,
126-
n_channels: int = 3,
124+
screen_height: int = 84,
125+
screen_width: int = 84,
126+
n_channels: int = 1,
127127
discrete: bool = True):
128128

129129
self.observation_space = Box(low=0, high=255, shape=(screen_height, screen_width,

tests/test_distributions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def test_sde_distribution():
5555
dist = dist.proba_distribution(deterministic_actions, log_std, state)
5656
actions = dist.get_actions()
5757

58-
assert th.allclose(actions.mean(), dist.distribution.mean.mean(), rtol=1e-3)
59-
assert th.allclose(actions.std(), dist.distribution.scale.mean(), rtol=1e-3)
58+
assert th.allclose(actions.mean(), dist.distribution.mean.mean(), rtol=2e-3)
59+
assert th.allclose(actions.std(), dist.distribution.scale.mean(), rtol=2e-3)
6060

6161

6262
# TODO: analytical form for squashed Gaussian?

0 commit comments

Comments
 (0)