From 2d3a5e47f34ac4b01e72cee5c5e8a8bc7a1f5da4 Mon Sep 17 00:00:00 2001 From: "Marcel R." Date: Tue, 21 May 2024 11:04:58 +0200 Subject: [PATCH] Fix 3.7 image, add 3.12 image. --- .github/workflows/deploy_images.yml | 24 +++++++++++++++++-- .github/workflows/lint_and_test.yml | 1 + README.md | 3 ++- docker/Dockerfile_312 | 37 +++++++++++++++++++++++++++++ requirements_dev.txt | 3 ++- 5 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 docker/Dockerfile_312 diff --git a/.github/workflows/deploy_images.yml b/.github/workflows/deploy_images.yml index bdc109a..af5ff43 100644 --- a/.github/workflows/deploy_images.yml +++ b/.github/workflows/deploy_images.yml @@ -20,6 +20,7 @@ on: - py310 - py311 - py311-cuda + - py312 - example platforms: @@ -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' || contains(github.event.inputs.specific_job, 'py39') || contains(github.event.inputs.specific_job, 'docs') }} runs-on: ubuntu-latest steps: - name: Checkout 🛎️ @@ -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' || contains(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' || contains(github.event.inputs.specific_job, 'docs')) }} needs: py39 runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 30f2ce0..f9201ea 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -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"} diff --git a/README.md b/README.md index 000cacb..d2c3910 100644 --- a/README.md +++ b/README.md @@ -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) | ✘ | @@ -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 diff --git a/docker/Dockerfile_312 b/docker/Dockerfile_312 new file mode 100644 index 0000000..fee24ff --- /dev/null +++ b/docker/Dockerfile_312 @@ -0,0 +1,37 @@ +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 +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 + +# 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 + +# initial command +CMD ["bash", "-i", "-l"] diff --git a/requirements_dev.txt b/requirements_dev.txt index 0ab122d..4909a4c 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,5 @@ -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