Skip to content

Python 3.12 image #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/actions/build-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
- name: Build and deploy image 🐳
uses: docker/build-push-action@v5
with:
context: docker
context: .
file: ${{ inputs.docker_file }}
platforms: ${{ inputs.platforms }}
push: ${{ inputs.push_image }}
Expand Down
38 changes: 29 additions & 9 deletions .github/workflows/deploy_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ on:
- py310
- py311
- py311-cuda
- example
- py312
- docs

platforms:
description: Platforms to build for
Expand All @@ -33,7 +34,7 @@ on:

jobs:
py37:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py37') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py37' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -52,7 +53,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

py38:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py38') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py38' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -71,7 +72,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

py39:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py39') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py39' || github.event.inputs.specific_job == 'docs' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -90,7 +91,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

py39_base:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py39') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py39' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -109,7 +110,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

py310:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py310') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py310' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -128,7 +129,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

py311:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py311') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py311' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -147,7 +148,7 @@ jobs:
push_image: ${{ github.event.inputs.push_image == 'true' }}

py311-cuda:
if: ${{ github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'py311-cuda') }}
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py311-cuda' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
Expand All @@ -166,8 +167,27 @@ jobs:
tags: cmsml/cmsml:3.11-cuda
push_image: ${{ github.event.inputs.push_image == 'true' }}

py312:
if: ${{ github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'py312' }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Build and deploy image 🐳
uses: ./.github/actions/build-image
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
docker_file: docker/Dockerfile_312
platforms: ${{ github.event.inputs.platforms }}
tags: cmsml/cmsml:3.12
push_image: ${{ github.event.inputs.push_image == 'true' }}

docs:
if: ${{ github.event.inputs.push_image == 'true' && (github.event.inputs.specific_job == 'all' || contains(github.event.inputs.specific_job, 'example')) }}
if: ${{ github.event.inputs.push_image == 'true' && (github.event.inputs.specific_job == 'all' || github.event.inputs.specific_job == 'docs') }}
needs: py39
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- {tag: "3.9", tf: "default"}
- {tag: "3.10", tf: "default"}
- {tag: "3.11", tf: "default"}
- {tag: "3.12", tf: "default"}
# scan tf versions
- {tag: "3.9_base", tf: "2.5.3"}
- {tag: "3.9_base", tf: "2.6.5"}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ To use the cmsml package via docker, checkout our [DockerHub](https://hub.docker
| `cmsml/cmsml:3.10` | 3.10 | latest (~2.16.1) | latest (~2.3.0) | ✘ |
| `cmsml/cmsml:3.11` | 3.11 | latest (~2.16.1) | latest (~2.3.0) | ✘ |
| `cmsml/cmsml:3.11-cuda` | 3.11 | latest (~2.16.1) | latest (~2.3.0) | ✔︎ |
| `cmsml/cmsml:3.12` | 3.12 | latest (~2.16.1) | latest (~2.3.0) | ✘ |

<!-- marker-after-docker -->

Expand All @@ -74,7 +75,7 @@ The tests can be triggered with
pytest -n auto tests
```

and in general, they should be run for Python 3.7 to 3.11.
and in general, they should be run for Python 3.7 to 3.12.
To run tests in a docker container, do

```shell
Expand Down
11 changes: 4 additions & 7 deletions docker/Dockerfile_310
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
Expand All @@ -26,12 +26,9 @@ RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# install cmsml from master
RUN git clone https://github.com/cms-ml/cmsml.git && \
cd cmsml && \
pip install --no-cache-dir .[dev] && \
cd .. && \
rm -rf cmsml
# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
11 changes: 4 additions & 7 deletions docker/Dockerfile_311
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
Expand All @@ -26,12 +26,9 @@ RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# install cmsml from master
RUN git clone https://github.com/cms-ml/cmsml.git && \
cd cmsml && \
pip install --no-cache-dir .[dev] && \
cd .. && \
rm -rf cmsml
# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
43 changes: 20 additions & 23 deletions docker/Dockerfile_311_cuda
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,30 @@ WORKDIR /root

# minimal software stack
RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir \
numpy \
scipy \
matplotlib \
pandas \
numexpr \
jupyterlab \
notebook \
scikit-learn \
scikit-optimize \
xgboost \
scinum \
nvidia_smi \
py3nvml \
torch
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
RUN pip install --no-cache-dir matplotlib
RUN pip install --no-cache-dir pandas
RUN pip install --no-cache-dir numexpr
RUN pip install --no-cache-dir jupyterlab
RUN pip install --no-cache-dir notebook
RUN pip install --no-cache-dir scikit-learn
RUN pip install --no-cache-dir scikit-optimize
RUN pip install --no-cache-dir tensorflow
RUN pip install --no-cache-dir xgboost
RUN pip install --no-cache-dir scinum
RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# install cmsml from master
RUN git clone https://github.com/cms-ml/cmsml.git && \
cd cmsml && \
pip install --no-cache-dir .[dev] && \
cd .. && \
rm -rf cmsml
# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
34 changes: 34 additions & 0 deletions docker/Dockerfile_312
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM python:3.12

# set the workdir
WORKDIR /root

# minimal software stack
RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
RUN pip install --no-cache-dir matplotlib
RUN pip install --no-cache-dir pandas
RUN pip install --no-cache-dir numexpr
RUN pip install --no-cache-dir jupyterlab
RUN pip install --no-cache-dir notebook
RUN pip install --no-cache-dir scikit-learn
RUN pip install --no-cache-dir scikit-optimize
RUN pip install --no-cache-dir tensorflow
RUN pip install --no-cache-dir xgboost
RUN pip install --no-cache-dir scinum
RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
11 changes: 4 additions & 7 deletions docker/Dockerfile_37
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
Expand All @@ -26,12 +26,9 @@ RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# install cmsml from master
RUN git clone https://github.com/cms-ml/cmsml.git && \
cd cmsml && \
pip install --no-cache-dir .[dev] && \
cd .. && \
rm -rf cmsml
# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
11 changes: 4 additions & 7 deletions docker/Dockerfile_38
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
Expand All @@ -26,12 +26,9 @@ RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# install cmsml from master
RUN git clone https://github.com/cms-ml/cmsml.git && \
cd cmsml && \
pip install --no-cache-dir .[dev] && \
cd .. && \
rm -rf cmsml
# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
11 changes: 4 additions & 7 deletions docker/Dockerfile_39
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update; apt-get clean
RUN apt-get install -y nano less htop git libhdf5-serial-dev; apt-get clean

# python software stack
RUN pip install --no-cache-dir --upgrade pip setuptools
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir --upgrade ipython
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir scipy
Expand All @@ -26,12 +26,9 @@ RUN pip install --no-cache-dir nvidia_smi
RUN pip install --no-cache-dir py3nvml
RUN pip install --no-cache-dir torch

# install cmsml from master
RUN git clone https://github.com/cms-ml/cmsml.git && \
cd cmsml && \
pip install --no-cache-dir .[dev] && \
cd .. && \
rm -rf cmsml
# copy and install
COPY . /cmsml
RUN pip install --no-cache-dir --upgrade /cmsml[dev] && rm -rf /cmsml

# initial command
CMD ["bash", "-i", "-l"]
7 changes: 4 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
flake8~=7.0
flake8~=7.0.0;python_version>="3.8"
flake8~=5.0.0;python_version<"3.8"
flake8-commas~=2.1.0
flake8-quotes~=3.3.2
pytest-cov~=5.0.0
pytest-xdist~=3.4.0
pytest-cov~=5.0.0;python_version>="3.8"
pytest-xdist~=3.4.0;python_version>="3.8"
Loading