Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
メルカリ写真検索における Amazon EKS の活用事例
Search
Hirofumi Nakagawa/中河 宏文
June 14, 2019
Technology
6
29k
メルカリ写真検索における Amazon EKS の活用事例
AWS Summit Tokyo 2019
Hirofumi Nakagawa/中河 宏文
June 14, 2019
Tweet
Share
More Decks by Hirofumi Nakagawa/中河 宏文
See All by Hirofumi Nakagawa/中河 宏文
IoTデバイスでMLモデルを動かす技術
hnakagawa
0
150
Kanazawa_AI.pdf
hnakagawa
0
160
メルカリ写真検索における Amazon EKS の活用事例と プロダクトにおけるEdgeAI technologyの展望
hnakagawa
5
8.8k
メルカリの写真検索を支えるバックエンド CCSE 2019 version
hnakagawa
0
290
メルカリの写真検索を支えるバックエンド
hnakagawa
1
1.1k
Mercari ML Platform
hnakagawa
1
17k
mlct.pdf
hnakagawa
2
2k
機械学習によるマーケット健全化施策を支える技術
hnakagawa
0
220
メルカリのマーケット健全化施策を支えるML基盤
hnakagawa
10
8.9k
Other Decks in Technology
See All in Technology
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
19k
サイト信頼性エンジニアリングとAmazon Web Services / SRE and AWS
ymotongpoo
7
1.8k
30→150人のエンジニア組織拡大に伴うアジャイル文化を醸成する役割と取り組みの変化
nagata03
0
220
Oracle Database Technology Night #87-1 : Exadata Database Service on Exascale Infrastructure(ExaDB-XS)サービス詳細
oracle4engineer
PRO
1
210
DevinでAI AWSエンジニア製造計画 序章 〜CDKを添えて〜/devin-load-to-aws-engineer
tomoki10
0
190
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
1
120
Amazon Athenaから利用時のGlueのIcebergテーブルのメンテナンスについて
nayuts
0
110
Introduction to OpenSearch Project - Search Engineering Tech Talk 2025 Winter
tkykenmt
2
160
リクルートのエンジニア組織を下支えする 新卒の育成の仕組み
recruitengineers
PRO
1
140
EMConf JP 2025 懇親会LT / EMConf JP 2025 social gathering
sugamasao
2
200
データベースの負荷を紐解く/untangle-the-database-load
emiki
2
540
JAWS DAYS 2025 アーキテクチャ道場 事前説明会 / JAWS DAYS 2025 briefing document
naospon
0
2.7k
Featured
See All Featured
The Invisible Side of Design
smashingmag
299
50k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Navigating Team Friction
lara
183
15k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
380
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Six Lessons from altMBA
skipperchong
27
3.6k
Being A Developer After 40
akosma
89
590k
How STYLIGHT went responsive
nonsquared
99
5.4k
Typedesign – Prime Four
hannesfritz
41
2.5k
Code Review Best Practice
trishagee
67
18k
Transcript
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ϝϧΧϦࣸਅݕࡧʹ͓͚Δ Amazon EKS ͷ׆༻ࣄྫ ࣸਅݕࡧΛࢧ͑ΔόοΫΤϯυ !1 גࣜձࣾϝϧΧϦ தՏ จ
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. தՏ จ • 20177݄ೖࣾ • ॴଐSRE→AI/MLνʔϜ • σόΠευϥΠό։ൃ͔ΒϑϩϯτΤϯυ ։ൃ·ͰΔԿͰ Twitter: hnakagawa14 GitHub: hnakagawa !2 ࣗݾհ
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Introduction !3
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. What is ࣸਅݕࡧ • ࣸਅݕࡧͱɺ͍ΘΏΔը૾ݕࡧػೳ • ΞϓϦ͔ΒࣸਅΛݩʹΛݕࡧ͢Δ • ໊ΛΒͳͯ͘ը૾͔ΒΛݕࡧ Ͱ͖Δ !4 ಈըϦϯΫ: https://youtu.be/kTni8EvOCgI
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. جຊతͳࣸਅݕࡧͷΈ !5 Deep Neural Networks (DNN)Λ༻ͯ͠ը૾ ͔ΒಛϕΫτϧΛऔಘ औಘͨ͠ಛϕΫτϧΛ Approximate Nearest Neighbor Index(ANN Index) ʹՃͯ͠ը૾indexΛߏங ݕࡧ࣌ʹಉ͘͡ը૾͔Β DNNΛհͯ͠ಛϕΫτϧΛऔ ಘ͠ɺANN Index͔Βݕࡧ 2 3 1
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. What is Kubernetes • KubernetesʢҎԼk8sʣͱΦʔϓϯιʔε ͷίϯςφɾΦʔέετϨʔγϣϯγες Ϝ • k8sʹCustom Resource Definitionͱݺ ΕΔಠࣗͷϦιʔεΛఆٛͰ͖Δػೳ͕͋ Γɺ։ൃऀͦͷػೳΛհͯ͠k8sͷػೳΛ ֦ுͰ͖Δ • Amazon Elastic Container Service for Kubernetes (Amazon EKS) ͱk8sͷϚω ʔδυɾαʔϏεɺίϯτϩʔϧϓϨʔϯ ͷཧΛߦͬͯ͘ΕΔ !6
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. What is Custom Resource Definition • Custom Resource DefinitionʢҎԼCRDʣͱ ಠࣗʹϦιʔεΛఆٛͰ͖Δk8sͷػೳ • CRDɾϦιʔεͱɺΧελϜɾίϯτϩʔ ϥͰߏ͞ΕΔ • ΧελϜɾίϯτϩʔϥ͕CRDɾϦιʔε ͷϥΠϑαΠΫϧ/ঢ়ଶʹԠͯ͡Ϋϥελͷ ঢ়ଶΛίϯτϩʔϧ͢Δ !7
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ML Platform Lykeion ࣸਅݕࡧLykeionͱݺΕΔͷML Platform্ ʹߏங͞Ε͓ͯΓɺԼهͷػೳPlatformଆͷػೳ Λ༻͍ͯ͠Δ !8 • Training/Serving CRD & ΧελϜίϯτϩʔϥ • ίϯςφϕʔεɾύΠϓϥΠϯ • Training/Serving ίϯςφΠϝʔδɾϏϧμʔ • ϞσϧɾϨϙδτϦ
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Architecture !9
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Architecture֓ཁਤ !10 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 1.TrainingɾϦιʔεͷ࡞ !11 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. TrainingɾϦιʔεͷ࡞ • Training custom resourceΛCronJob͕࡞ • ΧελϜɾίϯτϩʔϥ͕CRDɾϦιʔε Ͱઃఆ͞ΕͨίϯςφϕʔεɾύΠϓϥΠ ϯΛ࣮ߦ • ࣮ߦ͢Δόον୯Ґͱͯ͠Hourly, Daily, Monthly͕ଘࡏ !12
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ίϯςφϕʔεɾύΠϓϥΠϯ • ֤ఔΛݸผͷίϯςφɾΠϝʔδͰ࣮ߦ • ϥΠϒϥϦͷґଘؔͳͲڥφΠʔϒͳMLύΠϓϥΠϯͷΛղܾ • ύΠϓϥΠϯDAGYAMLͰهड़ • ֤ఔͷೖग़ྗPersistent VolumeʢҎԼPVʣΛհ͢ !13
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Batch Execution as Custom Resource • શͯͷόον࣮ߦใ͕CRDɾϦιʔεͱͯ͠ k8s্ʹΔ • ಉ͡ॲཧΛ࠶࣮ߦग़དྷΔͨΊɺόονͷ࠶࣮ߦ Λ͏ো෮چ࡞ۀ͕༰қ !14
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 2.ը૾ͷμϯϩʔυ !15 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ը૾ͷμϯϩʔυ • Amazon S3্ʹଘࡏ͢ΔϝϧΧϦɾΠϝʔδετΞ͔Βը૾Λμ ϯϩʔυ • ύΠϓϥΠϯ্ͬͱ͕͔͔࣌ؒΔఔʢը૾͕େͳͨΊ) • ͦͷͨΊPVʹҰఆظؒΩϟογϡ͢ΔࣄʹΑͬͯ࠶ΠϯσοΫε͕ ඞཁͳ࣌ʹૉૣ͘ύΠϓϥΠϯΛճͤΔΑ͏ʹ͍ͯ͠Δ • PVͷ࣮ମ Amazon EBS !16
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 3.ΞηοτͷΞοϓϩʔυ !17 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ΞηοτͷΞοϓϩʔυ • ύΠϓϥΠϯͷՌͰ͋ΔಛϕΫτϧͱANN IndexΛϞσϧɾϨϙδτϦʹอଘ • શͯͷՌόʔδϣϯཧ͞Εͨঢ়ଶͰอଘ͞ΕΔ • ϞσϧɾϨϙδτϦGCS্ʹߏங !18
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 4.ServingΠϝʔδͷϏϧυ !19 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ServingΠϝʔδͷϏϧυ 1. ϞσϧɾϨϙδτϦΛImage BuilderͱݺΕΔdaemon͕ࢹ 2. ৽͍͠Serving͖͢Ϧιʔε͕Ճ͞ΕΔͱࣗಈͰServingίϯςφɾΠϝʔδΛϏϧυ • ίϯςφɾΠϝʔδશͯͷANN IndexͷαʔϏϯάʹඞཁͳϦιʔεΛશؚͯΜͰ͍Δ 3. Ϗϧυ͞ΕͨίϯςφɾΠϝʔδΛίϯςφɾϨδετϦʹϓογϡ !20
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 5.ServingɾϦιʔεͷ࡞ !21 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ServingɾϦιʔεͷ࡞ • Image BuilderίϯςφɾΠϝʔδΛϏ ϧυͨ͋͠ͱɺServingΧελϜɾϦιʔ εΛ࡞ • ServingΧελϜɾίϯτϩʔϥCRDɾ ϦιʔεͷઃఆΛݩʹඞཁͳ DeploymentɺServiceΛ࡞ • ຊγεςϜͰߏங͞ΕͨANN IndexΛ ݸผͷIndexαʔϏεͱͯ͠σϓϩΠ !22
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 6.αʔϏεɾσΟεΧόϦ !23 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. αʔϏεɾσΟεΧόϦ • Ϋϥελ্ʹଘࡏ͢ΔIndexαʔϏεΛ k8sΛհͯࣗ͠ಈతʹऔಘ͢Δ • ͳΔ͘େ͖ͳཻͷIndexΛ༻͢ΔΑ ͏ɺҟͳΔظؒɾཻͷIndexαʔϏε (Hourly, Daily, Monthly) ΛࣗಈతʹΈ߹ ΘͤΔ • REST <-> IndexαʔϏεؒͷϓϩτίϧ gRPCΛ༻ !24
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ֓ཁਤͷৼΓฦΓ !25 S3 EKS
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Conclusion !26
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ࣸਅݕࡧͷόοΫΤϯυɾΠϯϑϥ 1. ίϯςφɾϕʔεͷ࠶ݱੑͷߴ͍γεςϜ 2. k8sͷCRD/ΧελϜɾίϯτϩʔϥαʔϏεɾσΟεΧόϦͷػೳΛ׆༻ 3. Batch Execution as Custom ResourceɺML PlatformͰ࣮ݱ͞Ε͍ͯΔػೳΛ༻ ͠ɺϩόετͳγεςϜΛߏங 4. ΫϥυɾΠϯϑϥΛk8sͰநԽ͢ΔࣄʹΑͬͯɺ֤Ϋϥυɾϕϯμͷྑ͍ͱ͜औΓ Λ͍ͯ͠Δ !27
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon EKSʹ͍ͭͯ • k8sͱ͍͑GCPͱ͍͏Πϝʔδ͕͋Δ͕(։ൃݩ͔ͩΒવ)ɺEKS͜ͳΕ͖ͯͯ҆ఆͨ͠ӡ ༻͕ग़དྷΔΑ͏ʹͳͬͨɻ͔͠͠Pros/Consવଘࡏ͢Δɻ • Pros • ૉͷk8sʹۙ͘ɺͦ͏͍ͬͨҙຯͰॊೈͳߏΛΈ͍͢ • Cons • ଞࣾͷϚωʔδυk8sαʔϏεʹൺɺk8sʹ͍ͭͯඞཁͳࣄલ͕ࣝଟ͍ • ͔͍͠͠উखͷྑ͍AWSͷS3RDSͷଞαʔϏεΛɺk8sͱڞʹ͍͍ͨϢʔβ͕᪳͢ Δཧ༝ͳ͍ !28
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWSͷྑ͍ͱ͜Ζ • AWSͷྑ͍ॴԿͱݴͬͯRDSɺAuroraʹද͞ΕΔɺϚωʔδυɾRDBMSαʔϏε • ࠷ॳRDSͰ࡞ͬͯɺύϑΥʔϚϯεʹࠔͬͨΒAuroraΛ͏ • Persistent͕ॏཁͳɺಛʹRDBΛ༻͢ΔγεςϜͰɺ࠷ॳͷબࢶʹͳΔ • ࠓճͷߏྫͱগ͠ҧ͏͕ɺk8s(EKS)ͰϏδωεɾϩδοΫ͕ͷΔΠϯϑϥ෦Λ நԽ͠PersistentʹRDSͷαʔϏεΛ༻͢Δͷ͓͢͢Ίߏͷ̍ͭ !29
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Thank you all for coming today !30