Skip to content
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

build(docker): upgrade to ubuntu 24.04 and Python 3.12 #592

Merged
merged 2 commits into from
Aug 7, 2024
Merged
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
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -47,15 +47,15 @@ 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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Check Python code formatting
run: |
Expand All @@ -64,15 +64,15 @@ 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

- 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: |
Expand All @@ -81,15 +81,15 @@ 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

- 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: |
Expand All @@ -98,15 +98,15 @@ 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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Check Python manifest completeness
run: |
Expand All @@ -115,15 +115,15 @@ 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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Install system dependencies
run: |
Expand All @@ -140,15 +140,15 @@ jobs:
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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Install Python dependencies
run: |
Expand All @@ -171,7 +171,7 @@ jobs:
files: coverage.xml

lint-dockerfile:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -180,7 +180,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
Expand All @@ -189,7 +189,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' &&
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# This file is part of REANA.
# Copyright (C) 2017, 2018, 2019, 2020, 2021, 2022, 2023 CERN.
# Copyright (C) 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# 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

# 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/
Expand All @@ -26,16 +24,16 @@ RUN apt-get update -y && \
git \
libpcre3 \
libpcre3-dev \
libpython3.8 \
libpython3.12 \
python3-pip \
python3.8 \
python3.8-dev \
python3.12 \
python3.12-dev \
vim-tiny && \
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 \
gcc \
python3.8-dev && \
python3.12-dev && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
98 changes: 51 additions & 47 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,83 +1,87 @@
#
# 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 setup.py
#
alembic==1.13.1 # via reana-db
alembic==1.13.2 # via reana-db
amqp==5.2.0 # via kombu
appdirs==1.4.4 # via fs
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
cachetools==5.3.3 # via google-auth
certifi==2024.2.2 # via kubernetes, requests
cachetools==5.4.0 # via google-auth
certifi==2024.7.4 # via kubernetes, requests
cffi==1.16.0 # via cryptography
chardet==3.0.4 # via requests
charset-normalizer==3.3.2 # via requests
checksumdir==1.1.9 # via reana-commons
click==8.1.7 # via flask, reana-commons
cryptography==42.0.5 # via sqlalchemy-utils
flask==2.1.3 # via reana-workflow-controller (setup.py)
cryptography==43.0.0 # via sqlalchemy-utils
flask==2.2.5 # via reana-workflow-controller (setup.py)
fqdn==1.5.1 # via jsonschema
fs==2.4.16 # via reana-commons
gitdb==4.0.11 # via gitpython
gitpython==3.1.42 # via reana-workflow-controller (setup.py)
google-auth==2.28.1 # via kubernetes
idna==2.10 # via jsonschema, requests
importlib-metadata==7.0.1 # via alembic, flask
importlib-resources==6.1.2 # via alembic
itsdangerous==2.1.2 # via flask
jinja2==3.1.3 # via flask
jsonpickle==3.0.3 # via reana-workflow-controller (setup.py)
jsonpointer==2.4 # via jsonschema
gitpython==3.1.43 # via reana-workflow-controller (setup.py)
google-auth==2.32.0 # via kubernetes
greenlet==3.0.3 # via sqlalchemy
idna==3.7 # via jsonschema, requests
importlib-resources==6.4.0 # via swagger-spec-validator
isoduration==20.11.0 # via jsonschema
itsdangerous==2.2.0 # via flask
jinja2==3.1.4 # via flask
jsonpickle==3.2.2 # via reana-workflow-controller (setup.py)
jsonpointer==3.0.0 # via jsonschema
jsonref==1.1.0 # via bravado-core
jsonschema[format]==3.2.0 # via bravado-core, reana-commons, swagger-spec-validator
kombu==5.3.5 # via reana-commons
jsonschema[format]==4.23.0 # via bravado-core, reana-commons, swagger-spec-validator
jsonschema-specifications==2023.12.1 # via jsonschema
kombu==5.3.7 # via reana-commons
kubernetes==22.6.0 # via reana-commons
mako==1.3.2 # via alembic
mako==1.3.5 # via alembic
markupsafe==2.1.5 # via jinja2, mako, werkzeug
marshmallow==2.20.1 # via reana-workflow-controller (setup.py), webargs
marshmallow==2.21.0 # via reana-workflow-controller (setup.py), webargs
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
oauthlib==3.2.2 # via requests-oauthlib
packaging==23.2 # via reana-workflow-controller (setup.py)
packaging==24.1 # via reana-workflow-controller (setup.py)
psycopg2-binary==2.9.9 # via reana-db
pyasn1==0.5.1 # via pyasn1-modules, rsa
pyasn1-modules==0.3.0 # via google-auth
pycparser==2.21 # via cffi
pyrsistent==0.20.0 # via jsonschema
python-dateutil==2.9.0 # via bravado, bravado-core, kubernetes
pyasn1==0.6.0 # via pyasn1-modules, rsa
pyasn1-modules==0.4.0 # via google-auth
pycparser==2.22 # via cffi
python-dateutil==2.9.0.post0 # via arrow, bravado, bravado-core, kubernetes
pytz==2024.1 # via bravado-core
pyyaml==6.0.1 # via bravado, bravado-core, kubernetes, reana-commons, swagger-spec-validator
reana-commons[kubernetes]==0.95.0a2 # via reana-db, reana-workflow-controller (setup.py)
reana-db==0.95.0a2 # via reana-workflow-controller (setup.py)
requests==2.25.0 # via bravado, bravado-core, kubernetes, reana-workflow-controller (setup.py), requests-oauthlib
requests-oauthlib==1.3.1 # via kubernetes
reana-commons[kubernetes]==0.95.0a3 # via reana-db, reana-workflow-controller (setup.py)
reana-db==0.95.0a3 # via reana-workflow-controller (setup.py)
referencing==0.35.1 # via jsonschema, jsonschema-specifications
requests==2.32.3 # via bravado, bravado-core, kubernetes, reana-workflow-controller (setup.py), requests-oauthlib
requests-oauthlib==2.0.0 # via kubernetes
rfc3339-validator==0.1.4 # via jsonschema
rfc3987==1.3.8 # via jsonschema
rpds-py==0.19.0 # via jsonschema, referencing
rsa==4.9 # via google-auth
simplejson==3.19.2 # via bravado, bravado-core
six==1.16.0 # via bravado, bravado-core, fs, jsonschema, kubernetes, mock, python-dateutil
six==1.16.0 # via bravado, bravado-core, fs, kubernetes, mock, python-dateutil, rfc3339-validator
smmap==5.0.1 # via gitdb
sqlalchemy==1.3.24 # via alembic, reana-db, sqlalchemy-utils
sqlalchemy-utils[encrypted]==0.41.1 # via reana-db, reana-workflow-controller (setup.py)
strict-rfc3339==0.7 # via jsonschema
swagger-spec-validator==3.0.3 # via bravado-core
typing-extensions==4.10.0 # via alembic, bravado, kombu, swagger-spec-validator
tzdata==2024.1 # via backports-zoneinfo
urllib3==1.26.18 # via kubernetes, requests
uwsgi==2.0.24 # via reana-workflow-controller (setup.py)
sqlalchemy==1.4.52 # via alembic, reana-db, sqlalchemy-utils
sqlalchemy-utils[encrypted]==0.41.2 # via reana-db, reana-workflow-controller (setup.py)
swagger-spec-validator==3.0.4 # via bravado-core
types-python-dateutil==2.9.0.20240316 # via arrow
typing-extensions==4.12.2 # via alembic, bravado, swagger-spec-validator
uri-template==1.3.0 # via jsonschema
urllib3==2.2.2 # via kubernetes, requests
uwsgi==2.0.26 # via reana-workflow-controller (setup.py)
uwsgi-tools==1.1.1 # via reana-workflow-controller (setup.py)
uwsgitop==0.11 # via reana-workflow-controller (setup.py)
uwsgitop==0.12 # via reana-workflow-controller (setup.py)
vine==5.1.0 # via amqp, kombu
wcmatch==8.4.1 # via reana-commons
webargs==6.1.1 # via reana-workflow-controller (setup.py)
webcolors==1.13 # via jsonschema
websocket-client==1.7.0 # via kubernetes
werkzeug==2.3.8 # via flask, reana-commons, reana-workflow-controller (setup.py)
zipp==3.17.0 # via importlib-metadata, importlib-resources
webcolors==24.6.0 # via jsonschema
websocket-client==1.8.0 # via kubernetes
werkzeug==2.2.3 # via flask, reana-commons, reana-workflow-controller (setup.py)

# The following packages are considered to be unsafe in a requirements file:
# setuptools
19 changes: 11 additions & 8 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,23 @@ check_commitlint () {
commit_hash=$(echo "$line" | cut -d ' ' -f 1)
commit_title=$(echo "$line" | cut -d ' ' -f 2-)
commit_number_of_parents=$(git rev-list --parents "$commit_hash" -n1 | awk '{print NF-1}')
# (i) skip checking release commits generated by Release Please
if [ "$commit_number_of_parents" -le 1 ] && echo "$commit_title" | grep -qP "^chore\(.*\): release"; then
continue
fi
# (ii) check presence of PR number
if ! echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
echo "✖ Headline does not end by '(#$pr)' PR number: $commit_title"
found=1
fi
# (iii) check absence of merge commits in feature branches
if [ "$commit_number_of_parents" -gt 1 ]; then
if echo "$commit_title" | grep -qP "^chore\(.*\): merge "; then
break
break # skip checking maint-to-master merge commits
else
echo "✖ Merge commits are not allowed in feature branches: $commit_title"
found=1
fi
elif echo "$commit_title" | grep -qP "^chore\(.*\): release"; then
true
elif echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
true
else
echo "✖ Headline does not end by '(#$pr)' PR number: $commit_title"
found=1
fi
done < <(git log "$from..$to" --format="%H %s")
if [ $found -gt 0 ]; then
Expand Down
Loading
Loading