From 9011096d490cd368bd407fa3af64be0efa144cd5 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 16 Oct 2020 09:39:31 -0700 Subject: [PATCH] Stop managing gerrit's local git mirror dir We stopped serving this content and the next step is to stop managing it internally. This depends on a change to jeepyb that makes the local git dir management on the jeepyb side optional. Once that lands we can update our configs to tell jeepyb to stop managing it. We also stop doing garbage collection, mounting it into containers that don't need it, etc. Depends-On: https://review.opendev.org/758597 Change-Id: I2185e90edfcac71941bc29a4e11b7b2d4c7c2e13 --- doc/source/jeepyb.rst | 1 - playbooks/rename_repos.yaml | 4 ++-- playbooks/roles/gerrit/defaults/main.yaml | 1 - playbooks/roles/gerrit/tasks/main.yaml | 2 +- playbooks/roles/gerrit/templates/manage-projects.j2 | 1 - playbooks/roles/gerrit/templates/projects.ini.j2 | 1 - playbooks/roles/gerrit/templates/track-upstream.j2 | 1 - 7 files changed, 3 insertions(+), 8 deletions(-) diff --git a/doc/source/jeepyb.rst b/doc/source/jeepyb.rst index ed8583bc64..a56b672678 100644 --- a/doc/source/jeepyb.rst +++ b/doc/source/jeepyb.rst @@ -44,7 +44,6 @@ connect to things or how to operate is in [projects] homepage=http://example.org - local-git-dir=/var/lib/git gerrit-host=review.example.org gerrit-user=example-project-creator gerrit-key=/home/gerrit2/.ssh/example_project_id_rsa diff --git a/playbooks/rename_repos.yaml b/playbooks/rename_repos.yaml index 4405d6d2eb..17ad633fa0 100644 --- a/playbooks/rename_repos.yaml +++ b/playbooks/rename_repos.yaml @@ -26,13 +26,13 @@ owner: gerrit2 mode: 0755 with_nested: - - [ '~gerrit2/review_site/git/', '/opt/lib/git/' ] + - [ '~gerrit2/review_site/git/' ] - "{{ repos }}" - name: Rename git repos on gerrit shell: mv {{ item[0] }}{{ item[1].old }}.git {{ item[0] }}{{ item[1].new }}.git with_nested: - - [ '~gerrit2/review_site/git/', '/opt/lib/git/' ] + - [ '~gerrit2/review_site/git/' ] - "{{ repos }}" - hosts: gitea diff --git a/playbooks/roles/gerrit/defaults/main.yaml b/playbooks/roles/gerrit/defaults/main.yaml index 5d4b171c25..a05f919a32 100644 --- a/playbooks/roles/gerrit/defaults/main.yaml +++ b/playbooks/roles/gerrit/defaults/main.yaml @@ -19,7 +19,6 @@ gerrit_container_volumes: - /home/gerrit2/.ssh:/var/gerrit/.ssh - /opt/project-config/gerrit/projects.yaml:/var/gerrit/etc/projects.yaml - /opt/project-config/gerrit/projects.ini:/var/gerrit/etc/projects.ini - - /opt/lib/git:/opt/lib/git gerrit_database_type: MYSQL gerrit_project_creator_user: openstack-project-creator gerrit_manage_projects_args: "-v" diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index a967112658..48da488623 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -309,7 +309,7 @@ - name: Set up cron job to optmize local mirror git repos cron: name: optmize-local-git-repos - state: present + state: absent user: gerrit2 job: 'find /opt/lib/git/ -type d -name "*.git" -print -exec git --git-dir="{}" gc \;' minute: 17 diff --git a/playbooks/roles/gerrit/templates/manage-projects.j2 b/playbooks/roles/gerrit/templates/manage-projects.j2 index 7f9f98cb39..6934f9d91d 100644 --- a/playbooks/roles/gerrit/templates/manage-projects.j2 +++ b/playbooks/roles/gerrit/templates/manage-projects.j2 @@ -18,7 +18,6 @@ exec docker run --rm --net=host -u root \ -v/opt/project-config:/opt/project-config \ -v/opt/project-config/gerrit/acls:/home/gerrit2/acls \ -v/opt/project-config/gerrit/projects.yaml:/home/gerrit2/projects.yaml \ - -v/opt/lib/git:/opt/lib/git \ -v/opt/lib/jeepyb:/opt/lib/jeepyb \ -v/home/gerrit2/review_site/etc/ssh_project_rsa_key:/home/gerrit2/review_site/etc/ssh_project_rsa_key \ -v/home/gerrit2/projects.ini:/home/gerrit2/projects.ini \ diff --git a/playbooks/roles/gerrit/templates/projects.ini.j2 b/playbooks/roles/gerrit/templates/projects.ini.j2 index fe45ab3224..523759e2f0 100644 --- a/playbooks/roles/gerrit/templates/projects.ini.j2 +++ b/playbooks/roles/gerrit/templates/projects.ini.j2 @@ -1,7 +1,6 @@ [projects] homepage=https://opendev.org acl-dir=/home/gerrit2/acls -local-git-dir=/opt/lib/git jeepyb-cache-dir=/opt/lib/jeepyb gerrit-host={{ gerrit_vhost_name }} gerrit-user={{ gerrit_project_creator_user }} diff --git a/playbooks/roles/gerrit/templates/track-upstream.j2 b/playbooks/roles/gerrit/templates/track-upstream.j2 index d1f7235dec..65328ea282 100644 --- a/playbooks/roles/gerrit/templates/track-upstream.j2 +++ b/playbooks/roles/gerrit/templates/track-upstream.j2 @@ -17,7 +17,6 @@ exec docker run --rm --net=host -u root \ -v/opt/project-config:/opt/project-config \ -v/opt/project-config/gerrit/projects.yaml:/home/gerrit2/projects.yaml \ - -v/opt/lib/git:/opt/lib/git \ -v/opt/lib/jeepyb:/opt/lib/jeepyb \ -v/home/gerrit2/review_site/etc/ssh_project_rsa_key:/home/gerrit2/review_site/etc/ssh_project_rsa_key \ -v/home/gerrit2/projects.ini:/home/gerrit2/projects.ini \