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.6k
Other Decks in Technology
See All in Technology
TypeScript、上達の瞬間
sadnessojisan
46
13k
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
いざ、BSC討伐の旅
nikinusu
2
780
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
390
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
Engineer Career Talk
lycorp_recruit_jp
0
190
Application Development WG Intro at AppDeveloperCon
salaboy
0
190
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
500
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
160
強いチームと開発生産性
onk
PRO
35
11k
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Into the Great Unknown - MozCon
thekraken
32
1.5k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Six Lessons from altMBA
skipperchong
27
3.5k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Making Projects Easy
brettharned
115
5.9k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
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