Skip to content

Commit 0e29efe

Browse files
committed
update python version while keeping lean image
1 parent 2294574 commit 0e29efe

File tree

4 files changed

+27
-48
lines changed

4 files changed

+27
-48
lines changed

.devcontainer/Dockerfile

+9-40
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,17 @@
1-
# FROM mambaorg/micromamba:jammy-cuda-12.1.0
2-
# FROM pytorch/pytorch:2.4.0-cuda11.8-cudnn9-devel
3-
# because of deps with torchtext will downgrade to torch 2.0.1
4-
FROM bitnami/pytorch:2.3.1
5-
1+
FROM docker.io/bitnami/pytorch:2.3.1
62
LABEL maintainer="Sylvain Le Groux <sylvain.legroux@gmail.com>"
73
USER root
8-
9-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
4+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive && \
105
apt-get install -y --no-install-recommends \
11-
build-essential \
12-
# libboost-all-dev \
13-
# libeigen3-dev \
14-
# cmake \
15-
# zlib1g-dev libbz2-dev liblzma-dev \
16-
# festival \
6+
# build-essential \
177
espeak-ng \
18-
# mbrola \
19-
git \
208
git-lfs \
21-
curl \
22-
ca-certificates \
23-
wget \
24-
pkg-config && \
25-
# spacy takes forever to install (wheels not available)
26-
pip install spacy && \
27-
python -m spacy download en_core_web_sm && \
28-
# Remove the effect of `apt-get update`
9+
libsndfile-dev \
10+
curl && \
2911
apt-get clean && \
3012
rm -rf /var/lib/apt/lists/*
3113

32-
# RUN git clone https://github.com/kpu/kenlm && \
33-
# cd kenlm; mkdir build; cd build && \
34-
# cmake ..; make -j 4; make install
35-
36-
# taking care of dependencies between torch/torchtext & lightning/numpy
37-
# RUN pip install torchtext torchvision torchaudio torchdata jupyterlab nbdev numpy lightning
38-
39-
# RUN python -m spacy download en_core_web_sm
40-
# #&& git clone https://github.com/slegroux/nimrod
41-
# WORKDIR /workspaces/nimrod
42-
COPY . .
43-
RUN pip install -e .
44-
RUN nbdev_install_quarto && nbdev_install_hooks
45-
# # RUN git config --global --add safe.directory /workspaces/nimrod
46-
47-
# EXPOSE 8888
48-
# CMD ["jupyter", "lab", "--allow-root", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''","--NotebookApp.password=''"]
14+
RUN pip install slg-nimrod==0.0.11
15+
RUN python -m spacy download en_core_web_sm
16+
RUN nbdev_install_hooks
17+
# RUN nbdev_install_quarto && \

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ _proc/
148148
_docs/
149149
data/codeparrot
150150
data/en/
151+
data
151152
token
152153
env-file
153154
Dockerfile.base

Makefile

+13-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,21 @@ test-full: ## Run all tests
3030
train: ## Train the model
3131
python src/train.py
3232

33-
container:
34-
docker build --network host -t slegroux/nimrod -f ".devcontainer/Dockerfile" .
33+
docker-build:
34+
# docker build --network host -t slegroux/nimrod -f ".devcontainer/Dockerfile" . --push
35+
# docker buildx build --network host --platform linux/amd64,linux/arm64 -t slegroux/nimrod:latest -f ".devcontainer/Dockerfile.nimrod" .
36+
docker buildx build --network host --platform linux/amd64 -t slegroux/nimrod:latest -f ".devcontainer/Dockerfile" .
3537

36-
test-container:
38+
docker-build-mac:
39+
docker buildx build --network host -t slegroux/nimrod-mac:latest -f ".devcontainer/Dockerfile" .
40+
41+
docker-test:
42+
## opt: --privileged
43+
docker run -it --network host -v $(PWD):/app --rm slegroux/nimrod /bin/bash
44+
45+
docker-test-mac:
3746
## opt: --privileged
38-
docker run -it --network host --rm slegroux/nimrod /bin/bash
47+
docker run -it --network host -v $(PWD):/app --rm slegroux/nimrod-mac /bin/bash
3948

4049
docker-run:
4150
docker run -p 8888:8888 -v $(PWD):/app slegroux/nimrod

settings.ini

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
### Python library ###
66
repo = nimrod
77
lib_name = slg_%(repo)s
8-
version = 0.0.9
9-
min_python = 3.7
8+
version = 0.0.11
9+
min_python = 3.9
1010
license = apache2
1111

1212
### nbdev ###
@@ -48,11 +48,11 @@ status = 3
4848
; requirements = lightning torch torchvision torchaudio torchtext torchdata \
4949

5050
; torch 2.0.1
51-
requirements = torchtext==0.15.2 torchvision==0.15.2 torchaudio==2.0.2 torchdata jupyterlab nbdev numpy lightning \
51+
requirements = torchtext torchvision torchaudio torchdata jupyterlab nbdev numpy lightning \
5252
anyascii datasets encodec fairscale hydra_colorlog hydra-core hydra-optuna-sweeper \
5353
inflect ipykernel jupyterlab jupyterlab-quarto librosa lhotse \
5454
matplotlib nvitop omegaconf onnxruntime optuna pandas phonemizer plum-dispatch portalocker \
55-
pre-commit python-dotenv pytest spacy streamlit timm tensorboard tqdm transformers wandb
55+
pre-commit python-dotenv pytest spacy==3.6 streamlit timm tensorboard tqdm transformers wandb
5656

5757
# https://github.com/kpu/kenlm/archive/master.zip cupy
5858

0 commit comments

Comments
 (0)