75
©2013 CloudBees, Inc. All Rights Reserved 1 ©2013 CloudBees, Inc. All Rights Reserved Jenkins ユーザーカンファレンス 東京 2015 川口耕介 / CTO, CloudBees, Inc. [email protected] / @kohsukekawa

Jenkins User Conference 東京 2015

Embed Size (px)

Citation preview

©2013 CloudBees, Inc. All Rights Reserved 1©2013 CloudBees, Inc. All Rights Reserved

Jenkins ユーザーカンファレンス東京 2015

川口耕介 / CTO, CloudBees, Inc.

[email protected] / @kohsukekawa

©2013 CloudBees, Inc. All Rights Reserved 2

CloudBeesの紹介 cloudbees.com

• エンタープライズ向けJenkinsソリューションの提供• Jenkins Enterprise by CloudBees

• Jenkins Operations Center by CloudBees

• Jenkins OSS サポート

• エンタープライズ向けプラグイン

• OSS Jenkinsの開発、コミュニティでの活動

• トレーニング及びコンサルティング

http://softwaretest.jp/jenkins/

©2013 CloudBees, Inc. All Rights Reserved 3

CloudBeesのお客様の紹介

金融 テクノロジ 小売 消費者向け 組み込み

©2013 CloudBees, Inc. All Rights Reserved 4

©2013 CloudBees, Inc. All Rights Reserved 5

インストール数

前年比

©2013 CloudBees, Inc. All Rights Reserved 6

スレーブの数

前年比

©2013 CloudBees, Inc. All Rights Reserved 7

ジョブの数

前年比

©2013 CloudBees, Inc. All Rights Reserved 8

Dockercon keynote

©2013 CloudBees, Inc. All Rights Reserved 9

Jenkins is everywhere

©2013 CloudBees, Inc. All Rights Reserved 10

©2013 CloudBees, Inc. All Rights Reserved 11

©2013 CloudBees, Inc. All Rights Reserved 12

Copyright Google

©2013 CloudBees, Inc. All Rights Reserved 13

Dockercon keynote

©2013 CloudBees, Inc. All Rights Reserved 14

Copyright HBO

©2013 CloudBees, Inc. All Rights Reserved 15

テレビにデビュー

©2013 CloudBees, Inc. All Rights Reserved 16

テレビにデビュー

©2013 CloudBees, Inc. All Rights Reserved 17

©2013 CloudBees, Inc. All Rights Reserved 18

http://en.wikipedia.org/wiki/File:Grand-Bazaar_Shop.jpg

©2013 CloudBees, Inc. All Rights Reserved 19

DotCi

©2013 CloudBees, Inc. All Rights Reserved 20

DotCiとは

• GitHub専用のJenkinsディストロ

• 1 リポジトリ = 1 ジョブ

• .ci.yamlによるバージョン管理された設定

• Docker

• バックエンドとしてMongoDB

©2013 CloudBees, Inc. All Rights Reserved 21

UI リフレッシュ

• 見た目の刷新

• レスポンシブ・デザイン

• 大きなボタンと入力フィールド

• カーブ

• 互換性を保ちつつ

©2013 CloudBees, Inc. All Rights Reserved 22

更なる UI/UX の改善

• ページ内容の動的な部分更新

– FOSDEM UI会議の積み残し課題

• やりたいこと色々

– GitHub等のリポジトリ一覧からジョブを作る

–プラグイン・パック

–設定画面の分解

– …

©2013 CloudBees, Inc. All Rights Reserved 23

©2013 CloudBees, Inc. All Rights Reserved 24

ファイル指紋によるファイルの追跡

©2013 CloudBees, Inc. All Rights Reserved 25

server

Chef/Puppet

sourcerepository

©2013 CloudBees, Inc. All Rights Reserved 26

継続的デリバリとファイルの追跡

• いつ、なにが、どこにデプロイされたのか?

• 追跡結果を基にした更なる自動化

–スモークテスト

–該当ビルドに情報を表示

• 拡張可能

–様々なツールのプロトコルに対応可能

©2013 CloudBees, Inc. All Rights Reserved 27

JenkinsとDocker

• DotCI

• Dockerプラグイン

– Dockerコンテナ内で使い捨てスレーブを走らせる

• Docker build publishプラグイン

– イメージのビルドとアップロード

©2013 CloudBees, Inc. All Rights Reserved 28

公式Dockerイメージ

docker run –p 8080:8080 jenkins

©2013 CloudBees, Inc. All Rights Reserved 29

受け入れテスト&ハーネス

• 実は古いプロジェクトの再生版v2

• 活発なアクティビティ

–コミット/週: 50+

–コミッタ: 22

–テスト: 365

–対象プラグイン: ~50

©2013 CloudBees, Inc. All Rights Reserved 30

X1K: スケーラビリティの改善

• マスター・スレーブ通信のNIO化

–何百ものスレーブを効率よく指揮

• 現在:JNLPスレーブでの利用

• 今後:CLI通信での利用

• Maven2ジョブの高速化

©2013 CloudBees, Inc. All Rights Reserved 31

©2013 CloudBees, Inc. All Rights Reserved 32

©2013 CloudBees, Inc. All Rights Reserved 33

ユースケース: 複雑な活動の指揮

• 多段階の継続的デプロイメント・パイプライン

• 一時サーバを活用したビルド

• 青緑デプロイメント + 自動コミット・アボート

• テストの並列実行と自動的なsharding

• literateプラグインと連携したブランチ毎の自動ジョブ生成

©2013 CloudBees, Inc. All Rights Reserved 34

サポートしたい処理の特徴

• 多段の処理を含む複雑なパイプライン

• ループや並列処理を含む非直線的な処理

• 再起動をまたぐ長時間ビルドのサポート

• 中断、確認、分岐などの人間との対話

• 一過性のエラーなどに便利な途中からの再開

• ジョブ間・組織間の処理の再利用

• 一箇所で処理を簡潔に記述

©2013 CloudBees, Inc. All Rights Reserved 35

©2013 CloudBees, Inc. All Rights Reserved 36

©2013 CloudBees, Inc. All Rights Reserved 37

©2013 CloudBees, Inc. All Rights Reserved 38

©2013 CloudBees, Inc. All Rights Reserved 39

node(“linux”) {

git ‘https://github.com/foo/bar.git’

sh “mvn install”

parallel(

{ sh “./regression-test.sh” },

{ sh “./performance-test.sh” }

)

}

©2013 CloudBees, Inc. All Rights Reserved 40

Build #153Build #153

©2013 CloudBees, Inc. All Rights Reserved 41

foo()

void foo() {

try {

sh ‘sleep 1h’

} finally {

sh ‘rm -rf *.tmp’

}

}

©2013 CloudBees, Inc. All Rights Reserved 42

Groovyのフローの中断と再開

• 「継続渡し方式(CPS)」への変換

• カスタムのGroovyインタプリタで実行

• プログラムの状態をセーフポイントで永続化

• Jenkins起動後の状態の復元

– Pickle: 素直に永続化できないオブジェクトを処理する拡張ポイント

©2013 CloudBees, Inc. All Rights Reserved 43

ビルドの中断と再開

• It “just works”

• ローカル変数やコールスタックも復元

• シェルなど外部プロセスも生き延びる

–スレーブの再接続

• Jenkins Enterprise: チェックポイントから再開

–最初からやり直すのではなく途中からやり直す

–元のビルドからアーティファクトなどを再利用

©2013 CloudBees, Inc. All Rights Reserved 44

©2013 CloudBees, Inc. All Rights Reserved 45

©2013 CloudBees, Inc. All Rights Reserved 46

©2013 CloudBees, Inc. All Rights Reserved 47

©2013 CloudBees, Inc. All Rights Reserved 48

©2013 CloudBees, Inc. All Rights Reserved 49

©2013 CloudBees, Inc. All Rights Reserved 50

©2013 CloudBees, Inc. All Rights Reserved 51

©2013 CloudBees, Inc. All Rights Reserved 52

現状

• 難しい基盤のところは大体完成

• ユーザ・コミッタ募集中

• 現在 version 1.1

• LTSでも動きます

©2013 CloudBees, Inc. All Rights Reserved 53

まとめ

• 複雑な活動を簡潔に指揮・記述

• 一つのジョブで必要な全てを記述

• GroovyによるDSL

• JVMのロスや再起動に耐えるデザイン

• 拡張性

• github.com/jenkinsci/workflow-plugin

©2013 CloudBees, Inc. All Rights Reserved 54

ワークフロー

• github.com/jenkinsci/workflow-plugin

• 幾つもの新しい拡張ポイント

• Jenkins Enterpriseへの機能追加も予定してます

©2013 CloudBees, Inc. All Rights Reserved 55

©2013 CloudBees, Inc. All Rights Reserved 56

LTSのトレインモデルへの変更

メインリリース系列

LTSリリース系列

ベースラインを選ぶ

1.554.21.554.1 1.554.3

4週間毎のLTSリリース

©2013 CloudBees, Inc. All Rights Reserved 57

LTSのトレインモデルへの変更

• アップグレードを事前計画するのが簡単

• LTSテストプロセスへの参加を容易に

©2013 CloudBees, Inc. All Rights Reserved 58

受け入れテスト&ハーネス

• 実は古いプロジェクトの再生版v2

• 活発なアクティビティ

–コミット/週: 50+

–コミッタ: 22

–テスト: 365

–対象プラグイン: ~50

©2013 CloudBees, Inc. All Rights Reserved 59

受け入れテスト&ハーネス

©2013 CloudBees, Inc. All Rights Reserved 60

Class of problems we hope to catch

• Browser-specific issues

• Container-specific issues

• OS-specific issues

• Packaging-specific issues

• Problematic plugin combinations

• Plugin with newer versions of cores

©2013 CloudBees, Inc. All Rights Reserved 61

This is for you, too

I want to make sure a new version of Jenkins works in

my environment with my set of plugins.

©2013 CloudBees, Inc. All Rights Reserved 62

Reusability

• Make your tests our tests

• Amass a bigger pool of tests

©2013 CloudBees, Inc. All Rights Reserved 63

Separately reusable pieces

Jenkins Controller

Page ObjectsJENKINS

HOME seeder

Machine Provisioner

Dockerfixtures

Cucumber integration

Geb + Spock VagrantJUT Process

pool

©2013 CloudBees, Inc. All Rights Reserved 64

More work ahead

• More regular executions

– More target platforms

– More browsers

• Test stability improvements

• Expand to non-functional tests

©2013 CloudBees, Inc. All Rights Reserved 65

X1K

©2013 CloudBees, Inc. All Rights Reserved 66

More efficient master/slave communication

• NIO in remoting

– use a few threads to manage 100s of

slaves

• JNLP today, coming to CLI soon

• Maven2 jobs are a lot faster

©2013 CloudBees, Inc. All Rights Reserved 67

Speaking of JNLP slaves…

©2013 CloudBees, Inc. All Rights Reserved 68

Speaking of JNLP slaves…

©2013 CloudBees, Inc. All Rights Reserved 69

http://www.flickr.com/photos/acmace/4410650624/

©2013 CloudBees, Inc. All Rights Reserved 70

“Eat our own dogfood” approach

• Continuous delivery pipeline for

our own infra

• Shout out to Puppet Labs for their

help

©2013 CloudBees, Inc. All Rights Reserved 71

Infra Summary

• It’s all out there

– github.com/jenkins-infra/jenkins-infra

• Come join the infra team

– Work on cutting-edge stuff & brag about it

elsewhere

©2013 CloudBees, Inc. All Rights Reserved 72

©2013 CloudBees, Inc. All Rights Reserved 73

©2013 CloudBees, Inc. All Rights Reserved 74

Conclusion• So many exciting things going on in

the project

• Let’s build this together

©2013 CloudBees, Inc. All Rights Reserved 75

Ops側の変更は最小に

• Chef

– カスタム・レポートハンドラとして実装

• Puppet

–標準リポート形式をJenkinsにPOSTするだけ

• 求むフィードバック

–データをJenkinsに送るベストな方法