Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git and GitHub at YAPC:Asia
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Andy Delcambre
August 30, 2014
Programming
3.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git and GitHub at YAPC:Asia
Andy Delcambre
August 30, 2014
More Decks by Andy Delcambre
See All by Andy Delcambre
Git, GitHub, Etc
adelcambre
3
260
Systems Programming - SoCoded 2013
adelcambre
2
200
Ruby Systems Programming
adelcambre
4
1.2k
Debugging Production Service Oriented Systems
adelcambre
3
450
Ruby, Rails and Engine Yard - Úll
adelcambre
1
340
SFRuby Nov 2011 - Release Early and Release Often
adelcambre
2
96
Release early and Release often
adelcambre
2
550
Other Decks in Programming
See All in Programming
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
110
LLM Plugin for Node-REDの利用方法と開発について
404background
0
170
New "Type" system on PicoRuby
pocke
1
830
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
120
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
AIで効率化できた業務・日常
ochtum
0
120
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
260
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
220
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
540
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
230
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
690
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Marketing to machines
jonoalderson
1
5.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
450
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
220
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Visualization
eitanlees
152
17k
Balancing Empowerment & Direction
lara
6
1.2k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Ethics towards AI in product and experience design
skipperchong
2
310
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Transcript
Andy Delcambre sadelcambre
None
YAPC:Asia
I don’t write Perl
I rarely write Perl
Total source lines grouped by language: ! ruby: 316613 (98.99%)
sh: 2268 (0.71%) ansic: 743 (0.23%) perl: 179 (0.06%) python: 31 (0.01%)
None
None
DIRECTED ACYCLIC GRAPH
$ git log commit b3f13c1 Author: Andy Delcambre Date: Thu
Aug 28 08:29 2014 ! Commit 3 ! commit c79e797 Author: Andy Delcambre Date: Thu Aug 28 08:29 2014 ! Commit 2 ! commit 9a42679 Author: Andy Delcambre Date: Thu Aug 28 08:28 2014 ! Initial commit commit b3f13c1 Commit 3 commit c79e797 Commit 2 commit 9a42679 Initial commit HEAD
$ git cat-file -p b3f13c1 tree 9e68447 parent c79e797 author
Andy Delcambre 1409182168 committer Andy Delcambre 1409182168 ! Commit 3 commit b3f13c1 Commit 3 tree 9e68447 commit c79e797 Commit 2 Parent
$ git cat-file -p 9e68447 100644 blob b465ded README.md commit
b3f13c1 Commit 3 tree 9e68447 commit c79e797 Commit 2 Parent blob 9e68447 README.md
$ git cat-file -p b465ded # Test ! A test
repo, for YAPC:Asia. commit b3f13c1 Commit 3 tree 9e68447 commit c79e797 Commit 2 Parent blob 9e68447 README.md # Test ! A test repo, for YAPC:Asia.
GitHub
Hosting a Git repo is Secret: EASY
enzo $ git init --bare demo.git Initialized empty Git repo
in /home/adelcambre/git/demo.git/ ! yt $ git remote add origin adelcambre@enzo:git/demo.git yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To adelcambre@enzo:git/demo.git * [new branch] master -> master ! yt $ git clone adelcambre@enzo:git/demo.git Cloning into 'demo'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done.
None
yt $ git remote add -f origin
[email protected]
:adelcambre/demo.git Updating origin
From github.com:adelcambre/demo * [new branch] master -> origin/master ! yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To https://github.com/adelcambre/demo.git * [new branch] master -> master
None
None
Hosting a *lot* of Git repos is Not so Secret:
HARD
> 7 million repositories
1.5 million pushes
100 million pulls & clones
27 fileservers
100 TB of online storage
None
Grit
1st Commit GitHub 1st Commit Grit
Ruby wrapper around Git
repo = Grit::Repo.new(“grit.git”) ! repo.commits # => [#<Grit::Commit "e80bbd2ce67651aa18e57fb0b43618ad4baf7750">, #<Grit::Commit
"91169e1f5fa4de2eaea3f176461f5dc784796769">, #<Grit::Commit "038af8c329ef7c1bae4568b98bd5c58510465493">, #<Grit::Commit "40d3057d09a7a4d61059bca9dca5ae698de58cbe">, #<Grit::Commit "4ea50f4754937bf19461af58ce3b3d24c77311d9">]
This works for everything! ! (locally)
27 fileservers
Smoke “Grit in the cloud”
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 …
module Smoke def self.install! ::Grit.send(:remove_const, :Git) ! ::Grit.const_set(:Git, Smoke::Git) end
end
ls_tree("HEAD").each do |entry| if entry.blob? load_blob(entry.oid) end end
Death by Round Trip
A condensed (and probably wrong) history of git
Bitkeeper
Git
Shared library?
libgit2
JGit
libgit2 http://github.com/libgit2/libgit2
Rugged http://github.com/libgit2/rugged
Ruby wrapper around libgit2
repo = Rugged::Repository.new("rugged.git") ! repo.last_commit # => #<Rugged::Commit:2227356240 oid: 0277b7df0fea08d5f3fc7177e47527fc24d96a0e>
Perl
Git-Raw https://metacpan.org/release/Git-Raw
None
GitRPC The New Hotness aka
Like Smoke, But Better
Caching
Pluggable Wire Protocols
Encoding Aware
GIT(1) Git Manual GIT(1) ! NAME git - the stupid
content tracker
GIT(1) Git Manual GIT(1) ! NAME git - the stupid
content tracker
Git doesn’t care about encodings
Smoke doesn’t either
GitRPC is encoding aware
Detect and tag as soon as possible
The Switch
class Repository def git Smoke::Repo.new(path) end ! def rpc GitRPC.new(path)
end end
None
Graphite
Graph Every Call Both GitRPC and Smoke
1 Year ago
None
None
None
Where are we today?
None
None
None
Good Progress But not done yet
Finding the Final 0.1%
Backscatter
Call Counting
def git backscatter_measure Smoke::Repo.new(path) end
None
Method Tracing
def git backscatter_trace 20 Smoke::Repo.new(path) end
None
Recap
Run both concurrently
Measure Everything
Use tracing to find the last 0.1%
Andy Delcambre sadelcambre
Further Reading Git for Computer Scientists http://eagain.net/articles/git-for-computer-scientists/ My mom told
me git doesn’t scale https://vimeo.com/64716825 How GitHub uses GitHub to build Github http://zachholman.com/talk/how-github-uses-github-to-build-github/