diff --git a/.github/actions/build-image/action.yml b/.github/actions/build-image/action.yml index efa0aba..34cc486 100644 --- a/.github/actions/build-image/action.yml +++ b/.github/actions/build-image/action.yml @@ -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 }} diff --git a/.github/workflows/deploy_images.yml b/.github/workflows/deploy_images.yml index bdc109a..eb127f7 100644 --- a/.github/workflows/deploy_images.yml +++ b/.github/workflows/deploy_images.yml @@ -20,7 +20,8 @@ on: - py310 - py311 - py311-cuda - - example + - py312 + - docs platforms: description: Platforms to build for @@ -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 🛎️ @@ -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 🛎️ @@ -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 🛎️ @@ -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 🛎️ @@ -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 🛎️ @@ -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 🛎️ @@ -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 🛎️ @@ -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: 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_310 b/docker/Dockerfile_310 index 3fb5112..5a54309 100644 --- a/docker/Dockerfile_310 +++ b/docker/Dockerfile_310 @@ -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 @@ -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"] diff --git a/docker/Dockerfile_311 b/docker/Dockerfile_311 index 64b8ca7..b098386 100644 --- a/docker/Dockerfile_311 +++ b/docker/Dockerfile_311 @@ -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 @@ -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"] diff --git a/docker/Dockerfile_311_cuda b/docker/Dockerfile_311_cuda index 5988d01..a0e0787 100644 --- a/docker/Dockerfile_311_cuda +++ b/docker/Dockerfile_311_cuda @@ -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"] diff --git a/docker/Dockerfile_312 b/docker/Dockerfile_312 new file mode 100644 index 0000000..f2b69e9 --- /dev/null +++ b/docker/Dockerfile_312 @@ -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"] diff --git a/docker/Dockerfile_37 b/docker/Dockerfile_37 index fa6de36..fec1da8 100644 --- a/docker/Dockerfile_37 +++ b/docker/Dockerfile_37 @@ -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 @@ -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"] diff --git a/docker/Dockerfile_38 b/docker/Dockerfile_38 index e1e96db..9275d51 100644 --- a/docker/Dockerfile_38 +++ b/docker/Dockerfile_38 @@ -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 @@ -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"] diff --git a/docker/Dockerfile_39 b/docker/Dockerfile_39 index d78f27a..d0dd435 100644 --- a/docker/Dockerfile_39 +++ b/docker/Dockerfile_39 @@ -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 @@ -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"] diff --git a/requirements_dev.txt b/requirements_dev.txt index 0ab122d..0dd3303 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -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"