Save 37% off PRO during our Black Friday Sale! »

High cost performance CI

High cost performance CI

D203fca278749fe5caa0338143f635cc?s=128

YutaTetsuka

May 24, 2017
Tweet

Transcript

  1. High cost performance CI Android Testing Bootcamp #6 Yuta Tetsuka

    2017/05/10
  2. Yuta Tetsuka - JustSystems corporation joined in 2012 - Team

    smilezemi (smile-zemi.jp) - Android engineer - Qiita: @tetsukay 1 About me 2
  3. What do you use the CI ? 3

  4. Github Enterprise  + CI as a Service? 4

  5. Github Enterprise  + Jenkins? 5

  6. Cost calculation - Github Enterprise - $2,500 / 10 users

    / year - JustSystems - About 300 users - $75,000(≓8,000,000 JPY) - CI as a Service - Restrictions are severe - Concurrent builds - Machine power - Build Environments 6
  7. Recommend solution 7

  8. Gitlab Best solution 8

  9. Gitlab...? Best solution…? 9

  10. (I’m thinking) Everyone's imagination against Gitlab 10

  11. 2013.1 Via https://www.slideshare.net/takafumionaka/is-there-anynecessityofusinggithubenterprise 11

  12. Eerie raccoon dog ※ たぬきです 12

  13. Destroy Database ※ リカバリ作業がYoutubeでストリーミング配信されました 13

  14. etc… slightly negative impression might be strong 14

  15. 突然ですが,少し昔話いいですか? ※ ここの英訳は伝わる気がしないので日本語で失礼します 15

  16. 2013 spring SVN to Git - SVNが嫌すぎて会社にGit導入要請 - 入れても良いけど選択肢とコスト計算して -

    Github Enterprise or Gitlab - 当時,GitlabはGithubの劣化コピー感満載 - 最低限の欲しい機能は付いてた - GithubコストとGitlab運用コスト比較検討 - なんとか自社で運用できるのでは? - と情シスが言い出す 16
  17. (当時の心境)正直なところ Github Enterpriseが良い... 17

  18. いま Gitlabでよかった! 18

  19. 驚異的な進化速度 - 細かい使い勝手がどんどん改善 - 月1のアップデートでChangelog300行とか - 早いアップデートで新機能がどんどん使える のは楽しい! 19

  20. e.g. Issue Board - いわゆるカンバン - 実はGithubより一足早くリリース - 2016.8 20

  21. e.g. Burndown Chart - Burndown Chart - ただしこれは有料 21

  22. 閑話休題: Gitlab CI 22

  23. CI with Gitlab 23

  24. Machine - Hardware - Cloud 24

  25. CI Runner - CI Engine - Multi Platform - Win,

    Mac, Linux - N:N link to Gitlab 25
  26. Executor - Docker - Docker based CI - Shell -

    CI on Runner Server Shell - Use iOS, Windows CI - Virtual Box - CI in Virtual Box - e.g. CI on Windows - SSH - Kick other machine 26
  27. prices - Gitlab - Community Edition $0 - Gitlab Runner

    - $0 (+ Hardware, Cloud) 27
  28. Setup Runner Use gitlab.com + My Runner 28

  29. Install Runner https://docs.gitlab.com/runner/install/linux-repository.html curl -sSL https://get.docker.com/ | sh # For

    Debian/Ubuntu curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-mu lti-runner/script.deb.sh | sudo bash # For RHEL/CentOS curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-mu lti-runner/script.rpm.sh | sudo bash # For Debian/Ubuntu sudo apt-get install gitlab-ci-multi-runner # For RHEL/CentOS sudo yum install gitlab-ci-multi-runner 29
  30. Register Runner https://docs.gitlab.com/runner/install/linux-repository.html $ sudo gitlab-ci-multi-runner register Please enter the

    gitlab-ci coordinator URL (e.g. https://gitlab.com ) > https://gitlab.com Please enter the gitlab-ci token for this runner > [ci token xxx] (Project Settings -> CI/CD Pipeline) Please enter the gitlab-ci description for this runner > my-runner INFO[0034] fcf5c619 Registering runner... succeeded Please enter the executor: shell, docker, docker-ssh, ssh? > docker Please enter the Docker image (eg. ruby:2.1): > ubuntu:latest INFO[0037] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 30
  31. Registered! 31

  32. Runner Test image: openjdk:8-jdk build: script: - echo ok -

    Create .gitlab-ci.yml - To project root directory $ echo ok ok Job succeeded 32
  33. Build Docker Image For Android build 33

  34. Create new project for image build Fork: https://github.com/gfx/docker-android-project/blob/master/Dockerfile - Files

    - Dockerfile - android-sdk-license - .gitlab-ci.yml - Default template for docker build - Start build, When you commit Sample: https://gitlab.com/tetsukay/android-container 34
  35. Build Success Fork: https://github.com/gfx/docker-android-project/blob/master/Dockerfile Sample: https://gitlab.com/tetsukay/android-container 35

  36. Build Android App 36

  37. Clone Droid Kaigi 2017 project Fork: https://github.com/DroidKaigi/conference-app-2017 - Add file

    - .gitlab-ci.yml Sample: https://gitlab.com/tetsukay/droidkaigi2017 37
  38. .gitlab-ci.yml Fork: https://github.com/DroidKaigi/conference-app-2017 Sample: https://gitlab.com/tetsukay/droidkaigi2017 image: registry.gitlab.com/tetsukay/android-container:master before_script: - chmod

    +x ./gradlew stages: - build - test build: stage: build script: - ./gradlew assembleDebug artifacts: paths: - app/build/outputs/ unitTests: stage: test script: - ./gradlew test 38
  39. Build Success Fork: https://github.com/DroidKaigi/conference-app-2017 Sample: https://gitlab.com/tetsukay/droidkaigi2017 39

  40. CI Feedback 40

  41. Merge Request (Pull Request) - CI pass is required to

    accept MR 41
  42. Issue - Display CI progress, and results 42

  43. Badge 43

  44. gitlab.com 44

  45. Gitlab.com git hosting service - Private Repo is FREE -

    Unlimited Users 45
  46. Gitlab.com Gitlab CI - Shared Runner is FREE - Unlimited

    builds - Unlimited concurrent builds - 4GB RAM - Docker CI only - By Digital Ocean 46
  47. Gitlab.com Container Registry - Private Image Repo is FREE -

    Unlimited private docker images 47
  48. Gitlab is best solution! Gitlabはいいぞ! 48

  49. Gitlab JP Community - Slack - https://gitlab-jp.herokuapp.com/ - Connpass -

    https://gitlab-jp.connpass.com/ 49
  50. https://www.justsystems.com/jp/employ/ 50