Automatic git cache maintenance on the controller

Goal: Automate the maintenance of cached git repositories on the Jenkins controller

Status: Selected

Team

Details

Abstract

maintenance

The project aims to add git-maintenance to improve performance of the Jenkins controller. Git-maintenance optimizes caches, thereby executing the git commands faster.

Rationale

Git caches that exist on the controller can become slower and larger than necessary during the lifetime of the remote repositories. Command line git focuses on high performance for frequent operations and relies on end users to perform most repository maintenance. Garbage collection, removal of deleted branches, and other operations are not performed by default on most cached repositories. This project aims to undertake the responsibility of git maintenance tasks by doing all the hard work behind the scenes and providing a simple user interface to configure the maintenance.

Project Deliverables

  • Git Maintenance official API support for v >= 2.30

  • Git Maintenance support for versions < 2.30 (Older versions of git)

  • Scheduling git maintenance using cron syntax to optimize caches on Jenkins controller.

  • Display execution results of maintenance tasks in UI.

  • Testing the software (Unit tests).

Architecture Diagram

architecture diagram

Evaluation Phase 1

maintenance config

  1. Added git maintenance api in Git Client Plugin.

  2. Created simple UI to configure maintenance tasks.

  3. Schedule and execute maintenance tasks based on cron syntax.

  4. Logging and unit tests.

Resources

  1. Slides

  2. Phase 1 demo and presentation:

Evaluation Phase 2

maintenance records

  1. Created a table to display maintenance execution results.

  2. Persist maintenance data in xml file.

  3. Documented the project.

  4. Git Client Plugin 3.12.0 released

Resources

  1. Phase 2 demo and presentation:

Outcomes

I cloned the linux kernel and scheduled git maintenance tasks. Below is the analysis of the git maintenance tasks. The repo was 813 commits behind the latest commit while performing the maintenance tasks. As I cloned it, the cache was almost optimized.

Maintenance Task

Gain

Prefetch

x 35

Commit Graph

x 410

Loose Objects

x 10

Garbage Collection

Cache already optimized.

Incremental Repack

N/A

Learnings-

  1. Architecture Designing

  2. Core Java Programming

  3. MultiThreading

  4. Testing (JUnit)

  5. CI/CD code development

  6. Time Management

Links