From 6aae67f78f089215bb0b3f54079cd0d4b0a09077 Mon Sep 17 00:00:00 2001 From: Stavros Date: Wed, 7 Aug 2024 13:45:49 +0200 Subject: [PATCH] build(docker): upgrade to Ubuntu 24.04 and Python 3.12 (#99) --- .github/workflows/ci.yml | 42 +++++++++++----------- .readthedocs.yaml | 4 +-- AUTHORS.md | 1 + Dockerfile | 36 +++++++++++-------- requirements.txt | 77 +++++++++++++++++++++------------------- setup.py | 2 +- 6 files changed, 88 insertions(+), 74 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afca464..7eced1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: [push, pull_request] jobs: lint-commitlint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -36,7 +36,7 @@ jobs: ./run-tests.sh --check-commitlint ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }} lint-shellcheck: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -47,7 +47,7 @@ jobs: ./run-tests.sh --check-shellcheck lint-black: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -55,7 +55,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check Python code formatting run: | @@ -64,7 +64,7 @@ jobs: ./run-tests.sh --check-black lint-flake8: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -72,7 +72,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check compliance with pep8, pyflakes and circular complexity run: | @@ -81,7 +81,7 @@ jobs: ./run-tests.sh --check-flake8 lint-pydocstyle: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -89,7 +89,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check compliance with Python docstring conventions run: | @@ -98,7 +98,7 @@ jobs: ./run-tests.sh --check-pydocstyle lint-check-manifest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -106,7 +106,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check Python manifest completeness run: | @@ -115,7 +115,7 @@ jobs: ./run-tests.sh --check-manifest docs-sphinx: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -123,7 +123,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Install system dependencies run: | @@ -134,18 +134,18 @@ jobs: - name: Install system dependencies run: | sudo apt-get update -y - sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config + sudo apt-get install python3.12-dev graphviz libgraphviz-dev pkg-config uuid-dev - name: Install Python dependencies run: | - pip install --upgrade pip 'setuptools<65.6' py wheel + pip install --upgrade pip 'setuptools' py wheel pip install -e .[all] - name: Run Sphinx documentation with doctests run: ./run-tests.sh --check-sphinx python-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -153,16 +153,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Install system dependencies run: | sudo apt-get update -y - sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config + sudo apt-get install python3.12-dev graphviz libgraphviz-dev pkg-config uuid-dev - name: Install Python dependencies run: | - pip install --upgrade pip 'setuptools<65.6' py + pip install --upgrade pip 'setuptools' py pip install twine wheel pip install -e .[all] @@ -176,7 +176,7 @@ jobs: files: coverage.xml lint-dockerfile: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -185,7 +185,7 @@ jobs: run: ./run-tests.sh --check-dockerfile docker-build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -194,7 +194,7 @@ jobs: run: ./run-tests.sh --check-docker-build release-docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 if: > vars.RELEASE_DOCKER == 'true' && github.event_name == 'push' && diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1240941..32f7a2d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,9 +7,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.8" + python: "3.12" sphinx: configuration: docs/conf.py diff --git a/AUTHORS.md b/AUTHORS.md index 9268ce3..88903bc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -9,5 +9,6 @@ The list of contributors in alphabetical order: - [Marco Donadoni](https://orcid.org/0000-0003-2922-5505) - [Marco Vidal](https://orcid.org/0000-0002-9363-4971) - [Sinclert Perez](https://www.linkedin.com/in/sinclert) +- [Stavros Moiras](https://orcid.org/0009-0005-4331-096X) - [Tibor Simko](https://orcid.org/0000-0001-7202-5803) - [Vladyslav Moisieienkov](https://orcid.org/0000-0001-9717-0775) diff --git a/Dockerfile b/Dockerfile index 4320317..cac853d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ # under the terms of the MIT License; see LICENSE file for more details. # Use Ubuntu LTS base image -FROM docker.io/library/ubuntu:20.04 +FROM docker.io/library/ubuntu:24.04 # Recognise target architecture ARG TARGETARCH @@ -13,10 +13,8 @@ ARG TARGETARCH # Use default answers in installation commands ENV DEBIAN_FRONTEND=noninteractive -# Use distutils provided by the standard Python library instead of the vendored one in -# setuptools, so that editable installations are stored in the right directory. -# See https://github.com/pypa/setuptools/issues/3301 -ENV SETUPTOOLS_USE_DISTUTILS=stdlib +# Allow pip to install packages in the system site-packages dir +ENV PIP_BREAK_SYSTEM_PACKAGES=true # Prepare list of Python dependencies COPY requirements.txt /code/ @@ -29,20 +27,21 @@ RUN apt-get update -y && \ curl \ g++ \ gcc \ + git \ gnupg2 \ graphviz \ graphviz-dev \ imagemagick \ krb5-config \ krb5-user \ - libauthen-krb5-perl \ + libauthen-krb5-simple-perl \ libkrb5-dev \ libssl-dev \ make \ pkg-config \ - python3-dev \ + python3.12-dev \ python3-pip \ - python3.8 \ + python3.12 \ uuid-dev \ vim-tiny && \ # Install xrootd @@ -60,17 +59,18 @@ RUN apt-get update -y && \ libxrootd-client-dev \ xrootd-client) \ fi && \ - pip install --no-cache-dir --upgrade pip 'setuptools<71' && \ + pip install --no-cache-dir --upgrade setuptools && \ pip install --no-cache-dir -r /code/requirements.txt && \ apt-get remove -y \ cmake \ g++ \ gcc \ + git \ graphviz-dev \ libssl-dev \ make \ pkg-config \ - python3-dev \ + python3.12-dev \ uuid-dev && \ apt-get autoremove -y && \ apt-get clean && \ @@ -82,7 +82,7 @@ COPY . /code # Add magick wrapper command to simulate ImageMagick v7 that is necessary by Snakemake # to produce thumbnails in generated reports. The wrapper simply passes conversion -# requests to ImageMagick v6 available on Ubuntu 20.04. +# requests to ImageMagick v6 available on Ubuntu 24.04. COPY scripts/magick-wrapper.sh /usr/local/bin/magick RUN chmod +x /usr/local/bin/magick @@ -92,14 +92,22 @@ ARG DEBUG=0 RUN if [ "${DEBUG}" -gt 0 ]; then pip install --no-cache-dir -e ".[debug,xrootd]"; else pip install --no-cache-dir ".[xrootd]"; fi; # Are we building with locally-checked-out shared modules? -# hadolint ignore=DL3013 -RUN if test -e modules/reana-commons; then \ +# hadolint ignore=DL3008,DL3013 +RUN apt-get update -y && \ + apt-get install -y --no-install-recommends \ + git && \ + if test -e modules/reana-commons; then \ if [ "${DEBUG}" -gt 0 ]; then \ pip install --no-cache-dir -e "modules/reana-commons[snakemake_reports]" --upgrade; \ else \ pip install --no-cache-dir "modules/reana-commons[snakemake_reports]" --upgrade; \ fi \ - fi + fi && \ + apt-get remove -y \ + git && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* # Check for any broken Python dependencies RUN pip check diff --git a/requirements.txt b/requirements.txt index 0429bfd..f0a59a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,77 +1,82 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --annotation-style=line --output-file=requirements.txt requirements.in setup.py # amqp==5.2.0 # via kombu appdirs==1.4.4 # via fs, snakemake -attrs==23.2.0 # via jsonschema -backports-zoneinfo[tzdata]==0.2.1 # via backports-zoneinfo, kombu +arrow==1.3.0 # via isoduration +attrs==23.2.0 # via jsonschema, referencing bracex==2.4 # via wcmatch bravado==10.3.2 # via reana-commons bravado-core==6.1.0 # via bravado, reana-commons -certifi==2024.2.2 # via requests +certifi==2024.7.4 # via requests charset-normalizer==3.3.2 # via requests checksumdir==1.1.9 # via reana-commons click==8.1.7 # via reana-commons configargparse==1.7 # via snakemake connection-pool==0.0.3 # via snakemake datrie==0.8.2 # via snakemake -docutils==0.20.1 # via snakemake -dpath==2.1.6 # via yte -fastjsonschema==2.19.1 # via nbformat +docutils==0.21.2 # via snakemake +dpath==2.2.0 # via yte +fastjsonschema==2.20.0 # via nbformat +fqdn==1.5.1 # via jsonschema fs==2.4.16 # via reana-commons gitdb==4.0.11 # via gitpython -gitpython==3.1.42 # via snakemake +gitpython==3.1.43 # via snakemake humanfriendly==10.0 # via snakemake -idna==3.6 # via jsonschema, requests -jinja2==3.1.3 # via snakemake -jsonpointer==2.4 # via jsonschema +idna==3.7 # via jsonschema, requests +importlib-resources==6.4.0 # via swagger-spec-validator +isoduration==20.11.0 # via jsonschema +jinja2==3.1.4 # via snakemake +jsonpointer==3.0.0 # via jsonschema jsonref==1.1.0 # via bravado-core -jsonschema[format]==3.2.0 # via bravado-core, nbformat, reana-commons, snakemake, swagger-spec-validator -jupyter-core==5.7.1 # via nbformat -kombu==5.3.5 # via reana-commons +jsonschema[format]==4.23.0 # via bravado-core, nbformat, reana-commons, snakemake, swagger-spec-validator +jsonschema-specifications==2023.12.1 # via jsonschema +jupyter-core==5.7.2 # via nbformat +kombu==5.3.7 # via reana-commons markupsafe==2.1.5 # via jinja2, werkzeug mock==3.0.5 # via reana-commons monotonic==1.6 # via bravado -msgpack==1.0.7 # via bravado-core +msgpack==1.0.8 # via bravado-core msgpack-python==0.5.6 # via bravado -nbformat==5.9.2 # via snakemake -packaging==23.2 # via snakemake +nbformat==5.10.4 # via snakemake +packaging==24.1 # via snakemake plac==1.4.3 # via yte -platformdirs==4.2.0 # via jupyter-core -psutil==5.9.8 # via snakemake +platformdirs==4.2.2 # via jupyter-core +psutil==6.0.0 # via snakemake pulp==2.7.0 # via reana-commons, snakemake -pygments==2.17.2 # via snakemake -pygraphviz==1.7 # via reana-commons -pyrsistent==0.20.0 # via jsonschema -python-dateutil==2.9.0 # via bravado, bravado-core +pygments==2.18.0 # via snakemake +python-dateutil==2.9.0.post0 # via arrow, bravado, bravado-core pytz==2024.1 # via bravado-core pyyaml==6.0.1 # via bravado, bravado-core, reana-commons, snakemake, swagger-spec-validator, yte -reana-commons[snakemake-reports]==0.95.0a2 # via reana-workflow-engine-snakemake (setup.py) -requests==2.31.0 # via bravado, bravado-core, snakemake +reana-commons[snakemake-reports]==0.95.0a3 # via reana-workflow-engine-snakemake (setup.py) +referencing==0.35.1 # via jsonschema, jsonschema-specifications +requests==2.32.3 # via bravado, bravado-core, snakemake reretry==0.11.8 # via snakemake +rfc3339-validator==0.1.4 # via jsonschema rfc3987==1.3.8 # via jsonschema +rpds-py==0.19.0 # via jsonschema, referencing simplejson==3.19.2 # via bravado, bravado-core -six==1.16.0 # via bravado, bravado-core, fs, jsonschema, mock, python-dateutil -smart-open==7.0.1 # via snakemake +six==1.16.0 # via bravado, bravado-core, fs, mock, python-dateutil, rfc3339-validator +smart-open==7.0.4 # via snakemake smmap==5.0.1 # via gitdb snakemake[reports]==7.32.4 # via reana-commons stopit==1.1.2 # via snakemake -strict-rfc3339==0.7 # via jsonschema -swagger-spec-validator==3.0.3 # via bravado-core -tabulate==0.8.10 # via reana-commons, snakemake +swagger-spec-validator==3.0.4 # via bravado-core +tabulate==0.9.0 # via snakemake throttler==1.2.2 # via snakemake toposort==1.10 # via snakemake -traitlets==5.14.1 # via jupyter-core, nbformat -typing-extensions==4.10.0 # via bravado, kombu, swagger-spec-validator -tzdata==2024.1 # via backports-zoneinfo -urllib3==2.2.1 # via requests +traitlets==5.14.3 # via jupyter-core, nbformat +types-python-dateutil==2.9.0.20240316 # via arrow +typing-extensions==4.12.2 # via bravado, swagger-spec-validator +uri-template==1.3.0 # via jsonschema +urllib3==2.2.2 # via requests vine==5.1.0 # via amqp, kombu wcmatch==8.4.1 # via reana-commons -webcolors==1.13 # via jsonschema -werkzeug==3.0.1 # via reana-commons +webcolors==24.6.0 # via jsonschema +werkzeug==3.0.3 # via reana-commons wrapt==1.16.0 # via smart-open, snakemake xrootd==5.6.0 # via -r requirements.in yte==1.5.4 # via snakemake diff --git a/setup.py b/setup.py index b1961ee..e6c9b39 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content",