Skip to content

Commit 6905839

Browse files
authored
Merge pull request #49 from huangshiyu13/dev
- add docker - update nlp package
2 parents 60fa0ab + 65399f1 commit 6905839

File tree

7 files changed

+69
-6
lines changed

7 files changed

+69
-6
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
__pycache__/
2+
logs
3+
.pytest_cache/
4+
.coverage
5+
.coverage.*
6+
.idea/
7+
logs/
8+
.pytype/
9+
htmlcov/
10+
.vscode/
11+
.git/

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ format:
2222
# Reformat using black
2323
black ${PYTHON_FILES} --preview
2424

25-
commit-checks: format lint
25+
commit-checks: format lint
26+
27+
docker-cpu:
28+
./scripts/build_docker.sh
29+
30+
docker-gpu:
31+
USE_GPU=True ./scripts/build_docker.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ conda install -c openrl openrl
8787

8888
想要修改源码的用户也可以从源码安装OpenRL:
8989
```bash
90-
git clone git@github.com:OpenRL-Lab/openrl.git && cd openrl
90+
git clone https://github.com/OpenRL-Lab/openrl.git && cd openrl
9191
pip install -e .
9292
```
9393

README_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ conda install -c openrl openrl
109109
Users who want to modify the source code can also install OpenRL from the source code:
110110

111111
```bash
112-
git clone git@github.com:OpenRL-Lab/openrl.git && cd openrl
112+
git clone https://github.com/OpenRL-Lab/openrl.git && cd openrl
113113
pip install -e .
114114
```
115115

docker/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG PARENT_IMAGE
2+
FROM $PARENT_IMAGE
3+
4+
WORKDIR /openrl
5+
6+
ADD setup.py setup.py
7+
ADD openrl openrl
8+
ADD README.md README.md
9+
10+
ENV VENV /root/venv
11+
12+
RUN \
13+
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
14+
15+
RUN \
16+
python3 -m pip install --upgrade pip --no-cache-dir && \
17+
python3 -m pip install --no-cache-dir . && \
18+
python3 -m pip install --no-cache-dir ".[nlp]" && \
19+
rm -rf $HOME/.cache/pip
20+
21+
ENV PATH=$VENV/bin:$PATH
22+
23+
CMD /bin/bash

scripts/build_docker.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
CPU_PARENT=cnstark/pytorch:2.0.0-py3.9.12-ubuntu20.04
4+
GPU_PARENT=cnstark/pytorch:2.0.0-py3.9.12-cuda11.8.0-ubuntu22.04
5+
6+
TAG=openrllab/openrl
7+
VERSION=$(python -c "from openrl.__init__ import __version__;print(__version__)")
8+
9+
if [[ ${USE_GPU} == "True" ]]; then
10+
PARENT=${GPU_PARENT}
11+
TAG="${TAG}"
12+
else
13+
PARENT=${CPU_PARENT}
14+
TAG="${TAG}-cpu"
15+
fi
16+
17+
echo "docker build --build-arg PARENT_IMAGE=${PARENT} -t ${TAG}:${VERSION} . -f docker/Dockerfile"
18+
docker build --build-arg PARENT_IMAGE=${PARENT} -t ${TAG}:${VERSION} . -f docker/Dockerfile
19+
docker tag ${TAG}:${VERSION} ${TAG}:latest
20+
21+
if [[ ${RELEASE} == "True" ]]; then
22+
docker push ${TAG}:${VERSION}
23+
docker push ${TAG}:latest
24+
fi

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
def get_install_requires() -> list:
2626
return [
27-
"setuptools>=50.0",
27+
"setuptools>=67.0",
2828
"gymnasium",
2929
"click",
3030
"termcolor",
@@ -37,7 +37,7 @@ def get_install_requires() -> list:
3737
"jsonargparse",
3838
"imageio",
3939
"opencv-python",
40-
"pygame"
40+
"pygame",
4141
]
4242

4343

@@ -55,7 +55,6 @@ def get_extra_requires() -> dict:
5555
"dev": ["build", "twine"],
5656
"mpe": ["pyglet==1.5.27"],
5757
"nlp": [
58-
"stable-baselines3==1.5.1a5",
5958
"transformers==4.18.0",
6059
"datasets",
6160
"nltk",

0 commit comments

Comments
 (0)