「ADエンジニアがみたre:Invent 2018」について市ヶ谷Geek★Nightで話してきました
市ヶ谷Geek★Nightさんにお声がけいただいて話してきました。re:Invent 2018に参加した話です。
まとめ
- QLDBは社内用途でサクッと使えそう。プラットフォームまたぎも技術的には面白そう。
- Timestream早く来て。
Workshopやセッションの話はajitofmでしたのでそちらをどうぞ。
会場提供いただいたオプトの皆様、どうもありがとうございました。
re:Invent 2018でみてきたセッション / あとでみるセッションのメモ
今年もre:Inventにいってきました。ということで参加してきたセッションやらワークショップについてのメモです。今回は1000セッションを超える規模ということもありすべては見れていないので、あとからみるためのセッションのメモも書いています。
新サービス類やイベント全般に関してはajitofmで話したのでそちらもどうぞ! ajitofm 36: Can't Wrap Up re:Invent 2018 within 1 hour
見たもの
見た順番に、記憶に残っているものを。
ARC334 - Scaling Push Messaging for Millions of Netflix Devices
Netflix built Zuul Push, a massively scalable push messaging service that handles millions of always-on, persistent connections to proactively push time-sensitive data, like personalized movie recommendations, from the AWS Cloud to devices. This helped reduce Netflix’s notification latency and the Amazon EC2 footprint by eliminating wasteful polling requests. It also powers Netflix’s integration with Amazon Alexa. Zuul push is a high-performance async WebSocket/SSE server. In this session, we cover its design and how it delivers push notifications globally across AWS Regions. Key takeaways include how to scale to large numbers of persistent connections, differences between operating this type of service versus traditional request/response-style stateless services, and how push messaging can be used to add new, exciting features to your application.
@raksoras
Zuulの話。どのようにGatewayとしてコネクションを管理するか(古いコネクションをrecycleする)、優先度キューの扱い、GatewayをAutoscalingさせるための指標についてなど。
DVC306 - Serverless: It All Started in Vegas
This talk dives into Trustpilot's journey to serverless compute. The journey starts at re:Invent 2016 and follows how the company fast-tracked its adoption within its engineering organization using a "serverless first" engineering principle. A representative from Trustpilot shares lessons learned and insights gained from running over 200 AWS Lambda functions with 12M invocations/day in production. Also covered are fun stories of what helped the company adopt serverless, how to make those stories actionable, a review of architectural patterns, and a discussion of why they choose serverless over traditional compute every day.
@martinbuberl
Lambdaをごりごり適用してEC2を減らしていった話。2年でLambda Function数が6倍になったらしい。 GitHub HookをLambdaでさばくのはいいアイデアかもしれない。
会社の開発原則: GitHub - trustpilot/principles: Trustpilot's Engineering Principles
実際にはECSでもLambdaでもよく、EC2からワークロードを逃してきたっていうのがメインの話。
NET404-R - [REPEAT] Elastic Load Balancing: Deep Dive and Best Practices
Elastic Load Balancing (ALB & NLB) automatically distributes incoming application traffic across multiple Amazon EC2 instances for fault tolerance and load distribution. In this session, we go into detail on ELB configuration and day-to-day management. We also discuss its use with Auto Scaling, and we explain how to make decisions about the service and share best practices and useful tips for success. Finally, Netflix joins this session to share how it leveraged the authentication functionality on Application Load Balancer to help solve its workforce identity management at scale.
もろもろのupdatesを交えつつ使い方について解説するセッション。
スロースタートつかっていこうという話。 Application Load Balancer のターゲットグループ - Elastic Load Balancing
あとNetflixの Sr.Security Engineerの人がALBでのCognitoとの連携の話をしてた。 Application Load Balancer を使用してユーザーを認証する - Elastic Load Balancing
AVR 202 Sumerian Workshop
Sumerian、高度なマインクラフトといった感じで面白かった。
Amazon Sumerian – VR アプリケーションや AR アプリケーションの構築 で3DモデルつくってWebVRに書き出す、というのもやった。Sumerian自体初めて触った。
こういうのが動く。壁のスイッチを押すと、部屋の電気がついて話し始めます。: http://tinyurl.com/arv202demo
Polly, Lex, Rekogtion, Comprehend, Translate, Transcribeあたりと連携できる。なので音声認識して適当に話す、というのを各サービスと連携して動かせる。
Workshopでは小さい部屋をつくって人間を配置した。壁のスイッチで部屋の上につるしたライトのon/offをするというのも書いた。これはState Machineをスイッチの挙動につけることができ、他のコンポーネントの状態を変更する、といったことが簡単に書ける。こんな感じ Amazon Sumerian ステートマシン - Amazon Sumerian
Workshopではやらなかったけど、Scriptingもできるらしい。 AMAZON SUMERIAN SCRIPTING API
ADT201-L - Leadership Session: Digital Advertising - Customer Learning & the Road Ahead
In this session, learn how experienced leaders in digital advertising respond to the rapid evolution and sophistication of the advertising market driven by innovation and groundbreaking technology. Our customers share real-world applications they've leveraged in the cloud and how they see the media landscape changing as adoption of AI in the space becomes more widespread. Learn about existing and upcoming advancements and how they affect digital transformation in the years to come. Come away with ideas on how you can apply these learnings to your technology stack.
- Karl Bunch - Worldwide Technical Leader, Digital Advertising
- Dave Pickles - Chief Technology Officer & Founder, The Trade Desk
- Alex Collmer - Founder & CEO, VidMob
- Patrick Wentling - Communications/PR Manager, The Trade Desk
re:Invent中で数少ないAD関連のセッション。VidMobがビデオのクリエイティブをいかに分析できるようにしてるかって話が面白かった。VidMobは動画広告クリエイティブの解析ツール。どうやっているかというと、
- RekognitionでビデオのObjectを認識。それぞれtimestampごとに属性の移り変わりを記録。
- ユーザのインタラクションをtimestampで結合し、クリエイティブの中のどの要素がエンゲージメントにつながったのかを取得。
ということをしている。あと音もこれに加わる。
Karlさんのいう「AI as new data source」がこれを端的に表している。つまりRekognitionがつけたタグによって分析可能なデータになるということ。
CON360-R1 - [REPEAT 1] From Monolith to Microservices (And All the Bumps along the Way)
Applications built on a microservices-based architecture and packaged as containers bring several benefits to your organization. In this session, Duolingo, a popular language-learning platform and an Amazon ECS customer, describes its journey from a monolith to a microservices architecture. We highlight the hurdles you may encounter, discuss how to plan your migration to microservices, and explain how you can use Amazon ECS to manage this journey.
まあどんどんコンテナに突っ込めばいい感じに移行できるよねっていうセッション。
BAP401-R - [REPEAT] Build a Voice-Based Chatbot for Your Amazon Connect Contact Center
Learn how easy it is to incorporate a voice-based Amazon Lex chatbot into your Amazon Connect contact center. In this workshop, we walk you through configuring your own Amazon Connect contact center, implementing a chatbot, and using it in your workflows to deliver a personalized voice-based caller experience. You also have the opportunity to further personalize caller experiences by using AWS Lambda to access caller information from your customer data system. Leave this workshop with a functioning Amazon Connect contact center and a voice-enabled chatbot that you can continually modify to your business needs. Come prepared to build by bringing your laptop and a phone to make test calls.
これは面白かった。コールセンターをつくるWorkshop。 Amazon Connect(簡単に使えるクラウド型コンタクトセンター)|AWS をつかう。
次のものをつくった。
- コールセンターが立ち上がる。ネタはITサポートデスク的なもの。
- 「パスワードリセットしたいんですけど」というとパスワードリセットできる。
- 「パソコンつかないんですけど」というと「電源きれてるんじゃない?がんばってね」といって電話を切られる。(冷たい!)
- 電話してきた顧客の名前をVoiceChat経由でDynamoDBに保存。(Connect -> Lambda -> DynamoDB)次に電話をかけたとき、もし名前があればその名前で返してくれる。「こんにちは鈴木さん」的な。
じゃあどうやってるかというとAmazon ConnectでもState Machine、というかここではContact Flowとよばれるものをつかう。こんな感じのGUIで応答を制御できる。
Amazon ConnectにLambdaつないでDynamoDBからデータ引いてきて名前をいってくれる雑なコールセンターができた。ちゃんと電話すると動く。 #reinvent pic.twitter.com/axb2r6SvwR
— suzuken (@suzu_v) November 28, 2018
ちなみにPollyで日本語を話せるようにはしたので電話からは日本語で話してくれる。が、Lexが日本語対応してないので返答は英語でしなければいけないという特殊なコールセンターになったのでした。
オレオレコールセンター、答える側は日本語で話してくれるけど、話す側は英語じゃないとだめという鬼仕様だ(Pollyが日本語サポートしてないのでIntentに設定できない)ちなみに「インターネットにつながってないんだけど」っていうと「がんばってね」っていわれて電話が切れます #reinvent pic.twitter.com/22zyntLeIq
— suzuken (@suzu_v) November 28, 2018
AIM395 - [NEW LAUNCH!] Easily add real-time recommendations to your applications with Amazon Personalize
新しく出たAmazon PersonalizeのWorkshop。
Amazon Personalize – Real-Time Personalization and Recommendation for Everyone | AWS News Blog
プログラムを書かずにPersonalizeができる!ってことでどんなものかと見に行ったけど、Workshop自体は微妙だったので途中で抜けてドキュメントを読んだ。
HLC303 - Data Patterns and Analysis with Amazon Neptune: A Case Study in Healthcare Billing
In this session, learn how to better analyze your data for patterns and inform decisions by pairing relational databases with a number of AWS services, including the graph database service, Amazon Neptune. Additionally, hear about the use of AWS Glue and Apache Ranger for data cataloging and as a baseline for query and dataset resolution. Learn about the use of AWS Fargate and AWS Lambda for serverless provisioning of complex data and how to do data rights management at scale on an enterprise data lake. As a case study, hear how Change Healthcare is building an Intelligent Health Platform (IHP) using these services to help standardize and simplify a number of healthcare workflows, including payment processing, which have traditionally been both complex and disconnected from healthcare event data.
- Mark Weiler - Sr. Solutions Architect, AWS
- John DeMastri - SVP, R&D - Platforms and Analytics, Change Healthcare
Neptune活用事例。医療系のサービスのBillingをいい感じにするぞ、っていう狙い。複数のサービスをまたいで計算しなければならないタスクがあり、それをGraphでやったら便利っていう話。ただモデリングとかはでてこなかったので具体的イメージがわきづらかった。
AWS DeepRacer - The MGM SpeedWay
今回のおもしろデバイス枠(と勝手に呼んでいる)、DeepRacerのワークショップ。DeepRacerは強化学習でつくったモデルを組み込める自動運転カー(物理) + そのマネジメントサービス。
AWS DeepRacer - the fastest way to get rolling with machine learning
次のことをやった。
- シミュレーションでコースを走らせる。これはその後物理コースで走らせるものと同じつくりになっている。
- 徐々にチューニングしていく。報酬関数を調整する。
- トレーニングをひたすら回す。
トレーニングはAWS Console上からできる。HLSで動画も転送してくれて、報酬スコアがどう変動しているかがみえるようになっている。Twitterに動画貼ったのでそちらをどうぞ。
ということで #deepracer トレーニング中の様子です。めっちゃコースアウトしてる。 #reinvent pic.twitter.com/7Jxm92UaxP
— suzuken (@suzu_v) November 28, 2018
報酬の関数はこんな感じ
def reward_function(on_track, x, y, distance_from_center, car_orientation, progress, steps, throttle, steering, track_width, waypoints, closest_waypoint): ''' @on_track (boolean) :: The vehicle is off-track if the front of the vehicle is outside of the white lines @x (float range: [0, 1]) :: Fraction of where the car is along the x-axis. 1 indicates max 'x' value in the coordinate system. @y (float range: [0, 1]) :: Fraction of where the car is along the y-axis. 1 indicates max 'y' value in the coordinate system. @distance_from_center (float [0, track_width/2]) :: Displacement from the center line of the track as defined by way points @car_orientation (float: [-3.14, 3.14]) :: yaw of the car with respect to the car's x-axis in radians @progress (float: [0,1]) :: % of track complete @steps (int) :: numbers of steps completed @throttle :: (float) 0 to 1 (0 indicates stop, 1 max throttle) @steering :: (float) -1 to 1 (-1 is right, 1 is left) @track_width (float) :: width of the track (> 0) @waypoints (ordered list) :: list of waypoint in order; each waypoint is a set of coordinates (x,y,yaw) that define a turning point @closest_waypoint (int) :: index of the closest waypoint (0-indexed) given the car's x,y position as measured by the eucliedean distance @@output: @reward (float [-1e5, 1e5]) ''' import math # Example Centerline following reward function marker_1 = 0.1 * track_width marker_2 = 0.25 * track_width marker_3 = 0.5 * track_width reward = 1e-3 if distance_from_center >= 0.0 and distance_from_center <= marker_1: reward = 1 elif distance_from_center <= marker_2: reward = 0.5 elif distance_from_center <= marker_3: reward = 0.1 else: reward = 1e-3 # likely crashed/ close to off track return float(reward)
ちなみにその後物理コースで走らせたら全然うまく走らず、1周2分かかりました・・。
SRV409-R1 - [REPEAT 1] A Serverless Journey: AWS Lambda Under the Hood
Serverless computing allows you to build and run applications and services without thinking about servers. Serverless applications don't require you to provision, scale, and manage any servers. However, under the hood, there is a sophisticated architecture that takes care of all the undifferentiated heavy lifting for the developer. Join Holly Mesrobian, Director of Engineering, and Marc Brooker, Senior Principal of Engineering, to learn how AWS architected one of the fastest-growing AWS services. In this session, we show you how Lambda takes care of everything required to run and scale your code with high availability
Lambda Functionの裏側をどうつくってるかという話。Firecrackerも発表され、Lambdaの基盤も変遷が聞けてよかった。 特にMarcさんのIsolation、KVM上でどうLambdaのスケジューリングの問題に対処したか、そしてFirecrackerでその問題にどう対処したかという話は面白かった。
もうVideoとスライドがあがっていたのでどうぞ。
AWS re:Invent 2018: [REPEAT 1] A Serverless Journey: AWS Lambda Under the Hood (SRV409-R1) - YouTube A Serverless Journey: AWS Lambda Under the Hood (SRV409-R1) - AWS re:…
あとでチェックするセッション
DynamoDB関連セッションはみておく。今回モデリング系のワークショップとかもあったけど行けなかった・・。
というのとお気に入りにいれておいてみてなかったやつのリストをどうぞ。
// https://www.portal.reinvent.awsevents.com/connect/interests.ww でconsoleを開いてスケジュールされていなかったやつだけ出す $x('//div[contains(@class, "resultRow") and not(contains(@class, "scheduled"))]/div[1]/a').map(e=>e.innerText).sort()
ADT301 - Create a Serverless Web Event Pipeline ADT302 - Democratize Data Preparation for Analytics & Machine Learning: A Hands-On Lab ADT303 - ML for Real-Time Self-Service Trend Detection & Root Cause Analysis: A Hands-On Lab AIM303-R - [REPEAT] Create Smart and Interactive Apps with Intelligent Language Services on AWS AIM348 - Translating Web Content Easily with Language Services from AWS AIM362 - Crowdsourcing Data Collection with Amazon Mechanical Turk AIM363 - [NEW LAUNCH!] Introducing Amazon Textract: Now in Preview AIM364 - [NEW LAUNCH!] Extract Insights from Millions of Documents with Amazon Textract AIM366 - [NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Inference Cost up to 75% AIM368 - [NEW LAUNCH!] Introducing Amazon SageMaker RL - Build and Train Reinforcement Learning models on Amazon SageMaker AIM369 - [NEW LAUNCH!] Introducing Amazon SageMaker Ground Truth: Build High-Quality and Accurate ML Training Datasets AIM396-S - ML Best Practices: Prepare Data, Build Models, and Manage Lifecycle AIM401-R1 - [REPEAT 1] Deep Learning Applications Using TensorFlow, ft. Siemens Financial Services AIM409 - Build a "Who's Who" App for Your Media Content AIM414 - Sequence-to-Sequence Modeling with Apache MXNet, Sockeye, and Amazon SageMaker AIM417 - Build a Searchable Media Library & Moderate Content at Scale Using Machine Learning AIM422 - Fraud Detection and Prevention Using Amazon SageMaker and Amazon Neptune ALX403-R2 - [REPEAT 2] Supercharge Any Alexa Skill by Understanding What Games Do ALX405-R2 - [REPEAT 2] Build a Game for Echo Buttons - an Alexa Gadget! ANT310 - Architecting for Real-Time Insights with Amazon Kinesis ANT322-R1 - [REPEAT 1] High Performance Data Streaming with Amazon Kinesis: Best Practices ANT377 - Migrate from Netezza to Amazon Redshift: Best Practices with Financial Engines ANT379 - [NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight ANT397 - [NEW LAUNCH!] Amazon Kinesis Data Analytics for Java Applications ANT398 - [NEW LAUNCH!] Introducing Amazon Managed Streaming for Kafka (Amazon MSK) ANT401-R - [REPEAT] Deep Dive and Best Practices for Amazon Redshift API330 - Predictive Scaling for More Responsive Applications ARC205-R1 - [REPEAT 1] Scaling Up to Your First 10 Million Users ARC308 - Chaos Engineering and Scalability at Audible.com ARC340 - [NEW LAUNCH!] Introducing AWS Ground Station – Fully managed Ground Station as a Service ARC341 - [NEW LAUNCH!] AWS Global Accelerator Deep Dive for Building Highly Available Services ARC407 - A Chronicle of Airbnb Architecture Evolution ARC408-R1 - [REPEAT 1] Under the Hood of Amazon Route 53 ARV301 - Meet Luke, Cristine, Grace and Preston - Sumerian Hosts ARV401-R - [REPEAT] Customizing the Environment in Your AR/VR Scene ARV403-R - [REPEAT] Machine Learning in the Edge - Enhanced by Amazon Sumerian CMP203-R - [REPEAT] Amazon Linux 2: A Stable, Secure, High-Performance Linux Environment CON301-R1 - [REPEAT 1] Mastering Kubernetes on AWS CON315-R1 - [REPEAT 1] Deploying Microservices using AWS Fargate CON318-R - [REPEAT] Running a High-Performance Kubernetes Cluster with Amazon EKS CON365 - [NEW LAUNCH!] Advancing Software Procurement in a Containerized World with the New AWS Marketplace for Containers CON367 - [NEW LAUNCH!] Introducing AWS App Mesh – service mesh on AWS CTD203-R1 - [REPEAT 1] Amazon Prime Video: Delivering the Amazing Video Experience CTD306 - Any Given Thursday, Friday, Saturday: How Pac-12 Streams Hundreds of Live Events CTD415-R - [REPEAT] Customizing Content Delivery with Lambda@Edge CTD416 - A Few Milliseconds in the Life of an HTTP Request DAT310-R - [REPEAT] Building Your First Graph Application with Amazon Neptune - Workshop DAT314 - Migrating Your NoSQL Database to Amazon DynamoDB DAT320 - Becoming a Nimble Giant: How Amazon DynamoDB Serves Nike at Scale DAT365 - Separating Fact from Fiction: Amazon DynamoDB Scaling and Adaptive Capacity DAT401 - Amazon DynamoDB Deep Dive: Advanced Design Patterns for DynamoDB DAT404-R - [REPEAT] Advanced Design Patterns for Amazon DynamoDB - Workshop DAT404-R1 - [REPEAT 1] Advanced Design Patterns for Amazon DynamoDB - Workshop DAT406 - Netflix: Iterating on Stateful Services in the Cloud DEM120 - [NEW LAUNCH!] How we made aibo smart: A journey through Serverless and IoT on AWS, and a view of AWS RoboMaker integration DEV303-R - [REPEAT] Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWatch DEV313-S - Shift-Left SRE: Self-Healing with AWS Lambda Functions DEV322-R - [REPEAT] What's New with the AWS CLI DEV379-R2 - [REPEAT 2] Introduction to Version 3 of the AWS SDK for JavaScript (TypeScript) DEV411-R1 - [REPEAT 1] Infrastructure as Code: AWS Best Practices ENT360 - [NEW LAUNCH!] Scaling HPC Applications on EC2 with Elastic Fabric Adapter GAM301 - Supercell – Scaling Mobile Games GPSCT302 - Building a Serverless Space Invaders Game on AWS GPSCT303 - Blockchain Architecture Design Patterns GPSCT311 - Tailor-Made SaaS: Multi-Tenant Customizations with AWS Lambda GPSCT404 - Architecting a Real-World Microservices Architecture and DevOps Strategy on AWS GPSTEC317 - Building Blockchain Platforms Beyond a Proof of Concept IOT367 - [NEW LAUNCH!] Introducing AWS IoT Events IOT368 - [NEW LAUNCH!] Introducing AWS IoT SiteWise MAE203 - Hollywood's Cloud-Based Content Lakes: Modernized Media Archives MAE310 - UnicornTrivia - Building a Live Trivia Mobile App Using AWS AppSync, AWS Amplify, and AWS Media Services MFG301 - Optimize Smart Factories Using Data Lakes and Machine Learning on AWS MOB306 - Build a Photo-Sharing App with AI-Powered Face and Object Detection MOB311 - Monetize Your Mobile App with Amazon Mobile Ads NET312 - Another Day in the Life of a Cloud Network Engineer at Netflix NET330 - [NEW LAUNCH!] Introduction to AWS Global Accelerator NET331 - [NEW LAUNCH!] Introducing AWS Transit Gateway NET402 - [NEW LAUNCH!] AWS Transit Gateway and Transit VPCs, Reference Architectures for Many VPCs NET416 - [NEW LAUNCH!] How to Architect for Multi-Region Redundancy Using Anycast Ips ROB201-R1 - [NEW LAUNCH!] [REPEAT 1] Announcing AWS RoboMaker: A New Cloud Robotics Service ROB301-R1 - [NEW LAUNCH!] [REPEAT 1] ROS and AWS RoboMaker ROB302-R1 - [NEW LAUNCH!] [REPEAT 1] Build and Deploy Robot Applications Easily with AWS SEC329 - AWS Encryption SDK: The Busy Engineer's Guide to Client-Side Encryption SEC403 - Five New Security Automations Using AWS Security Services & Open Source SRV305-R1OFV - [OVERFLOW] [REPEAT 1] Inside AWS: Technology Choices for Modern Applications (Red-Venetian) SRV346-R - [REPEAT] Build and Test a Serverless Error-Tracking Tool in One Weekend SRV375 - [NEW LAUNCH!] Lambda Layers STG212 - [NEW LAUNCH!] Introducing S3 Batch Operations: Managing Billions of Objects in Amazon S3 at Scale STG303-R - [REPEAT] Deep Dive on Amazon S3 Security and Management STG324 - [NEW LAUNCH!] Introducing AWS DataSync - Simplify, automate, and accelerate online data transfer STG378-R2 - [REPEAT 2] Querying Data in Place with AWS Object Storage Features and Analytics Tools STG398-R - [NEW LAUNCH!][REPEAT] Optimizing Costs in Amazon S3 Creating Cost Efficiencies w/ Amazon S3 Storage Classes & Introducing S3 Intelligent-Tiering STG401-R1 - [REPEAT 1] Building a Data Lake in Amazon S3 & Amazon Glacier
re:Invent 2017で聴いたセッション + あとでみるセッション
re:Invent 2017から昨日帰国しました。聴いたセッション、またあとでビデオ + スライドを見ておきたいセッションをメモしておきます。
聴いたセッション
Workshopが多いですね。セッション中のメモはDropbox Paperで取っていたのですが、Tweetにまとめているのもあるのでそちらもどうぞ。
- ATC303 - Cache Me If You Can: Minimizing Latency While Optimizing Cost Through Advanced Caching Strategies
- bidding engineの話。Lambda@EdgeでABテストとか。
- タイトルがおしゃれ。 元ネタ: https://en.wikipedia.org/wiki/Catch_Me_If_You_Can
- ATC301 - 1 Million bids in 100ms – using AWS to power your Real Time Bidder
- NLB + ENAで2M connection / min. さばいてるのが印象的なセッション。あとはbidderはstatelessにしてspot instanceにしてるとか。
- AerospikeをNVMe SSDで使ってる。I3 or F1。
- MCL309 - Deep Learning on a Raspberry Pi
- MXNetをラズパイで。資料はこれ GitHub - juliensimon/mxnetworkshop
- といっても実習はEC2でやったのであった。手法変えつつtrainの時間みつつ。あとはPyCameraつかえばinferenceをノードで動かせるとこまでやって終了。
- IOT204 - AWS Greengrass Basic Workshop
- Greengrassのセットアップまわりの基礎的な説明。pubsubをAWS IoTで眺めつつEC2をIoT Deviceとみなせるようにして一通りさわった。
- ARC401 - Serverless Architectural Patterns and Best Practices
- CTD403 - Supercharge Your Websites with the Power of Lambda@Edge
- suzuken on Twitter: "CTD403 - Supercharge Your Websites with the Power of Lambda@Edgeに来た。早速cloudfront distribution立てつつ準備中。 #reinvent"
- 内容はこれ GitHub - aws-samples/aws-lambda-edge-workshops: This repository contains instructions and blueprints for Lambda@Edge workshops
- Lambda@EdgeからDynamoDBのUpdate + Scanをするのが面白かった
- CON309 - Containerized Machine Learning on AWS
- クックパッドさんから2人登壇されていたので見に行ってきました。動画: AWS re:Invent 2017: Containerized Machine Learning on AWS (CON309) - YouTube 手元のiPhoneで試したらばっちり分類されていて便利でした :)
- MCL212 - SESSION FULL! NEW LAUNCH! AWS DeepLens workshop: Building Computer Vision Applications
- MCL209 - NEW LAUNCH! Introducing Amazon Translate – Now in Preview
- MCL345 - NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise
- MCL215 - NEW LAUNCH! Introducing Amazon Transcribe – Now in Preview
- DAT318 - NEW LAUNCH! Deep dive on Amazon Neptune
- MCL343 - NEW LAUNCH! Natural Language Processing for Data Analytics
聴いたセッションについてはajitofmでも話したのでよかったらそちらもどうぞ。
Published: ajitofm 14: Losing $100 in 5 minutes at Las Vegas with @_nishigori @chocopie116 https://t.co/ppllM62Uwf #ajitofm
— ajitofm (@ajitofm) 2017年12月1日
聴きたいけど聴けなかったセッション
あとでビデオとスライドで見ようかなあと思っているもの。Breakout Sessionの動画はこちら。そのうち全部あがるはず。
月曜日
- ABD331 - Log Analytics at Expedia Using Amazon Elasticsearch Service
- ATC302 - How to Leverage AWS Machine Learning Services to Analyze and Optimize your Google DoubleClick Campaign Manager Data at Scale
- AMF305 - Autonomous Driving Algorithm Development on Amazon AI
- GPSTEC313 - GPS: Real-Time Data Processing with AWS Lambda Quickly, at Scale, and What Comes Next?
- CMP332 - C5 Instances and the Evolution of Amazon EC2 Virtualization
- ABD315 - Building Serverless ETL Pipelines with AWS Glue
火曜日
- MCL365 - NEW LAUNCH! Introducing Amazon SageMaker
- ABD327 - Migrating Your Traditional Data Warehouse to a Modern Data Lake
- MCL310 - Building Deep Learning Applications with Apache MXNet and Gluon
- ABD215-R - [REPEAT] Serverless Data Prep with AWS Glue
- CTD301 - Amazon CloudFront Flash Talks: Best Practices on Configuring, Securing, Customizing, and Monitoring Your Distribution.
- DEV315 - GitHub to AWS Lambda: Developing, Testing, and Deploying Serverless Apps
- SRV403-R - [REPEAT] Serverless Authentication and Authorization: Identity Management for Serverless Applications
- MBL402 - NEW LAUNCH! Data Driven Apps with GraphQL: AWS AppSync Deep Dive
- CMP323 - AWS Batch: Easy and Efficient Batch Computing on AWS
水曜日
- DAT342 - NEW LAUNCH! How to build graph applications with SPARQL and Gremlin using Amazon Neptune
- SID341 - Using AWS CloudTrail Logs for Scalable, Automated Anomaly Detection
- MCL333-R - [REPEAT] Building Deep Learning Applications with TensorFlow on AWS
- CTD206 - NEW LAUNCH! Learn how Fubo is monetizing their content with server side ad insertion using AWS Elemental MediaTailor
- DAT326 - How DynamoDB Powered Amazon Prime Day 2017
- CON404 - Deep Dive into Container Scheduling with Amazon ECS
- CTD203 - NEW LAUNCH! Hear how OwnZones is using AWS Elemental MediaConvert to help media customers deliver world class VOD experiences
- CMP332 - C5 Instances and the Evolution of Amazon EC2 Virtualization
- CTD304 - Dow Jones & Wall Street Journal's journey to manage traffic spikes while mitigating DDoS & application layer threats
- CON214 - NEW LAUNCH! Introducing AWS Fargate
- MCL305 - Scaling Convolutional Neural Networks with Kubernetes and TensorFlow on AWS
- DEV324 - Deep Dive on Advanced Continuous Delivery Techniques Using AWS DevOps Tools
木曜日
- DAT308 - A story of Netflix and AB Testing in the User Interface using DynamoDB
- DEV203-R - [REPEAT] Launch Applications the Amazon Way
- DEV402 - Deep-Dive for AWS X-Ray
- SRV401 - Become a Serverless Black Belt: Optimizing Your Serverless Applications
- MCL341 - NEW LAUNCH! Infinitely Scalable Machine Learning Algorithms with Amazon AI
- SRV424 - Massively Parallel Data Processing with PyWren and AWS Lambda
- MCL342 - NEW LAUNCH! Graph-based Approaches for Cyber Investigative Analytics Using GPU Accelerated Community Detection and Visualization with Amazon Neptune and Graphistry
- CMP330 - NEW LAUNCH! Amazon EC2 Bare Metal Instances
おまけ
1週間ぶりに食べる日本食は最高だなあと思いました。
我々一行は帰国後すぐ蕎麦屋に向かった。この一週間でもっとも美味いを言い続けている… pic.twitter.com/9yKWEfP2vT
— suzuken (@suzu_v) 2017年12月2日
DeepLensはAWSの新サービスてんこ盛りデバイスだった
今週はラスベガスで開催されているAWS re:Inventに来ています。DeepLensのWorkshopに先程出てきたのでメモがてら貼っておきます。
概要
DeepLens自体は次の記事が詳しいです。
AWS DeepLens – Get Hands-On Experience with Deep Learning With Our New Video Camera | AWS News Blog
私はビデオもデバイスについても特に詳しいわけではないのですが、DeepLensがすごいなーと思ったのは、それ自体が今回発表されたサービスを含め、AWSのサービスを上手くつかって構築されていることです。
- SageMakerで作ったモデルを取り込む
- Greengrass Core上でlocal Lambdaを動かし、デバイスデータの送信とinferenceをする。
- eventのpubsub管理はAWS IoTで
- Greengrassに乗っているのでデプロイも簡単にできる
- ビデオデータはKinesis Video Streamでサーバ側へ送信 + バッファ可能
- inferenceの結果はAWS IoTトピックで扱えるので、任意のLambda functionのtriggerに設定可能
DeepLens自体のスペックは次のとおりです。
AWS DeepLens – Deep learning enabled video camera for developers - AWS
Workshopではこれらを一通り触りながらDeepLensにモデルをデプロイしていきました。次がWorkshopでつかったプロジェクトです。
GreengrassにDeepLensをデバイスとして関連付けすると、AWS IoT Device Gateway経由でイベントが流れてきます。例えば物体認識したイベントは次のようなデータが流れてきます。GreengrassではLambda functionをデバイスのlocalで実行できるので、ここでinferを実行するわけです。Greengrass SDKをつかったコードは次にあります。infer結果をpublishしているのがわかります。この例だとMXNetを使っています。
https://s3.amazonaws.com/deeplens-managed-resources/lambdas/hotdog-no-hotdog/new_hot_dog_lambda.zip
ちなみに今日あったアップデートでGreengrassからカメラやGPUにアクセスできるようになっています。
今日試したところ、DeepLensにはProjectを1つだけデプロイできます。ProjectというのはModelとFunctionの組み合わせでつくられるDeepLensの挙動のだと思うとわかりやすいです。
公式ページにもあるとおり、DeepLensがProgrammableというのはここで実現されています。
AWS DeepLens is easy to customize and is fully programmable using AWS Lambda. The deep learning models in DeepLens even run as part of an AWS Lambda function, providing a familiar programming environment to experiment with.
1つ1つをみるとやっていることはシンプルですが、よく考えられているなあと思ったポイントは以下のとおりです。
- Greengrass Coreの設定をしなくていい。DeepLensのconsoleからdeviceを紐付けるだけ。
- ゆえに証明書の配置とかも気にしなくていい。(出荷時点で組み込みのはず)Greengrassの設定するの若干面倒ですし・・
- ひとまずつなげばAWS IoTのpubsubにつなげるのでユーザはmodelとLambdaをどう書くかだけ考えるのに集中できる
あたりかなと。Greengrassで管理してるのでnetwork connectivityが安定しなければ再送される、あるいは他のGreeengrass Coreと連携して端末間通信する、あたりも便利そうですね。
感想
お、これは早速実物だ #reinvent #deeplens pic.twitter.com/lwbFhAfQ8x
— suzuken@re:Invent (@suzu_v) 2017年11月29日
あーこれgreengrassd動いてるのかな。まだ触らないでね!っていわれてる
— suzuken@re:Invent (@suzu_v) 2017年11月29日
ということでDeeplens Workshop始まった。デバイスのチームとMLのチームがコラボして開発されたとのこと。開発者が簡単にMLを扱えることを目指して開発しているとのこと。Video CameraではなくてDL enabled developer kitだと。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Workshopではすでにサンプルプロジェクトが用意されている。物体認識、行動認識、顔認識など。機能をカスタムしてもいいし、自分でプロジェクトを作ることもできる。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
SageMakerで作ったモデルをgreengrass経由でlocal Lambdaつかってデプロイするのかなーと想像してるけどどんな感じで進むのかしら
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Deeplens, Ubuntuのってるのか https://t.co/kIAck0l1aQ
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Deeplensはlambdaでinferenceする。VideoをKinesis Video Streamにおくる。デバイス管理はGreengrass。trainingなどはSageMakerで。今回発表されたサービスをもりもりつかっているなあ。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Deeplensのstorageは拡張できるらしい。MXNet用にclDNNが入ってる。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Tensorflowもサポート予定とのこと
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Alexaは入ってない。Audio StreamingではなくVideo Streaming。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
ホットドッグが配布されたw 「ホットドックの検出やるからまだ食べないでください!」とのこと
— suzuken@re:Invent (@suzu_v) 2017年11月29日
あ、これGreengrass Coreの1.2.0入ってるな。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
DeepLens consoleではmodelの設定とGreengrass上のLambda functionの設定ができる
— suzuken@re:Invent (@suzu_v) 2017年11月29日
あーDeepLensのinferenceの結果はMQTT topicでsubscribeできるのか。なるほど。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
なんていうか、DeepLens自体はGreengrassがpresetされたシンプルな構成だけど、Greengrass + Lambdaのおかげでデプロイもしやすいのがいいな。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
DeepLens上のLambda functionではpreprocess, inference, publishをしている。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
昨日Greengrass Workshopにいったので理解しやすくてよい
— suzuken@re:Invent (@suzu_v) 2017年11月29日
検出できた #deeplens #reinvent pic.twitter.com/ae4iolMad2
— suzuken@re:Invent (@suzu_v) 2017年11月29日
コードあった https://t.co/7E7fucz4p2 SageMakerつかってmodelを組んでみる
— suzuken@re:Invent (@suzu_v) 2017年11月29日
お、SageMakerでJupyter Notebookさくっと開いて実行できるじゃん便利
— suzuken@re:Invent (@suzu_v) 2017年11月29日
あーSageMakerでたてたJupyter NotebookでtrainしてmodelをS3にuploadしてそれをDeepLensですぐつかえるのかなにこれ便利
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Hotdog判別モデルをSageMakerでつくってs3に配置し、それをDeepLensのプロジェクトに追加してデプロイしている。
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Lab 4だとsubscribeしたtopicをLambdaのIoT RuleでSQLで絞り込むというのをしているな。これあったっけ? https://t.co/GMRrGffPlU
— suzuken@re:Invent (@suzu_v) 2017年11月29日
LambdaでIoT topicをsubscribeして、一定以上のp値でHotdogだと判定したらSNSでメールとばすのできた。無限にホットドック検出メールが飛んでくる・・w
— suzuken@re:Invent (@suzu_v) 2017年11月29日
これがないとDeepLensできないもんなあ。これ、DeepLensを作ろうとして用意したのかどうかとか気になる。SageMakerないとこのWorkshopも面倒だったろうし。https://t.co/fQheSFNnOA
— suzuken@re:Invent (@suzu_v) 2017年11月29日
Greengrass + Local Lambda + SageMakerの実用例がDeepLensっていうのはプレゼンテーションとしてもわかりやすいよなあ
— suzuken@re:Invent (@suzu_v) 2017年11月29日
今回のワークショップだとDeepLens上のUbuntuにはいってるデスクトップ環境つかってconsoleでの操作とかもできるし、なんていうか忍者の小道具みたいな感じがすごい
— suzuken@re:Invent (@suzu_v) 2017年11月29日
DeepLens Challenge Virtual Hackathonとな https://t.co/AhuooPL0oY #reinvent #deeplens
— suzuken@re:Invent (@suzu_v) 2017年11月29日
まとめ
*1:Workshop後にDeepLensももらえます
「サーバーレスの波はホンモノか?」あとがき
ご来場くださった方々、どうもありがとうございました。パネル内で話せなかったことやあとがきをまとめてみました。
ツールの補足
さきほどのパネルディスカッションで紹介したCloudWatch logsを見るツールは https://t.co/1ZmrgWfbYJ Kinesis Streamを雑にtailするツールは https://t.co/YAzsMZEQvj です #awssummit
— suzuken (@suzu_v) June 2, 2016
銀の弾丸はない
AWS Lambda、個人的には「簡単に立ち上がって隔離されたアプリケーション実行環境」としてつかってます。EC2でもECSでもできることがやれればいい。サービスつくる上で必要なものが動けばいいし、そのために試しやすい環境がすぐできるのはうれしい、というスタンスでつかってます。
— suzuken (@suzu_v) June 2, 2016
なので、これからLambdaで動いてるところを要件によってはEC2に移す、ということもするかもしれない。でもそれはよくて、初速をLambdaであげて実際に現場で動くものをつくれてリリースもできているのでよい。開発よりも運用の比重があがってきたときにどうなるか、あたりも大事。
— suzuken (@suzu_v) June 2, 2016
アプリケーションエンジニアとしてはすぐに本番のリソースと結び付けられて独立した実行環境が得られるのはメリットは大きい。ただし落ちづらいコード、スループットの出づらい実装になっていると使えないものに。そこはアプリケーションエンジニアとして責任をもつ必要がある。
— suzuken (@suzu_v) June 2, 2016
サーバーレス、という文脈で言うとLambdaみたいなものはとても便利に見えるだろうし、実際できることできないことははっきりしている。運用という観点から言うと、チームとしてインフラとアプリというもののスタンスを変えなければならないところもあるかもしれない。
— suzuken (@suzu_v) June 2, 2016
サービスをチームとしてサーブしている以上、そしてLambdaのようなものによって運用フェーズと開発フェーズが近くなる以上、そこで何を重要視するか?というのはチームによって違うと思う。たしかに検証はしやすいし、本番に近い状態でテストもできるのはメリットも大きい。
— suzuken (@suzu_v) June 2, 2016
とはいえ、じゃあ本当にこれはちゃんとサービスを動かし続けられるのか?というのをアプリケーションエンジニアがちゃんと動作モデルやエラーのケースまでケアしてコードを書く必要がある。普段からこれをやっているチームはすんなり運用までいけるかもしれないけど、そうじゃないと検証だけになるかも
— suzuken (@suzu_v) June 2, 2016
そういう文脈があるので、サーバーレス = デプロイが簡単ですぐ環境を得られる、ということだけではなくてチームとしてこういう領域を扱えるようにしていくというのをセットにしていかないとうまくいかないんじゃないかな、とも思う。だから使うだけで急に何かがよくなるわけではない。
— suzuken (@suzu_v) June 2, 2016
おわりに
パネルディスカッションの機会をつくっていただいたAWSのみなさま、モデレータの西谷さん、パネリストの木田さん、どうもありがとうございました。
追記 2016/06/15 12:50
セッションの動画が公開されました。
AWS Summit Tokyo Developer Conferenceのパネルディスカッションに登壇します
来週のAWS Summit TokyoのDevconにて、以下のパネルディスカッションに登壇予定です。6/2の16:20 - 17:00の回です。
AWS Summit Tokyo 2016 Developers Conference(DevCon)
【パネルディスカッション】サーバーレスの波はホンモノか? 最前線の開発者に聞くコードでサービスの全てを提供する方法
スケーラブルなアプリケーションやマイクロサービスを構築する上で、インフラの管理から「解放」されるサーバーレスアーキテチャーが注目されています。このサーバーレスアーキテクチャーが、どのくらいのインパクトを持つものなのか、実際にアプリケーションやサービス開発の最前線で活躍されている方をお招きし、その実態や期待値をお伺いするとともに、今後の進展についても議論します。
モデレータはAWSの西谷さん、パネリストはリクルートジョブズの木田さんと私です。サーバーレスのセッションで、今後のアーキテクチャを考える上でどのようにサーバーレスアーキテクチャを扱っていくか、というところ話す予定です。今実際にAWS LambdaやKinesis Streamを組み合わせたシステムを運用していてどうなのか、という話を交えつつ議論する予定です。私の事例としては以前AWSさんのオフィスにて発表したものがベースになります。どういった点がLambdaないしサーバーレスに向いており、どのような点から開発フェーズから運用、そしてアーキテクチャを考えていけばいいのかといったあたりの参考になるようなセッションにしたいと考えています。
お時間ありましたら是非お越しください。また6/2、6/3とも夕方から会場にはいる予定ですので、細かい技術的な質問等などあれば捕まえてください。あと飲みに行きましょう。
aws-cliのs3api put-objectでContent-MD5ヘッダをつける
put-object — AWS CLI 1.9.2 Command Reference をみると --content-md5
オプションがある。 PUT Object - Amazon Simple Storage Service にあるとおり、
To ensure that data is not corrupted traversing the network, use the Content-MD5 header. When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, returns an error.
ということでオブジェクトの完全性をチェックするには Content-MD5
ヘッダをPutObjectリクエストにつけるとよい。
AWS Developer Forums: awscli put-object --content-md5 trouble ... でもハマっている人がいた。最初 md5
とか md5sum
コマンドでやっていたのだが、これだとhexになったのが出てくる。 https://www.ietf.org/rfc/rfc1864.txt にもあるとおり、Content-MD5ヘッダに設定すべきは base64(md5)
であり base64(hex(md5))
ではない。ということでこれをまとめて aws s3api put-object
をつかって書くと以下の様にして実現できる。
# s3://your-bucket/your-key-prefix/obj に カレントディレクトリのobjをPutObjectする。
aws s3api put-object --bucket your-bucket --key your-key-prefix --content-md5 `openssl dgst -md5 -binary obj | openssl enc -base64` --body obj
APIを適当な言語で使っている場合にはmd5 sumのbinaryをPipeして組み立てればよいのだが、cliだとうっかりハマってしまった。ちなみにresponseのETagはPutしたObjectのmd5 checksumのhexが返ってくるので、これも合わせてチェックするとさらによいだろう。 レスポンスの例は以下のとおり。
{ "ETag": "\"a41422711fcbb0982991580e0d4799f6\"" }
これは md5sum -q obj
の結果と等しくなる。ただしMultipart Uploadの場合には必ずしもそうはならないので、留意すること。