45
クラウド・プログラミングの未来: イベント駆動型のマイクロサービス・アプリケーション・アーキテクチャ IBM Bluemix OpenWhisk Dr. Andreas Nauerz, Technical Product Manager @AndreasNauerz Markus Thömmes, Software Engineer @MarkusThoemmes October, 2016

IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Embed Size (px)

Citation preview

Page 1: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

クラウド・プログラミングの未来:イベント駆動型のマイクロサービス・アプリケーション・アーキテクチャ

IBM Bluemix OpenWhisk

Dr. Andreas Nauerz, Technical Product Manager @AndreasNauerzMarkus Thömmes, Software Engineer @MarkusThoemmes

October, 2016

Page 2: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Please Note:

1

• IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.

• Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision.

• The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract.

• The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.

• Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

Page 3: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Agenda

• OpenWhiskを⼀⾔でいうと?• 従来モデルとの⽐較• Daveとそのチームとの出会い• OpenWhiskの動作• OpenWhiskアーキテクチャ とその使い⽅• ユースシナリオ• プログラミング・モデル• デモ• 最新情報• まとめとQ&A

2

Page 4: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk* を⼀⾔で⾔うと

„イベントに応答してコードを実⾏するイベント・アクション・プラットフォーム

オープンソースとIBM Bluemix上のマネージドサービスとして提供

* whisk (動詞): きびきびと迅速に動作すること (source: merriam-webster.com)

Page 5: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhiskを⼀⾔で⾔うと

サーバーレス のデプロイとオペレーション・モデル

実⽤的で細分化した価格体系

複数⾔語対応の柔軟なプログラミング・モデル

オープン(Apache 2)対応 & オープン・エコシステム

⾼度なプログラミング構築(シークエンシングなど)をサポート

イベント・プロバイダー向けオープン・インタフェース

要求ベースの拡張性

Scalaへのインプリ

Docker, Kafka, Consul, …

Page 6: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk:従来モデルとの⽐較

Swift

Application

Container VMCF

2

Polling

1b

Request

1a

• 従来モデルとの⽐較– イベント・プログラミング・モデルではロスする可能性

があるため、継続的にポーリング必要– 実⽤性が低く、アイドル時も課⾦される

– 拡張が困難• 拡張のタイミング (メモリ、CPU、応答時間)• 拡張にかかる時間

– システム回復への⼼配• HA構成のために最低2プロセス必要 (稼動コスト)• 複数地域での運⽤(稼動コスト)• 安定した継続運⽤

Process & idle

Page 7: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk: 従来モデルとの⽐較

• OpenWhisk– イベント・プログラミング・モデル– 使った分だけ⽀払い

– 拡張が前提のしくみ• 要求あたり1プロセス

– システム回復へのコスト⾯の無駄がない• HA構成のために⼤きな追加コストがない

Pool of actions

Swift DockerJS

Trigger

1

Running action

Running action

Running action

3

ミリ秒単位でアクションを展開、実行、リソースを解放

OpenWhisk Engine

2

Page 8: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブはオンライン・フォト・コミュニティとマーケットプレイスの主任アーキテクトです。– プラットフォームを以下の⽤途で運⽤しています

• … 写真のシェアと販売• … ⼿動タグを使って写真の編集と分類

7

Page 9: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとチームは、競合に打ち克つために、継続的に先進的な機能拡張を⾏っています。– アイデア

• アップロードする際、⾃動的にシャープでノイズを低減し、感情分析が⾏えるようなモバイル・アプリを提供したい

8

Page 10: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– インフラや運⽤のディテールではなく付加価値のあるコード開発に

注⼒したい

Page 11: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– 多⽬的に合うモデルではなく、ある技術が好きでそれに精通した⼩さく

、アジャイルなチームで柔軟なプログラミング環境とモデルを使って、サービスを開発したい

Page 12: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– 何度も同じことを繰り返さず、さまざまなコミュニティやベンダの

提供するオープン・エコシステムの部品を簡単に既存の技術と組み合わせて利⽤したい統合したい

Page 13: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– 頻繁にコードを変更せずに、もっている部品を接続したり、つなげ

たりして強⼒なソリューションを構築できるようにしたい

Page 14: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– 重複作業が発⽣しないよう、作成した部品の共有と再利⽤をしたい

Page 15: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– 強⼒なクラウド・プラットフォームに負荷の⾼いタスクをアウトソー

スしたい

Page 16: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– リソースの待機時間は課⾦せず、利⽤した分のみの従量課⾦を使⽤

したい

Page 17: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デイブとそのチームの話

• デイブとそのチームは、要件の収集を始めました– ベンダ・ロックインではなく、システムの柔軟性を維持するために

コミュニティが運営するオープン・ソリューションを採⽤したい

Page 18: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk: アプリ構築の新しい⼿段…

さまざまな環境に対応

はじめやすさ 管理の⾃由度

OpenWhisk

イベント駆動型アプリ、サーバーレス環境に展開で

きます。

Instant Runtime

Cloud Foundryをベースとするアプリ中心のランタイ

ム環境

IBM Containers

OSの管理不要で移植可能で一貫性のある、アプリのデリバリーを行います。

仮想環境

VMを使用して、環境に最大限の柔軟性を持たせ、環境を最大限にコントロー

ルします。

Page 19: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhiskのアーキテクチャ

Trigger

Package

Feed

Package

Feed

Package

Feed

Package

Feed

REST

CLI iOS SDK

CRUD triggers, actions, and rulesInvoke actions

UI

Action

NodeJS

Action

Swift

Action

Docker

Rule

Rule

Rule

Action

NodeJS

Action

Docker

Service ecosytem

Bluemix services3rd party servicesSelf-enabled services

Chain Chain Invoke

Docker (and potentially other abstractions going forward)

Page 20: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhiskの動作

} 1

イベント・プロバイダー

OpenWhisk

Cloudant

Push Notifcations

データ・イベント発生例

-Gitリポジトリのコミット-Cloudant上のCRUD操作….

OpenWhisk動作と連動するトリガー実行

2

…JS Swift Docker …

Page 21: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhiskの動作

OpenWhisk

JS Swift Docker …

HTTPリクエスト例 HTTP GET

mynewcoolapp.com/customers

1 2 連携するOpenWhiskアクション „getCustomers“を起動

Browser

Mobile App

Web App

各種プログラミング言語

Page 22: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk: オープンソースの関係図

21

Controller

…Invoker InvokerInvoker

Page 23: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Cloudant

OpenWhisk: Bluemixの関係図

22

ELK-Stack

soon

Controller

Integration Service

soon

…InvokerInvokerInvoker

Monitoring

soon

Page 24: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk: Dockerの利⽤

• アクションの分離• コンテナごとに消費するリソースを超えて制御

23

A =wsk action invoke docker run

Page 25: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk: コンテナーの開始

24

Start containerdocker run

Initialize/init

Run/run

cold container

Page 26: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Start containerdocker run

Initialize/init

Run/run

OpenWhisk: コンテナーの開始

25

pre-warmed container

Page 27: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Start containerdocker run

Initialize/init

Run/run

OpenWhisk: コンテナーの開始

26

warm container

Page 28: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhisk: コンテナー開始の最適化

• パフォーマンスが最重要

27

cold container pre-warmed container warm container

faster

Page 29: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

ユースシナリオ

• マイクロサービス・ベースのアプリ / API

• モバイル・バックエンド

• データ (ストリーム)処理

• IoT

• コグニティブ

• ボット

Page 30: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

プログラミング・モデル

• サービスがトリガーとして発⾏するイベントを定義し、開発者はルール経由でイベントを制御するためにアクションと組み合わせる。

• 開発者は必要なアプリケーション・ロジックのインプリに必要な作業だけ⾯倒を⾒ればよい - 残りはシステムが対応する。

T R A

Page 31: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

プログラミング・モデル

トリガー: „起動可能なイベント・クラス”T

Page 32: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

プログラミング・モデル

アクション: „イベント・ハンドラー、例 イベントに応答して実⾏されるコード

A

Page 33: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

プログラミング・モデル

アクション: 柔軟性を⾼め、再利⽤を⽀援するためシークエンスを作成するためにチェーン可能

A

AA := A1 + A2 + A3

AB := A2 + A1 + A3

AC := A3 + A1 + A2

Page 34: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

プログラミング・モデル

ルール: „トリガーとアクションの組み合わせ“R

R := T A

Page 35: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

myActionmyFeedT

A

プログラミング・モデル

パッケージ: „ トリガーとアクションの集合P

A forecast

OpenSource YoursThird

Party

translatelanguageIdtextToSpeechA

AA

databaseCreatedocumentRead...changesT

AAA

Push Notifications

sendMessagewebhookT

A

webhookT

postA

WebsocketsendA

Page 36: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

デモ

Page 37: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

最新情報• 9⽉9⽇ベータ版公開(実験レベルから前進)

– サポート・プログラミング⾔語の追加Node 6、Pythonおよび プリリリース版Swift 3– Dockerコンテナベースで構築したアクションのために改善されたモデル– ブラウザベースのUIで統合の編集、監視、構成が可能– さまざまなプラットフォームへのバイナリCLIインストールの改善– イベント・プロバイダーの統合: Cloudant、Github、IBM Push Notifications– Cloudant、Weather Company Data for IBM Bluemix、IBM Watson、Slack、IBM Push

Notificationsおよびwebソケット⽤のプリビルドされ、すぐに利⽤可能なアクション– OSクライアント・アプリケーション⽤のSDK とサンプル・アプリ– Githubで興味深いオープン・ソースアプリが増加中

例 DarkVision (https://github.com/IBM-Bluemix/openwhisk-darkvisionapp)Skylink (https://github.com/IBM-Bluemix/skylink)

Page 38: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

まとめ

• OpenWhiskは…– コードに価値を追加するための開発に集中できます– 柔軟なプログラミング・モデルを使って⼩さいアジャイルな開発チーム

で作業できます– オープン・コミュニティの部品を活⽤できます– 最新の抽象化とチェーニングを利⽤して、強⼒なソリューションと組み

合わせられます– これまでに作った部品の再利⽤や組み合わせが可能になります– 集中するタスクの負荷や計算をアウトソースできます– 使⽤した分だけ⽀払います– あなたも参加できるオープン・ソリューションとして供されます

Page 39: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

まとめ

– イベントに応答して、アクションが実⾏され、ブロックされるか、⾮ブロックされます

– アクションはNode、SwiftまたはDockerコンテナー(今後も追加予定)でカスタム・ロジックを実⾏できます

– アクションは強⼒なソリューションを構成するためにチェーン可能です– Cloudant やGithubなどはスケジュールされたアクション同様イベント・

ソースからは独⽴してサポートされます– CLI、REST APIおよびiOS SDKのツールが利⽤できます

• なくなるものは? 複雑さ!

Page 40: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

OpenWhiskに参加してください

• OpenWhisk お試しは• IBM Bluemix OpenWhisk offering

• https://new-console.ng.bluemix.net/openwhisk/– オープンソースのOpenWhisk

• https://developer.ibm.com/openwhisk/

Page 41: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

⽇本でのOpenWhisk情報

• IBM Bluemix OpenWhiskhttp://www.ibm.com/cloud-computing/bluemix/openwhisk/

• IBM Bluemix OpenWhisk⼊⾨https://new-console.ng.bluemix.net/docs/openwhisk/index.html

• IBM Swift Sandbox - Xcodeをインストールせず、Swiftコードのテストが可能https://swiftlang.ng.bluemix.net

• IBM Swift KITURA - Swiftウェブアプリ開発プラットフォームhttps://github.com/IBM-Swift/Kitura

40

Page 42: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Questions?

Page 43: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Notices and Disclaimers

42

Copyright © 2016 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.

U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.

Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.

Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.

Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.

References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.

Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.

It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law

Page 44: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Notices and Disclaimers Con’t.

43

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.

IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®, FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®, StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.

Page 45: IBM Bluemix OpenWhisk: IBM Seminar 2016, Tokyo, Japan: The Future of Cloud Programming

Thank You