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
140
Kanazawa_AI.pdf
hnakagawa
0
160
メルカリ写真検索における Amazon EKS の活用事例と プロダクトにおけるEdgeAI technologyの展望
hnakagawa
5
8.7k
メルカリの写真検索を支えるバックエンド CCSE 2019 version
hnakagawa
0
280
メルカリの写真検索を支えるバックエンド
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
ドメイン駆動設計の実践により事業の成長スピードと保守性を両立するショッピングクーポン
lycorptech_jp
PRO
15
2.7k
Bring Your Own Container: When Containers Turn the Key to EDR Bypass/byoc-avtokyo2024
tkmru
0
890
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
14
3k
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!事例のご紹介+座学②
siyuanzh09
0
120
実践!生成AIのビジネス活用 / How to utilize Generative AI in your own business
gakumura
1
110
新卒1年目、はじめてのアプリケーションサーバー【IBM WebSphere Liberty】
ktgrryt
0
160
ABWGのRe:Cap!
hm5ug
1
140
第27回クラウド女子会 ~re:Invent 振り返りLT会~ 宣言型ポリシー、使ってみたらこうだった!
itkr2305
0
110
サーバレスの未来〜The Key to Simplifying Everything〜
kawaji_scratch
1
210
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
150
2024AWSで個人的にアツかったアップデート
nagisa53
1
110
When Windows Meets Kubernetes…
pichuang
0
320
Featured
See All Featured
Become a Pro
speakerdeck
PRO
26
5.1k
How to Ace a Technical Interview
jacobian
276
23k
Optimising Largest Contentful Paint
csswizardry
33
3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
How GitHub (no longer) Works
holman
312
140k
How to train your dragon (web standard)
notwaldorf
89
5.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
3k
Fireside Chat
paigeccino
34
3.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
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