...

Google Cloud Platform

by user

on
Category: Documents
19

views

Report

Comments

Transcript

Google Cloud Platform
Tokyo | 13 December 2016
Google Cloud Platform のご紹介
Google Cloud Platform の基礎
Agenda
1
Google Cloud Platform のご紹介
3
Google Cloud Platform を選ぶ理由
Google Cloud Platform を用いることで、デベロッパーの方々はアプリ
ケーションの構築やテスト、デプロイを Google の高いスケーラビリティと
安全性、信頼性をもったインフラストラクチャ上で行うことが可能になりま
す。
貴社のウェブやモバイル、アナリティクス、バックエンドの
ソリューションとして、コンピュート、ストレージ、 ビッグデータ/機械学
習、アプリケーションの各サービスを選択可能です。
Google のインフラストラクチャ (1/2)
過去 15 年間、Google は地球上で最も強力なインフラストラクチャと
してのデータセンターと高速光ファイバーネットワークの構築を行っ
てきました。
Google のインフラストラクチャ (2/2)
データセンター
Google は、計算やバッ
クエンドのストレージに
使用される、高効率な
バックエンドデータセン
ターを広範囲にデプロイ
し運用しています。
バックボーン
POP
エッジキャッシング
Google は、自社のデー
タセンターを相互接続す
るグローバルなメッシュ
バックボーン ネットワー
クを構築し、エッジ・ポイ
ント・オブ・プレゼンス
(POP) へのトラフィックを
提供しています。
33 か国で 70 を超える
エッジ POP を Google の
バックボーン ネットワーク
を通じて相互接続。
Google は、実質的に全て
の国のエッジロケーション
のネットワークインフラスト
ラクチャ上でエッジキャッシ
ングプラットフォーム を実行
しています。キャッシングプ
ラットフォームは、 ISP やア
クセスネットワーク内にもエ
レメントをもっています。
Cloud のリージョン と ゾーン
● リージョン
○ リージョンとは、貴社のリソースを実行することのできる地理的な場所のこと
であり、
○ 複数のゾーンが集まったものです
○ リージョンのリソースは、そのリージョン内のどのゾーンのリソースでも利用
可能です。
● ゾーン
○ リージョン内の隔離された場所
○ ゾーンのリソースは、そのゾーン内でのみ利用可能です。
環境問題への取り組み
自社のエコシステムを尊重しながらインフラストラク
チャを開発
• データセンター効率化のパイオニア
• 再生可能エネルギーに最大の投資を行っている私企業(風
力、太陽光)
• 初めて ISO 14001 認証を取得したデータセンター
• 2007 年以降 100% カーボンニュートラル
Image by Connie Zhou
革新的で顧客本位の料金体系
● 1 時間未満の課金単位
● 長期利用割引
○ どの月でも、カレンダー月で 1 か月間 25% を超えて仮想マシ
ンを実行したユーザー全てに自動的に特典を付与
● Compute Engine のカスタムマシンタイプ
○ アプリケーションに必要なリソースの分だけのお支払い
Image by Connie Zhou
Google はデータテクノロジーを革新します
Google
has been innovating data technologies
Flume
MapReduce
Dremel
Millwheel TensorFlow
GFS
Megastore
Bigtable
PubSub
Colossus
Spanner
2002
2004
2006
2008
2010
2012
F1
2014
2016
Google Research Publications の文献 : http://research.google.com/pubs/papers.html
コンピューターとしてのデータセンター:Design of Warehouse-Scale Machines の紹介(The Datacenter as a Computer : An Introduction
to the Design of Warehouse-Scale Machines)2009 年 http://research.google.com/pubs/pub35290.html
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
GCP が、その革新的なテクノロジーを貴社にお届けします
GCP
opens up that innovation for you to use
Dataflow
Dataproc
BigQuery
Dataflow
Cloud Storage
Datastore
Bigtable
2002
2004
2006
Cloud Storage
2008
2010
2012
ML
PubSub
2014
2016
Google Research Publications の文献 : http://research.google.com/pubs/papers.html
コンピューターとしてのデータセンター:Design of Warehouse-Scale Machines の紹介(The Datacenter as a Computer : An Introduction
to the Design of Warehouse-Scale Machines)2009 年 http://research.google.com/pubs/pub35290.html
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
オープン API とオープンソースへのこだわり
お客様を囲い込むのではなく、
お客様から選ばれるプラットフォームへ
次世代のクラウドコンピューティング
第 1 の波:
コロケー
ション
第 2 の波:
バーチャルデー
タ
センター
第 3 の波:
グローバルな
エラスティッククラ
ウド
現在
次世代
ユーザーが管理し、ユーザーが設定し、ユー
ザーが維持する
完全自動化
Image by Connie
Zhou
IaaS と PaaS
マネージド イ
ンフラストラク
チャ
(DevOps)
Compute Engine
App Engine
IaaS
PaaS
コンピュートおよび
ストレージ、ネットワーク
よりきめ細かなコントロール
Java, Go, PHP, Python
焦点はアプリケーションロジック
割り当てた分の支払い
管理オーバーヘッドの増大
使用した分だけの支払い
管理オーバーヘッドの削減
フルマネー
ジド サービ
ス
(NoOps)
Google Cloud Platform
コンピュート
App Engine
Container Engine
ストレージ
Compute Engine
Bigtable
ビッグデータ
BigQuery
Pub/Sub
Dataflow
Cloud
Storage
Cloud SQL
Cloud
Datastore
機械学習
Dataproc
Datalab
Vision API
機械学習
Speech API Translate API
リソース
●
Google Cloud Platform を選ぶ理由
https://cloud.google.com/why-google/
●
料金体系
https://cloud.google.com/pricing/philosophy/
●
データセンター
https://www.google.com/about/datacenters/
●
Google Cloud Platform 製品概要
http://cloud.google.com/products/
●
Google Cloud Platform ソリューション
http://cloud.google.com/solutions/
cloud.google.com
Google Cloud Platform 入門
Google Cloud Platform の基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Platform プロジェクト
2
Identity & Access Management (IAM)
3
Google Cloud Platform を使ってみる
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
19
プロジェクト (1/2)
● 全ての Google Cloud Platform サー
ビスは次の用途に使われるプロジェク
トと関連しています:
○
○
○
○
リソースのトラックと利用割り当て
課金の実行
パーミッションと認定の管理
サービスと API の実行
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
プロジェクト (2/2)
● プロジェクトは 3 種類の認証属性を利用
します:
○ プロジェクト名
○ プロジェクト番号
○ プロジェクト ID
■ アプリケーション ID とも呼ばれます
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
プロジェクトパーミッション - 初期の役割
オーナー
編集者
閲覧者
課金管理者
メンバーの招待
メンバーの削除
編集権限を含め、
プロジェクトの
削除ができる
アプリケーションのデ
プロイ
コードの変更
ビューアの権限を
含むサービスの設定
閲覧のみの
アクセス
課金の管理
管理者の追加
管理者の削除
プロジェクトには複数のオーナー、エディタ、閲覧者、課金管理者が存在してもよい。
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Platform プロジェクト
2
Identity and Access Management (IAM)
3
Google Cloud Platform を使ってみる
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Identity & Access Management(IAM)
誰が
何をできるか
その時、どのリソースを
使うか
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
IAM の役割 - 管理された役割
Google
グループ
InstanceAdmin
の役割
IAM
パーミッションの一覧
✔
✔
✔
✔
✔
✔
compute.instances.delete
compute.instances.get
compute.instances.list
compute.instances.setMachineType
compute.instances.start
compute.instances.stop
...
project_a
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
● リソースは親リソースの
ポリシーを継承します
○
●
example.com
それぞれのポリシーは次の項目か
らなります:役割のセット、役割のメ
ンバー
そのリソースのポリシーは、
リソースに設定された
ポリシーとその親リソースから
継承されたポリシーの和です
親リソースの制限の方が緩い
場合には、より厳しい
ポリシーで上書きされます
プロジェクト
○
example-dev
example-test
Compute
App
Engine Engine
Cloud
Storage
Cloud
Pub/Sub
instance_a
bucket_a
topic_a
queue_a
example-prod
Compute
Engine
Cloud
Storage
instance_a instance_b bucket_b bucket_c
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Policy
Inheritance
リソースにポリシーが
設定されます
リソース
●
組織
IAM リソースの階層
Organization
ベータ
● Organization は Google Cloud
可視性 (visibility) の管
理
リソースのルートノードです。
● Organization の 2 つの役割:
○ 組織管理 - 全てのクラウド
リソースの管理
example.com
[email protected]
組織管理
作成
○ プロジェクト作成者 - プロジェクト
作成の管理
[email protected]
プロジェクト作成者
project_1
project_2
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
サービスアカウント
● プロジェクトでサーバー間のやり取りを実行するための ID
(アイデンティティ) を提供します。
● 他のサービスへのアクセスの認証に使われます。
● サービスアカウントへ IAM の役割の割り当てが
行えます。
● E メールアドレスで認識されます:
<project_number>@developer.gserviceaccount.com
<project_id>@developer.gserviceaccount.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
サービスアカウントと IAM
● サービスアカウントはキーで認証
を行います。
○ キーの管理、 Compute Engine及び
App Engine のキーの
ローテーションは Google が
行います。
ID
IAM の役割
サービスアカウント
InstanceAdmin の役割
Compute Instances
ServiceAccountActor
の役割
サービスアカウント
● サービスアカウントへの IAM の
役割の割り当てが行えます。
● ServiceAccountActor の役割を、
ユーザー/グループに割り当てる
こともできます。
ユーザー/
グループ
リソース
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
例:サービスアカウントと IAM
project_a
component_1 を実行している VM は
Service Account 1 を使って
project_b に編集者としての
アクセスが認められます。
● component_2 を実行している VM は
Service Account 2 を使って
bucket_1 にオブジェクト閲覧者
(objectViwer)としてのアクセスが
認められます。
● サービスアカウントのパーミッションは
VM を再作成せずに変更可能です。
●
component_1
Service
Account 1
編集者
component_2
Service
Account 2
Storage.
objectViewer
project_b
bucket_1
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Platform プロジェクト
2
Identity and Access Management (IAM)
3
Google Cloud Platform を使ってみる
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform を使ってみる
Cloud Console - Web
ユーザーインターフェース
Cloud SDK/Cloud Shell
>_
(コマンドラインインターフェース)
REST-based API
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform Console
● 全てのプロジェクトデータの為の 集中
コンソール
● デベロッパーツール
○ Cloud Source Repositories
○ Cloud Shell
● product API へのアクセス
● プロジェクトの管理、作成
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud SDK
● SDK には、Cloud Platform 製品及びサー
ビス向けの CLI tool が含まれて
います。
○ gcloud, gsutil (Cloud Storage), bq (BigQuery)
● Docker イメージとして利用可能
● Cloud Shell 経由で利用可能
○ Compute Engine インスタンス上で実行されて
いる Cloud SDK のコンテナバージョン
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
RESTful APIs
● 製品とサービスへのプログラムによるアクセス
○ 通常はフォーマットとして JSON を使用
○ 認証と権限には OAuth 2.0 を使用
● Google Cloud Platform Console から利用可能
● 殆どの API は日々の割り当てとレート(制限)が
ありますが、リクエストにより引き上げが可能です。
○ 必要な容量を確保するために、あらかじめ計画を立てておく
ことが重要です
● APIs Explorer を使った事前検証
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
APIs Explorer
● APIs Explorer は、ブラウザを使って容易に Google APIs を試
してみることのできるインタラクティブなツールです。
● APIs Explorer を使ってできることは次の通りです:
○ 利用可能な API やバージョンから迅速に閲覧。
○ 各 API が提供しているメソッドとサポートしているパラメータを
インラインの文書と共に確認
○ あらゆるメソッドのリクエストの実行とそのレスポンスを
リアルタイムで確認
○ 認証及び権限をもった API コールを簡単に実行
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Client Libraries
● Google Cloud Client Libraries
○ コミュニティが所有する手作りの Client Libraries
● Google APIs Client Libraries
○ オープンソースで作成
○ 種々の言語をサポート
■ Java, Python, JavaScript, PHP, .NET, Go, Node.js, Ruby,
Objective-C, Dart
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
リソース
● Cloud SDK のインストールとクイックスタート
https://cloud.google.com/sdk/#Quick_Start
● ‘gcloud’ ツールガイド
https://cloud.google.com/sdk/gcloud/
● IAM
https://cloud.google.com/iam/
● Google Cloud Platform 上でのパーミッションの設定
https://cloud.google.com/docs/permissions-overview
● Google Cloud Platform のセキュリティ
https://cloud.google.com/security/
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google App Engine と Google Cloud Datastore
Google Cloud Platform の基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
概要と顧客成功事例
2
Google App Engine Standard Environment
3
Google App Engine Flexible Environment
4
Google Cloud Endpoints
5
Google Cloud Datastore
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
Compute
Engine
ネットワーキン
グ
Container
Engine
ビッグデータ
機械学習
ストレージ
運用とツール
App
Engine
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google App Engine とは
● スケーラブルなウェブアプリケー
ションや、モバイルバックエンドを
構築するためのプラットフォーム
(Platform as a Service)
● App Engine がデプロイやメンテナンス、ス
ケーラビリティを容易にし、貴社はアプリ
ケーションの開発に集中する
ことができます。
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
IaaS と PaaS
マネージド イ
ンフラストラク
チャ
(DevOps)
Compute Engine
App Engine
IaaS
PaaS
コンピュート
ストレージ、ネットワーク
よりきめ細かなコントロール
Java, Go, PHP, Python
焦点はアプリケーションロジック
割り当てた分の支払い
管理オーバーヘッドの増大
使用した分だけの支払い
管理オーバーヘッドの削減
フル
マネージド
サービス
(NoOps)
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Snapchat
「App Engine により私たちはアプリケーションの開発に集中す
ることができました。App Engine が提供してくれた開発の容
易さが無ければ、今の私たちは無かったでしょう。」
CTO Bobby Murphy
Snapchat は
7億の
写真やビデオを
毎日送信しています。
Google App Engine
は数百万人ものユーザーへと
成長している間も、絶えずス
ケーリングしていきます
小さなチームでも、迅速な技術
革新や世界的規模への成長が
容易に可能です
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
概要と顧客成功事例
2
Google App Engine Standard Environment
3
Google App Engine Flexible Environment
4
Google Cloud Endpoints
5
Google Cloud Datastore
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
App Engine Standard Environment (1/2)
● Java、 Python、 PHP、 Go の
特定のバージョン向けに
管理されたランタイム
● 需要に応じてインスタンスを
オートスケール
● 日々の使用量に応じた料金体系
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
App Engine Standard Environment (2/2)
● 開発、テスト、デプロイ用 SDK
● サンドボックスの制限に準拠する
ことが必要:
○ ローカルのファイルシステムへは書き込み
を行わない
○ リクエストは60 秒でタイムアウト
○ サードパーティー製ソフトウェアの
インストール制限
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
App Engine 標準ワークフローの例 - Web アプリケーション
1
Web アプリケーションをロー
カルで開発及びテスト
3
App Engine は自動的に
スケーリングして、
Web アプリケーションを
確実に提供
プロジェクト
App Engine は、様々なサー
ビスに専用の API を使って
アクセスが可能です
Memcache
App Engine
App Servers
2
SDKを使用して
App Engine をデプロイ
アプリケーションイ
ンスタンス
アプリケーションイ
ンスタンス
アプリケーションイ
ンスタンス
TaskQueue
Scheduled
tasks
Search
Logs
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
概要と顧客成功事例
2
Google App Engine Standard Environment
3
Google App Engine Flexible Environment
4
Google Cloud Endpoints
5
Google Cloud Datastore
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
App Engine Flexible Environment ベータ (1/2)
● クリック 1 つでアプリの構築、
デプロイ、コンテナ化
● 標準のランタイム (Python、 Java、
Go、 Node.js) でサンドボックスの制限
なし
● カスタム ランタイムは HTTP リクエスト
をサポートする言語であれば何でもサ
ポート
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
App Engine Flexible Environment ベータ (2/2)
● ベータ版の間は Compute Engine の
使用状況に応じた料金体系
● ローカルの開発は Docker に依存
● 標準のランタイム は App Engine サー
ビスにアクセス可能: Datastore、
Memcache、 Task queues、 ログ、
ユーザー等々
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
App Engine Standard vs Flexible Environment
Standard Environment
Flexible Environment
インスタンスのスタートアップ
ミリ秒
分
SSH アクセス
無し
有り(デフォルトでは無し)
スケーリング
マニュアル、基本的、自動
マニュアル、自動
ローカルディスクへの書き込み
無し
有り(一時書き込み)
サードパーティーバイナリの サ
ポート
無し
有り
ネットワークアクセス
App Engine サービス経由
有り
カスタム化可能なスタック
無し
有り
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
概要と顧客成功事例
2
Google App Engine Standard Environment
3
Google App Engine Flexible Environment
4
Google Cloud Endpoints
5
Google Cloud Datastore
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
ビッグデータ
機械学習
Cloud
Storage
ストレージ
Cloud
SQL
運用とツール
Cloud
Datastore
Cloud
Bigtable
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Datastore (1/2)
● アプリケーションバックエンド
向けに設計されたデータベース
● 数十億行の NoSQL データストア
● スキーマレスなアクセスで、データ
構造を考える必要がない
● ローカルの開発ツール
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Datastore (2/2)
● オートスケーリングで完全管理
● 冗長性をビルトイン
● ACID トランザクションをサポート
● 毎日無料枠あり
● 何処からでも RESTful インターフェー
スを通してアクセス
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
リソース
● 概要: App Engine
https://cloud.google.com/appengine/
● DevBytes - Your app, at scale with Google App Engine (Google
App Engine で貴社のアプリをスケーリング)
https://www.youtube.com/watch?v=ytT2-kL9v2o
● Datastore コンセプト概要
https://cloud.google.com/datastore/docs/concepts/overview
● Google Cloud Datastore API 入門
https://cloud.google.com/datastore/docs/datastore-api-tutoria
l
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform Storage
のオプション
Google Cloud Platform の基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Storage
2
Google Cloud Bigtable
3
Google Cloud SQL
4
ストレージオプションの比較
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
ビッグデータ
機械学習
Cloud
Storage
ストレージ
Cloud
SQL
運用とツール
Cloud
Datastore
Cloud
Bigtable
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Storage (1 of 2)
● 高性能、インターネットスケール、
イミュータブルな BLOB (バイナリ・
ラージ・オブジェクト)ストレージ
● ファイルシステムではありません。(しか
し、 Cloud Storage Fuse の
ような、サードパーティーツール
から、ファイルシステムのように
アクセスが可能)
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Storage (2 of 2)
● 管理が簡単で、容量の
マネジメントは不要
● データは稼働中も休止中も常に
暗号化された状態
● 全てのストレージクラスは、
同一の API でアクセスが可能
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud Storage のクラス
Nearline
Multi
Regional
地理的冗長性を備えた
ストレージクラスで、
可用性とパフォーマンスは
最高レベルです。
リージョンをまたがった
ユーザーに低レイテンシで、高
QPS のコンテンツを
届けるのに理想的です。
Regional
1 つのリージョン内での
可用性とパフォーマンスは
最高レベルです。特定の
リージョンでのコンピュートやアナ
リティクス、機械学習のワークロー
ドに理想的です。
データへのアクセス頻度が
1 か月あたり 1 回未満の
用途向け、高速、低コスト、高
耐久性のストレージです。
Coldline
データへのアクセス頻度が
1 年あたり 1 回未満の
用途向け、高速、低コスト、高
耐久性のストレージです。
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud Storage
の特徴
Regional バケット
ACLs
Object バージョニ
ング
Object Lifecycle
Management
Offline import
(サードパーティ)
Transfer Service
Object change
notification
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud Storage のインテグレーション
テーブルの
インポートと
エクスポート
Compute
Engine
BigQuery
オブジェクト スト
レージ、ログ、
Datastore の
バックアップ
Cloud Storage
App
Engine
スタートアップスク
リプト、
画像、及び
ジェネラル
オブジェクト
ストレージ
テーブルの
インポートとエ
クスポート
Cloud SQL
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Storage
2
Google Cloud Bigtable
3
Google Cloud SQL
4
ストレージオプションの比較
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
ビッグデータ
機械学習
Cloud
Storage
ストレージ
Cloud
SQL
運用とツール
Cloud
Datastore
Cloud
Bigtable
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Bigtable (1 of 2)
● テラバイトからペタバイトといった、大きな
ワークロードアプリケーション用のフルマ
ネージド、 NoSQL、
ワイドカラム データベース サービス
● 統合
○ HBase API を使ってアクセス
○ ビッグデータ、 Hadoop のエコシステムとネイ
ティブ互換
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Bigtable (2 of 2)
● 保護
○ 重複ストレージ
○ データは稼働中も休止中も常に
暗号化された状態
○ 役割ベース ACL
● 実績
○ Google Analytics や Gmail などの
主要なアプリケーションで稼働
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
サンガード社
課題:
概要:
処理するデータ:統合監査追跡システム (CAT) のデータで、
株式、オプションオーダー、見積もり、イベント の全ての
データを集めたリポジトリとなっています。
CAT の処理を行い、 1,000 億に上るマーケットのイベントを 4 時
間程度の間に「オーダーライフサイクル」としてまとめる方法。
6 年間のデータ(約 30PB)の保存
Cloud Bigtable でデータの処理とクエリ実行、容量の増大にも対応
60 億
マーケットイベント
1 時間あたりの書き込み
1.7 GB
1 秒あたり
6 TB
1 時間あたり
100 億
書き込み
1 時間あたりのバースト
1.7 ギガバイト
1 秒あたり
10 テラバイト
1 時間当たり
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Bigtable のアクセスパターン
アプリケーション API
データは、マネージド VM や HBase REST Server、 Hbase クライアントを使っ
た Java Server のようなデータサービスレイヤ-を通じて Cloud Bigtable への
読み書きが可能です。これは通常、アプリケーションや ダッシュボード、デー
タサービスとのデータのやり取りで使われます。
ストリーミング
よく使われる Cloud Dataflow Streaming や Spark Streaming、 Storm など
様々なストリーミングプロセスフレームワークを通して、データのストリーミング
(イベントごとの書き込み)が可能です。
バッチ処理
Cloud Bigtable
Hadoop MapReduce や Dataflow、 Spark などのバッチプロセスを通して
Cloud Bigtable へデータの読み書きをすることができます。多くの場合、要約さ
れたデータや新しく計算されたデータが Cloud Bigtable や
ダウンスト
リームのデータベースに書き戻されます。
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud Bigtable のインテグレーション
Google Cloud Dataflow
Cloud Dataflow コネクタを、 Bigtable のバッチや
パイプラインにおけるストリーミング処理に使用します。
Google Cloud Dataproc
Bigtable HBase クライアントを使用して、 Hadoop の
ジョブを Cloud Dataproc に統合します。
Cloud Bigtable
クラウドをベースとしたオンプレミスのHadoop
外部
サービス
Bigtable HBase クライアントを使用して Hadoop
クラスタと統合します
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Storage
2
Google Cloud Bigtable
3
Google Cloud SQL
4
ストレージオプションの比較
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
ビッグデータ
機械学習
Cloud
Storage
ストレージ
Cloud
SQL
運用とツール
Cloud
Datastore
Cloud
Bigtable
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud SQL (1 of 2)
● Google が管理する、クラウドの
MySQL リレーショナルデータ
ベース
● 従量課金モデル
● 管理用 REST API
● 手頃な料金と性能
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud SQL (2 of 2)
● Google の提供するセキュリティ
● 垂直スケーリング
(読み出しと書き込み)
● 水平スケーリング(読み出し)
● App Engine 及び Compute Engine
とのシームレスなインテグレーション
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud SQL
の特徴
なじみがあ
る
Google の
提供するセ
キュリティ
フレキシブル
な料金体系
マネージド
バックアップ
自動レプリ
ケーション
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud SQL のインテグレーション
外部サー
ビス
Cloud SQL は、 Java 用
Connector/J または Python 用
MySQLdb のような標準の
ドライバーで App Engine と
共に使用可能です。
Compute Engine インスタンスは、外
部 IP アドレスを用いて Cloud SQL イ
ンスタンスにアクセスする権限を取
得可能です。
Cloud SQL インスタンスは、
App Engine アプリケーションは
Compute Engine の
Cloud SQL へのアクセス権があり、イ インフラストラクチャの近くに
ンスタンスは一つの
配置するために preferred zone に
アプリケーションをフォロー
設定することができます。
するように設定可能です。
Cloud SQL は IP アドレス又はネット
ワークを CIDR 表記を使って
認証することで、外部の
アプリケーションやクライアントと一緒
に使う事ができます。
MySQL Workbench の様な
スタンダードツールを
データベース管理に使う事が
できます。外部読み出しの
レプリカの設定が可能です。
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
第二世代 Cloud SQL
● 第一世代と同じ機能を、より
高性能、大容量、低コストで実現
○ 第一世代のインスタンスを、最大
7 倍のスループット、 20 倍の
ストレージ容量で
○ 殆どのユースケースで第一世代より低コ
スト
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Storage
2
Google Cloud Bigtable
3
Google Cloud SQL
4
ストレージオプションの比較
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
ストレージオプションの比較 (1/2)
BLOB
SQL
NoSQL
Cloud
Storage
Cloud
Datastore
Cloud
Bigtable
Cloud SQL
好適:
構造化及び非構造化バイナリ又
はオブジェクトデータ
好適:
App Engine アプリケーションの
デフォルトのDB
好適:
「フラット」なデータ、高負荷の
リード/ライト、イベント、アナリ
ティカルデータ
好適:
ウェブフレームワーク、現有のア
プリケーション
ユースケース:
画像、大きなメディアファイル、
バックアップ
ユースケース:
ユーザープロファイル、プロダク
トカタログ
ユースケース:
アドテク、財務、 IoT データ
ユースケース:
ユーザー認定、顧客のオーダー
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
ストレージオプションの比較 (2/2)
Cloud Datastore
Cloud Storage
Cloud SQL
(第二世代)
Bigtable
ストレージタイプ
NoSQL、 文書
オブジェクト
(BLOB) ストア
リレーショナル SQL
NoSQL、ワイドカラム
全体容量
テラバイト超
ペタバイト超
最大 10TB
ペタバイト超
ユニットサイズ
1 メガバイト/エ
ンティティ
5 TB /オブジェ
クト
標準の MySQL の
限界まで
推奨 個別の値:セルあたり約 10 MB
1 行の合計:約 100 MB
トランザクション
有り
無し
有り
無し
複雑なクエリ
無し
無し
有り
無し
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
リソース
●
概要:Cloud Storage
https://cloud.google.com/storage/
●
DevBytes - クラウドへのファイル保存
https://www.youtube.com/watch?v=vyIap827rHs
●
Cloud SQL:特徴、顧客事例、料金体系、ドキュメント
https://cloud.google.com/sql/
●
Google Cloud SQL 入門
https://cloud.google.com/sql/docs/getting-started
●
Cloud Bigtable の概要
https://cloud.google.com/bigtable/docs/api-overview
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Container Engine
Google Cloud Platform の基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Container Technology
2
Docker Quick Tour
3
From Borg to Kubernetes
4
Google Container Engine
Docker の基本機能
アプリケーション実行に必要な
最低限のファイルを提供
① コンテナイメージを自動作成
アプリケーション
バイナリー
Dockerfile
コンテナ
イメージ
イメージの
作成手順を記載
アプリケーション
ライブラリー
OS ファイル
② コンテナイメージを保存・公開
③ ホストサーバーに
イメージを配布・実行
ホストサーバー
Google Cloud OnBoard
イメージレジストリー
Confidential
Linux コンテナの概要
▪ 「Linux コンテナ」は、プロセスグループごとに独立した OS 環境を見せる技術
●
●
●
ローカルディスクの内容(ディレクトリー内のファイル)
ネットワーク環境( NIC 、IP アドレス)
CPU 、メモリー割り当てなど
コンテナで分割した環境
通常の Linux 環境
Google Cloud OnBoard
すべてのアプリケーション
から同じ環境が見える
コンテナ
アプリケーション
・・・
アプリケーション
アプリケーション
アプリケーション
コンテナ
・・・
コンテナごとに
見える環境が異なる
Linux カーネル
Linux カーネル
物理サーバー/仮想マシン
物理サーバー/仮想マシン
Confidential
Namespace によるリソースの分割
▪ コンテナによって分離されるリソースにはいくつかの種類がありますが、内部的には、それぞれ
異なる技術で実現されています。
●
●
●
●
●
●
●
ファイルシステムの分離 ホストネームの分離
IPC の分離
ユーザ( UID/GID )の分
プロセステーブルの分
ネットワーク設定の分離 リソース配分の制御
*
*
*
*
*
*
*
Mount namespace (kernel 2.4.19)
UTS namespace (kernel 2.6.19)
IPC namespece (kernel 2.6.19)
User namespace (kernel 2.6.23 〜kernel 3.8)
PID namespace (kernel 2.6.24)
Network Namepsace (kernel 2.6.24)
Control groups
※ 参考資料「 Namespaces in operation, part 1: namespaces overview 」http:/ lwn.net/Articles/531114/
▪ Linux コンテナはこれらの機能を組み合わせて実現されるものであり、「コンテナ」という単一の技 術がある
わけではありません。
Google Cloud OnBoard
Confidential
コンテナイメージの管理機能
▪ 「コンテナイメージ」の 実 体 は、コンテナに 割 り
当てるディスクイメージに、ネットワーク設 定な
どの環境情報を付与したもの にすぎません。
アプリケーション
コンテナ
▪ Docker の特徴は、次のような「イメージ管理
機能」にあります。
ルートディレクトリ
として割り当て
ディレクトリツリー
▪ Dockerfile :
コンテナイメージを自動作成する仕組み
▪ Image Registry :
コンテナイメージを共有・配布する仕組み
ホスト OS にマウント
コンテナイメージ
Google Cloud OnBoard
Confidential
Agenda
1
Container Technology
2
Docker Quick Tour
3
From Borg to Kubernetes
4
Google Container Engine
コンテナとイメージのライフサイクル
コンテナを停止するとプロセスが停止
(ディスクイメージは残っている)
コンテナ起動時に
スナップショットを作成
プロセス
stop
スナップ
ショット
スナップ
ショット
start
commit
ディスクイメージを複製して
保存イメージとして登録
rm
×
保存イメージ
run
コンテナを削除すると
ディスクイメージを破棄
保存イメージ
参考: Docker におけるコンテナのライフサイクル
http:/ d.hatena.ne.jp/enakai00/20140628/1403933390
Google Cloud OnBoard
Confidential
コンテナとのネットワーク通信
▪ 外部ネットワークとの通信は、ホスト Linux でNAT が行われます。
●
●
コンテナから外部へは、デフォルトで IP マスカレードが行われます。
外部からコンテナへは、コンテナ起動時のオプションでポートフォワーディングを設定します。
コンテナ
TCP 80
ホスト Linux
ポート
フォワー
ディング
# docker run -d -p 8000:80 ...
eth0
Google Cloud OnBoard
外部ネットワーク
Confidential
vethXX
docker0
TCP 8000
ホスト Linux の
IP アドレスに接続
eth0
172.17.42.1
Docker の基本操作
▪ Apache HTTP サーバーを起動して index.html を用意する例です。
$ docker search httpd
NAME
httpd
centos/httpd
...
DESCRIPTION
The Apache HTTP Server Project
STARS
780
9
OFFICIAL
[OK]
AUTOMATED
[OK]
$ docker pull httpd
$ docker images
REPOSITORY
httpd
TAG
latest
IMAGE ID
3076aa23a73c
CREATED
9 days ago
VIRTUAL SIZE
193.3 MB
$ docker run -d --name webserver -p 8080:80 httpd:latest
a101d9d6fbf78a5c1b0fcf1339f1ee1a4f94eb7c9a74e51ea769d2050f84712c
$ docker ps
CONTAINER ID
a101d9d6fbf7
IMAGE
httpd:latest
COMMAND
"httpd-foreground"
CREATED
2 seconds ago
$ echo '<h1>Hello, World!</h1>' > /tmp/index.html
$ docker cp /tmp/index.html webserver:/usr/local/apache2/htdocs/index.html
Google Cloud OnBoard
Confidential
STATUS
Up 2 seconds
PORTS
0.0.0.0:8080->80/tcp
NAMES
webserver
Docker の基本操作
▪ コンテナ内部で bash を起動して、コンテナ内の様子を確認する例です。
$ docker exec -it webserver bash
root@a101d9d6fbf7:/usr/local/apache2# ps -ef
UID
PID PPID C STIME TTY
TIME
root
1
0 0 23:20 ?
00:00:00
daemon
8
1 0 23:20 ?
00:00:00
daemon
9
1 0 23:20 ?
00:00:00
daemon
10
1 0 23:20 ?
00:00:00
root
118
0 2 23:38 ?
00:00:00
root
124
118 0 23:38 ?
00:00:00
CMD
httpd -DFOREGROUND
httpd -DFOREGROUND
httpd -DFOREGROUND
httpd -DFOREGROUND
bash
ps -ef
root@a101d9d6fbf7:/usr/local/apache2# ip a
root@a101d9d6fbf7:/usr/local/apache2# df
...
Filesystem
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc noqueue
state UP 1K-blocks
group defaultUsed Available Use% Mounted on
none
10188088 5695284
3952236 60% /
link/ether 02:42:ac:12:00:02 brd ff:ff:ff:ff:ff:ff
tmpfs
304344
0
304344
0% /dev
inet 172.18.0.2/16 scope global eth0
tmpfs
304344
0
304344
0% /sys/fs/cgroup
valid_lft forever preferred_lft forever
/dev/sda1
10188088
5695284
3952236
60%
/etc/hosts
inet6 fe80::42:acff:fe12:2/64 scope link
shm
65536
0
65536
0%
/dev/shm
valid_lft forever preferred_lft forever
root@a101d9d6fbf7:/usr/local/apache2# exit
Google Cloud OnBoard
Confidential
Agenda
1
Container Technology
2
Docker Quick Tour
3
From Borg to Kubernetes
4
Google Container Engine
Google におけるコンテナの活用
▪ Large-scale cluster management at Google with Borg
●
http://research.google.com/pubs/pub43438.html
▪ Borg, Omega, and Kubernetes
●
http://research.google.com/pubs/pub44843.html
Google Cloud OnBoard
Confidential
プラネットスケールのサービスを実現するポイント
▪
▪
▪
▪
▪
全世界のすべてのデータセンターで共通化されたインフラの提供
OS レイヤーを隠蔽して、アプリケーションレベルでの管理に集中
リソーススケジューラーによるアプリケーションデプロイの最適化
アプリケーションのオートスケールとサービスの抽象化
データストアとアプリケーションの分離
分散ソフトウェア技術で実現した
Google Cloud OnBoard
Confidential
Borgの役割
Datacenter as a Computer
Kubernetes
▪
▪
▪
▪
オープンソースコミュニティで開発されているコンテナオーケストレーションツール
Google におけるコンテナ管理の経験を踏まえて、Google のエンジニアが設計を主導
ベアメタルサーバー上のコンテナと仮想マシン上のコンテナを管理可能
マイクロサービスを効率的にデプロイ、アップデートする機能として、コンテナ(Pod) のオートス
ケール、 Blue Green Deployment 、Rolling Update などを提供
Google Cloud OnBoard
Confidential
Deployment と Service によるマイクロサービス管理
▪ Deployment :同一の Pod を複数起動してスケールする仕組みを提供
▪ Service :同一の Pod に代表 IP アドレスを割り当てて抽象化する仕組みを提供
ReplicaSet
- replicas: 3
- selector:
- app: MyApp
- version: v1
Google Cloud OnBoard
Deployment
- name: MyApp
Service
- name: MyService
Virtual IP
Confidential
Blue Green Deployment
▪ 別バージョンの Pod 群を並列稼働して、 Service 定義の変更でアクセス先を切り替え
Virtual IP
ReplicaSet
- replicas: 3
- selector:
- app: MyApp
- version: v2
ReplicaSet
- replicas: 3
- selector:
- app: MyApp
- version: v1
Google Cloud OnBoard
Confidential
Rolling Update
▪ 同一の Deployment 配下のPod を段階的に新バージョンに入れ替えることでサービスのライブ
アップデートを実施
ReplicaSet
- replicas: 3
- selector:
- app: MyApp
- version: v1
ReplicaSet
- replicas: 3
- selector:
- app: MyApp
- version: v2
v2 を追加
v1 を削除
Google Cloud OnBoard
Confidential
Agenda
1
Container Technology
2
Docker Quick Tour
3
From Borg to Kubernetes
4
Google Container Engine
GKE : Google Container Engine
▪
▪
▪
▪
Google Cloud Platform で提供される Kubernetes のマネージドサービス環境
GUI/CUI 操作、 API リクエストにより Kubernetes のクラスタ環境を自動構築
Cloud SQL 、Cloud Datastore などのデータストアサービスと連携可能
Service によるネットワーク管理と Cloud Load Balancing のグローバル・ロードバラン サーを自
動連携
Google Cloud OnBoard
Confidential
デモンストレーションをお楽しみください
http:/ enakai00.hatenablog.com/entry/2016/08/10/152334
Google Cloud OnBoard
Confidential
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Compute Engine とネットワーキング
Google Cloud Platform の基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Compute Engine 概要
2
Google Cloud ネットワーキング
3
運用とツール
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
Compute
Engine
ネットワーキン
グ
Container
Engine
ビッグデータ
機械学習
ストレージ
運用とツール
App
Engine
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Compute Engine (1/3)
● Google のインフラストラクチャが ホストする仮想マシン上で、大規模な
ワークロードを実行
● ロバストなネットワーク機能
カスタムネットワークにデフォルトで対応
ファイア ウォールのルール
リージョンごとの HTTP(S) の
ロード バランシング
○ ネットワークのロード バランシング
○ サブネットワーク
○
○
○
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Compute Engine (2/3)
● High CPU、High memory、標準で
シェアードコア マシンタイプ
● Persistent disks
○ SSD、 ローカル SSD が標準
○ Snapshots
● ディスクのリサイズ、インスタンスのマイグ
レートをダウンタイムなしで
● インスタンスのメタデータとスタートアップ
スクリプト
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Compute Engine (3/3)
● 自動スケーリングとインスタンス
グループマネジメントのための
先進の API
● 革新的な料金体系
○
○
○
○
分単位の課金、継続利用割引
プリエンプティブル インスタンス
高スループットのストレージを追加料金なしで
カスタム マシン タイプ - 必要なハードウェア の分だ
けを課金
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
コンピュートオプションの比較
Compute
Engine
Container Engine
App Engine
Standard
App Engine Flexible
言語サポート
全て
全て
Java, Python, Go &
PHP
全て
サービスモデル
IaaS
ハイブリッド
PaaS
PaaS
主要な
ユースケース
一般的な計算の
ワークロード
コンテナ ベースの
ワークロード
ウェブとモバイルの
アプリケーション
ウェブとモバイルのアプリ
ケーション、コンテナ ベー
スのワークロード
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Compute Engine 概要
2
Google Cloud ネットワーキング
3
運用とツール
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
Cloud
Interconnect
ビッグデータ
Cloud
VPN
械学習
Cloud
DNS
ロード バラ
ンシング
ストレージ
運用とツール
Cloud
CDN
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud ロード バランシング (1/2)
● HTTP(s) ロード バランシング
○ 複数の Compute Engine リージョンに
またがる HTTP ベースのトラフィックを
バランス
○ グローバルにはトラフィックを外部 IP アドレ
ス経由で配信
○ スケーラブル、暖気運転なしで
レジリエンスとフォールト
トレランスを提供
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud ロード バランシング (2/2)
● TCP/SSL と UDP (ネットワーク)のロード
バランシング
○ TCP/SSL と UDP のトラフィックを、 Compute
Engine リージョン内でインス
タンスプールに拡散
○ 健全なインスタンスのみがトラフィックを維持す
るように保証
○ スケーラブルで暖気運転不要
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud CDN (Content Delivery Network)
● Google のグローバルに分散したエッジ キャッ
シュを使い、 HTTP(S) ロード
バランスされたコンテンツを
インスタンスよりもはるかにユーザーの
近くでキャッシュ
○ コンテンツをより高速にユーザーへと
配信しながらも、コストは削減
● Cloud CDN はネットワークロケーションの
キャッシュを使い、インスタンスに よって生成されたレスポンスを保存
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Compute Engine 概要
2
Google Cloud ネットワーキング
3
運用とツール
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
ビッグデータ
機械学習
ストレージ
Deployment
Manager
運用とツール
Stackdriver
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Stackdriver (1/2)
● 統合モニタリング、ロギング、診断
● Google Cloud Platformと Amazon Web
Services をまたがったワーク
● オープンソースエージェントの
インテグレーション
● 強力なデータ、アナリティクスの ツール
● PagerDuty、 BMC、 Splunk などとのコラ
ボレーション
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Stackdriver (2/2)
モニタリング
ロギング
プラットフォーム、システム及びア
プリケーションメトリクス
アップタイム/健全性チェック
ダッシュボードとアラート
プラットフォーム、システム及びア
プリケーションログ
ログ検索/閲覧/フィルター
ログベースのメトリクス
トレース
エラーレポート
レイテンシレポーティング及びサン
プリング
URL ごとのレイテンシと統計
エラー通知
エラーダッシュボード
デバッガ
アプリケーションのデバッグ
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Deployment Manager
● インフラストラクチャマネジメントサービ
ス
● 環境を記述する .yaml テンプレートを
生成、リソースを作成するために
Deployment Manager を使用
● 繰り返し可能なデプロイを提供
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
リソース
●
Google Compute Engine
https://cloud.google.com/compute/docs/
●
Google Cloud CDN
https://cloud.google.com/cdn/docs/
●
Google Cloud Stackdriver
https://cloud.google.com/stackdriver/docs/
●
Google Cloud Deployment Manager
https://cloud.google.com/deployment-manager/docs/
●
Google Cloud Source Repositories
https://cloud.google.com/source-repositories/docs/
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Big Data
Google Cloud Platform の基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Google Cloud Big Data Platform
©Google Inc. or its affiliates. All rights reserved. Do not distribute. 129
Google Cloud Big Data Platform
インテグレーションのリスクを減らし、価値を生み出すまでの時間を短縮
ビジネスやユーザー体験を変貌
させる、スケーラブルで安全、
信頼のデータドリブン
アプリケーション構築のための、統合
された NoOps クラウド
データプラットフォーム
●
●
●
●
より早く価値を生み出す
リアルタイムのアプリケーション
機械学習などのイノベーション
へのアクセス
完備性
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Platform
コンピュート
ネットワーキン
グ
BigQuery
ビッグデータ
Cloud
Pub/Sub
機械学習
Cloud
Dataflow
ストレージ
運用とツール
Cloud
Dataproc
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
ビッグデータサービス
BigQuery
Pub/Sub
アナリティクスデータベース
スケーラブルで
;
フレキシブルな
毎秒 100,000 行で
エンタープライズメッ
データをストリーミング
セージング
Dataflow
Dataproc
ストリーミングと バッチ
処理;統合、
簡素化された
パイプライン
Managed Hadoop
MapReduce、
Spark、 Pig、 Hive
サービス
フルマネージドの NoOps サービス
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
BigQuery (1/2)
● フルマネージド アナリティクスデータ
ウェアハウス
○ 巨大なデータセット(何百もの TB
規模のデータ)のほぼリアルタイムの
インタラクティブなアナリシスを提供
● SQL-like なシンタックスを使った クエ
リ
● パフォーマンスやスケーリングの管理
不要
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
BigQuery (2/2)
● セキュアで高性能な Google の
フルマネージド インフラ
ストラクチャ上で実行
○ コンピュートとストレージは、間にあるテラ
ビットの高速ネットワークで分離
○ 使用したストレージや処理の分だけ
お支払い
● 長期データストレージには自動的に割
引が適用
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Pub/Sub (1/2)
● Google Cloud Platform 及びその先を
見すえた、スケーラブルで信頼の
メッセージング
● 多対多の非同期メッセージングをサポート
● オフラインの消費者向けサポートも
● 実績のある Google テクノロジーがベース
● データプロセッシングパイプライン用に Cloud
Dataflow と統合
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Pub/Sub (2/2)
● トピックへのプッシュ/プル
サブスクリプションを使用
● ユースケース:
○ Dataflow、モノのインターネット (IoT)、
マーケティングアナリティクスにおける
データインジェスチョンのビルディングブロック
○ Dataflow ストリーミングの基礎
○ クラウドベースアプリケーション用プッシュ通知
○ Google Cloud Platform 全体のアプリケーションを接続
(Compute Engine と App Engine の間を
プッシュ/プル)
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Cloud Pub/Sub が信頼できる
リアルタイムメッセージングを提供
人事システ
ム
ベンダーオ
フィス
「新規契約者イベント」
「新入社員イベント」
Pub/Sub
分離された
ソース
人事トピック
信頼できる配信
ディレクト
リー
サービス
ファシリティ
システム
アカウント プ
ロビジョニングシ
ステム
バッジ アクティ
ベーションシステ
ム
分離されたワーカー
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Dataflow (1/2)
● スケーラブルでかつ信頼性の高いデータ
パイプライン実行の為のマネージドサービス
● コードを書くだけでバッチ、
そしてストリーミングが可能
○ トランスフォームをベースとする
プログラミングモデル
● クラスタは貴社向けにサイジング
● Compute Engine インスタンスを用いて
データを処理
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Dataflow (2/2)
● Cloud Storage や Cloud Pub/Sub、
BigQuery、 Bigtable などの
GCP サービスと統合
● オープンソースの Java や Python SDK
● ユースケース:
○ データの移行、フィルター、質の向上、
整形のための ETL (extract/transform/load)
パイプライン
○ データ分析 - バッチ計算またはストリーミングを用い
た連続計算
○ オーケストレーション - 外部サービスを含む、サービ
スの連携を行うパイプラインの形成
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Dataflow は NoOps データパイプラインを提供
Input
Read
Pipeline p = Pipeline.create();
p
.apply(TextIO.Read.from(“gs://…”))
Filter 1
.apply(ParDo.of(new Filter1()))
Group 1
.apply(new Group1())
Filter 2
.apply(ParDo.of(new Filter2())
Transform 1
Write
Output
オープンソース API (Apache
Beam) が Flink や Spark など
でも実行可能
パラレルタスク
(実行フレームワークにより自
動スケーリング)
class Filter1 extends DoFn<...> {
public void
processElement(ProcessContext c) {
.apply(TextIO.Write.to(“gs://…”));
... = c.element();
...
c.output(...);
p.run();
}
.apply(new Transform1())
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
同じコードでリアルタイム処理とバッチ処理
BigQuery
Cloud Pub/Sub
Cloud Dataflow Cloud Pub/Sub
Cloud Storage
Pipeline p = Pipeline.create();
p.begin()
.apply(PubsubIO.Read.from(“input_topic”))
.apply(SlidingWindows.of(60, MINUTES))
.apply(ParDo.of(new Filter1()))
.apply(new Group1())
.apply(ParDo.of(new Filter2())
.apply(new Transform1())
.apply(PubsubIO.Write.to(“output_topic”));
p.run();
Cloud Storage
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Dataflow がインジェスト、トランスフォーム、ロードを実行
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Dataproc (1/3)
● Hadoop や Spark/Hive/Pig を Google
Cloud Platform 上で高速、簡単、
マネージドな方法で実行
● クラウドインテグレーションのメリット
○ Cloud Storage
○ Stackdriver
● 初期化アクションを使用したクラスタのカス
タマイズと設定
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Dataproc (2/3)
● クラスタを 90 秒以下で生成
● Dataproc クラスタは分単位での課金
○ バッチ処理にプリエンプティブル インスタンスを使って
コストを削減
● ジョブを実行している間でも、クラスタのスケー
ルアップ、スケールダウンが可能
● デベロッパーツール
○ RESTful API
○ Google Cloud SDK とのインテグレーション
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Cloud Dataproc (3/3)
● ユースケース:
○ オンプレミスの Hadoop ジョブを簡単に
クラウドへマイグレート
○ 迅速に Cloud Storage に保存されている
データ(ログデータなど)を分析 クラスタを 2 分未満で生成し、即座に削除
○ Spark/Spark SQL を使い、即座に
データマイニングと分析
○ Spark Machine Learning Libraries (MLlib) を
使って分類アルゴリズムを実行
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
リソース
● Google Big Data Platform
https://cloud.google.com/products/#big-data
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Google Machine Learning
Google Cloud Platform 基礎
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Agenda
1
Googleでのディープラーニング活用
2
GCPが提供する機械学習サービス
3
機械学習サービスの利用例
4
ニューラルネットワークによる画像分類
Google のビジョン
“to provide access to the world’s
information in one click.”
150
One Click?
音声入力
151
行動履歴から
必要な情報を判別
DeepMind の WaveNet による音声合成技術
MOS(人間による聞き取り評価)
https://deepmind.com/blog/wavenet-generative-model-raw-audio/
152
Google Photo
画像のラベル付け処理
153
Gmail Smart Reply
メールの返答文を
予測して生成
コンテキストを理解して生成
モバイルアプリからの返信の
10%
https://gmail.googleblog.com/2016/03/smart-reply-comes-to-inbox-by-gmail-on-the-web.html
154
ディープラーニングで冷却設備の動作を改善
データセンター冷却コストが40%低下
データセンター電力効率(PUE)が15%改善
https://green.googleblog.com/2016/07/deepmind-ai-reduces-energy-used-for.html
155
Googleでのディープラーニングの利用実績
Android
Apps
Gmail
Maps
Photos
Speech
Search
Translation
YouTube
その他多数
156
Agenda
1
Googleでのディープラーニング活用
2
GCPが提供する機械学習サービス
3
機械学習サービスの利用例
4
ニューラルネットワークによる画像分類
Googleのインフラストラクチャー
分散ソフトウェア技術で実現した
Datacenter as a Computer
158
Googleが開発した分散ソフトウェア技術の例
159
GCP が提供する機械学習のクラウドサービス
学習済みモデルを
アプリケーションから
すぐに利用可能
APIサービス群
SPEECH API
Cloud Machine Learning
CLOUD ML
Cloud Datalab
DATALAB
ディープラーニングに最適化された
機械学習ライブラリー
(オープンソースとして公開)
160
VISION API
TRANSLATE API
NATURAL
LANGUAGE API
Cloud Vision API
画像認識の学習済みモデルを提供
画像をAPIに送るだけ、機械学習の知識は不要
月間1,000認識まで無償で試用可能(*)
(*) Google Cloud Platformのプロジェクト内で使用したリソースのコストは別途発生します。
https://cloud.google.com/vision/pricing
161
Cloud Speech API
音声認識の学習済みモデルを提供
音声データをAPIに送るだけ、機械学習の知識は不要
最初の60分間は無償で試用可能(*)
(*) Google Cloud Platformのプロジェクト内で使用したリソースのコストは別途発生します。
https://cloud.google.com/speech/pricing
162
Cloud Machine Learning
クラウド上で独自モデルを学習
TensorFlowの分散学習機能に対応
学習したモデルをAPIとして公開
163
Agenda
1
Googleでのディープラーニング活用
2
GCPが提供する機械学習サービス
3
機械学習サービスの利用例
4
ニューラルネットワークによる画像分類
Cloud Vision API の利用例
▪ ブラウザ上のコードでWebカメラから取得した画像を
クラウド上のAPIサービスに送信して「笑顔」を識別
http://goo.gl/9EM8tr
165
Cloud Vision API の利用例
▪ Finding Pete’s Dragon with Google Cloud Vision API
https://cloudplatform.googleblog.com/2016/08/finding-Petes-Dragon-with-Google-Cloud-Vision-API.html
166
TensorFlow の活用例
▪ Linuxサーバー上で学習したモデルをラズパイから利用
して、「きゅうり」の自動仕分けを実現
http://googlecloudplatform-japan.blogspot.jp/2016/08/tensorflow_5.html
167
TensorFlow の活用例
▪ How Ocado uses machine learning to improve customer service
http://www.ocadotechnology.com/our-blog/articles/How-Ocado-uses-machine-learning-to-improve-customer-service
168
TensorFlow の活用例
▪ Introduction to Trainspotting
https://svds.com/introduction-to-trainspotting/
169
その他の可能性
▪ 学習済みモデルをベースにして、個別データでさらにモデルをチューニング
●
カッコよく言うと「転移学習」と呼ばれる手法
▪ クラウド上で学習したモデルをクライアント上で直接に実行
●
大量データでパラメーターをチューニングするには、それなりの計算リソースが必要ですが、
学
習済みのモデルを実行するだけならクライアント側でも対応可能
▪ クライアント上でリアルタイムに学習処理を実施
●
170
簡単なモデルなら(処理性能的には)クライアント上でも学習処理は十分できます。
クライアント
上で取得したデータをリアルタイムに学習することで、何か面白いことができるかも?
Agenda
1
Googleでのディープラーニング活用
2
GCPが提供する機械学習サービス
3
機械学習サービスの利用例
4
ニューラルネットワークによる画像分類
線形 2項分類器
▪ 2種類のデータを直線で分類する例をNeural
Network Playgroundで試してみましょう。
http://goo.gl/A2G4Hv
ソフトマックス関数による画像分類
▪ たとえば、28x28ピクセルのグレイスケール画像は、各ピ
クセルの値を一列にならべると、784次元空間の点とみ
なすことができます。
▪ 大量の画像データを784次元空間にばらまくと、類似画
像は互いに近くに集まると考えられないでしょうか?
●
ソフトマックス関数で 784次元空間を分割することで、画像を
分類できるかも知れません・・・。
TensorFlowでやってみた
▪ 詳しくはこちらを参照
http://goo.gl/rGqjYh
正解例 不正解例
畳み込みニューラルネットワークによる性能向上
▪ 画像データをそのままソフトマックス関数に入力するのでは
なく、各種の画像フィルターを通して、特徴を抽出してから
ソフトマックス関数に入力します。
TensorFlowでやってみた
▪ 詳しくはこちらを参照
http://goo.gl/UHsVmI
http://goo.gl/VE2ISf
cloud.google.com
©Google Inc. or its affiliates. All rights reserved. Do not distribute.
Fly UP