Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Architecture for faster software delivery for business innovation

tnir
August 27, 2017

Architecture for faster software delivery for business innovation

「GitLabを軸とした、ビジネスを支える高速デリバリを実現するアーキテクチャ」

2017-08-27 July Tech FestaのD50で話した内容です。

tnir

August 27, 2017
Tweet

More Decks by tnir

Other Decks in Technology

Transcript

  1. GitLab を軸とした、 ビジネスを支える高速デリバリを実 現するアー キテクチャ D50 (16 15‑17 00), July

    Tech Festa 2017 @ AIIT, Shinagawa, Tokyo #JTF2017 2017‑08‑27 @tnir (Takuya Noguchi)
  2. @tnir Takuya Noguchi Software Engineer & Tech PR 今日の参加者の中ではアプリを書いている人 July

    Tech Festa 2 年ぶり2 度目の参加 (2015) 所属企業でスポンサー 検討するも日数不足で断念 発表者はGitLab Inc. およびその関連企業とは関係ありません。 発表内容 は個人的見解です。
  3. ねらい 20 年以上日本でDX (digital translation) をやってきた中で、 ビジネ スデリバリの高速化・ 汎用化が重要であることに気付く 「

    ビジネスデリバリについてもっと議論されていいのではない か」 GitLab を利用&OSS 貢献してきた知見を共有 特にGitLab についての誤った日本語情報の撲滅
  4. Agenda Source Control Management (SCM) Development Workflow & Software Development

    Life Cycle (SDLC) Demo Why should you choose GitLab? Features of GitLab: fundamental and beyonds Various Editions of GitLab Continuous Integration/Deployment Monitoring Community Growth and Startup Companies
  5. History of SCM (Or version control systems (VCS)) 1982 RCS

    1985 CVS 2000 Subversion 2000 GNU arch 2005 Git 2017 Now 12 yrs passed since Git released cf. Wikipedia: Version control software
  6. SDLC & Development Workflow チー ムにおけるソフトウェア開発/IT 開発にはSCM(Git) だけあれば いいのか? "No!"

    Software Development Life Cycle (SDLC) の理解/ 分析とワー クフ ロー の確立が重要 組織の成熟度にもよるが、 一番大変なことが多い
  7. GitLab の歴史 Git: 2005 GitHub: 2008 Bitbucket (Git support): 2010

    GitLab: Oct 2011 (0.9.4) (Oct 9, 2011) GitHub Enterprise (GHE): Oct 2011 (11.10.12) (Oct 15, 2011) GitLab.com: 2012 https://github.com/gitlabhq/gitlabhq/commit/e98c77857f9f765 d1854b92c2dc33049504a596d https://enterprise.github.com/releases/11.10.12/notes
  8. Alternatives to GitLab.com GitHub + their Marketplace + 3rd‑party ecosystem

    (CI, linter etc.) Bitbucket + their Integations AWS CodeCommit (CodeStar) MS Visual Studio Team Services (VSTS) GCP Source Repositories
  9. Why should we choose GitLab? 「 貧者のGHE」 2011~2014 年はそうだった。 Free

    (and Enterprise Editions) Freemium (GitHub.com ‑> GHE とは違う) Open 誰でも修正可 2015 年~: Y Combinator (YC W15) 資金確保→ エンジニア増↑↑↑ 開発スピー ドが速い 周辺領域も取り込まれる (GitLab CI, 新Runner)
  10. Advanced features CI/CD: CI/CD with Pipelines, Coverage, Environment, Variables Artifacts:

    Artifact repo with Browser, Container Registry, Pages Deployment: Boards, Canary Deployments Monitoring: Application Performance (APM) Cloud Native: deploy to Kubernetes, OpenShift Chat: Mattermost ChatOps: Slash commands (Mattermost/Slack) misc: Cycle Analytics, Conversational Development Index Mobile‑fast
  11. Various Editions of GitLab (2) Community Edition (CE) Enterprise Editions

    Enterprise Edition Starter (EES) ($39/u/y) Enterprise Edition Premium (EEP) ($199/u/y) 原則としてほとんどの機能はCE で使える チー ム規模(100 人以上かどうか) が大きい場合に必要な機能はEE に ( 公式見解) 30 人くらいでも欲しくなる機能がある( 個人的感想) 最近、EES/EEP に分割 (cf. GHE: $250/u/y)
  12. Various Editions of GitLab (3) 5 editions CE EES EEP

    GitLab.com 無料でGitHub.com Organization のように使える プライベー トrepo 無制限! プライベー トCI も無料枠あり( 並列実行数制限なし) DC= 米国(Azure) メンテナンスフリー
  13. (cont'd) GitLab Hosted (ex. GitHost.io) マネー ジドGitLab インスタンス課金 元々 別々

    のスター トアップGitHost を買収により統合 DC=Digital Ocean のみ 他IaaS も欲しい 2017 年5 月から新規申込停止中?
  14. 選び方 日本だとEE 導入事例はほとんど聞かない が、 日本初のGitLab リセラー 登場(CreationLine) (2017 年6 月)

    まずはCE を使うのが無難 個人的にはワー クフロー 改善のためEES を使いたい CI/CD やコンテナレジストリまで一気通貫で5 分で構築 お金さえ払えば気軽にCE<=>EE 切替できる GH.com<=>GHE ではそうはいかない
  15. Continuous Integration/Deployment (2) (2013 年ごろ) GitLab をユー ザとして使うことになり、 化石化 Jenkins

    インスタンス もおじさん不在 CI 刷新を検討する (GitLab からGH.com 経由で) CircleCI/Wercker/Magnum CI などを試す 当時: GitLab CI 3.x 個別インストー ル、Runner も今のものとは違う その後、 開発者がGitLab Inc. にジョインし、GitLab 8.0 で完全 統合され、Runner も新しくなってます
  16. c a c h e : p a t h

    s : ‐ v e n d o r / b e f o r e _ s c r i p t : ‐ a p t ‐ g e t u p d a t e ‐ y q q ‐ a p t ‐ g e t i n s t a l l ‐ y q q g i t l i b m c r y p t ‐ d e v l i b p q ‐ d e v l i b c u r l 4 ‐ g n u t l s ‐ d e # # I n s t a l l P H P e x t e n s i o n s ‐ d o c k e r ‐ p h p ‐ e x t ‐ i n s t a l l m b s t r i n g m c r y p t p d o _ p g s q l c u r l j s o n i n t l # # I n s t a l l & e n a b l e X d e b u g f o r c o d e c o v e r a g e r e p o r t s ‐ p e c l i n s t a l l x d e b u g ‐ d o c k e r ‐ p h p ‐ e x t ‐ e n a b l e x d e b u g # # I n s t a l l a n d r u n C o m p o s e r ‐ c u r l ‐ s S h t t p s : / / g e t c o m p o s e r . o r g / i n s t a l l e r | p h p ‐ p h p c o m p o s e r . p h a r i n s t a l l # # B r i n g i n a n y s e r v i c e s w e n e e d h t t p : / / d o c s . g i t l a b . c o m / e e / c i / d o c k e r / # # S e e h t t p : / / d o c s . g i t l a b . c o m / c e / c i / s e r v i c e s / R E A D M E . h t m l f o r e x a m p l e s s e r v i c e s : ‐ m y s q l : 5 . 7 # # S e t a n y v a r i a b l e s w e n e e d v a r i a b l e s : # C o n f i g u r e m y s q l e n v i r o n m e n t v a r i a b l e s ( h t t p s : / / h u b . d o c k e r . c o m / r / _ M Y S Q L _ D A T A B A S E : m y s q l _ d a t a b a s e M Y S Q L _ R O O T _ P A S S W O R D : m y s q l _ s t r o n g _ p a s s w o r d
  17. GitLab CI テンプレー ト (Objective‑C/Swift with Xcode 例) GitLab CI

    でiOS アプリをビルドし、ipa を配布する j o b : b e f o r e _ s c r i p t : ‐ e x p o r t L A N G = e n _ U S . U T F ‐ 8 ‐ s e c u r i t y u n l o c k ‐ k e y c h a i n ‐ p $ P A T H _ P H R A S E / U s e r s / $ U S E R _ N A M E / L i b r # X c o d e 7 , X c o d e 8 のプロジェクトが共存している場合、 使用するX c o d e を明 ‐ e x p o r t D E V E L O P E R _ D I R = / A p p l i c a t i o n s / X c o d e 7 . a p p / C o n t e n t s / D e v e l o p e s c r i p t : ‐ x c o d e b u i l d ‐ s c h e m e < スキー マ名> a r c h i v e ‐ a r c h i v e P a t h / < 任意のアー ‐ x c o d e b u i l d ‐ e x p o r t A r c h i v e ‐ e x p o r t O p t i o n s P l i s t < e x p o r t o p t i o n を記 a r t i f a c t s : p a t h s : ‐ a r t i f a c t s / < アプリ名. i p a >
  18. GitLab CI テンプレー ト https://gitlab.com/gitlab‑org/gitlab‑ci‑yml にて提供しており、 各々 のGitLab インスタンスにも同じものが提供されている Docker

    x (Python, Ruby etc.) がない → コンテナ化と静的分析の両方に対応できてない コントリビュー ション可能なので、 ぜひ改善をお願いします
  19. TIPS: 秘匿情報のインジェクション CI では秘匿情報(credentials) を入れたいことがある。GitLab CI では Secret Variables を標準で搭載。

    b e f o r e _ s c r i p t : ‐ e v a l $ ( s s h ‐ a g e n t ‐ s ) ‐ s s h ‐ a d d < ( e c h o " $ S S H _ P R I V A T E _ K E Y " ) (from gitlab‑examples/ssh‑private‑key)
  20. Container Registry artifacts の一つとして、Docker Container Registry のホスティング 機能 (GitLab Container

    Registry) docker/distribution‑based Container Registry 認証周りをGitLab と一貫管理できる
  21. Pages GitHub Pages (GHP) みたいなもの 全公開 (GHP と違い) GitLab CI

    との親和性が高い (GHP と違い) ACL もできそう ( 個人的なアイデア) 認証周りをGitLab と一貫管理できる( はず)
  22. Community Growth and Startup Companies 所属企業の社内にスペシャリストがいない コミュニティを頼ろう! GitLab のコミュニティを盛り上げていきたい 6

    ヶ月温め、3 ヶ月会場探し 毎回、 実参加者数 100 人超え 地方開催: 仙台、 東京、 福岡、 鹿児島、... 未開催でエリアで興味ある方お知らせください GitLab.JP Connpass グルー プ: 680 人 (8 月26 日現在) スポンサー(GitLab Tokyo) 企業 多数( 延べ2 桁) 運営、 大変 でも、 スター トアップに足りないR&D が強化される!
  23. 日本語情報 オフラインイベントが増えた Qiita 記事も増えてきた (520 記事) GitLab JP Slack: https://gitlab‑jp.herokuapp.com/

    omnibus (deb, rpm) によるデプロイの記事がほとんどに Helm Charts の記事はまだあまり見ない 2017‑08‑20 現在
  24. 苦労の連続 アプリ重たい パフォー マンスモニタリングを使った改善で軽量 バグ多い ひたすらMR 出し続ける Static Analysis 追加

    マー ジされたMR: 50 達成 ( 全体 11,000 MRs) Kubernetes, Prometheus, Review Apps, Vue.js の採用 InfluxDB (TICK stack), Redspread (acquired by Core OS) な どの失敗(!?) も多数 各コンポー ネントに納得して使えている (2017 年夏現在) コミュニティができつつある 年内に1000 人達成したい GitLab 日本人開発者を20 人に増やしたい ( 今10 人弱?) Rails だけでなく、 フロント(Vue.js)/ バックエンド (Go/gRPC) も多い
  25. まとめ GitLab を導入するだけで、 開発ワー クフロー の水準を( ある程度) 高 くできる OSS

    なのでMR コントリビュー ションによりすぐに改善できる 適切な技術判断されたオー ルインワンパッケー ジは便利