Open iknowright opened 1 year ago
還沒有時間好好 review 但想要先開啟一個討論:在志工性質開發專案引入新的 tech stack (ansible here) 往往需要更謹慎(因志工普遍開發經驗較少、churn rate 也高,故維護成本希望越低越好),因此想丟幾個問題看看大家有沒有什麼意見
👌🏻
但由於目前手動部署的方式我自己也沒有太清楚,所以在 CD 上需要小心。目前只是驗證到可以把 codebase 搬過去,並且 build image (docker-compose up 因為會牽涉一些環境變數與靜態檔案,還沒寫進去)。等大大們評估後才看看怎麼實際導入。
補充:後來發現學習成本其實蠻重的,如果 ssh-action, 對自動化不熟的志工來說就比較淺顯易懂(跑指令),ansible 就比較旋了 (跑 module)。
那就再麻煩 @iknowright 協助補上有關部署、Ansible 使用操作相關的說明文件了,我們可以再下一次例會時討論那份文件,確認每個人可以 follow 文件進行操作,Thanks!
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
a200f81
) 70.80% compared to head (b152d8f
) 70.77%. Report is 5 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
更新了,可以分為以下幾點:
管理者
自行觸發 (使用時機:如果 VM 中斷或者部署失敗,只有有權限的管理可以啟動 action;當環境變數的設定有改動後想要重新部署,則可以手動觸發)。承如 Matt 所說,目前這個專案屬於志工維護性質,導入新的技術時需要審慎的考慮。
以目前的服務規模,似乎還沒有增加這個技術棧 (Ansible ) 需求 ,長期來看後面的組員也不見得有維護 Ansible 的經驗
建議改用 Github Action + SSH 的方式部署至 Instances 內。避免維護上增加未知的風險
詳細可參考此專案 google-github-actions
Hi @tyuchx google-github-actions 其實跟 Ansible 是一樣後面都是 ssh,看起來 ssh-compute 這個套件是專門為 gcp 所設計,而 ansible 是不分平臺的。意思是這個 PR 也是 Github Action + SSH, 只是 SSH 是 ansible 而不是 ssh-compute。不過也蠻有道理 Ansible 要瞭解 playbook 的概念,ssh-compute 則是 script, 直覺上 ssh-compute 應該比較好上手?
主要是看大家是否可以掌握 CD 的精髓,而非後面工具的選擇,如果是選擇工具方面的話,我認爲 Ansible 是很好的選擇。如果要改成用 ssh-compute 我也可以協助。
Types of changes
Description
Add a github action to deploy project to staging VM using ansible Ansible will do:
More Information
Please refer run action on https://github.com/iknowright/pycon.tw/actions/runs/4290521364/jobs/7474619726