From: Luis Chamberlain <mcgrof@kernel.org>
To: kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 01/18] linux-mirror: add kdevops mirroring support
Date: Fri, 29 Mar 2024 19:25:23 -0700 [thread overview]
Message-ID: <20240330022540.612487-2-mcgrof@kernel.org> (raw)
In-Reply-To: <20240330022540.612487-1-mcgrof@kernel.org>
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 <mcgrof@kernel.org>
---
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
next prev parent reply other threads:[~2024-03-30 2:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-30 2:25 [PATCH 00/18] mirrors: enhance and add tons of mirrors Luis Chamberlain
2024-03-30 2:25 ` Luis Chamberlain [this message]
2024-03-30 2:25 ` [PATCH 02/18] Makefile.min_deps: add netcat as a min binary dependency Luis Chamberlain
2024-03-30 2:25 ` [PATCH 03/18] provision: generalize bridge-ip further Luis Chamberlain
2024-03-30 2:25 ` [PATCH 04/18] mirrors: add guestfs mirror options without 9p Luis Chamberlain
2024-03-30 2:25 ` [PATCH 05/18] mirrors: enable kdevops mirror Luis Chamberlain
2024-03-30 2:25 ` [PATCH 06/18] mirrors: add fstests to mirrors Luis Chamberlain
2024-03-30 2:25 ` [PATCH 07/18] fstests: use local primary fstests mirror if present Luis Chamberlain
2024-03-30 2:25 ` [PATCH 08/18] mirrors: add kdevops git alternative for fstests Luis Chamberlain
2024-03-30 2:25 ` [PATCH 09/18] mirrors: use kdevops fstests mirror when available Luis Chamberlain
2024-03-30 2:25 ` [PATCH 10/18] mirrors: add blktests mirror Luis Chamberlain
2024-03-30 2:25 ` [PATCH 11/18] mirrors: use blktests mirror when its available Luis Chamberlain
2024-03-30 2:25 ` [PATCH 12/18] mirrors: increase scope of mirroring in output Luis Chamberlain
2024-03-30 2:25 ` [PATCH 13/18] mirrors: move status check Luis Chamberlain
2024-03-30 2:25 ` [PATCH 14/18] mirrors: move mirror editing into one file Luis Chamberlain
2024-03-30 2:25 ` [PATCH 15/18] mirrors: add new mirrors.yaml and add xfsprogs Luis Chamberlain
2024-03-30 2:25 ` [PATCH 16/18] mirrors: add xfsdump mirror and use it Luis Chamberlain
2024-03-30 2:25 ` [PATCH 17/18] mirrors: add dbench git Luis Chamberlain
2024-03-30 2:25 ` [PATCH 18/18] mirrors: add blktrace mirror and use it Luis Chamberlain
2024-03-30 16:37 ` [PATCH 00/18] mirrors: enhance and add tons of mirrors Chuck Lever III
2024-04-03 1:01 ` Luis Chamberlain
2024-04-03 18:04 ` Chuck Lever III
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240330022540.612487-2-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox