Slide 1

Slide 1 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ϝϧΧϦࣸਅݕࡧʹ͓͚Δ Amazon EKS ͷ׆༻ࣄྫ ࣸਅݕࡧΛࢧ͑ΔόοΫΤϯυ !1 גࣜձࣾϝϧΧϦ தՏ ޺จ

Slide 2

Slide 2 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. தՏ ޺จ • 2017೥7݄ೖࣾ • ॴଐ͸SRE→AI/MLνʔϜ • σόΠευϥΠό։ൃ͔ΒϑϩϯτΤϯυ ։ൃ·Ͱ΍ΔԿͰ΋԰ Twitter: hnakagawa14 GitHub: hnakagawa !2 ࣗݾ঺հ

Slide 3

Slide 3 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Introduction !3

Slide 4

Slide 4 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is ࣸਅݕࡧ • ࣸਅݕࡧͱ͸ɺ͍ΘΏΔը૾ݕࡧػೳ • ΞϓϦ͔ΒࣸਅΛݩʹ঎඼Λݕࡧ͢Δ • ঎඼໊Λ஌Βͳͯ͘΋ը૾͔Β঎඼Λݕࡧ Ͱ͖Δ !4 ಈըϦϯΫ: https://youtu.be/kTni8EvOCgI

Slide 5

Slide 5 text

© 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

Slide 6

Slide 6 text

© 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

Slide 7

Slide 7 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Custom Resource Definition • Custom Resource DefinitionʢҎԼCRDʣͱ ͸ಠࣗʹϦιʔεΛఆٛͰ͖Δk8sͷػೳ • CRDɾϦιʔεͱɺΧελϜɾίϯτϩʔ ϥͰߏ੒͞ΕΔ • ΧελϜɾίϯτϩʔϥ͕CRDɾϦιʔε ͷϥΠϑαΠΫϧ/ঢ়ଶʹԠͯ͡Ϋϥελͷ ঢ়ଶΛίϯτϩʔϧ͢Δ !7

Slide 8

Slide 8 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ML Platform Lykeion ࣸਅݕࡧ͸Lykeionͱݺ͹ΕΔ಺੡ͷML Platform্ ʹߏங͞Ε͓ͯΓɺԼهͷػೳ͸Platformଆͷػೳ Λ࢖༻͍ͯ͠Δ !8 • Training/Serving CRD & ΧελϜίϯτϩʔϥ • ίϯςφϕʔεɾύΠϓϥΠϯ • Training/Serving ίϯςφΠϝʔδɾϏϧμʔ • ϞσϧɾϨϙδτϦ

Slide 9

Slide 9 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Architecture !9

Slide 10

Slide 10 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Architecture֓ཁਤ !10 S3 EKS

Slide 11

Slide 11 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1.TrainingɾϦιʔεͷ࡞੒ !11 S3 EKS

Slide 12

Slide 12 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. TrainingɾϦιʔεͷ࡞੒ • Training custom resourceΛCronJob͕࡞੒ • ΧελϜɾίϯτϩʔϥ͕CRDɾϦιʔε Ͱઃఆ͞ΕͨίϯςφϕʔεɾύΠϓϥΠ ϯΛ࣮ߦ • ࣮ߦ͢Δόον୯Ґͱͯ͠͸Hourly, Daily, Monthly͕ଘࡏ !12

Slide 13

Slide 13 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ίϯςφϕʔεɾύΠϓϥΠϯ • ֤޻ఔΛݸผͷίϯςφɾΠϝʔδͰ࣮ߦ • ϥΠϒϥϦͷґଘؔ܎ͳͲ؀ڥφΠʔϒͳMLύΠϓϥΠϯͷ໰୊Λղܾ • ύΠϓϥΠϯDAG͸YAMLͰهड़ • ֤޻ఔͷೖग़ྗ͸Persistent VolumeʢҎԼPVʣΛհ͢ !13

Slide 14

Slide 14 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Batch Execution as Custom Resource • શͯͷόον࣮ߦ৘ใ͕CRDɾϦιʔεͱͯ͠ k8s্ʹ࢒Δ • ಉ͡ॲཧΛ࠶࣮ߦग़དྷΔͨΊɺόονͷ࠶࣮ߦ Λ൐͏ো֐෮چ࡞ۀ͕༰қ !14

Slide 15

Slide 15 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2.ը૾ͷμ΢ϯϩʔυ !15 S3 EKS

Slide 16

Slide 16 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ը૾ͷμ΢ϯϩʔυ • Amazon S3্ʹଘࡏ͢ΔϝϧΧϦɾΠϝʔδετΞ͔Β঎඼ը૾Λμ΢ ϯϩʔυ • ύΠϓϥΠϯ্΋ͬͱ΋͕͔͔࣌ؒΔ޻ఔʢը૾਺͕๲େͳͨΊ) • ͦͷͨΊPVʹҰఆظؒΩϟογϡ͢ΔࣄʹΑͬͯ࠶ΠϯσοΫε͕ ඞཁͳ࣌ʹ͸ૉૣ͘ύΠϓϥΠϯΛճͤΔΑ͏ʹ͍ͯ͠Δ • PVͷ࣮ମ͸ Amazon EBS !16

Slide 17

Slide 17 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3.ΞηοτͷΞοϓϩʔυ !17 S3 EKS

Slide 18

Slide 18 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ΞηοτͷΞοϓϩʔυ • ύΠϓϥΠϯͷ੒Ռ෺Ͱ͋Δಛ௃ϕΫτϧͱANN IndexΛϞσϧɾϨϙδτϦʹอଘ • શͯͷ੒Ռ෺͸όʔδϣϯ؅ཧ͞Εͨঢ়ଶͰอଘ͞ΕΔ • ϞσϧɾϨϙδτϦ͸GCS্ʹߏங !18

Slide 19

Slide 19 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4.ServingΠϝʔδͷϏϧυ !19 S3 EKS

Slide 20

Slide 20 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ServingΠϝʔδͷϏϧυ 1. ϞσϧɾϨϙδτϦΛImage Builderͱݺ͹ΕΔdaemon͕؂ࢹ 2. ৽͍͠Serving͢΂͖Ϧιʔε͕௥Ճ͞ΕΔͱࣗಈͰServingίϯςφɾΠϝʔδΛϏϧυ • ίϯςφɾΠϝʔδ͸શͯͷANN Index౳ͷαʔϏϯάʹඞཁͳϦιʔεΛશؚͯΜͰ͍Δ 3. Ϗϧυ͞ΕͨίϯςφɾΠϝʔδΛίϯςφɾϨδετϦʹϓογϡ !20

Slide 21

Slide 21 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5.ServingɾϦιʔεͷ࡞੒ !21 S3 EKS

Slide 22

Slide 22 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ServingɾϦιʔεͷ࡞੒ • Image Builder͸ίϯςφɾΠϝʔδΛϏ ϧυͨ͋͠ͱɺServingΧελϜɾϦιʔ εΛ࡞੒ • ServingΧελϜɾίϯτϩʔϥ͸CRDɾ ϦιʔεͷઃఆΛݩʹඞཁͳ DeploymentɺService౳Λ࡞੒ • ຊγεςϜͰ͸ߏங͞ΕͨANN IndexΛ ݸผͷIndexαʔϏεͱͯ͠σϓϩΠ !22

Slide 23

Slide 23 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6.αʔϏεɾσΟεΧόϦ !23 S3 EKS

Slide 24

Slide 24 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. αʔϏεɾσΟεΧόϦ • Ϋϥελ্ʹଘࡏ͢ΔIndexαʔϏεΛ k8sΛհͯࣗ͠ಈతʹऔಘ͢Δ • ͳΔ΂͘େ͖ͳཻ౓ͷIndexΛ࢖༻͢ΔΑ ͏ɺҟͳΔظؒɾཻ౓ͷIndexαʔϏε (Hourly, Daily, Monthly) Λࣗಈతʹ૊Έ߹ ΘͤΔ • REST <-> IndexαʔϏεؒͷϓϩτίϧ ͸gRPCΛ࢖༻ !24

Slide 25

Slide 25 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. ֓ཁਤͷৼΓฦΓ !25 S3 EKS

Slide 26

Slide 26 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Conclusion !26

Slide 27

Slide 27 text

© 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

Slide 28

Slide 28 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKSʹ͍ͭͯ • k8sͱ͍͑͹GCPͱ͍͏Πϝʔδ͕͋Δ͕(։ൃݩ͔ͩΒ౰વ)ɺEKS΋͜ͳΕ͖ͯͯ҆ఆͨ͠ӡ ༻͕ग़དྷΔΑ͏ʹͳͬͨɻ͔͠͠Pros/Cons͸౰વଘࡏ͢Δɻ • Pros • ૉͷk8sʹۙ͘ɺͦ͏͍ͬͨҙຯͰ͸ॊೈͳߏ੒Λ૊Έ΍͍͢ • Cons • ଞࣾͷϚωʔδυk8sαʔϏεʹൺ΂ɺk8sʹ͍ͭͯඞཁͳࣄલ஌͕ࣝଟ͍ • ͔͠͠࢖͍উखͷྑ͍AWSͷS3΍RDS౳ͷଞαʔϏεΛɺk8sͱڞʹ࢖͍͍ͨϢʔβ͕᪳᪯͢ Δཧ༝͸΋͸΍ͳ͍ !28

Slide 29

Slide 29 text

© 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

Slide 30

Slide 30 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you all for coming today !30