From patchwork Wed Nov 6 12:41:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Moessbauer X-Patchwork-Id: 3902 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 06 Nov 2024 13:41:28 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ot1-f59.google.com (mail-ot1-f59.google.com [209.85.210.59]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4A6CfRqc018560 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Nov 2024 13:41:28 +0100 Received: by mail-ot1-f59.google.com with SMTP id 46e09a7af769-717fac47d50sf1578308a34.2 for ; Wed, 06 Nov 2024 04:41:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730896881; cv=pass; d=google.com; s=arc-20240605; b=TdY/kM/hkJjYLaYnOjLr/Eryas4xHLxKIVOZ5VvkJgLboDWW66zlJ1EBsE5vWLTwuW 8i1XwTW+0w7ucpx1Z9Q1dxJ8KuuKPLK1zOfzP/wszc/q1ygyV4415LMhQJgdvbO0zu2X jzpW/+TqFK4sDENYE2h2jU55wkhbsmShGa9loYCKIdGMymTpLbG/3roIO+aSZCPFL97d +Xta3parKyME/F9E2c6YviEYl84sYXQacBQ3fGCO3e9LaZANXnGxH45gYqrsIA0bsjAi voRWcJQq6yxTnb6tuR3HTZi13jQBaVlSW4RsZQWrOjFsXpSAu42QOcPcBac54DuqGu8M KzTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=YrraIzorot2dg7mHR9EI2VlQvPxihjBZwVD8m04TL8g=; fh=alp4OzdFJDsMvHiqZ/o8JGe/oUWkDap0ybO3RcfzJV4=; b=hukbvMplzRAq3YUvu0yQnLtWN4C2XijKJJPnmT6TYUMc5rjBWBbZIpKjTN/PCI2d9H IwUL3WiSaydKDDEsFzLagx6hci0DBSq9moLwcShYwjqZR9IhXDgUrXj3XSIXzBl+Bp0O f6411wV6b5slZVx6vXBi8B34LRBXYrTAiUz2aZO5Ji6snlKmpselfnGKzg/vOXSbfbBE TWp/srU0b5lIj6Q/2Wx0ZvxHZIHTqFfAVFGOeDyyeYm3uE1Fth21tmlgmaIYt4htFtJw ylv1Dg6tZfHLxFcY6gk37j5MmaFW8P5j0jhtf/JHeYv0Ai8radfjzeoXyHXANyNNPYUm E65A==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="iIK1YU/u"; spf=pass (google.com: domain of fm-1321639-20241106124117ea6b334caf08935df3-w0doqv@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1321639-20241106124117ea6b334caf08935df3-w0DoqV@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1730896881; x=1731501681; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YrraIzorot2dg7mHR9EI2VlQvPxihjBZwVD8m04TL8g=; b=nUgfVSMa0OEPXRyOCacTdq5cdTH/qT5a2VPudDpgbFIxph0bQif5wazGPwHJ0JHHUj m34OksF8b0Y55U8ENtj2OoiqjH8sLn/w7QuB7Dyfx+Omv3AuhlsVuTAiDJW2/13xS3mJ rHABxVaUiZKob47Ynhdi7P5Vq5nkhCINMebmdnBN0wW2QKW+1Z7ToQGeIcFYmQ/AiS7w f6XVyNalrn3d8BPkBZcskjO/1DUotoE7AHIQUYLD8IxiWJtOK5+1BAXg+6qj7A3DRPXU FEED44OqyR6aVjjI7QrOqCpc+Y8WktuizNk6pZedzmmiL/64P7rwQa4u92ubQZob1mSQ JtUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730896881; x=1731501681; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YrraIzorot2dg7mHR9EI2VlQvPxihjBZwVD8m04TL8g=; b=vCbmb+y9iog3xiDN8H98T+C/aCi2T6C5e9nIxIiLIEgrkIAODgnheAZpURZRgaLxXs Rx4YilM84lwduvLFwwPrsNRM2wW+61j+N67Q+n2nLpgiMpTCKR1w5WXVQ+d/ZFmFzQCI CQfr2xKuwiBFGNWPEkm1uQzt1PS3ExQBUsGLuieBS/JQrGpLpYCmGaWPhVbCq8i3nBVB nSLrRGj6V618ddRRmyPq3h3JkASlZsK2Wfqol31Ot/rYmXFPG2kXqx80kZ4ONLKdEwMN KiEwJzZCgdIcRvhpcN4j4eD2aboN+MXs4pirKOenPzzHkLMaY0BCf5Kwxm9KjoHd5lJP t26g== X-Forwarded-Encrypted: i=2; AJvYcCUccBIffY7tX/N6ArdiDQe8y6pCscvEM5FhusW6W9WOOPZhjQua1Cj+qx7ChCG5O50o6cogb50=@isar-build.org X-Gm-Message-State: AOJu0Yx8HC72bxPK+DznEeh3y73PZNLZSpbjAK73e+XDMK05bKW+dUNX 9w3GQeFBcJfoWlvhQVKGvNSWMahR1WWywdHgoRGj2e0bxK7FjvxP X-Google-Smtp-Source: AGHT+IGEoRJn2JJr3RpV++pSfMtw8ut3lDpU7sH5MDR/MvdOpPTSZ+7RhhMbUHodzwwXlF83gF8NSg== X-Received: by 2002:a05:6870:7311:b0:288:2955:3efb with SMTP id 586e51a60fabf-29051c4e8a4mr9211589fac.8.1730896881083; Wed, 06 Nov 2024 04:41:21 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:82a4:b0:278:2606:8489 with SMTP id 586e51a60fabf-294820f6998ls5718624fac.0.-pod-prod-09-us; Wed, 06 Nov 2024 04:41:20 -0800 (PST) X-Received: by 2002:a05:6870:8a20:b0:261:877:7459 with SMTP id 586e51a60fabf-29051d39578mr35290644fac.38.1730896880126; Wed, 06 Nov 2024 04:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730896880; cv=none; d=google.com; s=arc-20240605; b=Un2iu0NMGnEdazVGsuw5QpMoilyEG3YDvsvLHwEHysO9NbdS14f5P4C3rKo658rOqf 37EOP3X2tuzR3wdoOjV/s0/ddoJ+SuZamdQR61L8TDG0JJvun5LEcbYfVuyN95sQAzc9 To0lHnKH5GS8T5E10oKaQQfh6LWlpVjOM6xLYh23OlXUAYpTL+/XYFKn32aZntgm6PQD st7g/moQZEplq8PRWR8ELlfCxtxGD08SdpCPa6GTauX9vY5h4BG43mLrM+IMxHUXmZi0 cTC5zrwLJwv6RJ8vItCtSsYzLetz21wWV3g/hauiKK+GaJ7oN6VEcouuOStNYqyv0Hao 9hzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=E8xuwmHL3B2w9jjXybcrxpjo1xzFOT6FNTdA8pCpAGo=; fh=QHjmU9cI+NAmDDBS7+5Yc1hf2rJyWRDM00VAGqng09w=; b=G34MAQVEhEwBi6xNYoghiMnZzH0rkOqESo2Pybg0E8kShjN9n+/Aw8pC3e4sTf5p1U NTDA73v4/zccys2j3leidafcZpMZyX+kp5griEB386CftBbFuZt97LvothpEERt9pHGa GZBUAY0+rOiru604AvVL8/7PASfICMyb0mRhJYfjaQ+WUGcWwAZMY5CkQRiqOqjzkMpb ERdvyq5qeKfNGp/DhjgRMg46QX2ZR7UEZM9d+GWsunPmocPQeFwf7aVfGcYUapH7a3CD 4ilbCelsD6o/Ujlvgyf6XHv6+FDkvy8HgzGAVE56hLUbcQ25ofMSiEJsTVS4SFQ9Go53 6S3Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="iIK1YU/u"; spf=pass (google.com: domain of fm-1321639-20241106124117ea6b334caf08935df3-w0doqv@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1321639-20241106124117ea6b334caf08935df3-w0DoqV@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id 46e09a7af769-7189cc6ca47si587140a34.2.2024.11.06.04.41.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2024 04:41:19 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1321639-20241106124117ea6b334caf08935df3-w0doqv@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20241106124117ea6b334caf08935df3 for ; Wed, 06 Nov 2024 13:41:18 +0100 X-Patchwork-Original-From: "'Felix Moessbauer' via isar-users" From: Felix Moessbauer To: isar-users@googlegroups.com Cc: florian.bezdeka@siemens.com, jan.kiszka@siemens.com, alexander.heinisch@siemens.com, Felix Moessbauer Subject: [PATCH 1/1] improve apt fetching from rate-limited snapshot mirrors Date: Wed, 6 Nov 2024 13:41:08 +0100 Message-Id: <20241106124108.220323-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1321639:519-21489:flowmailer X-Original-Sender: felix.moessbauer@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="iIK1YU/u"; spf=pass (google.com: domain of fm-1321639-20241106124117ea6b334caf08935df3-w0doqv@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1321639-20241106124117ea6b334caf08935df3-w0DoqV@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Felix Moessbauer Reply-To: Felix Moessbauer Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The snapshot mirrors apply strict rate limiting, making it impossible to use them with a default apt configuration. On the other hand, apt does not obey the retry-after http response header, but uses a exponential backoff mechanism (retry after 1,2,4,...) seconds. By that, the currently used 3 retries are basically useless as apt aborts way before the rate-limit expires. We change that to retry at most 10 times with a futher upper limit of 10 minutes (both only when using ISAR_USE_APT_SNAPSHOT). This is a compromise between not stalling failed builds but also making them more reliable. Signed-off-by: Felix Moessbauer --- doc/user_manual.md | 4 +++- meta/classes/rootfs.bbclass | 5 ++++- meta/conf/bitbake.conf | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/user_manual.md b/doc/user_manual.md index 284847c8..4b07f903 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -433,7 +433,9 @@ Some other variables include: - `HOST_DISTRO_BOOTSTRAP_KEYS` - Analogously to DISTRO_BOOTSTRAP_KEYS: List of gpg key URIs used to verify apt bootstrap repo for the host. - `DISTRO_APT_PREMIRRORS` - The preferred mirror (append it to the default URI in the format `ftp.debian.org my.preferred.mirror`. This variable is optional. PREMIRRORS will be used only for the build. The final images will have the sources list as mentioned in DISTRO_APT_SOURCES. - `ISAR_USE_APT_SNAPSHOT` - Use a frozen apt snapshot instead of the live mirror. Optional. - `ISAR_APT_DL_LIMIT` - Rate limit the apt fetching to n kB / s. Optional. + - `ISAR_APT_DL_LIMIT` - Rate limit the apt fetching to n kB / s. Optional. + - `ISAR_APT_RETRIES` - Number of apt fetching retries before giving up. Optional + - `ISAR_APT_DELAY_MAX` - Maximum time in seconds apt performs retries. Optional - `DISTRO_APT_SNAPSHOT_PREMIRROR` - Similar to `DISTRO_APT_PREMIRRORS` but for a snapshot, pre-defined for supported distros. - `ISAR_APT_SNAPSHOT_TIMESTAMP` - Unix timestamp of the apt snapshot. Automatically derived from `SOURCE_DATE_EPOCH` if not overwritten. (Consider `ISAR_APT_SNAPSHOT_DATE` for a more user friendly format) - `ISAR_APT_SNAPSHOT_DATE` - Timestamp in upstream format (e.g. `20240702T082400Z`) of the apt snapshot. Overrides `ISAR_APT_SNAPSHOT_TIMESTAMP` if set. Otherwise, will be automatically derived from `ISAR_APT_SNAPSHOT_TIMESTAMP` diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index c7011508..03e80018 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -148,7 +148,10 @@ rootfs_configure_apt() { mkdir -p '${ROOTFSDIR}/etc/apt/apt.conf.d' { - echo 'Acquire::Retries "3";' + echo 'Acquire::Retries "${ISAR_APT_RETRIES}";' + if [ -n "${ISAR_APT_DELAY_MAX}" ]; then + echo 'Acquire::Retries::Delay::Maximum "${ISAR_APT_DELAY_MAX}";' + fi if [ -n "${ISAR_APT_DL_LIMIT}" ]; then echo 'Acquire::http::Dl-Limit "${ISAR_APT_DL_LIMIT}";' echo 'Acquire::https::Dl-Limit "${ISAR_APT_DL_LIMIT}";' diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 13966a62..5fe50787 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -148,6 +148,8 @@ export SOURCE_DATE_EPOCH ?= "${@get_source_date_epoch_value(d)}" SOURCE_DATE_EPOCH_FALLBACK ??= "1709565251" # Debian snapshots ISAR_USE_APT_SNAPSHOT ??= "0" +ISAR_APT_RETRIES ??= "${@'10' if bb.utils.to_boolean(d.getVar('ISAR_USE_APT_SNAPSHOT')) else '3'}" +ISAR_APT_DELAY_MAX ??= "${@'600' if bb.utils.to_boolean(d.getVar('ISAR_USE_APT_SNAPSHOT')) else ''}" ISAR_APT_SNAPSHOT_TIMESTAMP ??= "${SOURCE_DATE_EPOCH}" # Default parallelism and resource usage for xz