Redash ã®ã¢ã©ã¼ãéç¥å ãç¬èªæ¡å¼µãã
ãã®è¨äºã¯ Redash Advent Calendar 13æ¥ç®ã®è¨äºã§ããæè¿ãå°ç¹ã§ããï¼
ãã£ãã
ãã®ãã¤ã¼ããè¦ã¦ãã£ã¦ã¿ããã¨æãã¾ããã
Redashã£ã¦ãã©ã°ã¤ã³æ©æ§ããã®ããªâ¦
— ç¦æ@ã¤ã³ãã©æè¡â¦è ï¼ (@mutsuki99) 2018å¹´12æ12æ¥
ãªãªã¸ãã«ã® Destination ä½ã£ãã®ã¯ãããã ãã©ããããã¤ã Python ãã¡ã¤ã«ã®ã³ãã¼ã£ã¦ã®ãã¨ã¦ãããã¦ãªãæãããã¦ãããç°å¢å¤æ°ã®ãªã¹ãè¦ã¦ãéããã©ã¬ãã«ãªä»çµã¿ãããé°å²æ°ãªãã ãã©ãªãã
ãããã
ã³ã¼ããããã±ã¼ã¸åãã
redash/destinations
ã«ç½®ãã¦ããã³ã¼ãã以ä¸ã®ãããªæãã«ããã±ã¼ã¸åãã¾ãã
å¿ ããã GitHub ã Git ã使ããªãã¦ãããã®ã§ãããä»åã¯èª¬æãçãããã®ã§ããã§é²ãã¾ãã
ãã®è¨äºã®æ¬é¡ã«ã¯ãããã¦é¢ä¿ããã¾ãããããã® Destination ã¯ã¢ã©ã¼ãã JSONL å½¢å¼ã§ãã°ãã¡ã¤ã«ã«æ¸ãåºããã¨ãããã®ã«ãã¦ã¿ã¾ããã
Redash ã® requirements.txt ãå¤æ´ãã
ã¢ã©ã¼ãéç¥ã®ããã±ã¼ã¸ã requirements.txt
ã«è¿½å ãã¾ãã
-e git+https://github.com/ariarijp/redash-json-logger-destination.git#egg=redash-json-logger-destination-0.1.0
Redash ã® docker-compose.yml ãå¤æ´ãã
æ¤è¨¼ã«ã¯ Docker ã使ç¨ããã®ã§ãdocker-compose.yml
ã® server
㨠worker
ã® environment
ã«ä»¥ä¸ã追å ãã¾ãã
REDASH_ADDITIONAL_DESTINATIONS: "redash_json_logger_destination"
ãã® REDASH_ADDITIONAL_DESTINATIONS
ç°å¢å¤æ°ã§ãã¢ã©ã¼ãéç¥å
ã追å ãããã¨ãã§ãã¾ãã
追å ããããã®ãè¤æ°ããå ´åã¯ã«ã³ãåºåãã§è¨å®ã§ãã¾ãã
ãã«ããã
requirements.txt
ã®å¤æ´ãåæ ããã¤ã¡ã¼ã¸ããã«ããã¾ãã
ããã«ã¯ããªãæéããããã®ã§æ°é·ã«å¾ ã¡ã¾ãããã
$ docker-compose build
èµ·åãã¦ã¿ã
ããã§æºåã¯å®äºã§ããèµ·åãã¦ã¿ã¾ãããã
$ docker-compose run --rm server create_db $ docker-compose up -d
管çè ã¦ã¼ã¶ã¼ã®è¿½å ãªã©ã®è¨å®ã¯å²æãã¾ãã
è¨å®ç»é¢ãè¦ãã¨ãã¢ã©ã¼ãã®éç¥å ã追å ããã¦ãã¾ãã
ã¾ã¨ã
ãã®æé ã¯ãå»å¹´æ¸ããã¯ã¨ãªã©ã³ãã¼ã追å ããã¨ããè¨äºã¨ã»ã¨ãã©åãã ã£ãããã¾ãã
ä»æãå ã®ãã¤ã¼ããè¦ãã¾ã§ãã£ã¦ã¿ããã¨æã£ããã¨ããªãã£ãã®ã§ãããçµæã¨ãã¦åãããã«ã§ããã®ã§ããã£ãã§ãã