Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Thursday, 12 September 2013

Hesokuri - a personal backup solution for your source code

If you are a developer, source code is some of the most important data you have. It needs to be backed up regularly, it must be readily accessible from all of your machines, and it may even be confidential. Most of the code is probably already stored under version control.

With this in mind I developed Hesokuri, a background process that keeps Git repositories on multiple machines in sync. Changes are pushed aggressively to peers as they are committed. When a peer is offline, Hesokuri will retry a push regularly until the peer responds. In some cases, a peer will merge pushed commits into the current branch so they are immediately visible in any open text editor. This means that if Hesokuri is running on two or more networked machines, the Git repositories on them are duplicated, backed up, and widely accessible.

Once you have set up Hesokuri and written a simple configuration file, you can just use Git as you always have. Hesokuri also has a web interface so you can check what revisions of each repository have been pushed to each peer.

We are still working on the user interface and the list of features that we want to include, so thanks to the community in advance for your bug reports, pull requests, and other contributions!

For the source code and how to get started, check out the Hesokuri project page. You can also get help using Hesokuri and discuss improvements in the Google discussion group.

By Matthew DeVore, Google+ Team


Wednesday, 30 May 2012

Gerrit Hackathon #3, May 7-11, 2012


A great thanks goes out to Google for hosting the 3rd Gerrit Code Review Hackathon earlier this month at their Mountain View campus, it was well attended and very productive.

After quickly deciding to focus on adding a plugin framework to Gerrit during the hackathon, we discussed a few areas which could really benefit from plugins (authentication, hook, events, UI) and we identified new SSH commands as a possible quick prototype objective. After discovering some minor pitfalls of intense collaboration using Gerrit, we realized that we could make good use of the new Gerrit builtin rebase button. The rebase button did indeed come in handy for many of us to avoid overwriting each other’s changes with rebases, but we quickly noticed that simply having the owner and submitters allowed to rebase would not be adequate. This led to the proposal to upload a new rebase permission, which has been backported to be in the 2.4 release since that is the first release with the new rebase feature.

There were other minor Gerrit UI quirks discussed and fixes proposed for many of these during the following days:
• user links now link to the owner:user search instead of to the user’s dashboard, most of us found  that this is what we really want most of the time.
• Fixing the lack of reviewer visibility in the case of draft reviews
• set-account ssh command was also merged.


Now back to plugins; we completed our first prototype for SSH commands early Tuesday and we were on our way to a plugin framework.  We decided to break plugin concepts into 2 main types: plugins with full access to Gerrit’s internals (and bound to a specific Gerrit version), and extensions which would only be bound to light stable interfaces. Plugins and extensions both got their own classloaders, but extensions were isolated from Gerrit classes. Helloworld sample plugins and repositories were created on gerrit.googlesource.com for several of these allowing users to host plugins alongside Gerrit as distinct projects.

Shawn Pearce created two jar files to compile plugins and extensions against, the plugin jar is one massive jar with Gerrit and all its dependencies in it. This large jar file should make it possible for plugin developers to create plugins quickly without having to download the many dependencies independently using maven. The extensions jar file consists mainly of the new fairly sparse top level gerrit-extensions-api package.

Other plugin accomplishments:
• plugins got their own Guice injectors
• HttpServlet plugin support in Gerrit
• pegdown can be used by plugin developers to create lightweight documentation for their plugins
• plugin command to be able to operate on and view plugins in a live Gerrit instance

With an initial plugin infrastructure in place, initial rework of the Gerrit core started by expressing part of it in terms of plugin: refactoring the replication as plug-in and introducing the ability to create aliases in order to use plugins commands as surrogates of existing commands. We added the ability to capture JSON/RPC and SSH actions to generate audit-trails and, later in the week, the ability to add extra custom commit validation through plugins.

Additional plugins have been created to provide long awaited functionalities in Gerrit, such as the delete project command and an online server viewer accessible through a web link. As the number of plugins is expected to grow quickly it was proposed that we define a simple but published process to allow people to search through existing plugins and host in Gerrit contributed plugins and their descriptive wikis.

The final day we focused on how topic branches might be approached in Gerrit. We decided we did not want to add support for change labels to the database since we are attempting to migrate away from the db. To put this data into git notes, it is necessary to have an indexing system and we concluded it would need to be done (or attempted) with Lucene. This could then pave the path for greater use of Lucene in Gerrit.

Scalability was naturally on many of our minds. Git maintainer Junio C Hamano joined our discussions of the many hacks being implemented to deal with the git protocol's ref advertisement performance impacts.  Android Gerrit users seem to push many of the original git use case assumptions beyond their original intents, especially when it comes to ref counts.  We were delighted to get Junio's approval to propose non backwards compatible changes to the git protocol to make our use cases more efficient.

We also spent some time outlining an incremental approach to making open source Gerrit clusterable (the version running for android-review and gerrit-review is already clustered but uses much of Google's proprietary technologies such as GFS and BigTable). Several incremental steps were outlined on how to move Gerrit in that direction. The first step which is needed is to support a very simple master/master installation of Gerrit where both (or all if more than 2) masters share a common filesystem backend (likely a high end NFS server) and a common db. Two issues were identified here which need to be resolved before this is possible: Cache coherency and Submit conflict resolution.

So while this is by no means a full run down of the week, it should give you some insights into the progress which we made during this week and also into some of the plans for future Gerrit directions. With the beginnings of a solid plugin infrastructure now in place, we hope that the Gerrit community will pick up the task of providing shared plugins for common tasks and host these new plugins alongside the gerrit project at the gerrit-review site.

Some fun stats (external contributions counted also):
• New changes created during the 5 days of the Hackathon: 115
• New patchsets uploaded during the 5 days of the Hackathon: 353
• Changes touched during the 5 days of the Hackathon:143
• Changes submitted during the 5 days of the Hackathon: 63
• Changes submitted during the week after the Hackathon (many carryovers): 43

By Martin Fick, Qualcomm Innovation Center, Gerrit project submitter

This has been cross posted from the Repo and Gerrit Discussion List

Tuesday, 24 April 2012

Worldwide Mirrors of git.kernel.org


The Git version control system plays a big part in the development of the Linux kernel and its related utilities. Developers around the world need fast access to the repositories hosted by git.kernel.org.

Today Google is making available a public mirror of git.kernel.org at https://kernel.googlesource.com/. This mirror service is backed by the same high speed infrastructure that hosts the Android Open Source Project, which already serves more than 1 terabyte of data and 2.5 million requests each day.

kernel.googlesource.com is served out of multiple Google data centers, utilizing facilities in Asia, the United States and Europe to provide speedy access from almost anywhere in the world.

By Shawn Pearce, Open Source Programs Office