Skip to content

Commit fdd33c2

Browse files
Upgrade Dockerfile
1 parent 5f1bdbf commit fdd33c2

File tree

2 files changed

+78
-33
lines changed

2 files changed

+78
-33
lines changed

Dockerfile

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
1-
FROM nvidia/cuda:10.1-base-ubuntu18.04
1+
FROM ubuntu:24.04
22

3-
# Install necessary system packages and Python 3.10
4-
RUN apt-get update && apt-get upgrade -y && \
5-
apt-get install -y software-properties-common && \
6-
add-apt-repository ppa:deadsnakes/ppa && \
7-
apt-get install -y python3.10 python3.10-distutils python3.10-dev python3.10-venv vim
3+
# Install dependencies for building Python and basic tools
4+
RUN apt-get update && apt-get install -y \
5+
build-essential \
6+
wget \
7+
curl \
8+
git \
9+
libssl-dev \
10+
zlib1g-dev \
11+
libncurses5-dev \
12+
libncursesw5-dev \
13+
libreadline-dev \
14+
libsqlite3-dev \
15+
libgdbm-dev \
16+
libbz2-dev \
17+
libexpat1-dev \
18+
liblzma-dev \
19+
tk-dev \
20+
libffi-dev \
21+
uuid-dev \
22+
vim \
23+
ca-certificates
824

9-
# Set Python 3.10 as the default Python version
10-
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
25+
# Install Python 3.13.2 from source
26+
ENV PYTHON_VERSION=3.13.2
27+
WORKDIR /tmp
1128

12-
## Create a virtual environment and activate it
29+
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
30+
tar -xzf Python-${PYTHON_VERSION}.tgz && \
31+
cd Python-${PYTHON_VERSION} && \
32+
./configure --enable-optimizations && \
33+
make -j$(nproc) && \
34+
make altinstall && \
35+
ln -s /usr/local/bin/python3.13 /usr/bin/python3 && \
36+
ln -s /usr/local/bin/pip3.13 /usr/bin/pip3
37+
38+
# Create and activate virtual environment
1339
ENV VIRTUAL_ENV=/opt/venv
1440
RUN python3 -m venv $VIRTUAL_ENV
1541
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
1642

43+
# Set working directory and install project
1744
WORKDIR /project
1845
COPY . .
46+
47+
# Install dependencies and Jupyter extensions
1948
RUN pip install --upgrade pip && pip install -e .
20-
RUN jupyter contrib nbextension install

README.md

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div align="center">
22

3-
# 🚀⚡🔥 data-science-template 🚀⚡🔥
3+
# 🚀⚡🔥 Recommender System Template (Implicit Data) 🚀⚡🔥
44

5-
[![python](https://img.shields.io/badge/-Python_3.10-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
5+
[![python](https://img.shields.io/badge/-Python_3.13.2-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
66
[![pytorch](https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org)
77
[![hydra](https://img.shields.io/badge/Config-Hydra-89b8cd)](https://hydra.cc)
88
[![black](https://img.shields.io/badge/Code%20Style-Black-black.svg?labelColor=gray)](https://black.readthedocs.io)
@@ -11,17 +11,41 @@
1111

1212
</div>
1313

14-
Hi there! This is recommender system project prepared for data [ContentWise Impressions](https://github.com/ContentWise/contentwise-impressions) using:
15-
- `lightning` for model training
16-
- `hydra` for configuration
17-
- `clearml` for ML cycle control
18-
- (optionally) aws s3 as remote storage
14+
This repository provides a modular template for building recommender systems in Python using **implicit feedback data**. It is designed to streamline experimentation of recommendation models with a modern ML stack.
15+
16+
### 🔧 Tech Stack
17+
- **PyTorch Lightning** – for scalable and structured model training
18+
- **Hydra** – for flexible configuration management
19+
- **ClearML** – for experiment tracking and ML workflow orchestration
20+
- **(Optional) AWS S3** – for storing datasets and models remotely
21+
22+
### 📦 Dataset
23+
24+
As an example, this template uses the [ContentWise Impressions](https://github.com/ContentWise/contentwise-impressions) dataset, which contains real-world implicit feedback data.
25+
26+
### 🚀 Use Cases
27+
28+
- Rapid prototyping of recommender systems
29+
- Benchmarking implicit models
30+
- Educational purposes (learning modern ML tools in practice)
31+
32+
---
33+
34+
More details about setup, usage, and customization can be found in the sections below.
35+
1936

2037
## Prerequisites
2138

22-
To make use of this repository, you have to:
23-
- [download](https://github.com/ContentWise/contentwise-impressions) ContentWise data, concretally `CW10M` directory, and place it at `cache/CW10M/` (cache directory is included in .gitignore)
24-
- set up a ClearML server and, optionally, AWS S3 storage
39+
To make use of this repository, follow these steps:
40+
41+
1. **Download the dataset**
42+
Download the [ContentWise Impressions dataset](https://github.com/ContentWise/contentwise-impressions), specifically the `CW10M` directory.
43+
Place it in the following path: `cache/data-cw10m/`
44+
45+
2. **Set up external services**
46+
- Configure your connection to a ClearML server for experiment tracking.
47+
- (Optional) Set up access to AWS S3 if you want to use remote storage for data or models.
48+
2549

2650
## Configuration and installation
2751

@@ -32,6 +56,12 @@ CLEARML_WEB_HOST=<your-clearml-web-host>
3256
...
3357
```
3458

59+
Create and activate virtual environment with conda:
60+
```
61+
conda create --name <env_name> python=3.13.2
62+
conda activate <env_name>
63+
```
64+
3565
Install with pip:
3666
```bash
3767
pip install . # Add flag -e to install in editable mode
@@ -63,17 +93,4 @@ python steps/infer.py
6393
docker exec -it ds-container bash # Execute bash in a running container
6494
docker compose start/stop/down
6595
docker builder prune # Remove build cache
66-
bash linter.sh
67-
```
68-
69-
## References
70-
71-
* https://drivendata.github.io/cookiecutter-data-science
72-
* https://github.com/khuyentran1401/data-science-template
73-
74-
## Trash
75-
(Obsolete) Remember about clearml agent based on docker image:
76-
77-
```bash
78-
clearml-agent daemon --queue default --docker my-docker-image
7996
```

0 commit comments

Comments
 (0)