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
How Gitlab Works
Search
Saito
November 18, 2012
Technology
34
4.2k
How Gitlab Works
RubyConfChina presentation.
Saito
November 18, 2012
Tweet
Share
More Decks by Saito
See All by Saito
Middle-Scale F2E Application
saito
3
6.7k
Other Decks in Technology
See All in Technology
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
540
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
760
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1.1k
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
19
19k
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
610
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
210
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
360
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
120
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
850
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
100
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
3k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Invisible Side of Design
smashingmag
298
50k
Code Reviewing Like a Champion
maltzj
520
39k
Mobile First: as difficult as doing things right
swwweet
222
9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Code Review Best Practice
trishagee
65
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Adopting Sorbet at Scale
ufuk
73
9.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Transcript
How GitLab Works
Saito github.com/saitowu @saitowu
AIXForce
GitLab?
GitLab? Self Hosted Git Management Application
None
issues code snippet ssh & http wall ... code view
wiki network graph merge request
happy to use it.
happy to use it. want to know how it works?
None
backend
backend repo access
backend repo access presentation layer
Backend
Can be backend:
Can be backend: protocol
Can be backend: file => (RW) git => (R) ssh
=> (RW) http => (RW) protocol
Can be backend: file => (RW) git => (R) ssh
=> (RW) http => (RW) protocol x x
Can be backend: file => (RW) git => (R) ssh
=> (RW) http => (RW) protocol x x #=> remote #=> authentication
SSH:
SSH: normal: authorized_keys
SSH: normal: authorized_keys
SSH:
SSH: gitosis/gitolite: authorized_keys
SSH: gitosis/gitolite: authorized_keys SSH magic command
SSH: gitosis/gitolite: authorized_keys SSH magic command
SSH:
SSH: sshd: not authorized_keys
SSH: sshd: not authorized_keys but patched sshd
SSH: sshd: not authorized_keys but patched sshd
SSH: sshd: not authorized_keys but patched sshd
SSH: sshd: not authorized_keys but patched sshd <= instead of
sshd
SSH:
SSH: GitLab v1.0: gitosis #=> python
SSH: GitLab v1.0: gitosis #=> python GitLab v2.0: gitolite #=>
perl
HTTP:
HTTP: before Git v1.6.6: dumb
HTTP: before Git v1.6.6: dumb after Git v1.6.6: smart!!!
HTTP: https://github.com/schacon/grack/blob/master/lib/git_http.rb#L10-23
git-upload-pack #=> send git-receive-pack #=> receive HTTP:
git-upload-pack #=> send git-receive-pack #=> receive HTTP: smart
HTTP: GitLab v2.7: smart HTTP protocol
Repo Access
Grit: command-line wrapper
Rugged: ruby bindings to libgit2
Grit vs Rugged
Grit vs Rugged win
Grit vs Rugged win lose
Grit vs Rugged win lose github will migrate from grit
to rugged too
Repo Browser
Must Know:
Must Know: Git object model
Must Know: Git encoding strategy Git object model
Must Know: Git encoding strategy Ruby encoding Git object model
Git Object Model:
Git Object Model: 4 basic objects: blob tree commit tag
Git Object Model: 4 basic objects: blob tree commit tag
stored in: .git/objects
Git Object Model:
Git Object Model: git show <sha>
Git Object Model: git cat-file -p <sha> git show <sha>
Git Object Model: http://saito.im/note/Git-Internals/
Git Encoding Strategy: At the core level, git is character
encoding agnostic. http://www.kernel.org/pub/software/scm/git/docs/v1.5.0.2/git-log.html#_discussion
Git Encoding Strategy:
Git Encoding Strategy: filename
Git Encoding Strategy: filename blob contents
Git Encoding Strategy: filename blob contents commit message
Git Encoding Strategy: filename #=> tree blob blob contents commit
message
Git Encoding Strategy: filename #=> tree blob blob contents #=>
blob commit message
Git Encoding Strategy: filename #=> tree blob blob contents #=>
blob commit message #=> commit tag
Git Encoding Strategy:
Git Encoding Strategy: no need #=> blob contents
Git Encoding Strategy: no need #=> blob contents need #=>
commit message, filename
Git Encoding Strategy: no need #=> blob contents need #=>
commit message, filename IMHO: #=> hg hybird strategy & svn
Ruby Encoding: detect encoding:
Ruby Encoding: detect encoding:the longer the better
Ruby Encoding: detect encoding:the longer the better filename
Ruby Encoding: detect encoding:the longer the better filename blob contents
Ruby Encoding: detect encoding:the longer the better filename blob contents
commit message
Ruby Encoding: detect encoding:the longer the better #=> too short
filename blob contents commit message
Ruby Encoding: detect encoding:the longer the better #=> too short
#=> good to detect filename blob contents commit message
Ruby Encoding: detect encoding:the longer the better #=> too short
#=> good to detect #=> not long enough filename blob contents commit message
Ruby Encoding: Character encoding detection:
Ruby Encoding: Character encoding detection: charlock_holmes
Ruby Encoding: Character encoding detection: charlock_holmes rchardet19
Ruby Encoding: Character encoding detection: charlock_holmes #=> libicu rchardet19
Ruby Encoding: Character encoding detection: charlock_holmes #=> libicu rchardet19 #=>
pure ruby
Ruby Encoding:
Ruby Encoding: blob contents:
Ruby Encoding: blob contents: filename and commit message:
Ruby Encoding: blob contents: filename and commit message: detect and
encode
Ruby Encoding: blob contents: filename and commit message: detect and
encode hard to deal with
Ruby Encoding:
Ruby Encoding: CSI
Ruby Encoding: CSI #=> Character Set Independent
Ruby Encoding: CSI USC #=> Character Set Independent
Ruby Encoding: CSI USC #=> Character Set Independent #=> Universal
Character Set
Ruby Encoding: CSI USC #=> Ruby #=> Character Set Independent
#=> Universal Character Set
Ruby Encoding: CSI USC #=> Ruby #=> Java Python Perl
#=> Character Set Independent #=> Universal Character Set
Ruby Encoding:
Ruby Encoding: MRI 1.8:
Ruby Encoding: MRI 1.8: defective encoding
Ruby Encoding: MRI 1.8: MRI 1.9: defective encoding
Ruby Encoding: MRI 1.8: MRI 1.9: defective encoding Encoding Class
Ruby Encoding: MRI 1.8: MRI 1.9: defective encoding pros: regexp
length Encoding Class
Ruby Encoding: MRI 1.8: MRI 1.9: defective encoding pros: regexp
length cons: incompatible character encodings Encoding Class
Hooks
Post-receive:
Post-receive: push event to redis
Post-receive: push event to redis resque it
scalability : Web Hooks Post-receive:
interoperability : API Post-receive:
interoperability : API based on grape Post-receive:
More
Git: pull-request
Git: pull-request git format-patch <br>..<br>
Git: git apply --check <patch> pull-request git format-patch <br>..<br>
Git: git apply --check <patch> pull-request git format-patch <br>..<br> git
am <patch>
Git: git cherry-pick <sha> cherry-pick
One More Thing
Gitlab CI
Thanks