diff --git a/Dockerfile b/Dockerfile index 4c0fb5d..61e950c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 00739bc..96cb1f5 100644 --- a/Makefile +++ b/Makefile @@ -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