From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F33817CD for ; Sat, 30 Mar 2024 02:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711765544; cv=none; b=jXPAhwBQnU/PP4KUeV6ZYcONqR/fy+VXA2wyX80YTglGN7FslRIA20eD5R0BIswRhXSeJIW73kMmjMKIKE6eYBPat2KIDOu9HcQpm0Pjj0xeorEZ6PmflwHTskabNS7/nQeVqryRgXgxSDU47Kj4lfgiTeDiH4AvR1Qf4uyeVqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711765544; c=relaxed/simple; bh=+PWdWBn1GJsyngzqXu/9wofXh3Rcrz/HtNfFWBwEiZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mSoZgsyNlfcYNTIJKb5zEXguWd+db6dEZ+Xqx5YcRnaNgcsX9mUjqgbUk90QJo2aGN2N8QNkJ7Yd44/P/exS8dPexWwzRTtHcdKNMarsoEJBR23NWKh5b0KS8nzoP9Uoeiw7DdFv4TrmjTGHzFiSSaAw9oYXcfSqXe7t053w0Pw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=GccPXnId; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="GccPXnId" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=NK8rhLsTk9pCp0y85ZXevlQm4A2c2qWWLmkBbinfdfA=; b=GccPXnIdUd6l59CNM1PirwKKdI ATn9Drdwy+p4omCAf8UiJQ+qT8Y2En2FXoEydrhmExnz9DdoWbbBk8u9HDF/KFfQYOUgoof8yqPZD LahqU+UX+mUo1kKGwQ6b5Z3t6YGON6uedNesbVbsN4OxjZuCkQifiZrZcXJF50WfsmivJEVqrsocA 2WgRxS9xxt6F7RvgUbRgSoxLoSCEnPAfrEL+SVoUO922FDyiyoNUh6oVb/l3DKXeyVPaQVSmThozx QWoMcgFf7NN7jLZkdtgZeV5cDt01nAnuPa5Xm7Mtd5lGZXgPYQVeq6Y+ljA0kNDUizo1QJ49LlJa7 KxatCZ1Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rqOPd-00000002ZL3-2w2C; Sat, 30 Mar 2024 02:25:41 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 01/18] linux-mirror: add kdevops mirroring support Date: Fri, 29 Mar 2024 19:25:23 -0700 Message-ID: <20240330022540.612487-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240330022540.612487-1-mcgrof@kernel.org> References: <20240330022540.612487-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain We use kdevops git trees even on each guest, instead of cloning on github.com use the local mirror once and keep the mirror up to date every 5 minutes. Signed-off-by: Luis Chamberlain --- Makefile.linux-mirror | 5 +-- kconfigs/Kconfig.mirror | 32 +++++++++++++++++++ .../linux-mirror-systemd/Makefile | 10 ++++++ .../kdevops-mirror.service | 13 ++++++++ .../linux-mirror-systemd/kdevops-mirror.timer | 10 ++++++ 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.service create mode 100644 playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.timer diff --git a/Makefile.linux-mirror b/Makefile.linux-mirror index 245aa34cb4ca..762e53562493 100644 --- a/Makefile.linux-mirror +++ b/Makefile.linux-mirror @@ -46,8 +46,8 @@ LOCALHOST_SETUP_WORK += mirror mirror-help-menu: @echo "Mirror options:" - @echo "mirror - sets up systemd mirrors (Linux & QEMU)" - @echo "mirror-status - checks systemd mirrors status (Linux & QEMU)" + @echo "mirror - sets up systemd mirrors" + @echo "mirror-status - checks systemd mirrors status" @echo "" HELP_TARGETS += mirror-help-menu @@ -60,3 +60,4 @@ export MCGROF := $(subst ",,$(CONFIG_MIRROR_MCGROF_URL)) export MCGROF_LINUS := $(subst ",,$(CONFIG_MIRROR_MCGROF_LINUS_URL)) export QEMU := $(subst ",,$(CONFIG_MIRROR_QEMU_URL)) export QEMU_JIC23 := $(subst ",,$(CONFIG_MIRROR_QEMU_JIC23_URL)) +export KDEVOPS := $(subst ",,$(CONFIG_MIRROR_KDEVOPS_URL)) diff --git a/kconfigs/Kconfig.mirror b/kconfigs/Kconfig.mirror index 3f0b15859319..0cdce1566a8b 100644 --- a/kconfigs/Kconfig.mirror +++ b/kconfigs/Kconfig.mirror @@ -34,6 +34,7 @@ config INSTALL_LOCAL_LINUX_MIRROR to keep these properly updated. The repositories will be placed into /mirror/ directory: + Kernel development trees: /mirror/linux.git /mirror/linux-stable.git /mirror/linux-next.git @@ -41,6 +42,9 @@ config INSTALL_LOCAL_LINUX_MIRROR /mirror/mcgrof-next.git /mirror/mcgrof-linus.git + kdevops specific trees and kdevops git alternatives: + /mirror/kdevops.git + Enabling this even if you already have the repositories does nothing so it is safe to keep this enabled even after your first linux-mirror setup. You can however safely also disable this option after your @@ -51,6 +55,34 @@ config MIRROR_GIT_WORKS bool default $(shell, ./scripts/test_git_firewall.sh) +choice + prompt "kdevops mirror source" + default MIRROR_KDEVOPS_HTTPS_GITHUB + depends on INSTALL_LOCAL_LINUX_MIRROR + +config MIRROR_KDEVOPS_HTTPS_GITHUB + bool "HTTPS (github)" + help + If you enable this option then Github HTTPS will be used as the + source of the mirror. The URL is: + + https://github.com/linux-kdevops/kdevops.git + +config MIRROR_KDEVOPS_HTTPS_GITLAB + bool "HTTPS (GitLab)" + help + If you enable this option then GitLab HTTPS will be used as the + source of the mirror. The URL is: + + https://gitlab.com/linux-kdevops/kdevops.git + +endchoice + +config MIRROR_KDEVOPS_URL + string + default "https://github.com/linux-kdevops/kdevops.git" if MIRROR_KDEVOPS_HTTPS_GITHUB + default "https://gitlab.com/linux-kdevops/kdevops.git" if MIRROR_KDEVOPS_HTTPS_GITLAB + choice prompt "Linux mirror protocol" default MIRROR_TORVALDS_GIT if MIRROR_GIT_WORKS diff --git a/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile b/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile index 2bccada39cfc..5568d870c6bc 100644 --- a/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile +++ b/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile @@ -15,6 +15,9 @@ LINUX_TIMERS += kdevops-linus-mirror.timer LINUX_TIMERS += mcgrof-next-mirror.timer LINUX_TIMERS += mcgrof-linus-mirror.timer +KDEVOPS_SERVICES := kdevops-mirror.service +KDEVOPS_TIMERS := kdevops-mirror.timer + QEMU_SERVICES := qemu-mirror.service QEMU_SERVICES += qemu-jic23-mirror.service QEMU_TIMERS := qemu-mirror.timer @@ -32,12 +35,15 @@ MCGROF_TARGET_LINUS := $(MIRROR_PATH)/mcgrof-linus.git MCGROF_TARGET := $(MIRROR_PATH)/mcgrof-next.git QEMU_TARGET := $(MIRROR_PATH)/qemu.git QEMU_JIC23_TARGET := $(MIRROR_PATH)/qemu-jic23.git +KDEVOPS_TARGET := $(MIRROR_PATH)/kdevops.git MIRROR_SERVICES := $(LINUX_SERVICES) MIRROR_SERVICES += $(QEMU_SERVICES) +MIRROR_SERVICES += $(KDEVOPS_SERVICES) MIRROR_TIMERS := $(LINUX_TIMERS) MIRROR_TIMERS += $(QEMU_TIMERS) +MIRROR_TIMERS += $(KDEVOPS_TIMERS) ifeq ($(V),1) export Q= @@ -96,6 +102,10 @@ mirror: echo " CLONE qemu-project/jic23-qemu" ;\ git -C $(MIRROR_PATH) clone $(GIT_VERBOSE) --progress --mirror $(QEMU_JIC23) --reference /mirror/qemu.git $(QEMU_JIC23_TARGET) ;\ fi + $(Q)if [ ! -d $(KDEVOPS_TARGET) ]; then \ + echo " CLONE linux-kdevops/kdevops" ;\ + git -C $(MIRROR_PATH) clone $(GIT_VERBOSE) --progress --mirror $(KDEVOPS) $(KDEVOPS_TARGET) ;\ + fi install: $(Q)mkdir -p $(USER_SYSTEM) diff --git a/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.service b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.service new file mode 100644 index 000000000000..9cc1efdc892b --- /dev/null +++ b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.service @@ -0,0 +1,13 @@ +[Unit] +Description=kdevops mirror [qemu.git] +Documentation=man:git(1) +ConditionPathExists=/mirror/kdevops.git + +[Service] +Type=oneshot +ExecStartPre=/usr/bin/git -C /mirror/kdevops.git remote update --prune +ExecStart=/usr/bin/git -C /mirror/kdevops.git fetch --tags --prune +ExecStartPost=/usr/bin/git -C /mirror/kdevops.git fetch origin +refs/heads/*:refs/heads/* + +[Install] +WantedBy=multi-user.target diff --git a/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.timer b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.timer new file mode 100644 index 000000000000..9138bc7494bc --- /dev/null +++ b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-mirror.timer @@ -0,0 +1,10 @@ +[Unit] +Description=kdevops mirror query timer [kdevops.git] +ConditionPathExists=/mirror/qemu.git + +[Timer] +OnBootSec=5m +OnUnitInactiveSec=10m + +[Install] +WantedBy=default.target -- 2.43.0