Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pythonとクラウドと野球の推し活. / Baseball Data Platform for Python and Google Cloud

Pythonとクラウドと野球の推し活. / Baseball Data Platform for Python and Google Cloud

メジャーリーグのビッグデータ「Baseball Savant」をGoogle CloudおよびPythonライブラリを使ったデータ分析基盤として構築・可視化する事例の紹介となります.

【参考】

以下のプレゼンテーションの更新版となります.

Developers Summit 2023 10-C-6 「推しは推せる時に推せ」という俺のDXを実現するためのサーバレスなデータ基盤開発と運用

Shinichi Nakagawa

July 13, 2023
Tweet

More Decks by Shinichi Nakagawa

Other Decks in Technology

Transcript

  1. PythonͱΫϥ΢υͱ

    ໺ٿͷਪ͠׆.
    εϙʔπΞφϦςΟΫεΛ͍͍ײ͡ʹ΍ΔͨΊͷ

    ϓϥοτϑΥʔϜ࡞Γͱӡ༻, ͦͯ͠ਪ͠׆.
    Shinichi Nakagawa@shinyorke 2023/07/13 Start Python Club #95

    View full-size slide

  2. Who am I ?


    ʢ͓લ୭Α?ʣ
    • Shinichi Nakagawa@shinyorke


    • ΞΫηϯνϡΞגࣜձࣾ

    ςΫϊϩδʔίϯαϧςΟϯάຊ෦

    Ϛωʔδϟʔ


    • ຊۀ͸Ϋϥ΢υɾΠϯϑϥѻ͏νʔϜͰ৭ʑ΍ͬͯΔਓ


    • ࢓ࣄ΋झຯ΋ϑϧαΠΫϧͳΤϯδχΞ


    • ϓϩ໺ٿ͸೔ϋϜ, MLB͸ΞεϨνοΫεਪ͠


    • ʮLean Baseballʯͱ͍͏ݸਓϒϩάͰ

    ʮٕज़ʯʮ໺ٿʯʮΩϟϦΞʯʹ͍ͭͯ৭ʑॻ͍ͯ·͢.

    https://shinyorke.hatenablog.com/

    View full-size slide

  3. ॏཁͳεϥΠυ͸͜ͷ഑৭Ͱ͢


    ※10ຕ΋ͳ͍Ͱ͢, ࠷ѱ͜ͷ৭ͷεϥΠυ͚ͩ௥͍ͬͯͩ͘͞.

    View full-size slide

  4. ࠓ໷ͷςʔϚʮࢲͷਪ͠׆ʯ
    • Pythonͱ͸΋͏10೥Ҏ্ͷ͓෇͖߹͍Ͱ͢, ΋͸΍૬๮.

    ͱݴ͍ͭͭ, ࠷ۙ͸Go΍TypeScriptͱ΋஥ྑ͍ͯ͘͠·͢.


    • Ϋϥ΢υαʔϏε, ಛʹGoogle Cloud͸ެࢲڞ͓ੈ࿩ʹͳͬͯ·͢.

    ͳ͓ݱ࣮ͷ࢓ࣄ΍झຯͰ͸AWS΋࢖͍·͢ʢͰ΋Google͕େ൒ʣ.


    • ਎ମೳྗ͕ૉ੖Β͍͠໺ٿબख͕޷͖Ͱ͢.

    ೔ຊͩͱສ೾தਖ਼ʢ೔ຊϋϜʣ, ϝδϟʔ͸΋ͪΖΜ͜ͷํ…

    View full-size slide

  5. ʢݱ࣌఺ͰʣੈքҰͷ໺ٿબखʮΦΦλχαϯͷ2023೥ʯͷਪ͠ϙΠϯτΛτίτϯޠΔ.


    ೔ຊ࣌ؒ2023/7/11࣌఺ͷσʔλʢMLBલ൒ઓऴྃʣ࣌఺ͷσʔλΛݩʹղઆ͠·͢.

    ※σʔλࢀরݩʢMLBެࣜσʔλʣ: https://baseballsavant.mlb.com/statcast_search

    View full-size slide

  6. ΦΦλχαϯ͸Τά͍͙Β͍ͷύϫʔʢଧٿ଎౓ʣͱ֯౓Ͱ


    ϗʔϜϥϯΛྔ࢈͍ͯ͠Δ.

    View full-size slide

  7. ΦΦλχαϯ͸6݄͝ΖಥવόοςΟϯά͕͍͍ײ͡ʹͳΓଧ๮രൃ.


    ͦΓΌ͋6݄MVP΋Θ͔Δؾ͕͢Δʢͳ͓7݄಄ʹͪΐͬͱ࣪ͬͨ໛༷ʣ.

    View full-size slide

  8. ΦΦλχαϯ͸޿֯ʹΊͬͪΌ଎͍ଧٿ͕ΊͬͪΌඈͿʢޠኮྗʣ.

    View full-size slide

  9. ౤खΦΦλχαϯ͸?ࠓ೥΋εϥΠμʔʢਖ਼֬ʹ͸Sweeperʣ͓Խ͚ʹ.

    ͪΐͬͱඈᠳؾຯͳͷͱٿ଎Լ͕ͬͯΔͷ͕ෆ҆…

    View full-size slide

  10. ͪͳΈʹڈ೥ͷ౤खΦΦλχαϯʢ2022γʔζϯऴྃ࣌఺ʣ

    View full-size slide

  11. ϫΠʮ⽁σʔλج൫ཉ͘͠ͳ͖ͬͯͨϯΰʯ

    #ԶͷDXϓϩδΣΫτര஀


    ݩσʔλʢhttps://baseballsavant.mlb.com/ ʣͷෳࡶɾ೉ղ͕݁͞ߏΩπ͍.


    ͱ͍͏͜ͱͰఆظతʹσʔλΛDWHʹ์ΓࠐΉ&ՄࢹԽ͢Δج൫Λ࡞Ζ͏ʂ

    ͱͳͬͨͷ͕͜ͷϓϩδΣΫτͷΩοΧέ.

    View full-size slide

  12. اըɾઃܭɾ࣮૷ͦͯ͠ӡ༻…൒೥͔͚ۙͯ͘΍Γ͖ͬͨΓ·ͨ͠💪


    ※ࠓ΋伱Λݟ͚ͭͯվળɾ৽ػೳ։ൃத.

    View full-size slide

  13. ΞϓϦͱσʔλج൫ͷΞʔΩςΫνϟ

    View full-size slide

  14. ΞʔΩςΫνϟͱαʔϏεબͼͷಛ௃
    • ʮϑϧϚωʔδυ͔ͭαʔόϨεʯͳΫϥ΢υʹ߆Δ


    • ͓ࡒ෍ʹ༏͍͠ߏ੒ͱ࢖͍ํʹప͢Δ

    View full-size slide

  15. ʮϑϧϚωʔδυ͔ͭαʔόϨεʯͳΫϥ΢υ
    • ʮϑϧϚωʔδυ͔ͭαʔόϨεͳΫϥ΢υαʔϏεʯͷಛ௃


    • ͬ͘͟Γݴ͑͹ʮΞϓϦΛࡌͤͨΒͻͱ·ͣಈ͘ʯαʔϏεͷ͜ͱ.


    • ن໿ʹԊͬͯ։ൃͨ͠ίʔυ΋͘͠͸ContainerԽͨ͠؀ڥΛσϓϩΠͨ͠Βಈ͘.


    • ʮϑϧϚωʔδυ͔ͭαʔόϨεʯ͸ʮख͕͔͔ؒΒͳ͍ʯ


    • ΄΅ϝϯςφϯεϑϦʔ.ϛυϧ΢ΣΞͷอकɾӡ༻͔Β։์͞ΕΔ.


    • ҰਓͰ࢖͏࣌͸αʔόʔΛݮΒ͠, େਓ਺ͷ࣌͸૿΍͢౳ॊೈͳରԠָ͕.


    • ϦΫΤετ͋ͨΓͷॲཧ࣌ؒ, ࢖͑ΔϦιʔεྔͷ੍ݶɾϥϯλΠϜVersionͷ੍ݶ, etc…

    ߟྀ͢΂͖ཹҙ఺ɾܽ఺΋͋ΔͷͰ࢖͏࣌͸࢓༷ΛνΣοΫ&ͪΌΜͱςετ͠·͠ΐ͏.

    View full-size slide

  16. ʲਤʳGoogle Cloudͷ੹೚ڞ༗ϞσϧʢComputeܥαʔϏεʣ

    View full-size slide

  17. Cloud Run, GAE, Firebase, Cloud Functions


    Ҏ্͕GoogleܥͷαʔόϨεͳαʔϏε.

    View full-size slide

  18. ʁʁʁʮݸਓͰΫϥ΢υαʔϏεΛ͕ͬͭΓ࢖͏ͱ͓͕ۚ৺഑ʯ


    ͬͯࢥ͏͡Όͳ͍Ͱ͔͢, Ϋϥ΢υͱαʔόϨεͰ͍͍ײ͡ʹग़དྷ·͢.

    View full-size slide

  19. αʔόϨεͳΫϥ΢υ͸͓ࡒ෍ʹ༏͍͠
    • ʮ࢖͏ͱ্ཱ͖͚͕ͩͪΕ͹͍͍ʯͷͰΞϓϦέʔγϣϯج൫͸αʔόϨεʹશৼΓ


    • WebΞϓϦέʔγϣϯ΋όονॲཧ΋ίʔϧυελϯόΠʢΞΫηεͨ͠Βىಈʣ


    • ʮಈ͍͍ͯͳ͍࣌΋͓͕͔͔ۚΔʯͷ͸DWHͱετϨʔδͷΈʢͦΕ΋͘͝গֹʣ


    • ྉ͓ۚΑͼແྉ࿮ͷϧʔϧΛͪΌΜͱಡΜͰཧղͯ͠ਖ਼͘͠࢖͏


    • ྉۚମܥͱແྉ࿮͸ͪΌΜͱެࣜυΩϡϝϯτΛಡΉ.


    • ྫ͑͹Google Cloud Storage͸ద੾ͳετϨʔδλΠϓͷબ୒͓Αͼ,

    ௕ظอ؅ʢϑΝΠϧมߋͤͣ௕͘อଘʣͷར༻Ͱอ؅ίετ͕Լ͕ͬͨΓ͢Δ.

    View full-size slide

  20. Ұϲ݄Ͱ$3ະຬ, ίʔώʔ3.34ഋ෼ఔ౓ͰࡁΈ·ͨ͠🐯

    ※σʔλج൫ϓϩδΣΫτͷ࣮ίετΑΓࢉग़ʢίʔώʔ୅͸ίϯϏχίʔώʔج४ʣ, υϝΠϯऔಘྉ౳֎෦ίετΛআ͘

    View full-size slide

  21. ΞʔΩςΫνϟղઆͷ·ͱΊ
    • ʮϑϧϚωʔδυ͔ͭαʔόϨεʯͳΫϥ΢υαʔϏε͸ָͰ͋Δ.


    • อकɾӡ༻࡞ۀ͔Βͷղ์, ࢖ͬͯͳ͍࣌͸ίʔϧυελϯόΠ.


    • αʔόϨεͳΒͰ͸ͷ੍໿ࣄ߲ʹ஫ҙʢॲཧ࣌ؒɾϦιʔε౳ʣ.


    • ͓ࡒ෍ʹ༏͍͠࢖͍ํ͕Ͱ͖Δ.


    • αʔόϨε͸ʮ࢖͚͓͕͔͔ͬͨ࣌ͩۚΔʯߏ੒ͳͷͰ͓ࡒ෍ʹ༏͍͠.


    • ετϨʔδ΍DB͸ແྉ࿮ɾσʔλ௕ظอ؅ϧʔϧΛ׆༻.

    View full-size slide

  22. σʔλ෼ੳμογϡϘʔυΛ


    αʔόϨε͔ͭϞμϯͳPythonͰ


    ͍͍ײ͡ʹ࡞Δ

    View full-size slide

  23. ͪ͜Β͸શ෦PythonͰ։ൃ͍ͯ͠·͢.


    ։ൃதʹJavaScript/HTML͸Ұߦ΋ॻ͍͍ͯ·ͤΜ.

    View full-size slide

  24. PythonͳLow-codeͰ


    ͍͍ײ͡ʹ࡞Δ.
    • PlotlyΛLow-codeπʔϧͱͯ͠

    ࢖͑ΔΑ͏ʹͨ͠ʮDashʯΛར༻.


    • ϓϩτλΠϓͰ͸෼ੳɾՄࢹԽʹ

    Jupyter LabͱPlotlyΛ࢖͓ͬͯΓ,

    ͜ΕΛͦͷ··Ҡ২Ͱ͖ΔखஈͰ

    ࣮૷͔ͨͬͨ͠.


    • https://dash.plotly.com/

    View full-size slide

  25. ࠓճ࡞ͬͨίʔυ

    ʢҰ෦ൈਮʣ
    • Python͚ͩͰॻ͚Δͷ͸ΊͬͪΌศརͩͬͨ.


    • HTMLʹ໛ͨ͠ίϯϙʔωϯτΛPythonͰ

    ΰϦͬͱॻ͍ͯ࡞੒͢Δͱ͍͍ײ͡ʹಈ͘.


    • ΠϕϯτۦಈͰͷॻ͖׵͑͸Callbackͳ

    σίϨʔλʔͰ࣮૷.


    • ReactͬΆ͋ͬͯ͞ݸਓతʹ͸େ޷͖͕ͩ,

    ςετ͕௒ॻ͖ʹ͍͘ҹ৅…

    ※গͳ͘ͱ΋UI ίϯϙʔωϯτʹؔͯ͠

    View full-size slide

  26. Dash࣮ͬͯ༻Ͱ࢖͑·͔͢?
    • ݁࿦ʮΧελϚΠζʢࣗ࡞ʣ͕ඞཁͳσʔλՄࢹԽΞϓϦͳΒ˕ʯ


    • ໺ٿΞϓϦ͸ΧελϚΠζͰ࡞Δάϥϑ͕͋ͬͨͷͰॿ͔ͬͨ


    • ٿ৔ͷμΠϠϞϯυʢ֎໺ؚΉʣ


    • ετϥΠΫκʔϯදࣔ


    • ΧελϚΠζ͕ແ͚Ε͹࢖Θͳ͍͍ͯ͘ʢΉ͠Ζ։ൃ͢Δͳʣ

    Looker΍Tableau, RedashͰࡁΉͳΒͦΕ͕࠷΋޾ͤ

    View full-size slide

  27. μογϡϘʔυΞϓϦͷϢʔεέʔε
    • σϞΞϓϦέʔγϣϯʢWebΞϓϦέʔγϣϯʣ͸Cloud Run্Ͱϗετ. ࣮૷͸PythonʢDashʣ.
    • όοΫΤϯυͷೝূ͸API GatewayΛ༻͍ͯߦ͏, API KeyํࣜͷೝূʢSaaSతʹ࢖͏ͨΊ׶͑ͯ͜͏΍͍ͬͯΔʣ.
    • BigQueryʹ֨ೲ͞ΕͨσʔλΛݕࡧ͢ΔόοΫΤϯυʢRESTful APIʣ͸GoʢGinʣͰ࣮૷, Cloud RunͰϗετ.
    • RESTful APIͷResponse͸৚݅ผʹCloud StorageʹΩϟογϡʢಉ͡ΫΤϦΛԿ౓΋࣮ߦͤ͞ͳ͍ʣ.

    View full-size slide

  28. ʮΫϥ΢υαʔϏεબͼʯͷ೉͠͞Λղܾ͢Δ
    • αʔόϨεͳΫϥ΢υαʔϏεͷબͼํ - Google Cloudฤ


    • App EngineͱFirebaseͱCloud Run, Կ͕ҧ͏ͷ?


    • Cloud Functions͍ͬͯͭ࢖͏ͷ?ͦ΋ͦ΋Կऀ??


    • Python࢖͍తʹ͸Ͳ͏ͨ͠Βྑ͍͔?


    • ϓϩάϥϛϯάݴޠͷબͼํ

    View full-size slide

  29. αʔόϨεͳΞϓϦέʔγϣϯಈ࡞؀ڥ
    ओͳαʔϏεʢ(PPHMFʣ 63- ֓ཁ
    ("& (PPHMF"QQ&OHJOF
    IUUQTDMPVEHPPHMFDPNBQQFOHJOF
    αʔόϨε͔ͭϑϧϚωʔδυͷ
    ݩ૆Έ͍ͨͳଘࡏ ࢖͍΍͍͢
    'JSFCBTF IUUQT
    fi
    SFCBTFHPPHMFDPN
    ΞϓϦͷΈͳΒͣ %#ɾ௨஌ͱ
    ΍ΕΔ͜ͱ͕ଟ͍͔ͭศར
    جຊ+BWB4DSJQU͕ͩҰ෦1ZUIPOར༻Մ
    $MPVE3VO IUUQTDMPVEHPPHMFDPNSVO
    ޷͖ͳݴޠɾ؀ڥͰ࡞ΔͳΒ͜Ε

    ͻͱ·ͣ$POUBJOFS࡞ͬͯಈ͔ͤΔ
    $MPVE'VODUJPOT IUUQTDMPVEHPPHMFDPNGVODUJPOT
    ͪΐͬͱͨؔ͠਺Λಈ͔͢ͳΒ
    4MBDL#PU౳ͷখ͞ΊͳΞϓϦͳͲ

    View full-size slide

  30. Cloud RunΛબ୒ͨ͠ʢPythonicͳʣཧ༝
    • μογϡϘʔυΞϓϦͷґଘϥΠϒϥϦతʹApp EngineͰಈ͔͘ո͔ͬͨͨ͠Ί


    • PandasʹDashʢPlotlyʣͱσʔλܥͷϥΠϒϥϦ͕੝Γͩ͘͞ΜͷWebΞϓϦ


    • ͜ͷ࣌఺ͰͪΌΜͱͨ͠ContainerܥͰಈ͔͞ͳ͍ͱବ໨ͩͳͬͯ൑அˠͦͷ௨Γͩͬͨ


    • બ୒͢Δ·Ͱͷࢥߟͱͯ͠͸…


    1.ґଘϥΠϒϥϦͳͲͷ౎߹Ͱ΄΅PythonʢҰ෦GoʣͰͷ։ൃ -> Firebase͕ީิ͔Βফ͑Δ


    2.Cloud FunctionsͰಈ͔͢ʹ͸ඍົͳ࢓༷ͱͳͬͨͨΊબ୒ࢶͱͯ͠ফڈ


    3.App EngineʢStandardʣ͸Container͡Όͳ͍ -> Cloud Runʹܾఆ

    ※ContainerͰಈ͔ͤΔApp EngineʢFlexibleʣΛ࢖Θͳ͔ͬͨཧ༝͸…ͦΜͳબ୒ࢶΛೖΕͨ͘ͳ͔͔ͬͨΒͰ͢ʢ௚ٿʣ

    View full-size slide

  31. σʔλऩूόονॲཧʢج൫ʣΛ


    ͍͍ײ͡ʹ࡞Δ

    View full-size slide

  32. σʔλऩूج൫ͷϢʔεέʔε
    ᶃ Cron Scheduler͕ຖ೔ܾ·ͬͨ࣌ؒʹᶄͷTriggerΛݺͼग़͢
    ᶄ Trigger͸σʔλऩूαʔϏεʢCrawlerʣʹඞཁͳύϥϝʔλʔΛ࡞ͬͯ౉͢
    ᶅ Crawler͸Trigger͔ΒͷύϥϝʔλʔΛ࢖ͬͯσʔλݩαΠτ͔ΒCSVΛμ΢ϯϩʔυ, Datalakeʹอଘ
    ᶆ Cron SchedulerͷτϦΨʔΛݩʹImporter͸CSVσʔλΛDWHʢBigQueryʣʹ౤ೖ

    View full-size slide

  33. Ϋϥ΢υωΠςΟϒͳʮόονॲཧʯ
    • Ϋϥ΢υͰ͋Γ͕ͪͳόονॲཧํࣜ


    • Cloud Functions + Pub/SubΛ࢖ͬͯϐλΰϥεΠονతʹ࡞Δ

    View full-size slide

  34. Ϋϥ΢υͰ͋Γ͕ͪͳόονॲཧํࣜ
    ݴޠ ڧΈͱ୹ॴ Ϋϥ΢υωΠςΟϒͳํ๏ͱͯ͠
    ʲ΍Γํ࣍ୈʳࣗલͰαʔόʔ࡞Δ
    ʲڧΈʳ
    DSPOUBCͱԿ͔͠ΒͷݴޠͰ࡞ΕΔ
    ʲ୹ॴʳ
    ϝϯςɾӡ༻͕໘౗ɾଐਓԽ͢Δةݥ
    "84&$4'BSHBUFͳΒ͍͍ײ͡
    7.ܥͩͬͨΓϚγϯ͕ඞཁͳΒ
    Ϋϥ΢υ࢖͏ҙຯ͕ݮΔ͔΋
    ʲΦεεϝʳ"QBDIF"JS
    fl
    PXΛ
    Ϋϥ΢υαʔϏεͰ࢖͏
    ʲڧΈʳ
    "JS
    fl
    PXͷ࢓૊Έʹ৐ͬͯ؂ࢹɾӡ༻Մ
    ʲ୹ॴʳ
    "JS
    fl
    PXͷֶशίετɾऔΓѻ͍
    ۀ຿Ͱ࢖͏ ͋Δఔ౓ͷن໛͕͋Δ
    όονॲཧͰ͸ྑ͍ײ͡ͷํ๏
    (PPHMF$MPVE "84྆ํ͍͚Δ
    ʲཁ͕݅߹͑͹Φεεϝʳ
    1VC4VCʹΑΔΠϕϯτۦಈ
    ʲڧΈʳ
    ϚΠΫϩαʔϏεతʹ࡞ΕΔ
    ʲ୹ॴʳ
    ઃܭɾ࣮૷Λཧղɾ׳ΕΔֶशίετ
    Ϋϥ΢υαʔϏεͳΒͰ͸ͷํ๏
    ઃܭɾ࣮૷ͷֶशίετ͸͔͔Δ͕
    ׳Εͯ͠·͑͹݁ߏؾܰʹ࡞ΕΔ

    View full-size slide

  35. ؾܰͰ͍҆ʮPub/SubΠϕϯτۦಈʯΛ࠾༻
    ݴޠ ڧΈͱ୹ॴ Ϋϥ΢υωΠςΟϒͳํ๏ͱͯ͠
    ʲ΍Γํ࣍ୈʳࣗલͰαʔόʔ࡞Δ
    ʲڧΈʳ
    DSPOUBCͱԿ͔͠ΒͷݴޠͰ࡞ΕΔ
    ʲ୹ॴʳ
    ϝϯςɾӡ༻͕໘౗ɾଐਓԽ͢Δةݥ
    "84&$4'BSHBUFͳΒ͍͍ײ͡
    7.ܥͩͬͨΓϚγϯ͕ඞཁͳΒ
    Ϋϥ΢υ࢖͏ҙຯ͕ݮΔ͔΋
    ʲΦεεϝʳ"QBDIF"JS
    fl
    PXΛ
    Ϋϥ΢υαʔϏεͰ࢖͏
    ʲڧΈʳ
    "JS
    fl
    PXͷ࢓૊Έʹ৐ͬͯ؂ࢹɾӡ༻Մ
    ʲ୹ॴʳ
    "JS
    fl
    PXͷֶशίετɾऔΓѻ͍
    ۀ຿Ͱ࢖͏ ͋Δఔ౓ͷن໛͕͋Δ
    όονॲཧͰ͸ྑ͍ײ͡ͷํ๏
    (PPHMF$MPVE "84྆ํ͍͚Δ
    ʲ࠾༻ʳ
    1VC4VCʹΑΔΠϕϯτۦಈ
    ʲڧΈʳ
    ϚΠΫϩαʔϏεతʹ࡞ΕΔ
    ʲ୹ॴʳ
    ઃܭɾ࣮૷Λཧղɾ׳ΕΔֶशίετ
    Ϋϥ΢υαʔϏεͳΒͰ͸ͷํ๏
    ઃܭɾ࣮૷ͷֶशίετ͸͔͔Δ͕
    ׳Εͯ͠·͑͹݁ߏؾܰʹ࡞ΕΔ

    View full-size slide

  36. Pub/Sub + Cloud FunctionsͳϐλΰϥεΠον
    • crontab໾ͷΫϥ΢υαʔϏεʢCloud Schedulerʣ͔ΒPub/Subܦ༝Ͱୟ͘ࣄͰόονॲཧΛ࣮ݱ
    • ֤Cloud Functionsؔ਺ʢᶄ, ᶅ, ᶆʣ͸Pub/Sub͔ΒͷϝοηʔδΛड͚ͯಈ͘࢓૊ΈͰ࡞Δ
    • ͜ΕΒͷํ๏͸Google Cloudެࣜʹ΋Quick Start͕͋ΔͷͰਅࣅͨ͠Β࣮ݱՄೳʢਅࣅ͠·ͨ͠ʣ
    • ͪͳΈʹ؀ڥ͸Cloud RunͳͲ, ଞͷαʔϏε΋࢖͑·͢&ݴޠ͸Python͡Όͳͯ͘΋ߏ͍·ͤΜ

    View full-size slide

  37. Ҏ্, ٕज़ύʔτͷ࿩͸͓͠·͍.

    View full-size slide

  38. ͦΖͦΖ໺ٿͷ࿩ʹ໭Γ·͢.

    View full-size slide

  39. ࠓ೔֮͑ͯؼͬͯ΄͍͠ʮMLBͷ͓Խ͚ʯୡ
    • ϩφϧυɾΞΫʔχϟJr.ʢΞτϥϯλɾϒϨʔϒε/૸߈कͷ͓Խ͚ʣ


    • ౻࿘৾ଠ࿠ʢΦʔΫϥϯυɾΞεϨνοΫε/ૉࡐܕͷ͓Խ͚ʣ

    View full-size slide

  40. ϩφϧυɾΞΫʔχϟͬͯͲΜͳબखʁ
    • ΞτϥϯλɾϒϨʔϒε͍΍ϝδϟʔϦʔάͷະདྷΛഎෛ͏

    ௒ઈΞεϦʔτܕ֎໺खͰϙδγϣϯ͸ओʹϥΠτ


    • લ൒ઓऴྃ࣌఺ͷ੒੷ʢ89ࢼ߹ʣ: ଧ཰.331/ 21ຊྥଧ / 41౪ྥ

    ※લ൒ઓͰʮ20ຊྥଧ&40౪ྥʯ͸MLB্࢙ॳͷه࿥


    • લਓະ౸, 40ຊྥଧ&70౪ྥͱ͍͏Ғۀʢมଶͳه࿥ʣ͕ظ଴͞ΕΔ

    View full-size slide

  41. ΞΫʔχϟ͸ΦΦλχαϯͱҟͳΓ௿ͯ͘ڧ͍ଧٿ͕ଟ͍.

    View full-size slide

  42. ΞΫʔχϟ΋ΊͬͪΌ޿֯ʹଧͬͯΔ, ΦΦλχαϯͱλΠϓҧ͏ͷʹ🤔

    ※2ਓ͸ຊྥଧͱೋྥଧͷ਺ʹ͕ࠩ͋Γ·͢ʢΞΫʔχϟ͸ೋྥଧଟ͍ʣ

    View full-size slide

  43. ΦΦλχαϯͱಉੈ୅Ͱࠓγʔζϯϝδϟʔʹ౉ͬͨਓ…


    ͱ͍͑͹ʂʁ

    View full-size slide

  44. ౻࿘৾ଠ࿠౤खͷલ൒ઓ.
    • ౰ॳ͸ઌൃʢ4ࢼ߹ʣ -> Ϙʔϧͷίϯτϩʔϧ͕ΞϨͰதܧ͗ʹ഑ஔస׵

    ※ͨͩͨ͠·ʹઌൃ༗Γʢ1-2Πχϯά౤͛Δઌൃ, ΦʔϓφʔͱݺͿʣ


    • ੒੷͕ඇৗʹߥΕ͍ͯΔʢલ൒ઓ5উ7ഊ ๷ޚ཰9.00ʣ͕࣮͸ঃʑʹվળ.


    • 4݄ʢ6ࢼ߹ʣ: 0উ4ഊʢ݄ؒʣ๷ޚ཰13.00


    • 5݄ʢ11ࢼ߹ʣ: 2উ1ഊʢ݄ؒʣ๷ޚ཰10.50


    • 6݄ʢ9ࢼ߹ʣ: 1উ2ഊʢ݄ؒʣ๷ޚ཰4.35


    • 7݄ʢ5ࢼ߹ʣ: 2উ0ഊʢ݄ؒʣ๷ޚ཰0.00←ࠓ͜͜


    • ঃʑʹྑ͘ͳͬͨͷͬͯԿ͕ى͖ͨͷ͔ؾʹͳΓ·ͤΜ͔?

    View full-size slide

  45. ʲ౴ʳ੒੷҆ఆ࢝͠Ί͙ͨΒ͍͔ΒSweeper͕૿͑ͨʢ&ٿ଎͕ӈݞ্͕Γʣ.

    ੒੷ͱͷؔ܎͸ṖͰ͕͢স, ͔֬Β͍͠มԽ͸ͦͷลͰͨ͠.

    View full-size slide

  46. ʲ࠶ܝʳࠓ໷ͷςʔϚʮࢲͷਪ͠׆ʯ
    • Pythonͱ͸΋͏10೥Ҏ্ͷ͓෇͖߹͍Ͱ͢, ΋͸΍૬๮.

    ※࠷ۙ͸Go΍TypeScriptͱ΋஥ྑ͍ͯ͘͠·͢.


    • Ϋϥ΢υαʔϏε, ಛʹGoogle Cloud͸ެࢲڞ͓ੈ࿩ʹͳͬͯ·͢.

    ※ݱ࣮ͷ࢓ࣄ΍ͪΐͬͱͨ͠झຯͰ͸AWS΋࢖͍·͢.


    • ਎ମೳྗ͕ૉ੖Β͍͠໺ٿબख͕޷͖Ͱ͢.

    ೔ຊͩͱສ೾தਖ਼ʢ೔ຊϋϜʣ, ϝδϟʔ͸ΦΦλχαϯଞͨ͘͞Μ.

    View full-size slide

  47. ࠓ೔ͷ࿩Λཁ໿͢Δͱ…
    • ϑϧϚωʔδυ͔ͭαʔόϨεͳΫϥ΢υ͚ͩͰσʔλج൫͸࡞ΕΔ.

    ݸਓతʹ͸Google Cloudਪ͠Ͱ͢ʢ໪࿦, ଞͷΫϥ΢υͰ΋Ͱ͖·͢ʣ.


    • Կ͔΍ΔΜͩͬͨΒPythonͰ͍͍Μ͡Όͳ͍ΜͰ͔͢Ͷʢࡶʣ.

    ແ೉ʹԿͰ΋Ͱ͖·͢…͕৔߹ʹΑͬͯGoͱ͔TypeScript΋ྑ͖.


    • ਎ମೳྗ͓Խ͚͸໺ٿΛ΋ͬͱ໘ന͘͢Δʢਅإʣ.

    ΞΫʔχϟͷҒۀͱ, ౻࿘͞ΜͷࠓޙʢSweeperʹཔΔͷ͔ʣʹظ଴.

    View full-size slide

  48. ͓࢓ࣄʢۀ຿ʣͰࢀߟʹ͠Α͏ͱࢥͬͨํ΁
    • ࠓճ঺հͨ͠΍Γํɾߏ੒͸ઈରతͳճ౴ɾϕετϓϥΫςΟεͰ͸ͳ͍Ͱ͢.

    ྫ͑͹αʔόϨεɾΞʔΩςΫνϟʹ͢΂͖/͢΂͖͡Όͳ͍ঢ়گ͸࣮֬ʹଘࡏ͠·͢.


    • ͜ͷ࿩͸ࢲʢshinyorkeʣ͕΍Γ͍ͨࣄ, ͍͍ͱࢥͬͯΔࣄʢ&৮Γ͍ͨϞϊʣΛ

    ٧ΊࠐΜͰ࡞ͬͨ, ࣗ෼͕΍Γ͍ͨࣄͷूେ੒Ͱ, ͋͘·Ͱղͷग़͠ํͷҰͭͰ͢.


    • ྫ͑͹, αʔόϨεʹ߆Βͳ͍΍ΓํͩͱʮGKEΫϥελཱͯͯͦ͜Ͱಈ͔͢ʯͰऴΘΔ.

    ͜Ε΋ཱ೿ͳղ౴ͩͬͨΓ͠·͢, ϝϦσϝ࣍ୈͰʢK8sΛѻ͏ͷ͸ͦΕͳΓʹେมͰ͕͢ʣ.


    • Infrastructure as CodeͰ͖ͯͳ͍, ςετίʔυ଍Γͳ͍etc…࣮͸՝୊ࢁੵΈ.


    • ίϯςΩετͷཧղ͕த్൒୺ͳ··ਅࣅ͢Δͱരࢮ͠·͢, ਅࣅ͢ΔͳΒࣗݾ੹೚Ͱ.

    ※ߏ੒ɾࢹ఺తʹ͸৽نࣄۀ΍γϦʔζB͘Β͍ͷϕϯνϟʔͷγεςϜʹ͸Ԡ༻Մೳͳఔ౓ʹ͸࢖͑·͢.

    View full-size slide

  49. Python࢖͍ͷօ͞·΁.
    • Pythonʢ΋͘͠͸ΤϯδχΞϦϯάʣΛ޷͖ʹͳΓ,

    ҙࢤΛ࣋ͬͯԿ͔Λ΍Γ͖Δ, తͳʮҰ్ʹͳΕΔ໨ඪʯΛݟ͚ͭΔͱྑ͖.


    • ࢲ͸PythonͱΫϥ΢υ, ໺ٿ͕޷͖Ͱެࢲڞ৭ʑ΍͖ͬͯͨ݁Ռ,

    ٕज़΋ଞͷϞϊ΋ຏ͔Εͯ, ࣗ෼͕ཧ૝ͱ͢ΔΩϟϦΞΛาΜͰ͍·͢.


    • ΤϯδχΞϦϯάͳʮਪ͠׆ʯ͸ΤϯδχΞɾϏδωεύʔιϯͱͯ͠,

    ࣗ෼ͷਓੜͱΩϟϦΞΛ๛͔ʹ͢Δ΋ͷͩͱࢥͬͯ·͢ʂ΍͍ͬͯ͜͏ͥ🤛

    View full-size slide

  50. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠⽁


    @shinyorke

    View full-size slide