DSPOM2
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Project Overview ## Longterm Goal/Motivation Implement a git server with gitoxide that performs well ***at scale***. Some potential applications: * attract industry interest from git hosting provides (github, gitlab, aws code commit, ...) * allows implementation of distributed github alternative * allows implementation of other distributed services (time tracker, password manager) that leverage git as their core technology for data storage and backup * **move crates.io from github to a gitoxide based server** * potentially distributed/federate to allow separate instances in each legislature while still allowing colabaration > [name=Pascal] TODO: motivate in detail when writing grant application ## Project Goal Gitoxide is lacking support for git features that are necessary for a high performance git server. The goal of this grant is to develop support for these git features so that an efficient server can be implemented in the future. Specifically this project will focus on implementing a minimal prototype for a performant implementation of `git-upload-pack`. This command is invoked whenever a fetch (`git pull`/`git fetch` /`git clone`) is performed over ssh or locally. Apart from the packet transportation itself, the `git-upload-pack` commands main job is determining which objects to send and converting them into packs. Implementing this process with gitoxide is slow because it requires traversing the entire object graph. Rechability bitmaps were introduced to `git` to adress that problem and will be a large focus for this project. ## Technical Details To address the performance requirement layed out above, git was extended with multiple features (mainly by github, see talk by Taylor Blau): * speedup object counting (for fetch/clone) with reachability bitmaps: * compressed bitmap stored on disk for some commits that indicates which objects are reachable from a commit * counting objects for fetch/clone becomes a couple bitmap operations (very fast) * only works **inside a single pack** (by default) because each object is represented by its pack-order index * Tasks (related [#296](https://github.com/Byron/gitoxide/issues/296)) - [x] implement basic support (read from disk, iterate set bits) for EWAH bitmaps - [ ] implement set operations (union/intersection/insert element/remove element) for EWAH bitmaps - [ ] implement support for reading [bitmap pack files](https://git-scm.com/docs/bitmap-format) (which contain reachability bitmaps) * Outscoped (handeled by git maintainance) - [ ] implement support for writing/updating [pack files](https://git-scm.com/docs/bitmap-format) * repackaging the entire repo into a single pack file during maintenance is prohibitively expensive => reachability bitmaps must be extended to multipack indices (using reverse indecies, see below) * implementing support for reverse index files: * Use cases: * Implementing **reachability bitmaps** for multipack indices requires **a defined pack-order** for the full repo * many operations (like maintenance/repackaging/pack creation) require a mapping from position within pack to object-id (sha) => recomputed often, faster to cache * Tasks * [ ] implement reading single package rev files from disk * [ ] use reverse index cache during pack creation ([#76](https://github.com/Byron/gitoxide/issues/76)), benchmark if the improvement is worth it * [ ] implement creation of single-pack reverse index for a pack * [ ] implement reading multipack rev files from disk * Outscoped Tasks (required for git maitainance, see Future Work): * [ ] implement writing single package rev files to disk * [ ] implement writing multipack rev files to disk * [ ] implement creation of multipack reverse index for a repo * [ ] use multipack reverse index to implement full repo reachability index Implementing `git-upload-pack` requires implementing the server side of the fetch implementation * goal: be compatible with current gitoxide fetch implementation * must support protocol v2 * portocol v1 is a stretch goal (optional) * support for optional capabilities is a stretch goal (needed for shallow clone or advanced pack negotiations) ## Future Work * implement git maitainance * each push adds exploded packs to repository => need to be repacked to reduce filesize * regularly reorganize objects into few packs to keep repo fast * requirements for performance scaling: * only few packages should remain after repackaging * repackaging should only scale with the **number of new packages** since the last repack (not the total number of packages) * implement geometric pack creation (`git repack --geometric`) * Strategy to ensure maintenance operations is fast * When first implemented at GitHub saved 5.67 CPU-days every hour * Packs are sorted by the number of objects they contain * The `n`. pack has at least `M` times as many objects as the pack `n-1`, where `M` is an integer parameter (usually 2) * When the above property does not hold, all previous packages are repackaged into the `n`. pack > * Equivalent gix command for `git repackage --geometric` (perform repo maintainance)~~ * implement writing/creation of reachability bitmap # Somewhat Related Questions * the ssh protocol is essentially just an ssh tunnel that calls certain git binaries => so a server is just multiple gix applications and an ssh server? * alternative: implement a custom ssh server that can only execute a fixed set of commands (potentially faster because requests do not need to write to disk?) * fork an existing rust ssh server? (https://github.com/warp-tech/russh) * http/https/git protocol definitely require a custom server * pack integration is mostly implemented already [#307](https://github.com/Byron/gitoxide/issues/307) but does not use geometric repackaging # Grant Application ## Previous Experience Most of my Rust experience has been obtained by developing an open source [Verilog-A compiler](https://github.com/pascalkuthe/OpenVAF/) for multiple years with more than 60k lines of code. It builds on ideas from rust-analyzer/rustc for the frontend, cranelift and contains a custom middle-end that mixes architecture from llvm and cranelift. All code in Verilog-A is (due to limitations of existing compilers) usually contained in a single function, so performance needed to scale well to large functions. As a result, I am very proficient in developing high-performance rust code. Recently, I have been working on the [helix editor](https://github.com/helix-editor/helix) and related projects ([termi](https://github.com/pascalkuthe/termini) and [ropey](https://github.com/cessen/ropey)), as well as a library for performing fast diffs that match/exceed gits performance, [imara-diff](https://github.com/pascalkuthe/termini). It sped up a related `gitoxide` command by a factor of 2. Trough this work I connected with Sebastian ([byron](https://github.com/Byron/) on github) who suggested collaboration on `gitoxide` and offered to support me during this project. ## Project Proposal The crates.io index is currently hosted on github. As a result, the Rust infrastructure is reliant on a single company and unavailable in some legislatures. For example, to use crates.io in Mainland China, setting up a mirror is required and common practice. However, hosting a git server on independent infrastructure is challenging because canonical git cannot be used as a library and is difficult to extend or run at scale. Furthermore, the canonical git implementation often suffers from memory-safety related vulnerabilities (recently in `OpenSSL` for example). An alternative git server implementation in Rust as part of the `gitoxide` project can solve these problems. During this project, I will improve the pack creation machinery that runs on the server when a fetch is performed and optionally (stretch goal) develop a minimal viable product for the protocol implementation of the fetches. Pack generation in `gitoxide` currently doesn't scale well to large repositories (like the crates.io index). Improving this shortcoming will be my main focus. I plan to achieve this by utilizing on-disk caches that were added to git by GitHub, but other avenues to further speedups will also be explored. After the project concludes, the following end-results will be available: * Performance comparison of pack creation between `git` and `gitoxde`. * A pack creation implementation in `gitoxide` that will match or exceed the performance of `git` both in the presence and the absence of on-disk caches. * optionally (stretch goal): A server-side implementation of the git protocol used for fetching that leverages the pack creation to allow fast clones and fetches. This project benefits Rust beyond hosting crates.io by potentially attracting interest in Rust from git hosting providers (such as AWS or GitHub). A flexible git implementation also has great potential as the core data storage and backup technology for applications beyond source control. In the future, `gitoxide` can provide Rust with a unique ecosystem for building distributed services based on git that runs at scale.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully