Contenu connexe
Similaire à AWS における Microservices Architecture と DevOps を推進する組織と人とツール
Similaire à AWS における Microservices Architecture と DevOps を推進する組織と人とツール (20)
Plus de Amazon Web Services Japan
Plus de Amazon Web Services Japan (20)
AWS における Microservices Architecture と DevOps を推進する組織と人とツール
- 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Atsushi Fukui
Solutions Architect / DevOps Specialist
Amazon Web Services Japan K.K.
2018.11.05
AWSにおけるMicroservices Architecture と
DevOpsを推進する組織と人とツール
JDDStudy #4
- 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
自己紹介
名前
福井 厚(ふくい あつし)fatsushi@
所属
アマゾン ウェブ サービス ジャパン株式会社
技術統括本部レディネスソリューション部
ソリューション アーキテクト
Dev&Opsスペシャリスト
前職
エンタープライズ アプリケーション開発コンサルタント
好きなAWSサービス
AWS Code シリーズ、AWS Cloud9、Amazon ECS/EKS、AWS Lambda
- 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
• なぜDevOpsなのか
• DevOpsを実現する人, 組織, 文化, プラクティス, ツール
• AmazonにおけるDevOpsストーリー
• フルマネージドなサービスで実現するCI/CD on AWS
• まとめ
- 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://secure.flickr.com/photos/mgifford/4525333972
Why are we
here today?
- 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Software Moves
Faster Today
- 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ソフトウェアを取り巻く環境の変化
ソフトウェアの作成と配布はかつてないほど
高速になっている
• クラウド活用によって少ない資金でスタートアップが巨大
企業に対抗できる
• ダウンロードひとつで数百万人のユーザーにすぐに
ソフトウェアを配布できる
• 顧客の要求に応えるためには俊敏性が最も重要
• エンタープライズ企業でもスタートアップのアジリティ
が必要
- 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
かつてのソフトウェア配布モデル
ソフトウェア配布モデルは大きく様変わりしている
新しいソフトウェア配布モデル
- 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
このような俊敏さに必要な組織、人材とは?
顧客のニーズに機敏に対応し迅速にソフトウェアをリリースする
のに必要な組織と人材とは?
• 要求の変化に柔軟に対応できる組織と人材
• 自動化を推進する組織、人材
• フィードバックを得て、素早く意思決定できる組織と人材
• DevOpsを実現できる組織と人材
- 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
なぜ DevOps なのか?
5x変更による失敗率
の低下
440xコミットからデプロイ
までの速度
46xより頻繁な
デプロイメント
44%新機能の開発に
費やす時間の増加
Source: Puppet 2017 State of DevOps Report
- 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOpsとは何か?
- 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOpsとは何か?
DevOps =
開発者 顧客
releasetestbuild
plan monitor
デリバリのパイプライン
フィードバックループ
ソフトウェア開発のライフサイクル
無駄やボトルネックを取り除くことで、
ライフサイクルを効率化し、高速化すること
- 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3 Keys of successful DevOps
Culture
PracticesTools
- 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
カルチャー
• 壁を取り払う
• DevとOps
• DevOpsチーム間
• 中間プロセス
• 所有権と説明責任をチームに
• 個人に対する責任は小さく
• 一般的に大きなチームは、小さなチームより遅い
• 常に改善して高みを目指し、Howには柔軟さを残す
- 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プラクティス
• 継続的インテグレーション & デリバリー
• Infrastructure as Code
• Canary、Blue-Green デプロイメント
• Microservices
• Databaseを分解する
• Database per microservice パターン
• セルフサービスな環境
• 調達時のブロッカーをなくしOn Demandに
• 運用タスクをシンプルに
- 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps プラクティス
• 継続的インテグレーション
• 継続的デリバリー&デプロイメント
- 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps プラクティス
Microservices
• モノリシックなアプリケーション アーキテクチャ
から多くの独立したサービスへ
- 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps プラクティス
Infrastructure as code
• コードによってAWSリソースをモデル化
- 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Infrastructure as Code
• 可能な限り自動化する
• アプリケーションとインフラストラクチャの両方
• 宣言的にインフラを定義
• セキュリティを含め注意深くインフラを設計
• 定義や設定をアプリケーションコードのごとく扱う
• バージョンコントロール
• アプリケーションの一部としてのインフラ
• ロールバックのためのプラン
• モニタリング、ロギングと監査
- 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps プラクティス
• モニタリングとロギング
• メトリックスとログをトラックして分析
• インフラストラクチャとアプリケーションのリアル
タイムなパフォーマンスを理解する
- 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Version Control
Build/
Compile
Code
Dev
Unit Test
App Code
IT Ops ENV
DR
Test
Prod
Dev
Application
Write
App
Code
Infrastructure
AWS CloudFormation
tar, war, zip
yum, rpmDeploy
App
Package
Application
Build
AMIs
Validate
Templates
Write
Infra
Code
Deploy
Infras
Automate
Deployment
Artifact Repository
Only deploys application
Only deploys infrastructure
AWS CodeDeploy
CI/CDと自動化
- 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
その他のベストプラクティス
自動ロールバック
• 失敗時における最も速いリカバリのメカニズムと言える
• まずはロールバックし、その後ログ/グラフなどを用いてデバッグする
ダッシュボードを通じて状況を把握する
• 今何がおきているか?
• 通常時はどのように見えているのか?
• グラフがおかしかったり、アラームが発生した場合に何をするのか?
• グラフ内の動きはどのようなイベントと紐付けられるのか?
- 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
その他のベストプラクティス
コードのすべてをコードリポジトリに保管
• アプリ、インフラ、ドキュメント
• リポジトリ上にないものはプロダクションに持っていっては
いけない
コードレビューは良いコードのためのベストな方法
• クリーンで誰もが理解できるコードか?
• 設計がニーズを満たせているか?
• 同じことをするのにより良い方法、簡単な方法はないか?
- 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ツール
• Continuous Integration & Delivery ツール
• Pipelineツール
• ソースコード管理ツール
• テストツール
• レビューツール
• コード分析ツール
• デプロイツール
• Infrastructure management
• 構成管理ツール
• Metrics/Monitoring/Logging/Application Performance Management
• Communication and Collaboration
• セキュリティ分析ツール
- 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
信頼性
DevOpsのメリット
スピード
スケール
迅速なデリバリーコラボレーションの改善
セキュリティ
- 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon.com ストーリー
- 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Amazon Way
Photo credit: jurvetson via Visual Hunt / CC BY
- 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Amazon.com in 2001
- 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
モノリシックな開発サイクル
developers
releasetestbuild
delivery pipeline
app
- 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
モノリシックなアーキテクチャの問題点
密結合
メンテナンスと維持が難しい
• ソースコードが複雑に絡み合い、マージ一つでも一苦労
ビルドやテストがとにかく時間がかかる
デプロイがボトルネック
• デプロイが一大イベントとなる
1つのプロセスで提供される
スケールが難しい
- 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
単一目的のサービス
HTTPSのAPIのみによる通信
お互いをブラックボックスに
Microservices
- 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Two-pizza teams
全ての所有権
全ての説明責任
- 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Two Pizza Teamsの働き方
”サービスチーム”と呼ぶ
チームはサービスを所有し、構築する
• プロダクト プランニング(ロードマップ)
• 開発
• 運用/カスタマーサポート
“You build it, you run it”
大きな組織の一部分を構成する (Amazon.com、AWS
、Prime、 etc)
- 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
You build it, you run it. in 2006
The traditional model is that you take your software to the
wall that separates development and operations, and throw
it over and then forget about it. Not at Amazon. You build it,
you run it.
出典 http://queue.acm.org/detail.cfm?id=1142065
- 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservicesの開発ライフサイクル
開発者 デリバリパイプラインサービス
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
releasetestbuild
- 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
= 5000万回/年のデプロイ
数千のチーム
× Microservices アーキテクチャ
× 継続的デリバリ
× 複数の環境
- 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
24 48 61 82
160
280
516
722
1,017
1,430
2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
AWSの機能改善、イノベーションのスピード
- 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Our Leadership Principles
• Customer Obsession
• Ownership
• Invent and Simplify
• Are Right, A Lot
• Learn and Be Curious
• Hire and Develop The Best
• Insist on the Highest
Standards
• Think Big
• Bias for Action
• Frugality
• Earn Trust
• Dive Deep
• Have Backbone; Disagree and
Commit
• Deliver Results
https://www.amazon.jobs/jp/principles
- 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
OLPを3つピックアップ
Customer Obsession
リーダーはカスタマーを起点に考え行動します。カスタマーから信頼を獲得し、維持して
いくために全力を尽くします。リーダーは競合に注意を払いますが、何よりもカスタマー
を中心に考えることにこだわります。
Ownership
リーダーにはオーナーシップが必要です。リーダーは長期的な視野で考え、短期的な結果
のために、長期的な価値を犠牲にしません。リーダーは自分のチームだけでなく、会社全
体のために行動します。リーダーは「それは私の仕事ではありません」とは決して口にし
ません。
Bias for Action
ビジネスではスピードが重要です。多くの意思決定や行動はやり直すこともできるため、
大がかりな分析や検討を必要としません。計算されたリスクをとることも大切です。
- 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
高水準の維持
チームには権限が与えられ、多くの自由が認められている
• ただし、それにはチームとして高い水準を維持する必要がある
チームの水準を高く維持する
• オンボーディング/トレーニングを通じて
• あらゆるスケールで定義されたパターン/プラクティスと20年以上の組
織的なナレッジ
• 定期的な技術的、ビジネス的なメトリクスのレビュー
• 内部的なSME(Subject Matter Expert) による定期的な新ツール、サービ
ス、技術などの共有
- 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セルフサービス
テクノロジにとらわれない
ベストプラクティスを促進
単一目的のサービス群
- 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
(参考)開発のススメ方の特徴
Minimum Viable Product (MVP)
• 必要最低限の能力を兼ね備えたプロダクト
• お客様からのフィードバックをとても重視、開発の優先度づけもこれに基づく
PR/FAQ
• アマゾンではなにか製品/サービス開発を行う際にプレスリリースから書く
6 pager /1 pager
• 会議でのプレゼンテーションツールの利用はほとんどない
• プレゼン形式の会議は話し手の話術に依存し、聞き手にとっても捉え方が変わってし
まう恐れがあるため
• 会議は6pagerと呼ばれるレポート形式で行われ、最初の30分は6 pagerを静かに読む
ことから始まる
- 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps Tools on AWS
- 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 他のシステムとの統
合テスト
• ロードテスト
• UIテスト
• 侵入テスト
リリースとモニタの5つのフェーズ
Source Build Test Deploy Monitor
• .javaファイルなどの
ソースコードを
チェックイン
• 新しいコードのピア
レビュー
• コードのコンパイル
• ユニットテスト
• スタイルチェッカー
• コードメトリック
• コンテナイメージの
作成
• 本番環境にデプロイ • 異常なアクティビティや
エラーを素早く検知する
ために本番環境のコード
をモニタリング
- 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code サービス
Source Build Test Deploy Monitor
AWS CodeBuild +
Third Party
ソフトウェアリリースステップ
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
AWS
CodeStar
AWS X-Ray
Amazon
CloudWatch
- 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Networking AnalyticsCompute
Storage & Content Delivery
Developer Tools Management Tools
Security & Identity
Mobile Services Database Business Productivity,
Desktop & App Streaming
S3 CloudFront EFS Glacier
Storage
Gateway
AppStream
CloudSearch
SESSQS
Mobile A
nalytics
Cognito Device Farm
SNS
RDS DynamoDB ElastiCache RedShift WorkSpaces WorkDocs WorkMail
Lambda ECSEC2 VPC Direct Connect Route 53 EMR Data Pipeline KinesisELB QuickSight Elasticsearch
Service
CodeCommit
CloudWatch Cloud
Formation
CloudTrail Config OpsWorks Service C
atalog
IAM Directory
Service
Trusted A
dvisor
WAFSnowball
DMS
IoT
IoT
Game Dev
Mobile Hub
ElasticBeanstalk
ACM Inspector
GameLift
CodePipeline
CodeDeploy
ほとんどのサービスに用意されたAPI
Lightsail AWS Batch
Application
Discovery Service
SMS
Pinpoint
Application Services
API Gateway Elastic Transcoder SWF Step Functions
Messaging
Migration
X-Ray
CodeBuild
Amazon Lex Amazon Polly
AI
LexPolly Rekognition Machine
Learning
KMS ShieldOrganizations
- 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK
Ruby
iOS
Python (boto)
Android Node.js
AWS Toolkit
for Visual
Studio
.NET
AWS Toolkit
for Eclipse
PHP
AWS Tools
for Windows
PowerShell
AWS CLI
JavaScriptJava
Xamarin
- 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
AWS Codeサービスによるコンテナへの
デプロイメントの自動化
- 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リリースプロセスレベル
Source Build Test Production
継続的インテグレーション
継続的デリバリー
継続的デプロイメント
- 49. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWSのコンテナのための継続的デリバリー例
AWS
CodeCommit
AWS
CodeBuild
Amazon ECR
Amazon ECS
Source
repository Build Deploy
Or Or
AWS
CodePipeline
- 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS Cloud9
• クラウドベースの統合された開発環境(IDE)
• ブラウザのみでコーディング、実行、デ
バッグ
• リアルタイムのペアプログラミングを可能
にするチームでの環境共有
• AWSへのダイレクトなターミナルアクセス
• サーバーレスの優れた開発環境を提供:
ローカルテストとSDK,ライブラリ、プラグ
インが事前設定されたデプロイ環境
- 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
フル機能のエディタ
- 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• セキュアでスケーラブルなマネージドGitソース
管理
• スターンダードなGit toolが利用可能
• Amazon S3のスケーラビリティ、可用性、堅牢
なストレージを利用
• カスタマ特有のキーを使用した暗号化
• レポジトリサイズの上限なし
• Post commit hooks で SNS/Lambdaを呼び出せる
• Pull Request サポート
• ブランチごとの権限管理
• マネジメント コンソール上での編集、コミット
AWS CodeCommit
- 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 完全なマネージドのビルドサービスでソースコードのコ
ンパイル、実行、テスト、ソフトウェア パッケージの生
成をサポート
• 継続的なスケールと同時複数ビルドの実行
• Dockerイメージによってニーズにマッチするカスタムな
ビルド環境を構築可能
• 利用したコンピュータ リソース/分のみの支払い
• CodePipelineやJenkinsとの統合が可能
• VPC内のリソースへのアクセス、VPCエンドポイントの
提供
• ローカル環境での実行とデバッグのサポート
AWS CodeBuild
- 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• アプリケーションのすばやく信頼できる
アップデートを可能にする継続的デリバ
リサービス
• ソフトウェアリリースプロセスのモデル
化と見える化
• コードが変更されるたびにコードをビル
ド、テスト、デプロイ
• サードパーティツールやAWSとの統合
AWS CodePipeline
- 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
9. retrieve built artifacts
Source
Source
CodeCommit
Build
BuildDockerImage
CodeBuild
Deploy
DeployECS
CodePipeline
source artifacts
S3
built arctifacts
S
5. retrieve source artifacts
1. Repo change event
6. push built artifacts
3. poling a job
4. accept the job
7. Notify success status
8. update docker image
MyApplication
AWS CodeCommit
Amazon ECS
Amazon
ECR
AWS
CodeBuild
- 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• ビジネスからの迅速なサービス リリースが求めれらる時代
に適応する組織作りと人材育成が必要
• DevOpsを実現できる組織と人材の育成、組織の壁を超える
• DevOpsはカルチャー、プラクティス、ツールが揃って初め
て実現
• クラウドの持つアジリティーと柔軟性を最大限活用
• AWSが提供するサービスを活用してビジネス ニーズにス
ピーディーに答える組織、人材育成を!!
- 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Dev ♥ Ops
Better Together