From 86d41493d713aa0ae61dea2787f3ae992ada6e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Mon, 9 Dec 2024 17:30:13 +0100 Subject: [PATCH] Use Fedora-41-based base image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- alembic.ini | 4 ++++ docker-compose.yml | 6 +++--- files/docker/Dockerfile | 2 +- files/docker/Dockerfile.tests | 2 +- files/docker/Dockerfile.worker | 2 +- files/install-deps-worker.yaml | 19 +++++-------------- files/install-deps.yaml | 21 ++++++--------------- packit_service/service/api/usage.py | 3 ++- 8 files changed, 23 insertions(+), 36 deletions(-) diff --git a/alembic.ini b/alembic.ini index cd0f32ebe..90d3b8671 100644 --- a/alembic.ini +++ b/alembic.ini @@ -7,6 +7,10 @@ script_location = alembic # template used to generate migration files # file_template = %%(rev)s_%%(slug)s +# sys.path path, will be prepended to sys.path if present. +# defaults to the current working directory. +prepend_sys_path = . + # timezone to use when rendering the date # within the migration file as well as the filename. # string value is passed to dateutil.tz.gettz() diff --git a/docker-compose.yml b/docker-compose.yml index d1a592dcf..7204e385d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -97,8 +97,8 @@ services: GIT_SSH_COMMAND: "ssh -F /home/packit/.ssh/config" #SQLALCHEMY_ECHO: 1 volumes: - - ../packit/packit:/usr/local/lib/python3.9/site-packages/packit:ro,z - - ./packit_service:/usr/local/lib/python3.9/site-packages/packit_service:ro,z + - ../packit/packit:/usr/local/lib/python3.13/site-packages/packit:ro,z + - ./packit_service:/usr/local/lib/python3.13/site-packages/packit_service:ro,z - ./files/run_worker.sh:/usr/bin/run_worker.sh:ro,Z - ./secrets/packit/dev/packit-service.yaml:/home/packit/.config/packit-service.yaml:ro,z - ./secrets/packit/dev/copr:/home/packit/.config/copr:ro,z @@ -243,7 +243,7 @@ services: CELERY_RETRY_LIMIT: 0 PUSHGATEWAY_ADDRESS: "" volumes: - - ./packit_service:/usr/local/lib/python3.9/site-packages/packit_service:ro,z + - ./packit_service:/usr/local/lib/python3.13/site-packages/packit_service:ro,z - ./secrets/packit/dev/packit-service.yaml:/home/packit/.config/packit-service.yaml:ro,z - ./secrets/packit/dev/copr:/home/packit/.config/copr:ro,z - ./secrets/packit/dev/ssh_config:/packit-ssh/config:ro,z diff --git a/files/docker/Dockerfile b/files/docker/Dockerfile index f2a82282d..0470cc9a7 100644 --- a/files/docker/Dockerfile +++ b/files/docker/Dockerfile @@ -1,6 +1,6 @@ # Image for the web service (httpd), for celery worker see files/docker/Dockerfile.worker -FROM quay.io/packit/base:c9s +FROM quay.io/packit/base:fedora ARG SOURCE_BRANCH RUN if [[ -z $SOURCE_BRANCH ]]; then \ diff --git a/files/docker/Dockerfile.tests b/files/docker/Dockerfile.tests index ee597fb84..ced06b580 100644 --- a/files/docker/Dockerfile.tests +++ b/files/docker/Dockerfile.tests @@ -1,6 +1,6 @@ # For running tests locally, see check_in_container target in Makefile -FROM quay.io/packit/base:c9s +FROM quay.io/packit/base:fedora ARG SOURCE_BRANCH RUN if [[ -z $SOURCE_BRANCH ]]; then \ diff --git a/files/docker/Dockerfile.worker b/files/docker/Dockerfile.worker index aa06755e0..0a724d42b 100644 --- a/files/docker/Dockerfile.worker +++ b/files/docker/Dockerfile.worker @@ -1,6 +1,6 @@ # Celery worker which runs tasks (packit) from the web service -FROM quay.io/packit/base:c9s +FROM quay.io/packit/base:fedora ARG SOURCE_BRANCH RUN if [[ -z $SOURCE_BRANCH ]]; then \ diff --git a/files/install-deps-worker.yaml b/files/install-deps-worker.yaml index b4c8831a6..1c2a3c020 100644 --- a/files/install-deps-worker.yaml +++ b/files/install-deps-worker.yaml @@ -11,14 +11,16 @@ - name: Install all RPM/python packages needed to run packit-service worker ansible.builtin.dnf: name: - - python3-ipdb # for easy debugging - nss_wrapper # openshift anyuid passwd madness - python3-requests - python3-prometheus_client - python3-sqlalchemy - python3-psycopg2 - - python3-redis # celery[redis] + - python3-redis + - python3-celery - python3-lazy-object-proxy + - python3-sentry-sdk + - python3-syslog-rfc5424-formatter # logging to Splunk - dnf-utils - make # for pip-installing sandcastle from git repo @@ -29,7 +31,6 @@ - python3-boto3 # AWS (S3) - python3-fasjson-client - python3-gevent # concurrency pool, see run_worker.sh - - python3-eventlet # concurrency pool, see run_worker.sh - bodhi-client # sandcastle deps - python3-charset-normalizer @@ -38,10 +39,6 @@ - python3-pyyaml - python3-requests-oauthlib - python3-websocket-client - # for full support of %autorelease and %autochangelog - - rpmautospec-rpm-macros - # for additional macros needed to parse certain spec files - - epel-rpm-macros # for the `pkg_tool` switch to allow centpkg - centpkg state: present @@ -50,13 +47,7 @@ ansible.builtin.pip: name: - git+https://github.com/packit/sandcastle.git@{{ source_branch }} - # The above bodhi-client RPM installs python3-requests-2.25.1 and python3-urllib3-1.26.5 - # The below sentry_sdk would then install urllib3-2.x because of its urllib3>=1.26.11 requirement - # and 'pip check' would then scream that "requests 2.25.1 has requirement urllib3<1.27" - - urllib3<1.27 - - sentry-sdk - - syslog-rfc5424-formatter # Logging to Splunk - - celery==5.3.* # RHBZ#2032543 + - eventlet - name: Check if all pip packages have all dependencies installed command: pip check - import_tasks: tasks/setup-copr-repos.yaml diff --git a/files/install-deps.yaml b/files/install-deps.yaml index bb1dd13c9..5d3ae8f1f 100644 --- a/files/install-deps.yaml +++ b/files/install-deps.yaml @@ -11,9 +11,9 @@ - name: Install all RPM/python packages needed to run packit-service ansible.builtin.dnf: name: - - python3-ipdb # for easy debugging - python3-click - git # setuptools-scm + - dnf-utils # httpd & deps - python3-mod_wsgi - mod_http2 @@ -22,30 +22,21 @@ - python3-sqlalchemy - python3-psycopg2 - python3-prometheus_client - - python3-redis # celery[redis] + - python3-redis + - python3-celery - python3-lazy-object-proxy + - python3-flask-cors - python3-flask-restx - python3-flask-talisman - python3-flexmock # alembic (d90948124e46_..._.py ) + - python3-sentry-sdk+flask + - python3-syslog-rfc5424-formatter # logging to Splunk - python-jwt - bodhi-client # This is to be able to provide service version via API - python-setuptools_scm state: present install_weak_deps: False - - name: Install pip deps - ansible.builtin.pip: - name: - # The above bodhi-client RPM installs python3-requests-2.25.1 and python3-urllib3-1.26.5 - # The below sentry_sdk would then install urllib3-2.x because of its urllib3>=1.26.11 requirement - # and 'pip check' would then scream that "requests 2.25.1 has requirement urllib3<1.27" - - urllib3<1.27 - - sentry-sdk[flask] - - syslog-rfc5424-formatter - - celery==5.3.* # RHBZ#2032543 - - flask-cors # RHBZ#2100076 - - name: Check if all pip packages have all dependencies installed - ansible.builtin.command: pip check - import_tasks: tasks/setup-copr-repos.yaml - name: Install ogr, specfile and packit from copr ansible.builtin.dnf: diff --git a/packit_service/service/api/usage.py b/packit_service/service/api/usage.py index fba311da0..2ecb5020b 100644 --- a/packit_service/service/api/usage.py +++ b/packit_service/service/api/usage.py @@ -7,8 +7,9 @@ from logging import getLogger from typing import Any -from flask import Response, escape, redirect, request +from flask import Response, redirect, request from flask_restx import Namespace, Resource +from markupsafe import escape from packit_service.celerizer import celery_app from packit_service.constants import (