ããã«ã¡ã¯ãã¡ã«ã㤠æ©æ¢°å¦ç¿ã¨ã³ã¸ãã¢ã® @rio ã§ãã
ãã®è¨äºã¯ãMerpay & Mercoin Advent Calendar 2024 ã®è¨äºã§ãã
æ¬è¨äºã§ã¯ãã¡ã«ãã¤ã®æ©æ¢°å¦ç¿ã¨ã³ã¸ãã¢ãã¼ã ã§ä»å¹´åãçµãã ãMLOps ã®çååããã³å質åä¸ã«ã¤ãã¦ãç´¹ä»ãã¾ãã
ç®æ¬¡
- ã¡ã«ãã¤ã®æ©æ¢°å¦ç¿ã·ã¹ãã ã®æ¦è¦
- 1. éçºãã©ã³ãã®ãã¼ã¸
- 2. å種ãã¹ã¿ãã¼ã¿ã®æ´æ°
- 3. æ©æ¢°å¦ç¿ãã¤ãã©ã¤ã³ã®å®è¡
- ã¾ã¨ã
ã¡ã«ãã¤ã®æ©æ¢°å¦ç¿ã·ã¹ãã ã®æ¦è¦
ã¡ã«ãã¤ã§ã¯ãæ¯æã®ä¸ä¿¡æ æ´æ°ãã¸ãã¯ã®ä¸é¨ã«æ©æ¢°å¦ç¿ã·ã¹ãã ãæ¡ç¨ãã¦ãã¾ãã
ãã®ãããæ©æ¢°å¦ç¿ã¨ã³ã¸ãã¢ãã¼ã ã§ã¯æ¯æãªãªã¼ã¹ä½æ¥ãçºçãã¾ãã
æ¬è¨äºã§ã¯ããªãªã¼ã¹ä½æ¥ã®ãã¡ã以ä¸ã®ä½æ¥ã«é¢ãã¦å質ãæ
ä¿ããªããçååãç®æããåãçµã¿ããç´¹ä»ãã¾ãã
- éçºãã©ã³ãã®ãã¼ã¸
- å種ãã¹ã¿ãã¼ã¿ã®æ´æ°
- æ©æ¢°å¦ç¿ãã¤ãã©ã¤ã³ã®å®è¡
1. éçºãã©ã³ãã®ãã¼ã¸
éçºãã©ã³ãã§ã®ãã¾ãã¾ãªå¤æ´å
容ã main ãã©ã³ãã«åæ ããã¾ãã
ãã®ä¸ã§ããæ¯æå¿
ãçºçããã®ã config ãã¡ã¤ã«ã®æ´æ°ã§ãã
config ãã¡ã¤ã«ã§ã¯ãæ©æ¢°å¦ç¿ã¢ãã«ã®å¦ç¿ãæ¨è«ãå¾å¦çãªã©ã§å¿
è¦ãªè¨å®ããã¦ãã¾ãã
以ä¸ã¯ config ã§æå®ãã¦ããé
ç®ã®ä¾ã§ãã
- å¦ç¿ãè©ä¾¡ãã¼ã¿ã®æé
- æ¨è«å¯¾è±¡æ
- ãã¤ãã¼ãã©ã¡ã¼ã¿æ¢ç´¢ã«é¢ããè¨å®
- ã¢ãã«ããã¼ã¿ã»ãããªã©ã®ãã¼ã¸ã§ã³
- å種 I/O ã®ãã¹ããªã©
åé¡ç¹
config ãã¡ã¤ã«ã®æ´æ°æã«ãè¨å®æ¼ããè¨å®ã®ä¸åãªã©äººçºçãã¹ãèµ·ãã¦ãã¾ããã¨ãåé¡ã§ãããè¤æ°ã®æ©æ¢°å¦ç¿ã¢ãã«ããããã¨ããåã¢ãã«ãã¨ã®è¨å®é ç®ãå¤ããã¨ãè¦å ã¨ãã¦ããããã¾ãã
解決ç
config ãã¡ã¤ã«ã®è¨å®ã®ä¸åãæ©æ¢°çã«æ¤ç¥ãã¦ã¦ã¼ã¶ã«éç¥ããä»çµã¿ãå°å
¥ãã¾ããã
ã¯ã¼ã¯ããã¼ã¯ä»¥ä¸ã®ã¨ããã§ãã
ãã´åºå ¸: GitHub
config ã®ä¿®æ£ã以ä¸ã®ã±ã¼ã¹ã§åé¡ãã¦ãã¾ãã
- ã¢ãã«ã®æ¨è«ã®ã¿ãè¡ãããã®ä¿®æ£
- ã¢ãã«ã®åå¦ç¿ãè¡ãããã®ä¿®æ£
- ãªãªã¼ã¹ã«é¢ä¿ã®ãªãä¿®æ£
3.ã«ã¤ãã¦ã¯ validatioin ã¯å®æ½ãã¾ããã
1.2. ã«é¢ãã¦ã¯ãããããä¸è¬çãªå validation ã«å ãã¦ãæ©æ¢°å¦ç¿ã¢ãã«ã®è¦ä»¶ã«ç´ã¥ã以ä¸ã®ãã㪠validation ãè¡ã£ã¦ãã¾ãã
- ä½æ¥æã¨æ¨è«å¯¾è±¡æãçç¾ãã¦ããªãã
- å æãªãªã¼ã¹æã® config ã¨æ¯è¼ãã¦çç¾ããªãã
- ä½æ¥æã®Nã¶æåã®æ¥ä»ãæå®ããã¦ãããããªã©
ãã®ä»çµã¿ã®å°å ¥ã«ãããconfig ãã¡ã¤ã«æ´æ°æã«ä¸åããã£ãå ´åãPR ã®ãã¼ã¸åã«ä½ã³ã¹ãã§æ°ã¥ããããã«ãªãã¾ããã
2. å種ãã¹ã¿ãã¼ã¿ã®æ´æ°
ã¡ã«ãã¤ã®æ©æ¢°å¦ç¿ã·ã¹ãã ã«ã¯ããã¾ãã¾ãªãã¹ã¿ãã¼ã¿ãåå¨ãã¾ãã
ãã¹ã¿ãã¼ã¿ã®æ´æ°ã¯ãåºæ¬çã« PdM ã Biz ã®æ¹ãè¡ããããéç¨è¦³ç¹ã§ç¾ç¶ã¯ Google ã¹ãã¬ããã·ã¼ãã§ã®ç®¡çã«è½ã¡çãã¦ãã¾ãã
åé¡ç¹
ã·ã¹ãã ä¸ã®ç®¡ç㯠GitHub 㨠BigQuery ã§è¡ã£ã¦ãããããã¹ãã¬ããã·ã¼ãã®ãã¼ã¿ã ããã¹ããã¡ã¤ã«ã«å¤æããä½æ¥ãå¿ è¦ã«ãªãã¾ãããã®ä½æ¥ã§äººçºçãã¹ãèµ·ãããã¨ã¨ãä½æ¥ãéå¹çã§ãããã¨ãåé¡ã§ããã
解決ç
ã¯ã¼ã¯ããã¼ã¯ä»¥ä¸ã®ã¨ããã§ãã
ãã´åºå ¸ï¼GitHub, Google ã¹ãã¬ããã·ã¼ã
ã¹ãã¬ããã·ã¼ãã® validation ã§ã¯ãæ©æ¢°å¦ç¿ç¹æã®ãã®ã¯ããã¾ããã
ãã¼ã¿åãå
¥åå¤ã®ç¯å²ããããã®æ°ãå称ãªã©ãä¸è¬çãªé
ç®ããã§ãã¯ãã¦ãã¾ãã
è¤æ°ã®ãã¹ã¿ãã¼ã¿ãããã®ä»ã®ã¹ãã¬ããã·ã¼ãã§ç®¡çããã¦ãããã¼ã¿ã«ããã¦ãå質æ ä¿ããã³å¹çåã§ããããããã®ä»çµã¿ã使ãã¾ããã¦éç¨ãã¦ãã¾ãã
3. æ©æ¢°å¦ç¿ãã¤ãã©ã¤ã³ã®å®è¡
æ¯æã®ãªãªã¼ã¹ä½æ¥ã«ã¯ç´50åã®ã¿ã¹ã¯ãããã¾ãã
ãã®ãã¡ã®ããã¤ãã¯ãAirFlow ã® DAG ãç¨ãã¦å®è£
ããã¦ããæ©æ¢°å¦ç¿ãã¤ãã©ã¤ã³ãå®è¡ããã¿ã¹ã¯ã§ãã
åé¡ç¹
以ä¸ã®åé¡ãããã¾ããã
- å®è¡æ¥ã¨ã¿ã¹ã¯ãä¸è¦§ã«ãªã£ã¦ããã¹ãã¬ããã·ã¼ãã§ã¿ã¹ã¯ã管çãã¦ãããããã¤ã©ã® DAG ãå®è¡ãããã確èªããèªç¥ã³ã¹ããããã
- ãªãªã¼ã¹ã¿ã¹ã¯ã®æ°ãå¤ããã¨ãããããã¹ãææ»ããçºçãå¾ã
- ãªãªã¼ã¹ä½æ¥ã®ãªã³ãã¼ãã£ã³ã°ãéå¹çã§ãæ°è¦ã¡ã³ãã¼ã®ãã£ããã¢ããã«æéãããã
解決ç
ãªãªã¼ã¹ä½æ¥ãã¢ã·ã¹ããã¦ããã Slack botãâRelease Ops Assistantâï¼ä»¥é ROAï¼ãå°å ¥ãã¾ãããã¯ã¼ã¯ããã¼ã¯ä»¥ä¸ã®ã¨ããã§ãã
ãã´åºå ¸ï¼Slack, Google ã¹ãã¬ããã·ã¼ã, Google Compute Engine, Apache Airflow
ROA ãå®è£ ããéã«ãä¸è¨ã®è¦ä»¶ãæºããããã¨èãã¦ãã¾ããã
- Slack ããã® DAGããªã¬ã¼è¦æ±ã«ãªã¢ã«ã¿ã¤ã ã§å¯¾å¿ã§ãããã¨
- å®è£ åã³éç¨ã³ã¹ããä½ããã¨
æ¤è¨ããã¢ã¼ããã¯ãã£ã«ã¯ãCloud Functions ã Cloud Run ãªã©ããã¾ããããæçµçã«ã¯ Socket Mode ã使ããã¨ããçç±ã§ Google Compute Engineï¼ä»¥é GCEï¼ãæ¡ç¨ãã¾ãããSocket Mode ã¯ãWebSocket ã使ç¨ãã¦ãªã¢ã«ã¿ã¤ã ã§ã¤ãã³ããåä¿¡ã§ããæ¥ç¶æ¹å¼ã§ããã¡ã¤ã¢ã¦ã©ã¼ã«ãæ°ã«ããç°¡åã«ã¢ããªéçºãã§ããã¨ããç¹å¾´ããããããä¸è¨ã®è¦ä»¶ãæºãããã¨ãã§ãã¾ãã
ã¾ããã¸ã§ãã¹ã±ã¸ã¥ã¼ã©ã¼ã Cloud Scheduler ã Cloud Tasks ãªã©ãæ¤è¨ãã¾ããããæçµçã«ã¯ Slack ã¨ã®è¦ªåæ§ãæãé«ãã¨ããçç±ã§ Slack ã¯ã¼ã¯ããã¼ãæ¡ç¨ãã¾ããã
å³3 ã®ã¯ã¼ã¯ããã¼å
赤æ ã®é¨åã§ã¯ãSlack Bolt ã Socket Mode 㧠GCE ã®ããã°ã©ã ãããªã¬ã¼ããGCE ã Airflow REST API ãå©ã㦠DAG ãå®è¡ãã¦ãã¾ãã
ROA ã®å°å
¥ã«ããããã¤ã©ã®ã¿ã¹ã¯ãããã¹ãã Bot ãéç¥ãã¦ãããã®ã§èªç¥ã³ã¹ããä¸ããããªã¢ã«ã¿ã¤ã ã«ã¿ã¹ã¯ã®å®è¡ãã¹ãã¼ã¿ã¹ã®å¤æ´ãå¯è½ã¨ãªã£ããããã¹ãææ»ããçºçãã¥ãããªãã¾ããã
ã¾ã¨ã
æ¬çªç¨¼åä¸ã®æ©æ¢°å¦ç¿ã¢ãã«ã®éç¨ã«ã¤ãã¦ãå質ãæ
ä¿ããªããçååãããã¨ã§ãçç£æ§ãããã工夫ããç´¹ä»ãã¾ããã
çç£æ§åä¸ã¯ã©ããã¦ãå¾åãã«ãã¦ãã¾ããã¡ã§ãããä¸åº¦è
°ãæ®ãã¦ã¾ã¨ãã¦è¦ç´ããã§ãã¦é常ã«è¯ãã£ãã¨æãã¾ãã
次ã®è¨äºã¯ @komatsu ããã§ããå¼ãç¶ãã楽ãã¿ãã ããã