forked from vwxyzjn/cleanrl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cloud Utilities Improvement (vwxyzjn#65)
* cache changes * add dockerfile exmaple * refactor terraform files * support multi-arch * refactor * refactor * fix caching * update Dockerfile * include entrypoint * simplify the process of using wandb key * update docs * update dockerfile * refactor * test * update main.tf * update readme * fix docs * refactor * update files * better instructions * modify docs * add a test case * minor update * fix format * update test cases * update workflow * dummy change
- Loading branch information
Showing
22 changed files
with
349 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.mp4 | ||
*.pyc | ||
*.pyo | ||
*.log | ||
*.json | ||
**/wandb | ||
**/runs | ||
**/videos | ||
.git | ||
*.tfevents.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: utils_test | ||
on: | ||
push: | ||
paths: | ||
- cleanrl_utils/** | ||
- tests/** | ||
jobs: | ||
ci: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
poetry-version: [1.1.11] | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run image | ||
uses: abatilo/actions-poetry@v2.0.0 | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
|
||
- name: Install test dependencies | ||
run: poetry install -E pytest | ||
- name: Install cloud dependencies | ||
run: poetry install -E cloud | ||
- name: Run utils tests | ||
run: poetry run pytest tests/test_utils.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
debug.sh.docker.sh | ||
docker_cache | ||
rl-video-*.mp4 | ||
rl-video-*.json | ||
cleanrl_utils/charts_episode_reward | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM nvidia/cuda:11.4.2-runtime-ubuntu20.04 | ||
|
||
# install ubuntu dependencies | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && \ | ||
apt-get -y install python3-pip xvfb ffmpeg git build-essential python-opengl | ||
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
# install python dependencies | ||
RUN pip install poetry | ||
COPY pyproject.toml pyproject.toml | ||
COPY poetry.lock poetry.lock | ||
RUN poetry install | ||
RUN poetry install -E atari | ||
RUN poetry install -E pybullet | ||
|
||
# install mujoco | ||
RUN apt-get -y install wget unzip software-properties-common \ | ||
libgl1-mesa-dev \ | ||
libgl1-mesa-glx \ | ||
libglew-dev \ | ||
libosmesa6-dev patchelf | ||
RUN poetry install -E mujoco | ||
RUN poetry run python -c "import mujoco_py" | ||
|
||
COPY entrypoint.sh /usr/local/bin/ | ||
RUN chmod 777 /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
|
||
# copy local files | ||
COPY ./cleanrl /cleanrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import subprocess | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--tag', type=str, default="cleanrl:latest", | ||
help='the name of this experiment') | ||
args = parser.parse_args() | ||
|
||
subprocess.run( | ||
f"docker build -t {args.tag} .", | ||
shell=True, | ||
check=True, | ||
) | ||
|
Oops, something went wrong.