倧èŠæš¡ãªãµãŒãã¹ã§ã¯ãæ©æ¢°åŠç¿ã䜿çšããŠåé¡ã解決ããããšã¯ãäœæ¥ã®äžéšã®ã¿ãå®è¡ããããšãæå³ããŸãã MLã¢ãã«ã®åã蟌ã¿ã¯ããã»ã©ç°¡åã§ã¯ãªãããããã®åšãã«CI / CDããã»ã¹ãæ§ç¯ããããšã¯ããã«å°é£ã§ãã Yandexã«ã³ãã¡ã¬ã³ã¹ãDataïŒScienceïŒthe application programãã§ã YouDoã®ããŒã¿ãµã€ãšã³ã¹è²¬ä»»è
ã§ããAdam Eldarovã¯ãã¢ãã«ã®ã©ã€ããµã€ã¯ã«ã®ç®¡çãåãã¬ãŒãã³ã°ãšåãã¬ãŒãã³ã°ããã»ã¹ã®ã»ããã¢ãããã¹ã±ãŒã©ãã«ãªãã€ã¯ããµãŒãã¹ã®éçºãªã©ã«ã€ããŠè©±ããŸããã
-ã¯ããã«å§ããŸãããã ããŒã¿ãµã€ãšã³ãã£ã¹ããããŸãã圌ã¯Jupyter Notebookã«ããã€ãã®ã³ãŒããæžããŠãããæ©èœãšã³ãžãã¢ãªã³ã°ãçžäºæ€èšŒãã¢ãã«ã¢ãã«ã®ãã¬ãŒãã³ã°ãè¡ã£ãŠããŸãã é床ã¯åäžããŠããŸãã
ããããããæç¹ã§åœŒã¯ç解ããŠããŸããäŒç€Ÿã®ããžãã¹äŸ¡å€ãããããããã«ã圌ã¯ãœãªã¥ãŒã·ã§ã³ãçç£ã®ã©ããã§ãç¥è©±ã®çç£ã«çµã³ä»ããªããã°ãªããŸããã ã»ãšãã©ã®å Žåãæ¬çªç°å¢ã§èŠãã©ãããããã¯éä¿¡ã§ããŸããã ãããŠãåé¡ãçºçããŸããã©ãããããå
ã§ãã®ã³ãŒããç¹å®ã®ãµãŒãã¹ã«åºè·ããæ¹æ³ã§ãã ã»ãšãã©ã®å ŽåãAPIãæã€ãµãŒãã¹ãäœæããå¿
èŠããããŸãã ãŸãã¯ãPubSubããã¥ãŒãä»ããŠéä¿¡ããŸãã
æšå¥šäºé
ãäœæãããšããã¢ãã«ããã¬ãŒãã³ã°ããŠåãã¬ãŒãã³ã°ããå¿
èŠããããŸãã ãã®ããã»ã¹ãç£èŠããå¿
èŠããããŸãã ãã®å Žåãã³ãŒãèªäœãšã¢ãã«ã®äž¡æ¹ãåžžã«ãã¹ãã§ç¢ºèªããå¿
èŠããããŸãããã®ãããããæç¹ã§ã¢ãã«ãçãããã€ãŸå
ãäºæž¬ãå§ããããšã¯ãããŸããã ãŸããABãã¹ããéããŠå®éã®ãŠãŒã¶ãŒã§ç¢ºèªããå¿
èŠããããŸãã
ã©ã®ããã«ã³ãŒãã«ã¢ãããŒãããŸããïŒ GitLabããããŸãã ãã¹ãŠã®ã³ãŒãã¯ãç¹å®ã®ãã¡ã€ã³ã®åé¡ã解決ããå€ãã®å°ããªã©ã€ãã©ãªã«åå²ãããŠããŸãã åæã«ãããã¯å¥åã®GitLabãããžã§ã¯ããGitããŒãžã§ã³ç®¡çãããã³GitFlowåå²ã¢ãã«ã§ãã äºåãã¹ãããã¯ãªã©ã䜿çšããŠãçµ±èšãã¹ããã§ãã¯ãæºãããªãã³ãŒããã³ãããã§ããªãããã«ããŸãã ãããŠããã¹ãèªäœããŠããããã¹ãã ç§ãã¡ã¯ãããããã£ããŒã¹ã®ãã¹ãã¢ãããŒãã䜿çšããŸãã
éåžžããã¹ããèšè¿°ãããšãããã¹ãé¢æ°ãšãæã§äœæããåŒæ°ãããã€ãã®äŸãããã³ãã¹ãé¢æ°ãè¿ãå€ãæã£ãŠããããšãæå³ããŸãã ããã¯äžäŸ¿ã§ãã ã³ãŒãã¯èšããã§ããŠãååãšããŠå€ãã®äººã¯ãããæžãã®ãé¢åã§ãã ãã®çµæããã¹ãã«ãã£ãŠæããã«ãªã£ãã³ãŒãã®æããããŸãã ããããã£ããŒã¹ã®ãã¹ãã¯ããã¹ãŠã®åŒæ°ã«ç¹å®ã®ååžãããããšãæå³ããŸãã ãã§ãŒãžã³ã°ãè¡ãããããã®ååžãããã¹ãŠã®åŒæ°ããµã³ããªã³ã°ãããããã®åŒæ°ã䜿çšããŠãã¹ã察象ã®é¢æ°ãåŒã³åºããç¹å®ã®ããããã£ã«ã€ããŠãã®é¢æ°ã®çµæã確èªããŸãã ãã®çµæãã³ãŒããã¯ããã«å°ãªããªããåæã«å€ãã®ãã¹ãããããŸãã
GitFlowãšã¯äœã§ããïŒ ããã¯åå²ã¢ãã«ã§ããã2ã€ã®äž»èŠãªãã©ã³ããããããšãæå³ããŸã-éçºãšãã¹ã¿ãŒã補åã®æºåãã§ããŠããã³ãŒããããããã¹ãŠã®éçºã¯éçºãã©ã³ãã§å®è¡ããããã¹ãŠã®æ°æ©èœã¯æ©èœãã©ã³ãããååŸãããŸãã ã€ãŸããåæ©èœã¯æ°ããæ©èœãã©ã³ãã§ãããæ©èœãã©ã³ãã¯çåœã§ãªããã°ãªãããæ©èœãã°ã«ã§ãã«ããŒãããŸãã ãã®åŸããªãªãŒã¹ãäœæããdevããmasterã«å€æŽãã¹ããŒããã©ã€ãã©ãªãŸãã¯ãµãŒãã¹ã®ããŒãžã§ã³ã¿ã°ããã®äžã«é
眮ããŸãã
ç§ãã¡ã¯éçºãè¡ã£ãŠãããããã€ãã®æ©èœãèŠã€ããŠGitLabã«ããã·ã¥ããæ©èœãã©ã³ãããããŒãžã³ãžã®ããŒãžãªã¯ãšã¹ããäœæããŠããŸãã ããªã¬ãŒãåäœãããã¹ããå®è¡ããŸãããã¹ãŠãæ£åžžã§ããã°ãããªãŒãºã§ããŸãã ãããããããä¿æããŠããã®ã¯ç§ãã¡ã§ã¯ãªããããŒã ã®èª°ãã§ãã ã³ãŒããä¿®æ£ããããã«ãããã¹ä¿æ°ãå¢å ãããŸãã ãã®ã³ãŒãã»ã¯ã·ã§ã³ã¯æ¢ã«2人ã«ç¥ãããŠããŸãã ãã®çµæã誰ãããã¹ã«ã¶ã€ãã£ãå Žåã誰ãã¯ãã§ã«èªåãäœãããŠããããç¥ã£ãŠããŸãã
ã©ã€ãã©ãªã®ç¶ç¶çãªçµ±åã¯ãéåžžãå€æŽã®ãã¹ãã®ããã«èŠããŸãã ãŸãããªãªãŒã¹ãããšãããã±ãŒãžã®ãã©ã€ããŒãPyPIãµãŒããŒã«ãå
¬éãããŸãã
ããã«ããã€ãã©ã€ã³ã§åéã§ããŸãã ããã«ã¯ãLuigiã©ã€ãã©ãªã䜿çšããŸãã ã¿ã¹ã¯ãªã©ã®ãšã³ãã£ãã£ã§åäœããŸããã¿ã¹ã¯ã«ã¯åºåããããã¿ã¹ã¯ã®å®è¡äžã«äœæãããã¢ãŒãã£ãã¡ã¯ããä¿åãããŸãã å®è¡ããããžãã¹ããžãã¯ããã©ã¡ãŒã¿ãŒåããã¿ã¹ã¯ãšãã®åºåãèå¥ããã¿ã¹ã¯ãã©ã¡ãŒã¿ãŒããããŸãã ããã«ãã¿ã¹ã¯ã«ã¯åžžã«ä»ã®ã¿ã¹ã¯ãèšå®ããèŠä»¶ããããŸãã ããçš®ã®ã¿ã¹ã¯ãå®è¡ãããšããã®åºåããã§ãã¯ããããšã§ãã¹ãŠã®äŸåé¢ä¿ããã§ãã¯ãããŸãã åºåãååšããå ŽåãäŸåé¢ä¿ã¯éå§ãããŸããã äžéšã®ã¹ãã¬ãŒãžããã¢ãŒãã£ãã¡ã¯ããæ¬ èœããŠããå Žåãéå§ãããŸãã ããã«ããããã€ãã©ã€ã³ãæåå·¡åã°ã©ãã圢æãããŸãã
ãã¹ãŠã®ãã©ã¡ãŒã¿ãŒã¯ããžãã¹ããžãã¯ãèå¥ããŸãã ããããããšã§ã圌ãã¯ã¢ãŒãã£ãã¡ã¯ããç¹å®ããŸãã ããã¯åžžã«ãããçš®ã®ç²åºŠãæ床ããŸãã¯é±ãæ¥ãæéã3æéã®æ¥ä»ã§ãã ã¢ãã«ããã¬ãŒãã³ã°ãããšãLuigi taskaã«ã¯åžžã«ãã®ã¿ã¹ã¯ã®ãã€ããŒãã©ã¡ãŒã¿ãŒããããããããçæããã¢ãŒãã£ãã¡ã¯ãã«æŒãããã€ããŒãã©ã¡ãŒã¿ãŒãã¢ãŒãã£ãã¡ã¯ãã®ååã«åæ ãããŸãã ãããã£ãŠãåºæ¬çã«ãã¹ãŠã®äžéããŒã¿ã»ãããšæçµææç©ãããŒãžã§ã³ç®¡çãããããã¯äžæžããããããšã¯ãªããåžžã«ã¹ãã¬ãŒãžã«ã®ã¿æŽæ°ãããã¹ãã¬ãŒãžã¯äœããã®çš®é¡ã®ãã¯ããã¯ãã¢ãã«ãªã©ã®æçµææç©ãèŠãHDFSãšS3ãã©ã€ããŒããå®è¡ããŸãã ãããŠããã¹ãŠã®ãã€ãã©ã€ã³ã³ãŒãã¯ãé¢é£ãããªããžããªã®ãµãŒãã¹ãããžã§ã¯ãã«ãããŸãã
ãªããšãä¿®æ£ããå¿
èŠããããŸãã HashiCorpã¹ã¿ãã¯ã圹ã«ç«ã¡ãŸããTerraformã䜿çšããŠã³ãŒãã®åœ¢ã§ã€ã³ãã©ã¹ãã©ã¯ãã£ã宣èšããVaultã§ç§å¯ã管çããŸãããã¹ãŠã®ãã¹ã¯ãŒããããŒã¿ããŒã¹ãžã®å€èŠ³ããããŸãã Consulã¯ãæ§æã«äœ¿çšã§ããããŒå€ã¹ãã¬ãŒãžã«ãã£ãŠé
åžãããæ€åºãµãŒãã¹ã§ãã ãŸããConsulã¯ããŒããšãµãŒãã¹ã®ãã«ã¹ãã§ãã¯ãè¡ããå¯çšæ§ããã§ãã¯ããŸãã
ãããŠ-éç§æ°ã ããã¯ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ã®ã·ã¹ãã ã§ããããµãŒãã¹ãšããçš®ã®ããããžã§ããæé€ããŸãã
ã©ã®ããã«äœ¿çšããŸããïŒ Luigiãã€ãã©ã€ã³ããããŸããDockerã³ã³ãããŒã«ããã¯ããããããŸãã¯å®æçãªããããžã§ããNomadã«ããããããŸãã ããããžã§ã-ããã¯å®äºãããã®ã§ããããã¹ãŠãæåããå Žå-ãã¹ãŠãOKã§ããã°ãæåã§åéã§ããŸãã ããããäœãåé¡ãçºçããå ŽåãNomadã¯è©Šè¡ã䜿ãæããããæ£åžžã«çµäºããªããŸã§åè©Šè¡ããŸãã
å®æçãªããããžã§ã-ããã¯ãŸã£ããåãã§ãã¹ã±ãžã¥ãŒã«ã«åŸã£ãŠã®ã¿æ©èœããŸãã
åé¡ããããŸãã äœããã®ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ã·ã¹ãã ã«ã³ã³ãããå±éããå Žåããã®ã³ã³ãããCPUããŸãã¯ã¡ã¢ãªãå¿
èŠãšããã¡ã¢ãªéã瀺ãå¿
èŠããããŸãã 3æéå®è¡ãããã€ãã©ã€ã³ãããå Žåã2æéã§10 GBã®RAMã1æé-70 GBãæ¶è²»ãããŸãã 圌ã«äžããå¶éãè¶
ãããšãDockerããŒã¢ã³ãæ¥ãŠDockersã殺ããŸãïŒãïŒ[02:26:13]絶ããã¡ã¢ãªãè¿œãåºããããªãã®ã§ã70 GBãã¹ãŠã®ããŒã¯ã¡ã¢ãªè² è·ãæå®ããå¿
èŠããããŸãã ããããããã«åé¡ããããŸãã3æéã®70 GBããã¹ãŠå²ãåœãŠãããä»ã®ãžã§ãã«ã¯ã¢ã¯ã»ã¹ã§ããªããªããŸãã
ãããã£ãŠãç§ãã¡ã¯ä»ã®æ¹æ³ã§è¡ã£ãã ç§ãã¡ã®Luigiãã€ãã©ã€ã³å
šäœã¯ãããèªäœã§ã¯ããžãã¹ããžãã¯ã®çš®é¡ãéå§ãããNomadããããããã©ã¡ãŒã¿ãŒåããããžã§ãã§ãµã€ã³ãã®ã»ãããèµ·åããã ãã§ãã å®éãããã¯ãµãŒããŒïŒnrzbïŒ[02:26:39]æ©èœã®é¡äŒŒç©ã§ãããAVS Lambdaã¯ç¥ã£ãŠããŸãã ã©ã€ãã©ãªãäœæãããšãããã©ã¡ãŒã¿åããããžã§ããã€ãŸãããã€ãã®ãã©ã¡ãŒã¿ãæã€ã³ã³ããã®åœ¢åŒã§ãã¹ãŠã®ã³ãŒããCIãä»ããŠå±éããŸãã ããšãã°ãLite JBM Classifierã«ã¯ããã¬ãŒãã³ã°çšã®å
¥åããŒã¿ãžã®ãã¹ãžã®ãã©ã¡ãŒã¿ãŒãã¢ãã«ã®ãã€ããŒãã©ã¡ãŒã¿ãŒãããã³åºåã¢ãŒãã£ãã¡ã¯ããžã®ãã¹ããããŸãã ãããã¯ãã¹ãŠNomadã«ç»é²ãããŠãããLuigiãã€ãã©ã€ã³ããAPIãä»ããŠããããã¹ãŠã®Nomadãžã§ãããã«ã§ããŸãããLuigiã¯åãã¿ã¹ã¯ãäœåºŠãå®è¡ããªãããã«ããŸãã
åžžã«åãããã¹ãåŠçãè¡ã£ãŠãããšããŸãããã 10åã®æ¡ä»¶ä»ãã¢ãã«ããããæ¯åããã¹ãåŠçãåéããããããŸããã ããã¯äžåºŠã ãéå§ãããåæã«åå©çšããããã³ã«å®æããçµæã«ãªããŸãã åæã«ããããã¯ãã¹ãŠåæ£çã«æ©èœããŸãã倧ããªã¯ã©ã¹ã¿ãŒã§å·šå€§ãªã°ãªããæ€çŽ¢ãå®è¡ã§ããéãæšãŠãæéãããããŸããã
ã¢ãŒãã£ãã¡ã¯ãããããŸããäœããã®åœ¢ã§ããããµãŒãã¹ã®åœ¢ã«æŽããå¿
èŠããããŸãã ãµãŒãã¹ã¯ãHTTP APIãå
¬éãããããã¥ãŒãä»ããŠéä¿¡ããŸãã ãã®äŸã§ã¯ãããã¯HTTP APIã§ãããæãåçŽãªäŸã§ãã åæã«ããµãŒãã¹ãšã®éä¿¡ããŸãã¯HTTP JSON APIãä»ããŠä»ã®ãµãŒãã¹ãšéä¿¡ãããµãŒãã¹ã¯ãJSONã¹ããŒã ãæ€èšŒããŸãã ãµãŒãã¹èªäœã¯ãAPIããã³ãã®ãªããžã§ã¯ãã®ã¹ããŒã ã®ããã¥ã¡ã³ãã§åžžã«JSONãªããžã§ã¯ããèšè¿°ããŸãã ãã ãããã¹ãŠã®JSONãªããžã§ã¯ããã£ãŒã«ããåžžã«å¿
èŠãªããã§ã¯ãªããããæ¶è²»è
äž»å°ã®ã³ã³ãã©ã¯ããæ€èšŒããããã®ã¹ããŒã ãæ€èšŒãããã«ã¹ã±ãŒãåé害ã«ããåæ£ã·ã¹ãã ã®é害ãé²ãããã«ããã¿ãŒã³ãµãŒããããã¬ãŒã«ãŒãä»ããŠéä¿¡ãè¡ãããŸãã
åæã«ãConsulããã®ãµãŒãã¹ã®å¯çšæ§ã確èªã§ããããã«ããµãŒãã¹ã¯HTTPãã«ã¹ãã§ãã¯ãèšå®ããå¿
èŠããããŸãã åæã«ãNomadã¯ã3ã€ã®helloãã§ãã¯ã®ãµãŒãã¹ãé£ç¶ããŠååšããããã«ããããšãã§ãããµãŒãã¹ãåèµ·åããŠæ¯æŽããããšãã§ããŸãã ãµãŒãã¹ã¯ãã¹ãŠã®ãã°ãJSON圢åŒã§æžã蟌ã¿ãŸãã JSONãã®ã³ã°ãã©ã€ããŒãšElasticsã¹ã¿ãã¯ã䜿çšããŸããFileBitã¯ãã¹ãŠã®æç¹ã§ãã¹ãŠã®JSONãã°ãååŸããŠãã°ãã£ãã·ã¥ã«å
¥ããããããElasticã«å°éãããšãKBanãåæã§ããŸãã åæã«ãã¡ããªãã¯ãåéããŠããã·ã¥ããŒããæ§ç¯ããããã«ãã°ã䜿çšããŸãããããã¯éå¹ççã§ããããã«ã¯Prometheusã䜿çšããã·ã¹ãã ã䜿çšããŸããåããã·ã¥ããŒããµãŒãã¹ã®ãã³ãã¬ãŒããäœæããããã»ã¹ãããããµãŒãã¹ã«ãã£ãŠçæãããæè¡ã¡ããªãã¯ãåæã§ããŸã
ããã«ãäœãåé¡ãçºçããå Žåãã¢ã©ãŒããå
¥ããŸãããã»ãšãã©ã®å Žåãããã§ã¯ååã§ã¯ãããŸããã ã»ã³ããªãŒã¯ç§ãã¡ã®å©ãã«ãªããŸããããã¯ã€ã³ã·ãã³ãåæã®ããã®ãã®ã§ãã å®éããã¹ãŠã®ãšã©ãŒã¬ãã«ãã°ãSentryãã³ãã©ãŒã§ãã£ããã£ããSentryã«ããã·ã¥ããŸãã ãããŠã詳现ãªãã¬ãŒã¹ããã¯ããããŸãããµãŒãã¹ãã©ã®ç°å¢ã«ãã£ãããã©ã®ããŒãžã§ã³ãã©ã®é¢æ°ãã©ã®ã¹ã³ãŒãã§åŒã³åºããããããã®ã¹ã³ãŒãå
ã®ã©ã®å€æ°ãã©ã®å€ã§ãã£ããã«é¢ãããã¹ãŠã®æ
å ±ããããŸãã ãã¹ãŠã®èšå®ãããã¯ãã¹ãŠè¡šç€ºãããäœãèµ·ãã£ãã®ããçŽ æ©ãç解ããŠãšã©ãŒãä¿®æ£ããã®ã«åœ¹ç«ã¡ãŸãã
ãã®çµæããµãŒãã¹ã¯æ¬¡ã®ããã«ãªããŸãã å¥ã®GitLabãããžã§ã¯ãããã€ãã©ã€ã³ã³ãŒãããã¹ãã³ãŒãããµãŒãã¹ã³ãŒãèªäœãããŸããŸãªæ§æãNomadãCIæ§æãAPIããã¥ã¡ã³ããã³ãããããã¯ãªã©ã
ãªãªãŒã¹ãè¡ããšãã次ã®ããã«CIãå®è¡ããŸãïŒã³ã³ãããŒãæ§ç¯ãããã¹ããå®è¡ããã¹ããŒãžã³ã°ã«ã¯ã©ã¹ã¿ãŒãããããããããã§ãµãŒãã¹ã®ãã¹ãã³ã³ãã©ã¯ããå®è¡ããè² è·ãã¹ããå®æœããŠãäºæž¬ãé
ãããªãããšã確èªããèããŠããè² è·ãç¶æããŸãã ãã¹ãŠãåé¡ãªããã°ããã®ãµãŒãã¹ãå®çšŒåç°å¢ã«å±éããŸãã ãããŠã2ã€ã®æ¹æ³ããããŸãïŒå®æçãªããããžã§ããããã¯ã°ã©ãŠã³ãã§åäœããŠã¢ãŒãã£ãã¡ã¯ããçæããå ŽåããŸãã¯ãã€ãã䜿çšããŠäœããã®ãã€ãã©ã€ã³ãããªã¬ãŒããå Žåããã€ãã©ã€ã³ãå±éããããšãã§ããŸãããµãŒãã¹ãå±éããŸãã
ãã®å Žåãä»ã«äœãèµ·ãããŸããïŒ æ©èœãã©ã³ãã®éçºã«ã¯ãæ©èœãã°ã«ã®ãããªãã©ãã€ã ããããšèšããŸããã è¯ãæ¹æ³ã§ã¯ãäœããããŸããããªãã£ãå Žåã«æŠéã§æ©èœãããã¯ã¢ãŠãããããã«ãããã€ãã®ãã°ã«ã§æ©èœãã«ããŒããå¿
èŠããããŸãã ãã®åŸããªãªãŒã¹ãã¬ã€ã³ã§ãã¹ãŠã®æ©èœãåéããæ©èœãæªå®æã§ãã£ãŠãå±éã§ããŸãã æ©èœã®åãæ¿ãã ãããªãã«ãªããŸãã ç§ãã¡ã¯å
šå¡ããŒã¿ãµã€ãšã³ãã£ã¹ããªã®ã§ãAVãã¹ããè¡ããããšèããŠããŸãã LightGBMãCatBoostã«çœ®ãæãããšããŸãããã ããã確èªãããã®ã§ãããåæã«ãAVãã¹ãã¯ãŠãŒã¶ãŒIDãåç
§ããŠç®¡çãããŸãã æ©èœãã°ã«ã¯userIDã«ãã€ã³ããããŠãããããAVãã¹ãã«åæ ŒããŸãã ããã§ãããã®ã¡ããªãã¯ã確èªããå¿
èŠããããŸãã
ãã¹ãŠã®ãµãŒãã¹ã¯Nomadã«å±éãããŸãã 2ã€ã®Nomadãããã¯ã·ã§ã³ã¯ã©ã¹ã¿ãŒããããŸãã1ã€ã¯ããããžã§ãçšã§ããã1ã€ã¯ãµãŒãã¹çšã§ãã
ãã¹ãŠã®ããžãã¹ã€ãã³ããKafkaã«ããã·ã¥ããŸãã ããããæŸãããšãã§ããŸãã æ¬è³ªçã«ãããã¯åçŸã®ã¢ãŒããã¯ãã£ã§ãã ããã€ãã®ãµãŒãã¹ã§HDFSã«ãµãã¹ã¯ã©ã€ããããªã¢ã«ã¿ã€ã åæãè¡ããåæã«ClickHouseã§ãã¹ãŠããããåããããã·ã¥ããŒããæ§ç¯ããŠãµãŒãã¹ã®ãã¹ãŠã®ããžãã¹ã€ãã³ããåæã§ããŸãã AVãã¹ããåæã§ããŸãã
ãŸããã³ãŒããå€æŽããªãã£ãå Žåã¯ãæ©èœã®åãæ¿ãã䜿çšããªãã§ãã ããã ãã³ã§ãã€ãã©ã€ã³ãçªã£èŸŒãã ã ãã§ã圌ã¯æ°ããã¢ãã«ãæããŠãããŸããã ãããžã®æ°ããéããããŸãã æ§æå
ã®ã¢ãã«ãžã®Nomadãã¹ãå€æŽããæ°ãããµãŒãã¹ããªãªãŒã¹ããã ãã§ããããã§Canary Deploymentãã©ãã€ã ãå©ãã«ãªããŸããNomadã§ããã¯ã¹ããå©çšã§ããŸãã
çŸåšã®ããŒãžã§ã³ã®ãµãŒãã¹ã¯3ã€ã®ã€ã³ã¹ã¿ã³ã¹ã«ãããŸãã 3ã€ã®ã«ããªã¢ãå¿
èŠã ãšèšããŸã-å€ãããŒãžã§ã³ãåæžããããšãªããæ°ããããŒãžã§ã³ã®ã¬ããªã«ãããã«3ã€å±éããŸãã ãã®çµæããã©ãã£ãã¯ã¯2ã€ã®éšåã«åå²ããå§ããŸãã ãã©ãã£ãã¯ã®äžéšã¯ããµãŒãã¹ã®æ°ããããŒãžã§ã³ã«åé¡ãããŸãã ãã¹ãŠã®ãµãŒãã¹ã¯ããã¹ãŠã®ããžãã¹ã€ãã³ããKafkaã«ããã·ã¥ããŸãã ãã®çµæãã¡ããªãã¯ããªã¢ã«ã¿ã€ã ã§åæã§ããŸãã
ãã¹ãŠãæ£åžžã§ããã°ããã¹ãŠãæ£åžžã§ãããšèšããŸãã ãããã€ãããšãNomadã¯ãã¹ãŠã®å€ãããŒãžã§ã³ãéãã«ãªãã«ããæ°ããããŒãžã§ã³ãã¹ã±ãŒãªã³ã°ããŸãã
ãã®ã¢ãã«ã¯ããŠãŒã¶ãŒã¢ã€ãã ãšãããšã³ãã£ãã£ã«ãã£ãŠããŒãžã§ã³ã«ãŒãã£ã³ã°ããã€ã³ãããå¿
èŠãããå Žåã«åé¡ããããŸãã ãã©ãã£ãã¯ã¯ã©ãŠã³ãããã³ã§ãã©ã³ã¹ãåãããããããã®ãããªã¹ããŒã ã¯æ©èœããŸããã ãã®ããã次ã®æ¹æ³ã§ãµãŒãã¹ã2ã€ã®éšåã«åããŸããã
ããã¯ãã²ãŒããŠã§ã€å±€ãšã¯ãŒã«ãŒå±€ã§ãã ã¯ã©ã€ã¢ã³ãã¯ãHTTPãä»ããŠã²ãŒããŠã§ã€ã¬ã€ã€ãŒãšéä¿¡ããŸããããŒãžã§ã³ãéžæãããã©ãã£ãã¯ãåæ£ããããã®ãã¹ãŠã®ããžãã¯ã¯ã²ãŒããŠã§ã€ã«ãããŸãã åæã«ãè¿°éšãå®äºããããã«å¿
èŠãªãã¹ãŠã®I / OããŠã³ãã¿ã¹ã¯ãã²ãŒããŠã§ã€ã«é
眮ãããŸãã ãªã¯ãšã¹ãã®è¿°èªã§userIDãååŸããäœããã®æ
å ±ãè¿œå ããå¿
èŠããããšããŸãã ä»ã®ãã€ã¯ããµãŒãã¹ããã«ããŠããã¹ãŠã®æ
å ±ãæ©èœããŸãã¯ããŒã¹ãååŸããå¿
èŠããããŸãã ãã®çµæããããã¯ãã¹ãŠã²ãŒããŠã§ã€ã§çºçããŸãã 圌ã¯ã¢ãã«ã«ã®ã¿ããåŽåè
ãšéä¿¡ãã1ã€ã®ããšãè¡ããŸã-äºæž¬ããŸãã å
¥åããã³åºåã
ãããããµãŒãã¹ã2ã€ã®éšåã«åå²ããããããªã¢ãŒããããã¯ãŒã¯åŒã³åºãã®ããã«ãªãŒããŒããããçºçããŸããã ãããã¬ãã«åããæ¹æ³ã¯ïŒ HTTP2ã®äžã§å®è¡ãããGoogleã®JRPCãã¬ãŒã ã¯ãŒã¯ãGoogleã®RPCãå©ãã«ãªããŸãã å€éåãšå§çž®ã䜿çšã§ããŸãã JPRCã¯ãããããã䜿çšããŸãã ããã¯ãé«éã·ãªã¢ã«åãšéã·ãªã¢ã«åãè¡ãã匷ãåä»ãããããã€ããªãããã³ã«ã§ãã
ãã®çµæãã²ãŒããŠã§ã€ãšã¯ãŒã«ãŒãåå¥ã«ã¹ã±ãŒãªã³ã°ããããšãã§ããŸãã äžå®éã®ãªãŒãã³HTTPæ¥ç¶ãç¶æã§ããªããšããŸãããã ããŠãã²ãŒããŠã§ã€ãã¹ã±ãŒãªã³ã°ããŸãã äºæž¬ãé
ãããŠãè² è·ãç¶æããæéããããŸããã ãã®ã¢ãããŒãã¯ãå€è
ãã³ãã£ããã«éåžžã«é©ããŠããŸãã ã²ãŒããŠã§ã€ã§ã¯ããã¹ãŠã®ãã©ãã£ãã¯ãã©ã³ã·ã³ã°ããžãã¯ãå®è£
ãããŠãããããå€éšãã€ã¯ããµãŒãã¹ã«ã¢ã¯ã»ã¹ããããããåããŒãžã§ã³ã®ãã¹ãŠã®çµ±èšãååŸãããã©ãã£ãã¯ã®ãã©ã³ã¹ããšãæ¹æ³ã決å®ã§ããŸãã ãã³ããœã³ãµã³ããªã³ã°ã䜿çšãããšããŸãããã
ãã¹ãŠåé¡ãããŸãããã¢ãã«ã¯äœããã®åœ¢ã§èšç·Žãããã®ã§ãNomad configã«ç»é²ããŸããã ãããããã¬ãŒãã³ã°äžã«é³è
åããæéããã§ã«ããæšå¥šã®ã¢ãã«ãããããããã絶ããåãã¬ãŒãã³ã°ããå¿
èŠãããå Žåã¯ã©ãã§ããããïŒ ãã¹ãŠãåãæ¹æ³ã§è¡ãããŸããå®æçãªããããžã§ãã«ãã£ãŠãããšãã°3æéããšã«äœããã®ã¢ãŒãã£ãã¡ã¯ããçæãããŸãã åæã«ã圌ã®ä»äºã®çµããã«ããã€ãã©ã€ã³ã¯Consulã®æ°ããã¢ãã«ã®ãã¹ãèšå®ããŸãã ããã¯ããŒå€ã¹ãã¬ãŒãžã§ãããæ§æã«äœ¿çšãããŸãã Nomadã¯æ§æãæ§æã§ããŸãã ããŒå€ã¹ãã¬ãŒãžConsulã®å€ã«åºã¥ããç°å¢å€æ°ããããšããŸãã 圌ã¯å€æŽãç£èŠããæ°ãããã¹ã衚瀺ããããšããã«ã2ã€ã®ãã¹ãåãããšãã§ãããšå€æããŸãã 圌ã¯ãæ°ãããªã³ã¯ãä»ããŠã¢ãŒãã£ãã¡ã¯ãèªäœãããŠã³ããŒãããããªã¥ãŒã ãšãªããŒãã䜿çšããŠãµãŒãã¹ã³ã³ãããŒãDockerã«é
眮ããŸããããããã¹ãŠå®è¡ããŠãããŠã³ã¿ã€ã ãçºçããªãããã«ããŸãã ãŸãã¯ã圌ã¯æ°ããèšå®ãã¬ã³ããªã³ã°ãããµãŒãã¹ã圌ã«å ±åããŸãã ãŸãã¯ããµãŒãã¹èªäœããããæ€åºããŸã-ãããŠãããèªäœã¯ç¬ç«ããŠããã®ã¢ãã«ãã©ã€ãæŽæ°ã§ããŸãã ããã ãã§ããããããšãã