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
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
490
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
150
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
170
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
210
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
170
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
120
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
190
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
110
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
5
210
Featured
See All Featured
Visualization
eitanlees
146
15k
Building Adaptive Systems
keathley
38
2.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
A Philosophy of Restraint
colly
203
16k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Rails Girls Zürich Keynote
gr2m
94
13k
Six Lessons from altMBA
skipperchong
27
3.5k
Gamification - CAS2011
davidbonilla
80
5.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
The Cult of Friendly URLs
andyhume
78
6.1k
Building an army of robots
kneath
302
44k
GitHub's CSS Performance
jonrohan
1030
460k
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