Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
https://gcpug.jp
GCP Update
GCPUG AdminGoogle Developers Expert
Mercari / Merpay Solution Team@sinmetal
https://goo.gl/RZAy93
https://gcpug.jp 2
● App Engine Standard for Node.js β● App Engine Standard for Python 3 α● App Engine Standard for PHP 7.2 α● Cloud Composer β● Cloud Memorystore β● Cloud Tasks α● Cloud Scheduler α
NEWS
https://gcpug.jp 3
● Flexでしか使えなかったNode.jsがβでStandardに登場● Powered By gVisor ● App Engineの中でいくつか使えない機能がある
○ App Engine Memcache○ App Engine Task Queue○ App Engine UserService○ App Engine Search
App Engine Standard for Node.js β
https://gcpug.jp 4
App Engine Architecture
Google DatacenterApp Engine Services
GoogleFrontend
App EngineFrontend
Static Server
Pending Request Queue
App Server
Datastore
Memcache
Task Queue
Search
URL Fetch
Socket
App Engine RPC
https://gcpug.jp 5
2つのRPCの口を持つCloud Datastore
App Engine
Datastore
Other
gRPC
App Engine RPC
https://gcpug.jp 6
App Engineは外と直接通信できない
App Engine Services
App Engine
Datastore
Memcache
Task Queue
Search
URL Fetch
Socket
App Engine RPC
PubSub
Spanner
App Engine RPCしか外と通信できないので、Socket API 経由でgRPCをしゃべる
https://gcpug.jp 7
gVisorによる解放
外と直接通信できるようになったので、Scoket APIを使わなくてもgRPCが使えるようになった
https://gcpug.jp 8
● Memcache○ 現状維持, 新しいRuntimeが使えるようになるかは謎○ GCP全体の新たなMemcache系のサービスとしてはCloud
Memorystoreが登場● Search
○ 現状維持, 新しいRuntimeが使えるようになるかは謎● Task Queue
○ Cloud Tasksに進化
App Engine RPCしか喋れないサービスの今後
https://gcpug.jp 9
● ついにPython 3がやってくる!○ Request Form
● ついにPHP 7.2がやってくる!○ Request Form
● 今回、なぜRuntimeのαがあるのかは Java 8 ランタイム以降のサンドボックスと gVisor by @apstndb を参考に
App Engine Standard Runtime VersionUP !!
https://gcpug.jp 10
● Cloud Tasks α○ App Engine Task Queueが独立したサービス○ Request Form
● Cloud Scheduler α○ App Engine Cronが独立したサービス○ Request Form
Cloud Tasks α and Cloud Scheduler α
https://gcpug.jp 11
● Apache Airflowのフルマネージドサービス● ワークフローを定義して、実行できる
Google Cloud Composer β
https://gcpug.jp 12
Google Cloud Composer β
● First Step (Environmentを作る)○ 後ろではGKEのクラスターが作られ、Apache Airflowがイン
ストールされている○ Node数とマシンタイプなどを選ぶ○ gcloud beta composer environments create sinmetal1 --location us-central1 --zone us-central1-f
--machine-type n1-standard-2 --labels env=beta
https://gcpug.jp 13
Google Cloud Composer β
https://gcpug.jp 14
Google Cloud Composer β
https://gcpug.jp 15
DAG (directed acyclic graph)
● DAG (非循環グラフ)○ 最後、どっかにゴールするグラフ○ Pythonで記述する○ Operatorと呼ばれるものを組み合わせて作る
https://gcpug.jp 16
DAG (directed acyclic graph)
from airflow.operators import bash_operatorfrom airflow.operators import python_operator def greeting(): print('Hello World!')
# An instance of an operator is called a task. In this case, the # hello_python task calls the "greeting" Python function. hello_python = python_operator.PythonOperator( task_id='hello', python_callable=greeting)
# Likewise, the goodbye_bash task calls a Bash script. goodbye_bash = bash_operator.BashOperator( task_id='bye', bash_command='echo Goodbye.')
https://gcpug.jp 17
DAG (directed acyclic graph)
● BashOperator● PythonOperator● Google Cloud Platform Operators
○ Cloud Dataflow Operator○ Cloud Dataproc Operator○ Cloud Datastore Operator○ Cloud Machine Learning Engine Operator○ Cloud Storage Operator
● EmailOperator
https://gcpug.jp 18
DAG (directed acyclic graph)
Cloud Storage上にDAGを記述した.pyを置いてImportする
gcloud beta composer environments storage dags import --environment sinmetal1 --location us-central1 --source gs://dag-airflow-sinmetal/quickstart.py
https://gcpug.jp 19
Google Cloud Composer β
https://gcpug.jp 20
Google Cloud Composer β
https://gcpug.jp 21
Google Cloud Composer β Price
Web core hours $0.074 / vCPU hour
Database core hours $0.125 / vCPU hour
Web and database storage $0.273 per GB / month
Network egress $0.156 / GB
Price
Example Price (n1-standard-1 3 workers)Web core hours $26.91
Database core hours $45.66
Web and database storage $2.05
Network egress $1.44
合計 $76.06まぁまぁ、高い
https://gcpug.jp 22
● Redisのフルマネージドサービス● 現状、Compute EngineのNetworkからしか接続できない● 2つのMode
○ Basic■ サイズ変更時にデータがFlush
○ Standard■ マスター, レプリカ構成■ サイズ変更時もデータ維持■ 高可用性
Google Cloud Memorystore β
https://gcpug.jp 23
Google Cloud Memorystore β Price
キャパシティ ネットワーク 価格 GB/1h
M1 (1 ~ 4GB) 3 Gbps $0.049
M2 (5 ~ 10GB) 3 Gbps $0.027
M3 (11 ~ 35GB) 3 Gbps $0.023
M4 (36 ~ 100GB) 6 Gbqs $0.019
M5 (> 100GB) 12 Gbps $0.016
キャパシティ ネットワーク 価格 GB/1h
M1 (1 ~ 4GB) 3 Gbps $0.064
M2 (5 ~ 10GB) 3 Gbps $0.054
M3 (11 ~ 35GB) 3 Gbps $0.046
M4 (36 ~ 100GB) 6 Gbqs $0.035
M5 (> 100GB) 12 Gbps $0.030
Basic Standard
最低料金 $0.049 * 1GB * 24h * 30day = $35.28 最低料金 $0.064 * 1GB * 24h * 30day = $46.08