diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c8581b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# 1. Base Image: +# - PyTorch 1.11.0 +# - CUDA 11.3 (The corresponding version for torch 1.11.0) +# - Python 3.9.12 (Closest available to 3.9.13) +FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime + +# 2. Set Working Directory +WORKDIR /app + +# 3. (CRITICAL!) Package Installation +# We are avoiding installing directly from a local 'requirements.txt' +# because it often causes Python version conflicts (specifically with Python 3.9) +# due to pre-compiled binaries or version lock issues. +# Instead, we directly install the core packages needed for the project, +# allowing pip to automatically select compatible versions for this environment. +RUN pip install --no-cache-dir \ + numpy \ + pandas \ + scikit-learn \ + matplotlib + +# 4. Copy all project files +COPY . . + +# 5. Default command: Start bash shell +CMD ["/bin/bash"] diff --git a/README.md b/README.md index 71d7f3a..0f92475 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,19 @@ pip install torch==1.11.0 pip install -r requirements.txt ``` +- If you prefer Docker (requires Docker Engine and NVIDIA Container Toolkit): +```bash +# 1. Build the image (run from the directory containing the Dockerfile) +docker build -t d3r . + +# 2. Run the experiment +# (Ensure your downloaded datasets are in this directory for the mount to work) +docker run --rm -it --gpus all \ + -v .:/app/data \ + d3r \ + /bin/bash +``` + 2. Download data. You can obtain two benchmarks from [Google Cloud](https://drive.google.com/drive/folders/1UJ6SGfb6h-9R0L18FLDXpISKh1nhaqWA?usp=sharing). The datasets are well pre-processed. For the SWaT dataset, you can apply for it by following its [official tutorial](https://itrust.sutd.edu.sg/itrust-labs_datasets/dataset_info/). We unify the SWaT dataset to minute granularity and retain only continuous metrics: ```