TL;DR
NTTãã³ã¢ ãã¼ã¿ãã©ãããã©ã¼ã é¨ï¼ä»¥ä¸DPé¨ï¼æå±ã®é»é ã§ããDPé¨ã§ã¯ãã¼ã¿æ´»ç¨ã®æ°ä¸»åãç®æãã¦ç¤¾å åãã«streamlitã®éçºãã©ãããã©ã¼ã ãç¬èªã«å®è£ ããç¾å¨streamlitã¢ããªã±ã¼ã·ã§ã³æ°åã³éçºè ã®æ°ã¯100人以ä¸ãå©ç¨è ã¯æ°å人ã«ã®ã¼ãã¾ãã
åèï¼æ¨å¹´è¨äº 社å¡1000人以ä¸ã使ããStreamlit in Google Cloudã®ãµã¼ãã¬ã¹ãã©ãããã©ã¼ã ãå®å ¨å 製ãã¦ã¿ã
éçºè ã»å©ç¨è ã®å¢å ã«ä¼´ãããã©ãããã©ã¼ã ã«æ±ããããã»ãã¥ãªãã£ãããéè¦ã«ãªã£ã¦ãã¾ãããstreamlitã®å ´åãã¢ããªéçºè ã®æ¹ãå°æ¥ã§WEBã¢ããªã±ã¼ã·ã§ã³ã®ã¨ã³ã¸ãã¢ã§ã¯ãªããã¨ãå¤ããããã©ãããã©ã¼ã ã«ã»ãã¥ãªãã£ã«ããããæ©è½å®è£ ãããéã¯ã§ããã ãã¢ããªéçºè ã®çæ§ã®èªç¥è² è·ãä¸ããªã工夫ãæ±ãããã¾ããã
æ¬è¨äºã§ã¯ãã©ãããã©ã¼ã ã¨ã³ã¸ãã¢ãªã³ã°åã³DevSecOpsã®è¦³ç¹ããããã®streamlitéçºãã©ãããã©ã¼ã ã«ããã¦èªç¥è² è·ãæãã¤ã¤ã»ãã¥ãªãã£ãåä¸ããã工夫ãè¨è¨ããç´¹ä»ãã¾ãã
æ³å®ããèªè
- ãã©ãããã©ã¼ã ã¨ã³ã¸ãã¢ãªã³ã°ã«èå³ãããæ¹
- DevSecOpsã«èå³ãããæ¹
Canary Release of Cloud Workstations
streamlitã®ã¢ããªéçºè åãã®IDEç°å¢ã¨ãã¦DPé¨ã§ã¯Cloud Workstationsã¨ããã³ã³ãããã¼ã¹ã§ç®¡çã§ããã¯ã©ã¦ãä¸ã®ãµã¼ãã¹ãå©ç¨ãã¦ãã¾ããCloud Workstationsãå©ç¨ãããã¨ã§ä»¥ä¸3ç¹ãå®ç¾ãã¦ãã¾ãã
- ã©ã®éçºè ã«ãåç¾æ§ã®ããåä¸ããã¤ã»ãã¥ã¢ãªIDEç°å¢ãæä¾ããï¼ã³ã³ãããã¼ã¹ã®éçºç°å¢ç®¡çï¼
- éçºç°å¢ãVPCå ã«ç¨æããï¼VPCéå®å ¬éãªã½ã¼ã¹ã¸ã®ã¢ã¯ã»ã¹ãå®ç¾ããï¼
- éçºã®å¿ é ãã¼ã«(GitHub CLIç)ãäºåã«ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ç°å¢ãæä¾ããã»ããã¢ããã®è² æ ãä¸ãã
Cloud Workstationsã§å©ç¨ã§ãããã¼ã¹ã®ã³ã³ããã¤ã¡ã¼ã¸ã¯Google Cloudãã»ãã¥ãªãã£ããããå½ã¦ãã¤ã¡ã¼ã¸ã常æå ¬éã»æ´æ°ãã¦ããã¦ããããã®ææ°ã¤ã¡ã¼ã¸ãé©ç¨ãããã¨ã§OSã¬ã¤ã¤ã®ã»ãã¥ãªãã£ããããèªåé©ç¨ã§ãã¾ããCloud Workstationsã¨ãã¦ã¯å¸¸ã«ææ°ã®ã¤ã¡ã¼ã¸ãå©ç¨ãããã¨ãæ¨å¥¨ããã¦ããã®ã§ããææ°ã®ã¤ã¡ã¼ã¸ãç´ã¡ã«å ¨éçºè ã«èªåã§é©ç¨ãã¦ãã¾ãã¨éçºè ãå©ç¨ããã©ã¤ãã©ãªã¨ã®äºææ§ã«åé¡ãçããçªç¶æ¨æ¥ã¯åãã¦ããã³ã¼ããã¨ã©ã¼ã«ãªãäºæ ãçºçããå¯è½æ§ãããã¾ããã
ããã§æ¬ãã©ãããã©ã¼ã ã§ã¯ä¸å³ã®ããã«ãDPé¨ã®ä¸é¨éçºã¡ã³ãã¼ã ãã«å è¡ãã¦ãã¼ã¿çã¤ã¡ã¼ã¸ã¨ãã¦ææ°ã®ã¤ã¡ã¼ã¸ãé©ç¨ããã®ã¤ã¡ã¼ã¸ããã¨ã«ãã¦5æ¥ä»¥ä¸åé¡ãªãå©ç¨ãã¦ããï¼ç£æ»ãã°ä¸èµ·åãã°ã5æ¥ä»¥ä¸ããï¼ãã¨ãæ¤ç¥ãããã®å¾ã«ãã¼ã¿ã¤ã¡ã¼ã¸ãå ¨éçºè ã«é©ç¨ããå ¬éçã¤ã¡ã¼ã¸ã«ææ ¼ãããã¨ãããã¤ãã©ã¤ã³ãç¬èªå®è£ ãã¦ãã¾ãããã®ä»çµã¿ã«ãã£ã¦ä¸è¬ã®éçºè ã«ã¯ç¹å¥ãªèªç¥è² è·ããããã«ã常ã«èªåçã«ã»ãã¥ã¢ãªéçºç°å¢ãæä¾ãããã¨ãå®ç¾ãã¾ããã
å ·ä½ã®å®è£ ã¨ãã¦ã¯ãã¾ããã¼ã¿çã¤ã¡ã¼ã¸ãæ¥æ¬¡ã§ææ°ã®googleæä¾ã®ã³ã³ããããã¨ã«æ´æ°ãã¾ãããã¼ã¿çã®WorkStationsã¯ææ°åããã¦ããã³ã³ããã¤ã¡ã¼ã¸ãåç §ãã¾ããããã¦ããã¼ã¿çã®WorkStationsãå©ç¨ãã¦ããã¦ã¼ã¶ã¼ã®ãã°ãloggingããåå¾ããã°ã«ã¼ã¿ã¼ã§BQå ã«ä¿åãããã¼ã¿çã¤ã¡ã¼ã¸ã®æ´æ°ããããã°ã¨çªåãããã¨ã§ãã¼ã¿çã¤ã¡ã¼ã¸ãç¾æç¹ã§ä½æ¥å©ç¨ããã¦ããã®ãã確èªãããã¥ã¼ãç¨æãã¦ãã¾ãã
ãããã¦ã§ãããã¥ã¼ããã¨ã«ææ°ã®ãã¼ã¿çã¤ã¡ã¼ã¸ã5æ¥ä»¥ä¸å©ç¨ããã¦ããå ´åãå ¬éçã¤ã¡ã¼ã¸ã«ææ ¼ããã¨ãããã¤ãã©ã¤ã³ãå®è£ ãã¦ãã¾ãããã®ãã¤ãã©ã¤ã³ã®ãããã§ä»å¹´ã¯opensslã®ãã¼ã¸ã§ã³ãgoogleæä¾ã®ã³ã³ããå´ã§ã¢ãããã¼ãããã¦pythonã®ã©ã¤ãã©ãªã¨ã®äºææ§åé¡ãçºçããéãããã¼ã¿çã®æç¹ã§ã³ã³ãããã¼ã¸ã§ã³ã®åãæ»ããè¡ããã¨ã§ãå ¨ä½ã®éçºè åãã«ã¯å¯¾çæ¡ã示ããå¾ã§ã³ã³ããã¤ã¡ã¼ã¸ã®ãã¼ã¸ã§ã³ã¢ãããè¡ããã¨ãã§ãã¾ããã
DevSecOps with GitHub Actions Reusable Workflows
ç»åå¼ç¨å ï¼DevSecOps
æ¬ãã©ãããã©ã¼ã ã§ã¯ã1ã¤ã®streamlitã¢ããª=1ã¤ã®GitHubã¬ãã¸ããªã¨ããåã¬ãã¸ããªã«ããã¦devãã©ã³ãã¸commitããã°èªåã§devç°å¢ã«ãmainãã©ã³ãã¸PRããã°æ¬çªç°å¢ã«èªåãããã¤ããCI/CDãGitHub Actionsãå©ç¨ãã¦å®è£ ãã¦ãã¾ãã
å½åCI/CDã®ããã®GitHub Actionsã®ã¯ã¼ã¯ããã¼ãã¡ã¤ã«ã¯åã¢ããªã±ã¼ã·ã§ã³å´ã®ã¬ãã¸ããªã«é ç½®ãã¦ãã¾ãããããã®æ§æã§ã¯ãã©ãããã©ã¼ã å´ã®ç®¡çè ã追å ã§ã»ãã¥ãªãã£ä¸ç¹å®ã®é¢æ°ãç¦æ¢ãããããã©ãããã©ã¼ã å´é½åã®å¤æ´ãå ¨ã¢ããªã±ã¼ã·ã§ã³ã«åæ ããéã¯å ¨ã¢ããªã±ã¼ã·ã§ã³ã®ã¬ãã¸ããªã«å¤æ´ãä¾é ¼ãããããã©ãããã©ã¼ã 管çè ããPRãæ°åã®ã¬ãã¸ããªã«åºãå¿ è¦ãããã¾ããã
ããã§ãä»å¹´ã¯ã¢ããªã®ãããã¤ã®ããã«å©ç¨ããGitHub Actionsã®ã¯ã¼ã¯ããã¼ãã¡ã¤ã«åã³Dockerfileããã©ãããã©ã¼ã ã®ç®¡çè
ã管çããã¬ãã¸ããªï¼Adminã¬ãã¸ããªï¼å
ã§å®ç¾©ããåã¢ããªã®ã¬ãã¸ããªããAdminã¬ãã¸ããªå
ã®ã¯ã¼ã¯ããã¼ãå¼ã³åºãæ§æã«å¤æ´ãã¾ããã
ref:GitHub Actions / Reusable Workflows
ãã®å¤æ´ã«ããããã©ãããã©ã¼ã éå¶å´ãã»ãã¥ãªãã£è¦ä»¶ã«ä¼´ã追å ãã¸ãã¯ãCI/CDã®ä¸ã«çµã¿è¾¼ããã¨ã容æã«ãªãããã¤ããã®ãã¸ãã¯ãéçºè èªèº«ã¯æèããã«æ¸ããã¢ããªã®éçºè ã®èªç¥è² è·ãä¸ãããã¨ãªããCI/CDãã¤ãã©ã¤ã³ã®å¤æ´ã»çµ±å¶ãã§ããããã«ãªãã¾ããã
ã¾ãåã¢ããªã±ã¼ã·ã§ã³ã®ã¬ãã¸ããªã§ä»»æã®è¨å®ã許å¯ãããã©ã¡ã¼ã¿ã¼ãæå®ã®jsonãã¡ã¤ã«ã«è¨è¼ãã¦ããããã¨ã§ãã¯ã¼ã¯ããã¼èªä½ã®å¤æ´ã¯èªç±ã«å¤æ´ã§ããªãããã«çµ±å¶ãåãã¤ã¤ãã¢ããªã±ã¼ã·ã§ã³ã®ã¯ã¼ã¯ãã¼ãã«åãããã³ã³ãã¥ã¼ãã£ã³ã°ãªã½ã¼ã¹ã®å¤æ´(cpu/memç)ãæè»ã«ãã¦ãããããã工夫ãã¦ãã¾ãã
ããã«ç´è¿ã§ã¯ãã®ä¸å¤®ç®¡çãããã¯ã¼ã¯ããã¼ã®ä¸ã§pythonã®éç解æãã¼ã«ãå°å ¥ã(Bandit)ãã³ã¼ãå ã«SQLã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¯ããã¨ããèå¼±æ§ããªããèªåã§æ¤ç¥ããä»çµã¿ã試é¨å°å ¥ãã¦ãã¾ãã
Auditablity of LLM Access
æ¬åºç¤ã§ã¯å¾æ¥DWHã¨ãã¦Snowflakeã®æ¥ç¶ããµãã¼ããã¦ãã¾ããããä»å¹´ã¯LLMã®ã¦ã¼ã¹ã±ã¼ã¹ããµãã¼ããã¹ãLLMã¨ã®æ¥ç¶ãä¸æ©è½ã¨ãã¦æä¾ãå§ãã¾ããã
LLMãåç´ã«å©ç¨ããã ãã§ããã°LLMã¨ã®æ¥ç¶ããµãã¼ãããSDKãå©ç¨ããã°ããã ãã§å¾ã«æè¡çãªãã¼ãã«ã¯ããã¾ãããããã©ãããã©ã¼ã ã¨ãã¦æä¾ããå ´å課é¡ã«ãªãã®ã¯ã誰ãããã¤ãã©ã®ç°å¢ãããã©ããããã®ãã¼ã¯ã³ãå©ç¨ãã¦ãããã®ç£æ»æ§ã®æ ä¿ãå¿ è¦ã«ãªãã¾ãã
ãã®ç¹ã«ã¤ãã¦ã¯å¾æ¥Snowflakeã¸ã®æ¥ç¶ãããã§ãããããã©ãããã©ã¼ã å´ããLLMã®å©ç¨ã«ããã£ã¦ã¯æ¥ç¶ç¨ã®é¢æ°ãå ±éã©ã¤ãã©ãªã¨ãã¦æä¾ãããããå©ç¨ãã¦ããããã¨ã§ã¢ããªéçºè ãç¹ã«ã³ã¼ãã®ä¸ã§æ示çã«ãã°åºåç¨ã®ãã¸ãã¯ãå®è£ ããªãã¨ããä¸è¨ã®ãããªç£æ»æ§ãæ ä¿ã§ããããã«ãã¦ãã¾ãã
ç¹ã«LLMã¸ã®æ¥ç¶ã«ã¤ãã¦ã¯ãç£æ»æ§ãæ ä¿ãã¤ã¤æ±ç¨æ§ãæãããããLangChainã¨ããLLMãå©ç¨ããä¸ã§ã¯é常ã«ä¸è¬çãªOSSããã¼ã¹ã«ãã¦æ¥ç¶æ©è½ãå ±éé¢æ°ã¨ãã¦æä¾ãããã¨ã§ãéçºè ã«å®è£ ã®èªç±åº¦ã»æ©è½æ§ãæä¾ãã¤ã¤ããã©ãããã©ã¼ã å´ã§ã®ç£æ»æ§ãæ ä¿ã§ããããã«ãã¦ãã¾ãã
æå¾ã«
ä½ããã®ãã©ãããã©ã¼ã ãæä¾ããä¸ã§ã»ãã¥ãªãã£åä¸ãããããã«ã¯ããã®ãã©ãããã©ã¼ã ã®å©ç¨è ã«ä½ããã®ä¸ä¾¿ãèªç¥è² è·ãçºçãããããå¾ãªãå ´é¢ãã©ããã¦ãåºã¦ãã¦ãã¾ãã¾ãããããããã®èªç¥è² è·ãæå°éã«æãã¤ã¤ã»ãã¥ãªãã£ãåä¸ãããããã«ã¯ããã©ãããã©ã¼ã ã¨ã³ã¸ãã¢ãªã³ã°ã¨DevSecOpsã®èãæ¹ãåãå ¥ãããã¨ãæå¹ã§ããã¨èãã¦ãã¾ã
ç¾æç¹ã§å©ç¨å¯è½ãªæè¡ãæ大éã«å©ç¨ãã¤ã¤ãå©ç¨è ã®èªç¥è² è·ã®è»½æ¸ã¨ãã©ãããã©ã¼ã ã®ã»ãã¥ãªãã£ã©ã¡ããã諦ããã®ã§ã¯ãªããã©ããã£ã¦ä¸¡ç«ããããããããçªãè©°ãã¦èãã¦ããããããããå®å ¨ã§ä½¿ãããããã©ãããã©ã¼ã ãæä¾ãã¦ããããã¨èãã¦ãã¾ãã
ãã©ãããã©ã¼ã ãéç¨ãã¦ããæ¹ã ã«ã¨ã£ã¦ãæ¬è¨äºãå°ãã§ãåèã«ãªãã°å¹¸ãã§ãã ãªããæ¬è¨äºã®è©³ç´°é¨åã«ã¤ãã¦ã¯æ¥åå§è¨å ã¡ã³ãã¼ã§ãããè¾°å·±ããã»å ¼åããã«å·çååããã ãã¾ããããã®å ´ãåãã¦ã礼ç³ãä¸ãã¾ãã