-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (78 loc) · 2.68 KB
/
Copy pathDockerfile
File metadata and controls
88 lines (78 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Use Ubuntu as base image with Python 3.10
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV RUST_VERSION=1.81.0
ENV PYTHONPATH=/app/python
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
curl \
git \
libbz2-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
pkg-config \
python3.10 \
python3.10-dev \
python3.10-venv \
python3-pip \
wget \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_VERSION}
ENV PATH="/root/.cargo/bin:${PATH}"
# Set working directory
WORKDIR /app
# Copy project files
COPY . .
# Build Rust project
RUN cargo build --release
# Install Python dependencies
RUN python3.10 -m pip install --upgrade pip setuptools wheel
RUN python3.10 -m pip install \
dgl==1.1.3 \
pandas \
"numpy>=1.22.0,<1.24.0" \
"scipy>=1.8.0,<1.11.0" \
aigverse \
pyyaml \
scikit-learn \
pydantic \
chardet \
matplotlib \
seaborn \
pathlib2
# Install PyTorch and related packages
RUN pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu124
# Install other Python dependencies
RUN pip install torch_geometric
RUN pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.6.0+cu124.html
RUN pip install optuna
# Install the Python package
# RUN cd python && python3.10 -m pip install -e .
# Create directories for data and models
RUN mkdir -p /app/data/circuit_features /app/data/graph_cache /app/models /app/benchmarks /app/output
# Set default command
CMD ["/bin/bash"]
# Usage examples:
# Build: docker build -t solver-tuner .
#
# Run interactive session:
# docker run -it --rm -v $(pwd)/data:/app/data -v $(pwd)/benchmarks:/app/benchmarks -v $(pwd)/output:/app/output -v $(pwd)/models:/app/models solver-tuner
#
# Run training:
# docker run -it --rm -v $(pwd)/data:/app/data -v $(pwd)/benchmarks:/app/benchmarks -v $(pwd)/output:/app/output -v $(pwd)/models:/app/models solver-tuner \
# bash -c "trainer data/test_experiment.csv data/test_circuit --model-out=models/model.pt --features-dir=data/circuit_features/ --epochs=20 --learning-rate=0.01"
#
# Run prediction:
# docker run -it --rm -v $(pwd)/data:/app/data -v $(pwd)/benchmarks:/app/benchmarks -v $(pwd)/output:/app/output -v $(pwd)/models:/app/models solver-tuner \
# bash -c "predictor --aig-file benchmarks/6s8.aig --model models/model.pt --find-best"