public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 08/18] mirrors: add kdevops git alternative for fstests
Date: Fri, 29 Mar 2024 19:25:30 -0700	[thread overview]
Message-ID: <20240330022540.612487-9-mcgrof@kernel.org> (raw)
In-Reply-To: <20240330022540.612487-1-mcgrof@kernel.org>

kdevops supports its own CONFIG_GIT_ALTERNATIVES which allows
kdevops to mirror upstream projects on its own organization, so
that our own fork can host patches which perhaps have not landed
upstream on fstests yet, and also to ensure reproducible workflows.
If we follow upstream, the branch may be a moving target and sometimes
thigns may work sometimes things will not. For deatils refer to our
Kconfig documentation of GIT_ALTERNATIVES.

This now mirrors the fstests kdevops git alternatives. We will place
these mirrored alternatives under a directory representing the
alternative source, in this case its kdevops, /mirror/kdevops/fstest.git.
Note that we have an alternative for fstests for btrfs but this doesn't
yet properly pronounce itself as an alternative itself, its was just
caked in as another option. We should fix that so that we can also
mirror btrfs's fstests and be able to easily use it.

Now with today's defaults you will end up using mirroring for
both kdevops and fstests when you enable the fstests workflow
if a mirror was found for each one on your system:

grep git extra_vars.yaml | grep git
kdevops_git: git://192.168.122.1/mirror/kdevops.git
kdevops_git_version: HEAD
fstests_git: git://192.168.122.1/mirror/kdevops/fstests.git
fstests_git_version: HEAD

It is important to use --reference here as the kdevops fork and so
can share objects on the server with the fstests tree. If you add
support for a tree which is a fork, do the same.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 Makefile.linux-mirror                         |  1 +
 kconfigs/Kconfig.mirror                       | 30 +++++++++++++++++++
 .../linux-mirror-systemd/Makefile             |  7 +++++
 .../kdevops-fstests-mirror.service            | 13 ++++++++
 .../kdevops-fstests-mirror.timer              | 11 +++++++
 5 files changed, 62 insertions(+)
 create mode 100644 playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.service
 create mode 100644 playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.timer

diff --git a/Makefile.linux-mirror b/Makefile.linux-mirror
index d6b0c848eaeb..f6cc1b447eb8 100644
--- a/Makefile.linux-mirror
+++ b/Makefile.linux-mirror
@@ -62,3 +62,4 @@ export QEMU		:= $(subst ",,$(CONFIG_MIRROR_QEMU_URL))
 export QEMU_JIC23	:= $(subst ",,$(CONFIG_MIRROR_QEMU_JIC23_URL))
 export KDEVOPS		:= $(subst ",,$(CONFIG_MIRROR_KDEVOPS_URL))
 export FSTESTS		:= $(subst ",,$(CONFIG_MIRROR_FSTESTS_URL))
+export KDEVOPS_FSTESTS	:= $(subst ",,$(CONFIG_MIRROR_KDEVOPS_FSTESTS_URL))
diff --git a/kconfigs/Kconfig.mirror b/kconfigs/Kconfig.mirror
index fa5ec8c1333f..076d5d117984 100644
--- a/kconfigs/Kconfig.mirror
+++ b/kconfigs/Kconfig.mirror
@@ -44,6 +44,7 @@ config INSTALL_LOCAL_LINUX_MIRROR
 
 	  kdevops specific trees and kdevops git alternatives:
 	    /mirror/kdevops.git
+	    /mirror/kdevops/fstests.git
 
 	  Tools:
 	    /mirror/fstests.git
@@ -429,5 +430,34 @@ config MIRROR_FSTESTS_URL
 	default "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git" if MIRROR_FSTESTS_HTTPS
 	default "https://kernel.googlesource.com/pub/scm/fs/xfs/xfstests-dev.git" if MIRROR_FSTESTS_HTTPS_GOOGLE
 
+choice
+	prompt "Tools - kdevops/fstests.git mirror protocol/source"
+	default MIRROR_KDEVOPS_FSTESTS_HTTPS_GITHUB
+	default MIRROR_KDEOVPS_FSTESTS_HTTPS_GITLAB
+	depends on INSTALL_LOCAL_LINUX_MIRROR
+
+config MIRROR_KDEVOPS_FSTESTS_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/fstests.git
+
+config MIRROR_KDEVOPS_FSTESTS_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/fstests.git
+
+endchoice
+
+config MIRROR_KDEVOPS_FSTESTS_URL
+	string
+	default "https://github.com/linux-kdevops/fstests.git" if MIRROR_KDEVOPS_FSTESTS_HTTPS_GITHUB
+	default "https://gitlab.com/linux-kdevops/fstests.git" if MIRROR_KDEVOPS_FSTESTS_HTTPS_GITLAB
+
 endif # ENABLE_LOCAL_LINUX_MIRROR
 endif # TERRAFORM
diff --git a/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile b/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile
index 7de8cc4e326d..4a69ee7ca88f 100644
--- a/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile
+++ b/playbooks/roles/linux-mirror/linux-mirror-systemd/Makefile
@@ -19,7 +19,9 @@ KDEVOPS_SERVICES  := kdevops-mirror.service
 KDEVOPS_TIMERS := kdevops-mirror.timer
 
 TOOLS_SERVICES  := fstests-mirror.service
+TOOLS_SERVICES  += kdevops-fstests-mirror.service
 TOOLS_TIMERS := fstests-mirror.timer
+TOOLS_TIMERS += kdevops-fstests-mirror.timer
 
 QEMU_SERVICES  := qemu-mirror.service
 QEMU_SERVICES  += qemu-jic23-mirror.service
@@ -40,6 +42,7 @@ QEMU_TARGET     	:= $(MIRROR_PATH)/qemu.git
 QEMU_JIC23_TARGET	:= $(MIRROR_PATH)/qemu-jic23.git
 KDEVOPS_TARGET		:= $(MIRROR_PATH)/kdevops.git
 FSTESTS_TARGET		:= $(MIRROR_PATH)/fstests.git
+KDEVOPS_FSTESTS_TARGET	:= $(MIRROR_PATH)/kdevops/fstests.git
 
 MIRROR_SERVICES := $(LINUX_SERVICES)
 MIRROR_SERVICES += $(QEMU_SERVICES)
@@ -116,6 +119,10 @@ mirror:
 	  echo "          CLONE fstests" ;\
 	  git -C $(MIRROR_PATH) clone $(GIT_VERBOSE) --progress --mirror $(FSTESTS) $(FSTESTS_TARGET) ;\
 	fi
+	$(Q)if [ ! -d $(KDEVOPS_FSTESTS_TARGET) ]; then \
+	  echo "          CLONE kdevops-fstests" ;\
+	  git -C $(MIRROR_PATH) clone $(GIT_VERBOSE) --progress --mirror $(KDEVOPS_FSTESTS) --reference $(FSTESTS_TARGET) $(KDEVOPS_FSTESTS_TARGET) ;\
+	fi
 
 install:
 	$(Q)mkdir -p $(USER_SYSTEM)
diff --git a/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.service b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.service
new file mode 100644
index 000000000000..822a62548937
--- /dev/null
+++ b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=kdevops-fstests mirror [kdevops/fstests.git]
+Documentation=man:git(1)
+ConditionPathExists=/mirror/kdevops/fstests.git
+
+[Service]
+Type=oneshot
+ExecStartPre=/usr/bin/git -C /mirror/kdevops/fstests.git remote update --prune
+ExecStart=/usr/bin/git -C /mirror/kdevops/fstests.git fetch --tags --prune
+ExecStartPost=/usr/bin/git -C /mirror/kdevops/fstests.git fetch origin +refs/heads/*:refs/heads/*
+
+[Install]
+WantedBy=multi-user.target
diff --git a/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.timer b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.timer
new file mode 100644
index 000000000000..4ec7a794b488
--- /dev/null
+++ b/playbooks/roles/linux-mirror/linux-mirror-systemd/kdevops-fstests-mirror.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=kdevops fstests mirror query timer [kdevops/fstests.git]
+ConditionPathExists=/mirror/kdevops/fstests.git
+
+[Timer]
+OnBootSec=10m
+# Every 6 hours
+OnUnitInactiveSec=360m
+
+[Install]
+WantedBy=default.target
-- 
2.43.0


  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 ` [PATCH 01/18] linux-mirror: add kdevops mirroring support Luis Chamberlain
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 ` Luis Chamberlain [this message]
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-9-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