Contenu connexe
Similaire à Gaming cicd-pipeline gaming-technight-2 (20)
Plus de Amazon Web Services Japan (20)
Gaming cicd-pipeline gaming-technight-2
- 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Game Entertainment, Amazon Web Services Japan K.K.
Solutions Architect, 森 祐孝
AWS上で実現するゲーム開発
CI/CDパイプライン
- 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
森 祐孝(もり ゆうこう)
ソリューションアーキテクト
経歴
• メーカー系SIer(ソフト開発)
• 電⼦マネー運営(サーバソフト開発)
• 独⽴系SIer
• 情報通信キャリア向けのSIでPL、PM
• コンソール系ゲーム会社(テクニカルディレクター)
• ブラウザソーシャルゲーム、スマートフォン向けソーシャルゲーム
担当
• ソーシャルゲーム、コンソールゲーム系のお客様
• Amazon Lumberyard 、Amazon GameLift
⾃⼰紹介
- 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ゲームでのシステム構成例
S3CloudFront
WAF
Shield
ALB
API
Gateway
GameLift
ElastiCacheDynamoDB
AuroraEC2
EC2 ECS
Lambda
Kinesis
Kinesis FireHose
S3
Redshift
Athena
QuickSight
CognitoRoute53
分析基盤
配信基盤
ネットワーク
セキュリティ
API基盤
ゲーム基盤
共通基盤
Mobile
PC
Console
Aurora
or
- 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CI/CDパイプラインを実現するAWS
のマネージドサービス
- 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 他のシステムと
の統合テスト
• ロードテスト
• UIテスト
• 侵⼊テスト
リリースプロセスの4つの主なフェーズ
ソース ビルド テスト 運⽤
• ソースコードを
チェックイン
• バージョン管理、
ブランチ管理
• 新しいコードの
ピアレビュー
• Java、C#、C++
などのコードのコ
ンパイル
• ユニットテスト
• スタイルチェッ
カー
• コードメトリック
• コンテナイメージ
の作成
• 本番環境に
デプロイ
- 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CI/CDパイプライン
ソース ビルド テスト 運⽤
継続的インテグレーション
継続的デリバリ
継続的デプロイメント
継続的インテグレーション(CI)、継続的デプロイメント(CD)を実現
- 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
継続的デリバリのメリット
開発者の
⽣産性を改善
バグをすばやく
検出して対処
アップデートの
配信を⾼速化
ソフトウェアの
リリースプロセスを
⾃動化
- 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ゲームにおけるCI/CDパイプライン
ソースコード
Code Commit
GitHub
Code Build S3
ECR
Code Deploy
ECS
EC2
ビルド〜テスト〜デプロイまでを⾃動化
OSSやサードパーティも組み合わせ可能
Code Pipline
Source Build/Test Deploy
Lumberyard
ソースコードの
バージョン管理
ビルド⾃動化 デプロイ⾃動化
AWS CodeStar
Jenkins
- 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DEMO!
- 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Cloud9
コードの作成や実行やデバッグが可能な
クラウドベースのIDEサービス
N E W !
- 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Cloud9
コードの作成や実行やデバッグが可能なクラウドベースの IDE サービス
素早く開始
ブラウザで利用可能
AWSとのインテグレーション
サーバーレスアプリ開発を簡単に
リアルタイム
ペアプログラミング
- 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
クラウドベースの統合開発環境
AWS Cloud9
• AWSクラウド上で開発・テスト・デバッグを完
結できる統合開発環境のサービスを発表。環境
構築に時間を掛けず、即座に開発を始められる
• 初の”クラウドネイティブ”なIDE。Lambdaと
統合され、ファンクションのテストをシームレ
スに実⾏できる。CodeStarとの統合も
• ⾃分の開発環境にアクセスできるユーザをIAM
ユーザの単位で設定し、共同作業が可能に
- 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Storing your code
- 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
クラウドにおけるソース管理に求められるもの
Secure Fully
managed
High
availability
Store
anything
- 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
v AWSによるフルマネージドなサービス
v ⾼可⽤性、耐久性及びハードウェア、ソフトウェアを管理する
負荷の削減
v セキュアにコードを管理
v AWS CodeCommitは送信時及び保存時に暗号化
v 容易にスケール
v 多数のファイルやブランチ、履歴を保持可能
v どのようなファイルも保存可能
v 保存できるファイルのサイズやタイプに制限はない
v 他のAWSサービスやサードパーティーと連携可能
v IAM Roleによる他のサービスとの連携が容易
v 他のリモードレポジトリからの移⾏が容易
v 他のGitベース リポジトリからシンプルに移⾏可能
v 既存のGitツールが利⽤可能
AWS CodeCommit
- 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeCommit
git pull/push CodeCommit
Git オブジェクトは
Amazon S3で管理
Git インデックスは
Amazon
DynamoDBで管理
暗号化キーは
AWS KMSで管理
SSH or HTTPS
- 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プルリクエストにも対応
• リポジトリのユーザに対して、プルリクエストを起点としたコードに
関する議論やコミュニケーションの機会を提供できるようになった
• CodeCommitの仕組みの中でコードレビューを実施したり、変更箇所
を精査することが可能に。結果として品質改善に繋げることができる
- 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Build & test your
application
- 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
vフルマネージド
vAWS CodeBuild はセットアップ、パッチ、
アップデート、サーバー管理の手間が不要
vオン デマンド
vビルドしたいニーズに合わせて自動でス
ケール。利用した分数のみのお支払い
vすぐに使える
v最もポピュラーな開発言語用の構成済み
のビルド環境を提供。最初にビルド スクリ
プトを作成するだけ。
AWS CodeBuild
- 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
どのように動作するのか?
1. ソースコードのダウンロード
2. 一時的なコンテナ内でbuildspecで構成されたコマンドを実
行(ビルドごとに新規に作成される)
3. マネジメント コンソールとCloudWatch Logs にビルドの出
力結果が送信される
4. 生成されたアーティファクトをS3バケットにアップロード
- 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodeBuildでどのようにリリースプロセスを自動化するか?
• CI/CDのためのAWS CodePipelineとの統合
• 容易な自動化(API/CLI)
• ビルド環境を持ち込み可能
• 必要なツールを含むDockerイメージの作成
• オープンソース Jenkins プラグイン
• CodeBuildをJenkins Master のWorkerとして利用
- 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deploying your
applications
- 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
v ⾃動化されたデプロイメント
v 開発、テスト、本番環境への完全に⾃動化されたデプロイ
メント。AWS CodeDeployは数千台の環境にスケール可能
v 最⼩のダウンタイム
v インプレース デプロイメントではAmazon EC2インスタ
ンスに対してローリング アップデートが可能
v ブルー/グリーン デプロイメントでは最新のリビジョンを
インスタンスにデプロイしてトラフィックを即時またはテ
スト完了後すぐに新しい環境にリルート
v 停⽌とロールバック
v ⾃動的またはマニュアルで停⽌とロールバックが可能
v センターコントール
v AWS CodeDeployコンソール及びAWS CLIでステータス
のトラックが可能
v 容易な適⽤
AWS CodeDeploy
- 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デプロイとは?
アプリケーションやアセットの
更新をサーバに反映させること
実際には、更新されたファイル
群を対象のサーバ群に配布する
Availability Zone Availability Zone
v2
- 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
よくある課題をAWS CodeDeployで解決
自動化できていない
→もちろん自動的にデプロイ
デプロイサーバの負荷、シングルポイント
→マネージドサービスのためパフォーマンス、耐障害性も気にしなくて
良くなる
新規サーバ構築時にデプロイ対象がわからない
→CodeDeployなら、AutoScalingと連動し自動でデプロイ
複数人でデプロイがぶつからない様に管理するのが面倒
→AWS CodeDeployで一元管理
- 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デプロイの効率化・安定化
質の高いリリースのためには、必要不可欠
効率的で安定している仕組みがあるなら、それを使わない手は
ない
AWS CodeDeployが選択肢
- 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Orchestrating build and
deploy with a pipeline
- 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デプロイメントパイプラインとは
ソースコードからビルドやテストなどのステージを⾃動化
したプロセス
プロセスは開発チームやサービスそれぞれで異なる
スムーズなデプロイメントには⽋かせない
ソースコード
ビルド テスト
ステージ
デプロイ
本番
デプロイ
UAT
デプロイメントパイプライン
- 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
v リリース プロセスを⾃動化
v ソースリポジトリからビルド、テスト、デプロイメントまで完
全に⾃動化されたリリース プロセス
v ⼀環したリリース プロセスを確⽴
v コードの変更に対して⼀貫した実⾏ステップのセットを定義
v 改善された品質でデリバリをスピードアップ
v リリース プロセスを⾃動化し、インクリメンタルな機能追加を
可能について顧客に素早くリリース
v お気に⼊りのツールを利⽤可能
v 既存のソース、ビルド、デプロイメントのツールをパイプラン
に組み込み
v 進捗状況が⼀⽬瞭然
v リアルタイムにパイプラインのステータスをレビュー可能
AWS CodePipeline
- 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline
カスタマイズ可能なワークフローエンジン
パートナーやカスタムのシステムと連携
ビジュアルエディターと可視化されたステータス
継続的デリバリー、リリース⾃動化を、Amazonの様に
Build
1) ビルド
2) Unitテスト
1) デプロイ
2) UIテスト
Source Beta Production
1) デプロイ
2) 負荷テスト
Gamma
1) カナリア デプロイ
2) リージョン1 デプロイ
3) リージョン2 デプロイ
- 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MyApp
CodeCommit
Source
Build
CodeBuild
Build
DeployToInteg
CodeDeploy
Staging
IntegTest
End2EndTester
DeployToProd
CodeDeploy
Production
ソースのコミット
アプリケーション
のビルド
ステージング環境
へのデプロイ
ステージンの確認
本番環境への
デプロイ
CodePipelineでのリリースプロセスモデル化
アクション ステージ
パイプライン
トランジション
- 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar
- 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar
AWS上にアプリケーションをすばやく開発・ビルド・デプロイ
AWS上での開発をわずか数分間で開始
チームをまたがった開発をセキュアに
ソフトウェアデリバリの管理を容易に
様々なプロジェクトテンプレートから選択
- 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Step1 : プロジェクトテンプレート選択
- 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Step1 : プロジェクトテンプレート選択
- 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Step2 : 開発ツールセットアップ
- 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Complete!
- 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セットアップ内容
• サンプルアプリケーション
• EC2 or Beanstalk or Lambda
• CodeCommitリポジトリ
• CodeBuildビルドプロジェクト
• デプロイツール
• CodeDeploy or Beanstalk or CloudFormation
• CodePipeline 継続的デプロイメントパイプライン
• CloudWatchメトリクス
• プロジェクトダッシュボード
- 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Project Dashboard
CloudWatchメトリクス
CodeCommit Appエンドポイント
CodePipelineJIRA統合メニュー
- 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon GameLift
- 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon GameLift
• セッションベースのマルチプレイヤーゲームサーバーをホ
スティングするためのマネージドサービス
• プレーヤ数に応じて自動的に拡張/縮小
• 世界中で低レイテンシのプレーヤー体験を提供
• GameLift Server SDK(C#, C++)を提供
• クライアントSDKは10⾔語以上サポート
• DDoSプロテクション※
• ダウンタイムなしでライブアップデートをリリース
• 利用した分だけの料金
• カスタマイズ可能なマッチメイキング機能
※DDoS 攻撃からゲームサーバーを保護する方法
https://aws.amazon.com/jp/blogs/gamedev/protect-multiplayer-game-servers-from-ddos-attacks-using-amazon-gamelift-2/
- 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GameLiftはわずか数分の作業で簡単に始められます。
サーバアプ
リのアップ
ロード
Fleetを
構成
スケール
アップ
ゲームを
プレイ
1 2 3 4
- 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GameLift FlexMatch
• カスタマイズ可能なマッチ
メイク
• プレイヤーグループ
• レイテンシーによるマッチ
メイクも
• ルールを緩める事も可能
• マッチの許可・否認
• ベストなリージョン配置
• 追加料⾦はなし
グループ プレイ
キューイング
マッチ
- 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GameLift Local
• ローカル開発マシン上のGameLift APIのサブセットをエミュレートす
るクライアントサイドのデバッグツール
• ダウンロード:
• https://aws.amazon.com/gamelift/getting-started/
• GameLift Server SDKパッケージに含まれる
• GameLift Server SDK APIsをサポート
• 下記のClient APIsをサポート
CreateGameSession, DescribeGameSessions, CreatePlayerSession,
CreatePLayerSessions, DescribePlayerSessions
GameLift Debug & Test
- 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GameLiftの開発プロセスを自動化することも可能
MyApp
CodeCommit
Source
Build
CodeBuild
Build
DeployToInteg
CodeDeploy
Integration
IntegTest
End2EndTester
DeployToProd
CodeDeploy
Production
EC2
テスト環境へはEC2上に
GameLift local+テストモ
ジュールをデプロイ
CodeDeploy
EC2CodeDeploy GameLift
Gamelift Localでテスト
されたバイナリを
GameLiftへアップロード
- 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• マネージドサービスを使えば簡単にCI/CDを実現する
ツールが利⽤できます。これらを活⽤することで⾼品質
なソフトウェアをインクリメンタルな開発⼿法で素早く
リリースできます。
• 多くのユーザが楽しんでくれるゲームのバックエンドは、
AWSが全⼒でサポートします!
• 安⼼して多くのユーザにおもしろゲームの提供し、⼤き
なイノベーション⽣むをゲーム開発に集中していただけ
ればと思います
- 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.