61
being-healthy-dev-and-ops 迷ったら健全な方 ~クックパッドのDevとOps~ 成田 一生 2013/09/28

Being healthy dev and ops in cookpad - Issei Naruta

Embed Size (px)

Citation preview

Page 1: Being healthy dev and ops in cookpad - Issei Naruta

being-healthy-dev-and-ops

迷ったら健全な方~クックパッドのDevとOps~

成田 一生2013/09/28

Page 2: Being healthy dev and ops in cookpad - Issei Naruta

About me

Page 3: Being healthy dev and ops in cookpad - Issei Naruta

成田 一生なるた いっせい

@mirakui

photo by sora_h

VP Infrastructure at Cookpad Inc.

2008 ヤフー 新卒入社メールサービスのバックエンド開発

2010 クックパッド入社サービス開発エンジニアとして入社後、開発基盤チームを経てインフラチームに

Page 4: Being healthy dev and ops in cookpad - Issei Naruta

About Cookpad

Page 5: Being healthy dev and ops in cookpad - Issei Naruta
Page 6: Being healthy dev and ops in cookpad - Issei Naruta
Page 7: Being healthy dev and ops in cookpad - Issei Naruta
Page 8: Being healthy dev and ops in cookpad - Issei Naruta
Page 9: Being healthy dev and ops in cookpad - Issei Naruta
Page 10: Being healthy dev and ops in cookpad - Issei Naruta
Page 11: Being healthy dev and ops in cookpad - Issei Naruta
Page 12: Being healthy dev and ops in cookpad - Issei Naruta
Page 13: Being healthy dev and ops in cookpad - Issei Naruta
Page 14: Being healthy dev and ops in cookpad - Issei Naruta

Our Phase

Page 16: Being healthy dev and ops in cookpad - Issei Naruta

歴史

Page 17: Being healthy dev and ops in cookpad - Issei Naruta

1997 創業

2008 Coldfusion → Ruby on Rails へ移行

2013

2009

2010

2011

2012

現在

2007

2002

2003

2004

2005

2006

2001

2000

1999

1998

東証マザーズ上場

成田 JOIN

東証一部へ上場変更

エンジニアの人数:

3

10~20

約60

1

Page 18: Being healthy dev and ops in cookpad - Issei Naruta

1人 1人が開発も運用も全部やる

10人 うち1~2人が開発しつつ運用

50人 数人規模の運用チーム登場

100人 運用チームの拡大・専門別の細分化

エンジニアの規模

このあたりで JOIN

いまここ

Page 19: Being healthy dev and ops in cookpad - Issei Naruta

サービス開発系エンジニア(約40人)

技術部エンジニア(12人)

インフラ部エンジニア

(5人)

2013

Dev Ops

Dev

Page 20: Being healthy dev and ops in cookpad - Issei Naruta

今日の話

• 組織が大きくなってきた

• Dev と Ops の関係はどうなっていくのか?

DevOps

Dev Ops

Page 21: Being healthy dev and ops in cookpad - Issei Naruta

デプロイ

Page 22: Being healthy dev and ops in cookpad - Issei Naruta

デプロイ

5~10 deploy / day

Page 23: Being healthy dev and ops in cookpad - Issei Naruta

デプロイルール(一部)

• CI をパスしたリビジョンのみデプロイしてよい

• デプロイはコードを push した開発者自身が行う

• 営業時間内のみデプロイ可能• デプロイ後は開発者が動作確認し、不具合を見つけたらすぐにロールバックする

Page 24: Being healthy dev and ops in cookpad - Issei Naruta
Page 25: Being healthy dev and ops in cookpad - Issei Naruta

失敗

Page 26: Being healthy dev and ops in cookpad - Issei Naruta

リリース日が今日だった

• Dev「リリース今日です」

• Ops「!?」

Page 27: Being healthy dev and ops in cookpad - Issei Naruta

リリース前の Ops の作業

• 本番サーバセットアップ

• 監視設定

• キャパシティ測定

• 冗長化

• などなど…

Page 28: Being healthy dev and ops in cookpad - Issei Naruta

Dev の事情

• ソースコードはリリース直前まで fix しない

• 「リリース日」は重要

• Dev がデプロイ可能=(技術的には)勝手にリリース可能

• 非公開→ユーザ限定公開→全体公開

Page 29: Being healthy dev and ops in cookpad - Issei Naruta

developing

setupservers re

lease

✔source codefix

✔ fixturesfix

Dev

Ops

Page 30: Being healthy dev and ops in cookpad - Issei Naruta

本質的な問題

Dev - Ops 間コミュニケーション

Page 31: Being healthy dev and ops in cookpad - Issei Naruta

どうするか?

• リリース日の決定に Ops の承認が必要なルールにする?

• Ops「ソースコード fix してからリリースまでに3営業日必要です」??

Page 32: Being healthy dev and ops in cookpad - Issei Naruta

権威的にならない

Page 33: Being healthy dev and ops in cookpad - Issei Naruta

承認フローの増加

• 個人のオーナーシップが減衰仕事が楽しくなくなる

• 承認を通すテクニックや政治が発生

• コミュニケーションで解決できる部分はギリギリまでそうするべき

Page 34: Being healthy dev and ops in cookpad - Issei Naruta

プロダクトのリリースをOps が止めない

Page 35: Being healthy dev and ops in cookpad - Issei Naruta

developing

setupservers re

lease

✔source codefix

✔ fixturesfix

Dev

Ops

BAD

Page 36: Being healthy dev and ops in cookpad - Issei Naruta

developing

setupservers

release

✔source codefix

✔ fixturesfix

Dev

Ops

communication

GOOD

Page 37: Being healthy dev and ops in cookpad - Issei Naruta

完璧さを追求しない

Page 38: Being healthy dev and ops in cookpad - Issei Naruta

Ops が完璧さを求めると…

• リリース前に、完全に fix されたソースコードでキャパシティ計測したい

• パフォーマンスに問題のあるコードを一切許したくない

Page 39: Being healthy dev and ops in cookpad - Issei Naruta

Dev Ops

Corporation

Customers

Page 40: Being healthy dev and ops in cookpad - Issei Naruta

Dev とか Ops とかの前に

組織や顧客(ユーザー)にとって有益な判断かどうか大事

Page 41: Being healthy dev and ops in cookpad - Issei Naruta

求めるべきは

「完璧さ」ではなく「健全さ」

Page 42: Being healthy dev and ops in cookpad - Issei Naruta

健全さのために

時には Ops にとって不利益な選択を許す

➡ 素晴らしいアーキテクチャ vs リリース日

➡ サーバ増やして解決 vs コスト

➡ オペレーション完全自動化 vs 人件費

Page 43: Being healthy dev and ops in cookpad - Issei Naruta

Not 完璧 but 健全

リリース前、完全に fix されたソースコードでキャパシティ計測したい

➡ 開発初期からパフォーマンスについて話し合う

➡ キャパシティ計測するのに十分なレベルのコードを早めに出してもらうようにコミュニケーション

Page 44: Being healthy dev and ops in cookpad - Issei Naruta

Not 完璧 but 健全

パフォーマンスに問題のあるコードを一切許したくない

➡ サーバ増やして解決するならそれでいい場合もあるのでは?ユーザ/組織に利益がある方は?

Page 45: Being healthy dev and ops in cookpad - Issei Naruta

歩み寄りのために

Page 46: Being healthy dev and ops in cookpad - Issei Naruta

Dev のことをよく理解する

• Ops がサービスの最新のソースコードを追う

• Dev 同士の議論に耳を傾ける

• 開発の初期から輪に入れてもらう

Page 47: Being healthy dev and ops in cookpad - Issei Naruta

Ops に求められるもの

サーバで動いているものをソースコードレベルで理解する

➡ ミドルウェア

➡ アプリケーション

Page 48: Being healthy dev and ops in cookpad - Issei Naruta

Dev に求めるもの

• サーバサイドのセンス

• そのコードに大量のトラフィックが来たらどうなるか

• キャッシュなど

Page 49: Being healthy dev and ops in cookpad - Issei Naruta

例: パフォーマンスが出ない

× Ops が黙ってチューニング

○ Dev と Ops 一緒に直していく

Page 50: Being healthy dev and ops in cookpad - Issei Naruta

パフォーマンスに影響が出そうなコード

必ず pull-request で mention してもらうというルール

Page 51: Being healthy dev and ops in cookpad - Issei Naruta

Ops もサービスのコードにpull-request を出す

Page 52: Being healthy dev and ops in cookpad - Issei Naruta

わりとできていること

Ops → Dev の理解

➡ 元 Dev が Ops を率いている

➡ Ops が全員コード読み書きできる

➡ Dev への口出しソースコードレベルでのつっこみ

Page 53: Being healthy dev and ops in cookpad - Issei Naruta
Page 54: Being healthy dev and ops in cookpad - Issei Naruta

今後の課題

Page 55: Being healthy dev and ops in cookpad - Issei Naruta

組織がさらに巨大になると

エンジニア個人が自分で意思決定する機会が少なくなっていく?

➡ 人が増えると自分より上の視点を持ちにくくなる

➡ ルールやフローを信じて疑わない状態に陥りやすい

➡ 現場の裁量を維持できるかが鍵

Page 56: Being healthy dev and ops in cookpad - Issei Naruta

おわりに

Page 57: Being healthy dev and ops in cookpad - Issei Naruta

ベンチャー企業の DevOps

• はじめはみんな DevOps

• 組織が拡大すると、それまで当たり前だったことがやりにくくなる

• Dev とOps が離れていくのをどこまで食い止められるか

• 鍵は「健全な方を選択し続けること」

• Dev Ops 間の健全さ=組織の健全さ

Page 58: Being healthy dev and ops in cookpad - Issei Naruta

迷ったら健全な方

• 完璧さではなく健全さ• トレードオフにぶつかったら「この選択は健全だろうか?」と自分に問いかける

• 時には泥臭い方法を選ぶ• 自分の立場にとっての都合のよさではなく、全体にとって健全な方を選ぶ

Page 59: Being healthy dev and ops in cookpad - Issei Naruta

PR

Page 60: Being healthy dev and ops in cookpad - Issei Naruta

We’re hiring

https://info.cookpad.com/jobs/[en, ja]

Page 61: Being healthy dev and ops in cookpad - Issei Naruta

Thank you for listening