GitLabéæ¹é ã«ã³ãã¡ã¬ã³ã¹ã§çºè¡¨ãã¦ãã¾ãã
2/6(Thu) ã«æ ªå¼ä¼ç¤¾ããªã³ã ã¨ãã¯ã·ãæ ªå¼ä¼ç¤¾ã®åå㧠GitLab éæ¹é ã«ã³ãã¡ã¬ã³ã¹ãè¡ããã¾ãã
ä¼å ´ã¯ããªã³ã ããã®ãªãã£ã¹ã§ã¨ã¦ããããããªæãã§ãã
ããªã³ã æ»ãã«æ¥ã¾ãã
— éººé¡ (@catatsuy) February 6, 2014
ããªã³ã 綺éºããã¦å§åããã¦ã
— éººé¡ (@catatsuy) February 6, 2014
ããªã³ã ãããã 3 人ï¼ãã¯ã·ããããç§ãå«ã㦠3 人ãçºè¡¨ãã¾ãã
ç§ãçºè¡¨ããçç±ã¨ãã¦ï¼ãã¯ã·ãã§ã¯ä¸é¨ã®ãµã¼ãã¼ãé¤ãã¦ãµã¼ãã¼ã® root ãã¤ã³ãã©ã®äººéããæã¦ã¾ãã
ãªã®ã§ GitLab ãªã©æ°ãããã¼ã«ã使ãã«ã¯ã¤ã³ãã©ã®ååãä¸å¯æ¬ ãªã®ã§ããï¼ç§ã GitLab å°å
¥ãææ¡ããä¸äººã ã£ãã®ã§æãè¡ã㧠GitLab å°å
¥ããã®å¾ã®éç¨ãé©å½ãªæãã§ãã£ã¦ãã¾ãã
ãããªä¸ï¼éæ¹é ã«ã³ãã¡ã¬ã³ã¹ã®è©±ãåã£ã¦ããã®ã§ç§ãçºè¡¨ããæãã«ãªã£ãã®ãæµãã§ã
ã¨åç½®ãã¯ãããããã«ãã¦çºè¡¨ã§ããï¼çºè¡¨å 容ã¯ç°¡åã«è¨ãã¨ãGitLab ã® git ã¢ã¯ã»ã¹ããã¦ãã grit ãé ããéã ãã rugged ã«æ¸ãå¤ãããã£ããã©è²ã ãã£ãæå¥ã«åºæ¥ãªãã£ããï¼ï¼ãã¨ããéæ¹é ã«ã³ãã¡ã¬ã³ã¹ãªã®ã«æ¹é ãå ¨ãããªããã¬ã¼ã³ã§ãã
ããã¦ãã®çºè¡¨ãããæ°æéå¾ã«
GitLab is moving from Grit to Rugged to save memory and gain speed. https://t.co/Wv6y2q51l0 Help in the form of merge requests is welcome.
— GitLab (@gitlab) February 6, 2014
ã¨å ¬å¼ããã¤ã¼ããã¦ãã¦çç¬ãã¾ãã
ãããããã«ãªã¯ãã¦ããããã§ãã
çºè¡¨è³æ
å 容
GitLab ã®æ°ã«ãªãã¨ãã
- é ã
- ç¹ã«ã³ãããããã¼ã¸ãªã¯ã¨ã¹ãã® diff ãåãã¨ãããé ã
- IO ãåºãã£ã¦ããããã§ã¯ãªã
- slow query ãåºãªã
- ã§ã¯ä¸ä½ä½ãåå ãªã®ãï¼
Git ã®èªã¿è¾¼ã¿ãé ã
- Git ã®èªã¿è¾¼ã¿ãé ãã¨æ°ä»ã
- 調æ»ãã¦ç´ããªãã®ãèãã
- æé足ããªãã¦ç´ããã§ã¼ãºã¾ã§éã«åããâ¦
- ã¨ããããåºæ¥ãã¨ããã¾ã§å ±æ
grit ç¹å¾´ #1
- Git ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãï¼git ã®ã³ãã³ãã®å®è¡çµæãã´ãªã´ãªãã£ã¦ãã
- åããã»ã¹ã®èµ·åãããï¼ãã¡ã¤ã«ããã¼ã¹ãããâ¦
- ã½ã¼ã¹ã³ã¼ããã ãã¶é
- ããã¥ã¡ã³ãã貧弱
- ã½ã¼ã¹ã³ã¼ããèªãå¿ è¦ããã
- æããããã©ã¤ãã©ãªã§ï¼ä¼¼ããããªã¡ã½ãããè¤æ°ãããªã©ä¸è²«æ§ããªã
- ãªãã¸ã§ã¯ãæåã ActiveRecord ãå°ãæèãããã㪠API è¨è¨
grit ç¹å¾´ #2
- æ¬å®¶ã®ãªãã¸ããªã¯æ¢ã«æ´æ°ãåæ¢ãã¦ãã¦ï¼è²ã
㪠Fork ããã
- ã½ã¼ã¹ã³ã¼ãããã¾ã綺éºã§ãªãï¼ã¡ã³ããã³ã¹ãããæ°ããã人ããã¾ãããªãå°è±¡
- GitLab ã使ã£ã¦ããã®ã¯ç¬èª Forkï¼ä»å使ç¨ããã®ã¯ããï¼
- æãã¡ã³ãããã¦ãã grit ã¨æããã
- ããã GitLab 以å¤ãã使ããã¦ãããã¨ã¯èæ ®ããã¦ããªã
- GitHub æ¬å®¶ã Fork ãã¦ã
- æè¿æ´æ°ã¯ãªã
rugged ç¹å¾´
- libgit2 ã® Ruby ãã¤ã³ãã£ã³ã°
- libgit2 㯠C å®è£ ã§äºå®ä¸ã® git ã®åå®è£
- GitHub ã使ã£ã¦ããããã
- C ã® API ããã¤ã³ãã£ã³ã°ãã¦ããã ããªã®ã§ git ã®å®è£
ãããªãçã§åºã¦ãã
- git ã®å é¨ã®ç¥èããªãã¨ä½¿ãã®ãé£ãã
- ã³ãã³ãã©ã¤ã³ã®ä½¿ãæ¹ããç¥ããªã人ã«ã¯ä½¿ãã«ãã
- C å®è£ ã ãããï¼Fork ã¯å°ãªãï¼ã¹ã¿ã¼ã¯å¤ãï¼
- rugged ã«é¢ããããã¥ã¡ã³ãã¯å°ãªã
- libgit2 ã¯ãã
- å°æ¥çã«ã¯ GitLab ã使ããããããï¼æ¬æ°åº¦ã¯ä¸æï¼
grit vs rugged
gem | grit | rugged |
---|---|---|
implementation | pure ruby | C extension |
service | GitLab | Github |
speed | slow | high speed |
document | little | little |
grit ä»æ§
- grit 㧠diff ãåãã¨ãåããã»ã¹ãç«ã¡ä¸ã㦠git ã®ã³ãã³ããå©ã
- ããªãé ãã¯ã
- GitLab ã§ææè©°ã¾ã£ãããã«æããã®ã¯ãã
- ã³ãããä¸è¦§ã¯ãã°ããã´ãªã´ãªãã
- Ruby ã ã¨æååæä½ãé åã®æ«å°¾ã«è¦ç´ 追å ãªã©ã¯é ã
- grit ã ã¨å¤§ãããã diff ãåããã¨ããã¨ä¾å¤ã§è½ã¡ã
Grit::Git.git_max_size
ãããã©ã«ã 5MB ã§ããã大ããããã¨å¤§ä¸å¤«ã ãï¼æ¨æºåºåã大ãããªãã¨ããªãæéãããã- GitLab ãªã
gitlab.yml
ã®git: max_size
ãå¤æ´ãã - ä»åã®ãã³ããã¼ã¯ã§ã¯ä¸é¨ãããã«æµè§¦ããã®ã§å¤æ´
ãã³ããã¼ã¯
- grit ã¯ã¡ã½ããã«ãã£ã¦ã¯åããã»ã¹ãå¼ã³åºã
- ruby æ¨æºæè¼ã®
Benchmark.benchmark
ã¯ããã©ã«ãã§åããã»ã¹ã®å®è¡æéãåºåããªã - å¼æ°ã渡ãã¦è¡¨ç¤ºã§ããããã«ãã
- ruby æ¨æºæè¼ã®
- ã³ãããã 100 åã®è©³ç´°æ å ±ã¨ã³ãããå士㮠diff ã 99 çµåã£ã¦ã¿ã
ãã³ãçµæ
å®éã«ãã£ã¦â¦
- è¦ããã£ããï¼æé足ããâ¦
- ä»å¾ã®èª²é¡ã¨ã(ry
grit/GitLab ãã°
- GitLab å¨è¾ºã® gem 㯠gem ã¨ãã¦ç»é²ããã¦ããã«ãé¢ããã GitLab 以å¤ãã使ç¨ãããã¨ãä¸åèæ ®ãã¦ããªã
- åä½ã§èªã¿è¾¼ããã¨ããã¨ãã°ã«æ©ã¾ããããã¨ã«ãªã
- èªåãééãããã°ç´¹ä»
[gitlab_git] GitLab ãã使ããã¨ããèãã¦ããªã
- gitlab_git ã GitLab 㧠git ãå®éã«è§¦ãé¨å
- grit ã使ãã®ã¯ãã
- rugged ã使ãå ´åã¯ãããå¤§å¹ ã«æ¸ãæããå¿ è¦ãã
- GitLab 㯠ActiveSupport ãèªã¿è¾¼ã¾ãããï¼gitlab_git ã¯ç¬ç«ãã gem ãªã®ã§ä½¿ããªãèªã¿è¾¼ãå¿
è¦
- ãããä¸é¨ããèªã¿è¾¼ãã§ããªãã£ã
- å
·ä½çã«ã¯
try
ã使ç¨ãã¦ãã
- ãã«ãªã¯åºãã
- åãè¾¼ã¾ããªã
- Pull Request #22 · gitlabhq/gitlab_git
[grit] require ã§ããªã #1
- Gemfile ãã
path:
æå®ã§èªã¿è¾¼ã㨠require ã§ããªãVERSION
ãã¡ã¤ã«ã®ãã¹ãééãã¦ãã¦èµ·åã§ãã¦ããªã- ãã§ã«ãã«ãªã¯ãåºã¦ãã
- ä½ã¶æãåãè¾¼ã¾ããæ¾ç½®ããã¦ãã
- ãã¼ã¸ãã¦ããããããã«å¬ä¿ã³ã¡ã³ããã
- ãã¼ã¸ãã¦ããããï¼ï¼
- ä»åã®ãã³ããã¼ã¯ã«ã¯ãã¡ãããã®ããããé©ç¨
- Fixed issue #32 · Pull Request #35 · gitlabhq/grit
ãã話
[grit] æ³å®å¤ã®ã³ããã #2
- ãã commit ãèªã¿è¾¼ããªã
- ãªãã¸ã§ã¯ããã¡ã¤ã«ãæ³å®å¤ã®å½¢å¼ããã
- æ£ããæåãä¸æãªãã issue ç»é²
- Issue #37 · gitlabhq/grit
- git ã®ãã¡ã¤ã«ãæ¹è¡ãªã©ãããã¼ã¹ããã¦ããã ãã®å®è£ ãªã®ã§è§£æçµæããããããªããã¨ã¯ãããããã
[grit] å½ãã®ã³ã¡ã³ãã¢ã¦ã #3
- ã³ã¡ã³ãã¢ã¦ãã«åããã£ã
git.rev_list
ãå¼ã¶ã¨method_missing
ã«ãªãã¨æ¸ãã¦ãã£ããï¼å®é㯠include ããã¯ã©ã¹ã«å®è£ ããã£ã- ãã«ãªã¯ãããåå¿ããªã
- ã©ããå¤ãããããã³ã¼ãã§ä½ãæ³å®ãããåãã ã£ãã®ãããããªã
method_missing
ã®æ¹ã«ãã¦ãåãããã ã£ããï¼ãã¹ãã¯éããªã- Pull Request #38 · gitlabhq/grit
URL
- Git - Git Objects
- Git - Git References
- Ruby - Bundlerã§Cæ¡å¼µãå«ãã gemãå ¬éãã - Qiita
- gitlabhq/grit
- libgit2/rugged
- libgit2
- libgit2 API
ã¾ã¨ã
- GitLab ãé«éåã§ããªãã®ã模索ããã grit ã rugged ã«æ¸ãæããã°ããã®ã§ã¯ï¼ã¨ãã仮説ãã§ãã
- ãã³ããã¼ã¯ãåã£ã¦æ¯è¼ãããã¨ããã grit ã¨ã GitLab å¨è¾ºã® gem ããã®ã¼ããã¦å¤§å¤ã ã£ã
- ãã«ãªã¯ãåºããããããï¼åãè¾¼ã¾ãããã¨ã¯ãã¾ããªã
- ããã¥ã¡ã³ãããªãã®ã§ã½ã¼ã¹ã³ã¼ããèªãå¿ è¦ããã£ã¦å¤§å¤
- rugged ã¯éããæ¸ãæããããã«ã¯ rugged ã®ã¡ã½ãããããææ¡ããå¿ è¦ãããã®ã§é¢åãã