{"id":15350088,"url":"https://github.com/takezoe/gitmesh","last_synced_at":"2025-04-15T02:37:03.207Z","repository":{"id":38420424,"uuid":"115780343","full_name":"takezoe/gitmesh","owner":"takezoe","description":"An experimental project to make a distributed git server cluster","archived":false,"fork":false,"pushed_at":"2022-12-08T02:15:35.000Z","size":3342,"stargazers_count":59,"open_issues_count":33,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T15:01:34.359Z","etag":null,"topics":["git","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takezoe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-30T07:07:40.000Z","updated_at":"2025-03-12T21:19:34.000Z","dependencies_parsed_at":"2023-01-24T06:31:10.533Z","dependency_job_id":null,"html_url":"https://github.com/takezoe/gitmesh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoe%2Fgitmesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoe%2Fgitmesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoe%2Fgitmesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoe%2Fgitmesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takezoe","download_url":"https://codeload.github.com/takezoe/gitmesh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248995102,"owners_count":21195497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","scala"],"created_at":"2024-10-01T11:57:13.075Z","updated_at":"2025-04-15T02:37:02.347Z","avatar_url":"https://github.com/takezoe.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"gitmesh\n========\n\n## What's this?\n\nThis is an experimental project to make a distributed git server cluster. The main goal of this project is to find a reasonable way to add scalability and redundancy to git repositories. Basic idea is locating git repositories on multiple nodes, and proxy requests from git clients to appropriate nodes. This approach is similar to [GitHub's DGit](https://githubengineering.com/introducing-dgit/) (it has been renamed to [Spokes](https://githubengineering.com/building-resilience-in-spokes/)).\n\nThe distributed gitserver cluster consists of following two kinds of servers:\n\n- [Controller server](https://github.com/takezoe/gitmesh/tree/master/gitmesh-controller-server)\n\n  This is a front server of the cluster. It manages repository servers and proxy requests from git clients to appropriate repository servers. We can make redundant it by setup multiple instances with a load balancer. \n\n- [Repository server](https://github.com/takezoe/gitmesh/tree/master/gitmesh-repository-server)\n\n  This is a storage server of the cluster. Git repositories are located on this kind of servers actually. We can add any number of repository server instances to the cluster.\n\n![Architecture](architecture.png)\n\nThis project is still under development phase, but if you are interested, please try it. Any feedback is welcome!\n\n## Setup\n\nYou can run a minimal gitmesh cluster on docker and docker-compose.\n\n### Prerequisites\n\n- Java 8\n- sbt\n- Docker\n\n### Build docker images\n\nFirst, run the following command at the root of this repository to build docker images.\n\n```\n$ ./build-docker.sh\n```\n\nThis script builds following docker images:\n\n- gitmesh-console\n- gitmesh-controller-server\n- gitmesh-repository-server\n\n### Run a cluster using docker-compose\n\nNext, run the following command to start a minimal gitmesh cluster (console x 1, controller x 1, mysql x 1, repository x 2). \n\n```\n$ ./run-docker-compose.sh\n```\n\nThis command executes docker-compose internally. So you can run a cluster with another structure by modifying `docker-compose.yml`.\n\nWeb console is available at `http://localhost:8080`, and endpoints are available at `http://localhost:8081`. See [this section](#check-the-cluster-operation) to know how you can use a gitmesh cluster as a Git server.\n\n## Build and run from source code\n\nYou can also build and run gitmesh from source code for now. This guide shows how to run the cluster with minimum configuration (one controller server and one repository server on a single machine).\n\n### Prerequisites\n\n- Java 8\n- sbt\n- MySQL\n\nYou have to create an empty database before run the controller server. If you use docker, run a MySQL container as follows:\n\n```\n$ docker pull mysql\n$ docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysql MYSQL_DATABASE=gitmesh -d -p 3306:3306 mysql\n```\n\n### Start the controller server\n\nModify `gitmesh-controller-server/src/main/resources/application.conf` for your environment, and run the controller server as follows:\n\n```\n$ cd gitmesh-controller-server\n$ sbt ~jetty:start\n```\n\nThe controller server is started on port 8081 in default. Tables are created automatically in the database configured in `application.conf`.\n\n### Start the repository server\n\nModify `gitmesh-repository-server/src/main/resources/application.conf` for your environment, and run the repository server as follows:\n\n```\n$ cd gitmesh-repository-server\n$ sbt ~jetty:start\n```\n\nThe repository server is started on port 8082 in default.\n\n## Check the cluster operation\n\nLet's create a new repository and push a commit using `git` command to check the cluster operation.\n\nYou can create a new repository via Web API. In this case, a repository url is `http://localhost:8081/git/test.git`.\n\n```\n$ curl -XPOST http://localhost:8081/api/repos/test\n```\n\nCreate a local repository and push a first commit to the remote repository on the cluster:\n\n```\n$ mkdir test\n$ cd test\n$ git init\n$ touch README.md\n$ git add .\n$ git commit -m 'first commit'\n$ git remote add origin http://localhost:8081/git/test.git\n$ git push origin master\n```\n\nThe remote repository is created under the directory configured in the repository server's `application.conf`.\n\n### Web console\n\ngitmesh also offers a [web console](https://github.com/takezoe/gitmesh/tree/master/gitmesh-console) for administrators.\n\n![Web console](console.png)\n\nRun followng commands to start the web console.\n\n```\n$ cd gitmesh-console\n$ npm install\n$ npm run dev\n```\n\nThe web console is available at http://localhost:8080/. You can check repositories and nodes status, and create or delete repositories on this console.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakezoe%2Fgitmesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakezoe%2Fgitmesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakezoe%2Fgitmesh/lists"}