Skip to contentSkip to conversation

Fixes for git mirroring on Fedora

PATCH In review [email protected] 3 participants 11 messages Mar 10, 2025 – Mar 12, 2025

lore
Share & tools
lore
#0 lore raw

cover Fixes for git mirroring on Fedora

From: Chuck Lever <[email protected]>

Hi -

After Konstantin's announcement on Friday, I've set up git mirroring for my nightly kdevops runs. The controllers run Fedora 40. I found one or two nits to get the mirror to work smoothly.

Bonus extra-credit patch is to add the Linux repo that contains the LTS kernel release condidates.

Chuck Lever (4):
linux-mirror: Fix installation on Fedora systems
linux-mirror: Ensure git-daemon runs as the Ansible user
mirror: Reduce frequency of retrieving results archive
linux-mirror: Add a mirror for linux-stable-rc

 playbooks/roles/linux-mirror/defaults/main.yml            | 5 +++--
 .../roles/linux-mirror/tasks/install-deps/fedora/main.yml | 8 ++++++++
 .../roles/linux-mirror/templates/[email protected]   | 1 +
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2    | 8 +++++++-
 4 files changed, 19 insertions(+), 3 deletions(-)
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/4 linux-mirror: Fix installation on Fedora systems

From: Chuck Lever <[email protected]>

I noticed that git-daemon was not installed when I set up the git mirror on my Fedora 40 control host.

If "include_tasks:" has a tag, the included tasks also need to have a "tags:" attribute or they will not be run.

Also, because my lab is already behind a firewall gateway, there happens to be no firewall running on my controller, so the "enable the git port" step fails with:

firewall is not currently running, unable to perform immediate actions without a running firewall daemon

---
 .../roles/linux-mirror/tasks/install-deps/fedora/main.yml | 8 ++++++++
 1 file changed, 8 insertions(+)
playbooks/roles/linux-mirror/tasks/install-deps/fedora/main.yml +8 -0
index 2a93256a3d6e..01e98895cabe 100644
@@ -9,6 +9,11 @@
     state: present
   when:
     - install_linux_mirror|bool
+  tags: [ 'mirror' ]
+
+- name: Gather service facts
+  ansible.builtin.service_facts:
+  tags: [ 'mirror' ]
 
 - name: Open the firewall on control node for git traffic
   become: true
@@ -22,3 +27,6 @@
     state: enabled
   when:
     - install_linux_mirror|bool
+    - '"firewalld.service" in ansible_facts.services'
+    - ansible_facts.services['firewalld.service'].state == "enabled"
+  tags: [ 'mirror' ]
Signature · 1 line
2.48.1
#2 lore raw

PATCH 2/4 linux-mirror: Ensure git-daemon runs as the Ansible user

In reply to [email protected]

From: Chuck Lever <[email protected]>

In my initial installation, git-daemon emits the "safe.directory" warning and exits; remote attempts to access the repos there fail.

git-daemon needs to run as the same user that owns the repos to avoid this warning. linux-mirror doesn't currently have a consistent "user" for this: the instructions say "create a /mirror directory" but then later tasks in linux-mirror try to create /mirror owned by root.

This patch doesn't address that larger problem, but it simply adds a setting under the daemon's [Service] stanza to make it run as the user that is setting up the mirror.

---
 playbooks/roles/linux-mirror/templates/[email protected] | 1 +
 1 file changed, 1 insertion(+)
playbooks/roles/linux-mirror/templates/[email protected] +1 -0
index a8bf669608bc..06c08d989545 100644
@@ -7,3 +7,4 @@ ExecStart=-/usr/bin/git daemon --verbose --init-timeout=10 --timeout=5 --inetd -
 StandardInput=socket
 StandardOutput=inherit
 StandardError=journal
+User={{ ansible_user_id }}
Signature · 1 line
2.48.1
#3 lore raw

PATCH 3/4 mirror: Reduce frequency of retrieving results archive

In reply to [email protected]

From: Chuck Lever <[email protected]>

Each run takes longer than 10 seconds, which generates a "git process is still running" warning in the system journal every minute.

---
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +1 -1
index dabbadcc6528..45e79349a3d4 100644
@@ -36,7 +36,7 @@ mirrors:
   - short_name: "kdevops-results-archive"
     url: "{{ defaults_kdevops_results_archive_git }}"
     target: "kdevops-results-archive.git"
-    refresh: "10s"
+    refresh: "10m"
   - short_name: "kdevops/fstests"
     url: "{{ mirror_kdevops_fstests_url }}"
     target: "kdevops/fstests.git"
Signature · 1 line
2.48.1
#9 lore raw

PATCH 4/4 linux-mirror: Add a mirror for linux-stable-rc

In reply to [email protected]

From: Chuck Lever <[email protected]>

I test the LTS queue/ branches nightly.

---
 playbooks/roles/linux-mirror/defaults/main.yml         | 5 +++--
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
playbooks/roles/linux-mirror/defaults/main.yml +3 -2
index c95342591090..c193932931b6 100644
@@ -14,12 +14,13 @@ defaults_nfstest_git: "git://git.linux-nfs.org/projects/mora/nfstest.git"
 defaults_xfsprogs_git: "https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git"
 defaults_xfsdump_git: "https://github.com/linux-kdevops/xfsdump-dev.git"
 
-# These are mirrors which have variability support, the above should be coverted
+# These are mirrors which have variability support. The above should be converted
 # to these types so to support alternatives for sources and also the ability to
-# not use git and instead https incase of firewall restrictions in some
+# not use git and instead https in case of firewall restrictions in some
 # environments.
 mirror_kdevops_url: "https://github.com/linux-kdevops/kdevops.git"
 mirror_stable_url: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
+mirror_stable_rc_url: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git"
 mirror_torvalds_url: "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
 
 install_only_git_daemon: false
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +6 -0
index 45e79349a3d4..79bbbc6595ba 100644
@@ -88,6 +88,12 @@ mirrors:
     refresh: "120m"
     refresh_on_boot: "20m"
     reference: "linux.git"
+  - short_name: "stable-rc"
+    url: "{{ mirror_stable_rc_url }}"
+    target: "linux-stable-rc.git"
+    refresh: "120m"
+    refresh_on_boot: "20m"
+    reference: "linux-stable-rc.git"
   - short_name: "vfs"
     url: "{{ mirror_vfs_url }}"
     target: "vfs.git"
Signature · 1 line
2.48.1
#4 lore raw

Re: [PATCH v1 3/4] mirror: Reduce frequency of retrieving results archive

In reply to [email protected]
Quoted 16 lines · On Mon, Mar 10, 2025 at 02:32:07PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

Each run takes longer than 10 seconds, which generates a "git process is still running" warning in the system journal every minute.

---
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +0 -0
index dabbadcc6528..45e79349a3d4 100644

playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 mirrors: · line 39

Quoted 5 lines
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +1 -1
@@ -36,7 +36,7 @@ mirrors:
   - short_name: "kdevops-results-archive"
     url: "{{ defaults_kdevops_results_archive_git }}"
     target: "kdevops-results-archive.git"
-    refresh: "10s"
+    refresh: "10m"

We don't poke kernel.org here ever, this is a github tree.

The question here is how often we want this updated to make CI updates take effect. It is why I went so low here. I think such a low value only makes sense for mirrors which won't need to leverage leverage kdevops-results-archive to push updates to that tree, as otherwise their tree will be out of sync. So, I think a bool to lower this default might be nice, disabled by default, and a new defconfig for mirror-ci might be useful which has that bool enabled. This way folks who wish to help with CI infra and use kdevops-results-archive to push results there, can just have their mirror setup use:

make defconfig-mirror-ci

Without this we risk that a CI run, once it has test results to upload, won't be able to push the results. Because it will git fetch prior, but its using the mirror.

Luis

Reviewed-by on the v1 series
#10 lore raw
In reply to [email protected]
Quoted 10 lines · On Mon, Mar 10, 2025 at 02:32:04PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

Hi -

After Konstantin's announcement on Friday, I've set up git mirroring for my nightly kdevops runs. The controllers run Fedora 40. I found one or two nits to get the mirror to work smoothly.

Bonus extra-credit patch is to add the Linux repo that contains the LTS kernel release condidates.

Other than that small nit I pointed out:

Luis

#5 lore raw

Re: [PATCH v1 3/4] mirror: Reduce frequency of retrieving results archive

In reply to Luis Chamberlain
Quoted 12 lines · Luis Chamberlain
Quoted 11 lines · On Mon, Mar 10, 2025 at 02:32:07PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

Each run takes longer than 10 seconds, which generates a "git process is still running" warning in the system journal every minute.

---
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 mirrors: · line 39

Quoted 10 lines
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +1 -1
index dabbadcc6528..45e79349a3d4 100644
@@ -36,7 +36,7 @@ mirrors:
   - short_name: "kdevops-results-archive"
     url: "{{ defaults_kdevops_results_archive_git }}"
     target: "kdevops-results-archive.git"
-    refresh: "10s"
+    refresh: "10m"

We don't poke kernel.org here ever, this is a github tree.

Hi Luis, thanks for the review.

The issue I see is local, on the mirror. This one's not an issue about unnecessary workload on the remote repo.

Basically the poll for new commits takes a while on my system, so every minute I get a verbose system journal warning that there is a git process left over from the last timer run. The log messages are noise, and because they come out so often, they will fill up the controller's root filesystem.

Also, from a code legibility standpoint, "10s" looks like an anomaly, a typo. IMO it could be clearer if it were documented (with what you said here, below) in a brief comment. Maybe it is already and I missed it.

On my system, systemd timer jobs don't seem to run more often than once a minute anyway... 10s might be impossibly short.

I'm open to finding another way to address this, and I am OK not pushing this one until we agree on a consensus solution.

Quoted 10 lines

The question here is how often we want this updated to make CI updates take effect. It is why I went so low here. I think such a low value only makes sense for mirrors which won't need to leverage leverage kdevops-results-archive to push updates to that tree, as otherwise their tree will be out of sync. So, I think a bool to lower this default might be nice, disabled by default, and a new defconfig for mirror-ci might be useful which has that bool enabled. This way folks who wish to help with CI infra and use kdevops-results-archive to push results there, can just have their mirror setup use:

Quoted 5 lines

make defconfig-mirror-ci

Without this we risk that a CI run, once it has test results to upload, won't be able to push the results. Because it will git fetch prior, but its using the mirror.

Perhaps another choice would be to not mirror this repo at all, since it is also the target of local updates.

Signature · 1 line
Chuck Lever
#6 lore raw

Re: [PATCH v1 3/4] mirror: Reduce frequency of retrieving results archive

Quoted 28 lines · Chuck Lever
Quoted 12 lines · Luis Chamberlain
Quoted 11 lines · On Mon, Mar 10, 2025 at 02:32:07PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

Each run takes longer than 10 seconds, which generates a "git process is still running" warning in the system journal every minute.

---
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 mirrors: · line 39

Quoted 10 lines
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +1 -1
index dabbadcc6528..45e79349a3d4 100644
@@ -36,7 +36,7 @@ mirrors:
   - short_name: "kdevops-results-archive"
     url: "{{ defaults_kdevops_results_archive_git }}"
     target: "kdevops-results-archive.git"
-    refresh: "10s"
+    refresh: "10m"

We don't poke kernel.org here ever, this is a github tree.

Hi Luis, thanks for the review.

Quoted 8 lines

The issue I see is local, on the mirror. This one's not an issue about unnecessary workload on the remote repo.

Basically the poll for new commits takes a while on my system, so every minute I get a verbose system journal warning that there is a git process left over from the last timer run. The log messages are noise, and because they come out so often, they will fill up the controller's root filesystem.

In fact I see this for most of the mirrored repos, even on a kdevops controller system I set up a while ago:

qemu-jic23-mirror.service: Found left-over process 2176 (git) in control group while starting unit. Ignoring. qemu-jic23-mirror.service: This usually indicates unclean termination of a previous run, or service implementation deficiencies. qemu-mirror.service: Found left-over process 2180 (git) in control group while starting unit. Ignoring.
qemu-mirror.service: This usually indicates unclean termination of a previous run, or service implementation deficiencies.

I'm not sure what to make of it.

Quoted 32 lines

Also, from a code legibility standpoint, "10s" looks like an anomaly, a typo. IMO it could be clearer if it were documented (with what you said here, below) in a brief comment. Maybe it is already and I missed it.

On my system, systemd timer jobs don't seem to run more often than once a minute anyway... 10s might be impossibly short.

I'm open to finding another way to address this, and I am OK not pushing this one until we agree on a consensus solution.

Quoted 10 lines

The question here is how often we want this updated to make CI updates take effect. It is why I went so low here. I think such a low value only makes sense for mirrors which won't need to leverage leverage kdevops-results-archive to push updates to that tree, as otherwise their tree will be out of sync. So, I think a bool to lower this default might be nice, disabled by default, and a new defconfig for mirror-ci might be useful which has that bool enabled. This way folks who wish to help with CI infra and use kdevops-results-archive to push results there, can just have their mirror setup use:

Quoted 5 lines

make defconfig-mirror-ci

Without this we risk that a CI run, once it has test results to upload, won't be able to push the results. Because it will git fetch prior, but its using the mirror.

Perhaps another choice would be to not mirror this repo at all, since it is also the target of local updates.

Signature · 1 line
Chuck Lever
#8 lore raw

Re: [PATCH v1 3/4] mirror: Reduce frequency of retrieving results archive

In reply to Chuck Lever
Quoted 2 lines · Chuck Lever

Perhaps another choice would be to not mirror this repo at all, since it is also the target of local updates.

I think that's a good idea, and just enable it for a new mirror-ci defconfig, ie, only silly CI setups should mirror everything. I hadn't added variability to mirroring, so adding some with sensible developer defaults makes sense, while pushing all the odd ball trees to the mirror-ci.

Luis

#7 lore raw

Re: [PATCH v1 3/4] mirror: Reduce frequency of retrieving results archive

In reply to Chuck Lever
Quoted 50 lines · Chuck Lever
Quoted 28 lines · Chuck Lever
Quoted 12 lines · Luis Chamberlain
Quoted 11 lines · On Mon, Mar 10, 2025 at 02:32:07PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

Each run takes longer than 10 seconds, which generates a "git process is still running" warning in the system journal every minute.

---
 playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 mirrors: · line 39

Quoted 10 lines
playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 +1 -1
index dabbadcc6528..45e79349a3d4 100644
@@ -36,7 +36,7 @@ mirrors:
   - short_name: "kdevops-results-archive"
     url: "{{ defaults_kdevops_results_archive_git }}"
     target: "kdevops-results-archive.git"
-    refresh: "10s"
+    refresh: "10m"

We don't poke kernel.org here ever, this is a github tree.

Hi Luis, thanks for the review.

Quoted 8 lines

The issue I see is local, on the mirror. This one's not an issue about unnecessary workload on the remote repo.

Basically the poll for new commits takes a while on my system, so every minute I get a verbose system journal warning that there is a git process left over from the last timer run. The log messages are noise, and because they come out so often, they will fill up the controller's root filesystem.

In fact I see this for most of the mirrored repos, even on a kdevops controller system I set up a while ago:

qemu-jic23-mirror.service: Found left-over process 2176 (git) in control group while starting unit. Ignoring. qemu-jic23-mirror.service: This usually indicates unclean termination of a previous run, or service implementation deficiencies. qemu-mirror.service: Found left-over process 2180 (git) in control group while starting unit. Ignoring.
qemu-mirror.service: This usually indicates unclean termination of a previous run, or service implementation deficiencies.

Quoted 1 line

I'm not sure what to make of it.

Just feel free to toss it to mirror-ci defconfig, it just means adding a bit of variability.

Luis