-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull request adds a docker container that can be used to run the SLC package. This was done to improve the reproducibility of results.
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 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,26 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
{ | ||
"name": "Existing Dockerfile", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
"runArgs": [ | ||
"-e", | ||
"DISPLAY=${localEnv:DISPLAY}", | ||
"-v", | ||
"/tmp/.X11-unix:/tmp/.X11-unix:ro" | ||
], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python" | ||
] | ||
}, | ||
"settings": { | ||
"python.pythonpath": "/opt/conda/envs/han2020/bin/python" | ||
} | ||
}, | ||
"postCreateCommand": "echo 'If you need to run GUI applications inside this Docker container, remember to execute `xhost +local:docker` on your host machine to enable X11 forwarding. You can remove it again with `xhost -local:docker` when you are done.'" | ||
} |
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,43 @@ | ||
# Use the official Miniconda3 base image | ||
FROM continuumio/miniconda3:latest | ||
|
||
# Set environment variables for Conda | ||
ENV CONDA_HOME="/opt/conda" | ||
ENV PATH="$CONDA_HOME/bin:$PATH" | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
libopenmpi-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a Conda environment with Python 3.10 | ||
RUN conda create -n slc python=3.10 | ||
|
||
# Activate the Conda environment | ||
SHELL ["conda", "run", "-n", "slc", "/bin/bash", "-c"] | ||
|
||
# Copy the repo code into the Docker image | ||
COPY . /stable-learning-control | ||
|
||
# Clone stable-gym package | ||
RUN git clone https://github.com/rickstaa/stable-gym.git | ||
|
||
# Set the working directory | ||
WORKDIR /stable-learning-control | ||
|
||
# Install mpi4py using Conda | ||
# NOTE: Done since the pip version of mpi4py does not to seem to work in a Conda environment. | ||
RUN conda install mpi4py | ||
|
||
# Install slc package | ||
# RUN pip install -e . | ||
RUN pip install -e .[mujoco] | ||
|
||
# Install the stable-gym package | ||
RUN pip install -e ../stable-gym | ||
|
||
# Add Conda activation to .bashrc (optional) | ||
RUN echo "source activate slc" >> /root/.bashrc | ||
|
||
# Start the experiments | ||
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "slc", "python", "-m", "stable_learning_control.run"] |