Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install uv for fast Python environment management
RUN pip install --no-cache-dir uv

# Create working directory
WORKDIR /workspace

# Copy dependency lists first to leverage Docker layer caching
COPY requirements.txt /workspace/requirements.txt

# Create a virtual environment and install Python dependencies
RUN uv venv /opt/venv \
&& . /opt/venv/bin/activate \
&& uv pip install -r /workspace/requirements.txt

# Ensure the virtual environment is used by default
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install uv and use it to install Python dependencies system-wide
RUN pip install --no-cache-dir uv \
&& uv pip install --system -r /workspace/requirements.txt

# Copy the rest of the repository into the container
COPY . /workspace
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

# Run the unit test suite
test:
pytest -q
pytest -q

# Check style with ruff
lint:
ruff check src tests
ruff check src tests

# Format code with ruff
format:
ruff format src tests
ruff format src tests

# Build the Docker image
build:
docker compose build
docker compose build

# Bring up the research container
up:
docker compose up
docker compose up

# Tear down the research container
down:
docker compose down --remove-orphans
docker compose down --remove-orphans

# Open a shell inside the container
shell:
docker compose run --rm research bash
docker compose run --rm --user "$$(id -u):$$(id -g)" research bash

# Run the default experiment runner
run:
docker compose run --rm research python -m molmole_research.runner
docker compose run --rm --user "$$(id -u):$$(id -g)" research python -m molmole_research.runner

# Download the MolMole dataset into the data/ directory
download:
docker compose run --rm research python -m molmole_research.downloader --dataset doxa-friend/MolMole_Patent300 --out data/images
docker compose run --rm --user "$$(id -u):$$(id -g)" research python -m molmole_research.downloader --dataset doxa-friend/MolMole_Patent300 --out data/images