顯示具有 supervisord 標籤的文章。 顯示所有文章
顯示具有 supervisord 標籤的文章。 顯示所有文章

2014年7月26日 星期六

活動:Tainan.py x MOSUT 2014 7 月聚會



Tainan.py x MOSUT 2014 7 月聚會 - kuku

Tainan.py x MOSUT 2014 7 月聚會 - jserv



因為走錯路而遲到,在緊張的心情下(人好多)
我拿出輸出 VGA 有點接觸不良的 ipad 開始了這次的聚會 ... Orz


開場:新 Logo + 把玩 supervisord + Python 報報

(此次開場試用  evernote 簡報功能,開場簡報下載

活動開始後我先投稿做好許久,但是忘了拿出來的 MOSUT Logo ...
原圖下載svg)designed by nao


接著怕整場活動 Python 太少
所以快速介紹一下一個用 python 寫的好用程序管理工具:supervisord
接下來我進行簡短的 Python 工商服務後,就是講者的分享時間了!



跟大師學習:講講瀏覽器渲染 - 當內容遇上裝置



等等,第一位上場的講者難道不是 kuku 嗎?
怎麼投影片是第二位講者 jim Huang (jserv) 的?


是的,這就是 kuku 的「跟大師學習」系列演講,詳情請見下圖:

圖片來自 仁傑

以下為 Isrlab 對當天分享的補充:
昨天 Tainan.py X MOSUT,我們分享了最近研究的課題,主標題是 "向大師學習 - 講講瀏覽器渲染",副標題是 "當數位內容遇上裝置"。
這是一個有趣的年代,數位內容的生產者必須多方考慮眾多裝置差異及各家瀏覽器的渲染能力,我們正在嘗試幫數位內容的開發工具,加一些獨家功能,像是 Flash 編譯器的修改;也考慮深度挖掘瀏覽器的優化可能性,像是 Firefox Gecko 層的擴展。
分享給前端工程師,瀏覽器工程師,系統工程師。

kuku 使用的第二份投影片:Rendering Performance Case Studies (強力推薦一看)



一定會扯到 Python 的「情感運算學習網」上線

第二位講者小均這次為我們介紹 情感運算學習網
並且 demo 一個 辨識情感的小程式 (by python)
( jserv 已玩過改過,且說明其辨識能力不佳)


身為「我要征服台南牛肉湯」的作者,小均「順便」分享一下最近做的研究:

點此觀看研究報告
偷渡一下牛肉湯回報:
民生路那間無名牛肉湯,老闆每天都是自己到善化屠宰場選肉再拿回店面 ... 推!


Build A Lightweight Hypervisor for Realtime Linux

伴隨著隔壁在換招牌的陣陣轟聲
jserv 帥(爆)氣登場,為我們介紹 realtime linux:




工商服務


PyConAPAC 後,各地 Python 社群蓬勃揪團,依開台順序排序:


More info: 


Python 台灣使用者群組 


Or


Python Taiwan @ Facebook 
https://www.facebook.com/groups/pythontw/




筆記:把玩 supervisord


本文是從 evernote 筆記中轉存出來的文章,分享於 Tainan.py x MOSUT 2014.07 




# 看完了 wen 分享的文章以後 …




# 也來試看看用 python 寫的 [老字號] supervisor 吧 (推薦用來管理自己的 process)






# 安裝(盡量在 virtualenv 之外裝) 
pip install supervisor --pre


# 建立 config sample file

echo_supervisord_conf  >  /etc/supervisord.conf


# 修改 config file

[program:foo]
command=/bin/cat


# 建議啟動時讀取自己的 config file

supervisord -c supervisord.conf


# 使用 supervisorctl 來管理自己的 process (使用範例)

[tainanpy etc]$ supervisorctl

backup                           RUNNING    pid 26703, uptime 26 days, 18:18:33
main                               RUNNING    pid 26702, uptime 26 days, 18:18:33
sentry-web                    RUNNING    pid 26701, uptime 26 days, 18:18:33



supervisor> ?

default commands (type help <topic>):
=====================================
add    clear  fg        open  quit    remove  restart   start   stop  update
avail  exit   maintail  pid   reload  reread  shutdown  status  tail  version



supervisor> restart sentry-web

sentry-web: stopped
sentry-web: started



supervisor> status main

main                             RUNNING    pid 26702, uptime 26 days, 18:19:42
supervisor>


# 其實啟動時可以帶很多參數,config 檔支援 *更多* 設置方式


-c FILE, --configuration=FILE
  The path to a supervisord configuration file.
-n, --nodaemon Run supervisord in the foreground.
-h, --help Show supervisord command help.
-u USER, --user=USER
  UNIX username or numeric user id. If supervisord is started as the root user, setuid to this user as soon as possible during startup.
-m OCTAL, --umask=OCTAL
  Octal number (e.g. 022) representing the umask that should be used by supervisord after it starts.
-d PATH, --directory=PATH
  When supervisord is run as a daemon, cd to this directory before daemonizing.
-l FILE, --logfile=FILE
  Filename path to use as the supervisord activity log.
-y BYTES, --logfile_maxbytes=BYTES
  Max size of the supervisord activity log file before a rotation occurs. The value is suffix-multiplied, e.g “1” is one byte, “1MB” is 1 megabyte, “1GB” is 1 gigabyte.
-y NUM, --logfile_backups=NUM
  Number of backup copies of the supervisord activity log to keep around. Each logfile will be of size logfile_maxbytes.
-e LEVEL, --loglevel=LEVEL
  The logging level at which supervisor should write to the activity log. Valid levels are tracedebuginfowarnerror, and critical.
-j FILE, --pidfile=FILE
  The filename to which supervisord should write its pid file.
-i STRING, --identifier=STRING
  Arbitrary string identifier exposed by various client UIs for this instance of supervisor.
-q PATH, --childlogdir=PATH
  A path to a directory (it must already exist) where supervisor will write its AUTO -mode child process logs.
-k, --nocleanup
  Prevent supervisord from performing cleanup (removal of old AUTO process log files) at startup.
-a NUM, --minfds=NUM
  The minimum number of file descriptors that must be available to the supervisord process before it will start successfully.
-t, --strip_ansi
  Strip ANSI escape sequences from all child log process.
-v, --version Print the supervisord version number out to stdout and exit.
--profile_options=LIST
  Comma-separated options list for profiling. Causes supervisord to run under a profiler, and output results based on the options, which is a comma-separated list of the following: cumulativecallscallers. E.g. cumulative,callers.
--minprocs=NUM The minimum number of OS process slots that must be available to the supervisord process before it will start successfully.
supervisorctl Command-Line Options

-c, --configuration
  Configuration file path (default /etc/supervisord.conf)
-h, --help Print usage message and exit
-i, --interactive
  Start an interactive shell after executing commands
-s, --serverurl URL
  URL on which supervisord server is listening (default “http://localhost:9001”).
-u, --username Username to use for authentication with server
-p, --password Password to use for authentication with server
-r, --history-file
  Keep a readline history (if readline is available) 





autorestart
May be one of falseunexpected, or true. If false, the process will never be autorestarted. Ifunexpected, the process will be restart when the program exits with an exit code that is not one of the exit codes associated with this process’ configuration (see exitcodes). If true, the process will be unconditionally restarted when it exits, without regard to its exit code.
Default: unexpected
Required: No.
Introduced: 3.0


# 官網


Try it !


(文件 Host 在 Readthedocs <- 三月份若渴:來分享的外國朋友創辦的服務)