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
The Role of Developer Relations in AI Product Success.
giftojabu1
0
140
AIチャットボット開発への生成AI活用
ryomrt
0
170
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
AI前提のサービス運用ってなんだろう?
ryuichi1208
8
1.4k
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
2
230
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
200
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
260
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
Featured
See All Featured
Teambox: Starting and Learning
jrom
133
8.8k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Scaling GitHub
holman
458
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Agile that works and the tools we love
rasmusluckow
327
21k
Writing Fast Ruby
sferik
627
61k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Fireside Chat
paigeccino
34
3k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
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