From db35ac8d793506bc43b62e7e39d27a75de1043ed Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Mon, 6 Jul 2026 15:26:00 +0200 Subject: Migrate to pyproject.toml [tool.setuptools.data-files] does not support recursive directory installation. The old setup.cfg [files] worked because PBR's FilesConfig.expand_globs() used os.walk() to expand docker/*, but this hook is not triggered by the pbr.build PEP-517 backend. Move docker/ into kolla/ and use [tool.setuptools.package-data] instead. Update kolla_worker._get_images_dir() to check the kolla package directory first so both editable and regular installs work. Change-Id: I4fc452c03740ef22ebbb4e8d0d86c4f4783e2d09 Signed-off-by: Michal Nasiadka --- docker/cron/Dockerfile.j2 | 35 ----------------------------------- docker/cron/extend_start.sh | 21 --------------------- docker/cron/logrotate | 18 ------------------ 3 files changed, 74 deletions(-) delete mode 100644 docker/cron/Dockerfile.j2 delete mode 100644 docker/cron/extend_start.sh delete mode 100755 docker/cron/logrotate (limited to 'docker/cron') diff --git a/docker/cron/Dockerfile.j2 b/docker/cron/Dockerfile.j2 deleted file mode 100644 index d3a9213ac..000000000 --- a/docker/cron/Dockerfile.j2 +++ /dev/null @@ -1,35 +0,0 @@ -FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} -{% block labels %} -LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" -{% endblock %} - -{% block cron_header %}{% endblock %} - -{% import "macros.j2" as macros with context %} - -{% if base_package_type == 'rpm' %} - {% set cron_packages = [ - 'cronie', - 'logrotate' - ] %} - -# NOTE(hrw): In RHEL 9 family it is done by systemd timer, we want cron to -# handle it. -COPY logrotate /etc/cron.daily/logrotate - -{% elif base_package_type == 'deb' %} - {% set cron_packages = [ - 'cron', - 'logrotate' - ] %} -{% endif %} - -{{ macros.install_packages(cron_packages | customizable("packages")) }} - -COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 644 /usr/local/bin/kolla_extend_start - -{{ macros.kolla_patch_sources() }} - -{% block cron_footer %}{% endblock %} -{% block footer %}{% endblock %} diff --git a/docker/cron/extend_start.sh b/docker/cron/extend_start.sh deleted file mode 100644 index 3476302e1..000000000 --- a/docker/cron/extend_start.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -CRON_LOGROTATE_CURRENT_PATH="$(find /etc/cron* -name logrotate)" -CRON_LOGROTATE_CURRENT_SCHEDULE=$(echo "${CRON_LOGROTATE_CURRENT_PATH}" | sed -r 's/(.*)(hourly|daily|weekly|monthly)(.*)/\2/g') - -if [ -z $CRON_LOGROTATE_CURRENT_PATH ]; then - echo "logrotate is not handled by cron" -else - # Pass only for hourly|daily|weekly|monthly - if [[ "${KOLLA_LOGROTATE_SCHEDULE:-undefined}" =~ hourly|daily|weekly|monthly ]]; then - - CRON_LOGROTATE_DESIRED_PATH="/etc/cron.${KOLLA_LOGROTATE_SCHEDULE}/logrotate" - - if [[ "${CRON_LOGROTATE_CURRENT_PATH}" != "${CRON_LOGROTATE_DESIRED_PATH}" ]]; then - mv ${CRON_LOGROTATE_CURRENT_PATH} ${CRON_LOGROTATE_DESIRED_PATH} - CRON_LOGROTATE_CURRENT_SCHEDULE="${KOLLA_LOGROTATE_SCHEDULE}" - fi - fi - - echo "[i] Cron schedule for logrotate is currently set to: ${CRON_LOGROTATE_CURRENT_SCHEDULE}." -fi diff --git a/docker/cron/logrotate b/docker/cron/logrotate deleted file mode 100755 index 1ac157001..000000000 --- a/docker/cron/logrotate +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# skip in favour of systemd timer -if [ -d /run/systemd/system ]; then - exit 0 -fi - -# this cronjob persists removals (but not purges) -if [ ! -x /usr/sbin/logrotate ]; then - exit 0 -fi - -/usr/sbin/logrotate /etc/logrotate.conf -EXITVALUE=$? -if [ $EXITVALUE != 0 ]; then - /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" -fi -exit $EXITVALUE -- cgit v1.2.3