本文同步發佈於毛毛的踩坑人生
來到最後一天了
在前面 29 天裡面
我們從 Python -> Golang -> Flutter
一路從券商串到我們的手指頭
這真的是後端、前端都做
如果都有掌握住技能
那就是標題裡面的『全棧工程師啦』
What is a full-stack engineer?
A full-stack engineer is a high-level software engineer that works to design, test, and implement various software applications. They create software, applications, and scalable web services, while also providing leadership for coding teams. Full-stack engineers usually possess prodigious skills and are involved in each stage of software development. This can include data structure completion, architecture design, code review, performance evaluation, internal tool management, and updates. The term “full-stack” refers to the engineer’s ability to work on both the front-end and back-end development of an application.
好啦,我知道其實還差很遠
但基本上還算是半個🤣
在之前的天數當中
都主要是最基本的實作為優先
但現今最夯的 DevOps
講述到的可不只是程式開發
而是到部署、監控
自動化部署是必須的
如果每一次都要手動部署
不僅容易錯,也容易因為各種原因導致不明原因錯誤
我這邊提供一些方向
除了 Flutter
之外,其餘專案都應該要容器化,比如說 Docker
部署的地方也要慎選,絕對不要選在自己常用的機器上,常用的選擇如下
自動化工具我常用的是 Ansible,這邊弄通對職涯也會很有幫助的
CI/CD
也是需要使用的,筆者私人常用 Github Action,工作上反而比較常用 Gitlab CI
筆者選用的組合是 ESXi
、Ansible
、Github Action
TASK [setup_trader : Start Rabbitmq] **********************************************************************************************************************************************
Friday 13 October 2023 22:46:29 +0800 (0:00:08.727) 0:00:43.314 ********
changed: [trader]
TASK [setup_trader : Check if is listening] ***************************************************************************************************************************************
Friday 13 October 2023 22:46:42 +0800 (0:00:12.498) 0:00:55.812 ********
ok: [trader]
TASK [setup_trader : Create env folder] *******************************************************************************************************************************************
Friday 13 October 2023 22:46:47 +0800 (0:00:05.611) 0:01:01.423 ********
ok: [trader]
TASK [setup_trader : Configure ToC Sinopac Python] ********************************************************************************************************************************
Friday 13 October 2023 22:46:48 +0800 (0:00:00.561) 0:01:01.984 ********
ok: [trader]
TASK [setup_trader : Start ToC Sinopac Python] ************************************************************************************************************************************
Friday 13 October 2023 22:46:49 +0800 (0:00:00.983) 0:01:02.968 ********
changed: [trader]
TASK [setup_trader : Create env folder] *******************************************************************************************************************************************
Friday 13 October 2023 22:47:04 +0800 (0:00:15.048) 0:01:18.016 ********
ok: [trader]
TASK [setup_trader : Configure ToC Fugle Python] **********************************************************************************************************************************
Friday 13 October 2023 22:47:04 +0800 (0:00:00.559) 0:01:18.575 ********
ok: [trader]
TASK [setup_trader : Start ToC Fugle Python] **************************************************************************************************************************************
Friday 13 October 2023 22:47:05 +0800 (0:00:00.977) 0:01:19.553 ********
changed: [trader]
TASK [setup_trader : Create env folder] *******************************************************************************************************************************************
Friday 13 October 2023 22:47:18 +0800 (0:00:12.801) 0:01:32.355 ********
ok: [trader]
TASK [setup_trader : Create config folder] ****************************************************************************************************************************************
Friday 13 October 2023 22:47:19 +0800 (0:00:00.562) 0:01:32.918 ********
ok: [trader]
TASK [setup_trader : Configure ToC Machine Trading Env] ***************************************************************************************************************************
Friday 13 October 2023 22:47:19 +0800 (0:00:00.573) 0:01:33.492 ********
ok: [trader]
TASK [setup_trader : Configure ToC Machine Trading Config] ************************************************************************************************************************
Friday 13 October 2023 22:47:20 +0800 (0:00:00.979) 0:01:34.472 ********
ok: [trader]
TASK [setup_trader : Start ToC Machine Trading] ***********************************************************************************************************************************
Friday 13 October 2023 22:47:21 +0800 (0:00:01.040) 0:01:35.512 ********
changed: [trader]
PLAY [RESET TRADER] ***************************************************************************************************************************************************************
PLAY [CENTER SETUP] ***************************************************************************************************************************************************************
PLAY [RESET CENTER] ***************************************************************************************************************************************************************
PLAY [BLOG SETUP] *****************************************************************************************************************************************************************
PLAY [RESET BLOG] *****************************************************************************************************************************************************************
PLAY [HB SETUP] *******************************************************************************************************************************************************************
PLAY RECAP ************************************************************************************************************************************************************************
trader : ok=34 changed=13 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
Friday 13 October 2023 22:47:31 +0800 (0:00:09.132) 0:01:44.644 ********
===============================================================================
setup_trader : Start ToC Sinopac Python ----------------------------------------------------------------------------------------------------------------------------------- 15.05s
setup_trader : Start ToC Fugle Python ------------------------------------------------------------------------------------------------------------------------------------- 12.80s
setup_trader : Start Rabbitmq --------------------------------------------------------------------------------------------------------------------------------------------- 12.50s
setup_trader : Install loki ------------------------------------------------------------------------------------------------------------------------------------------------ 9.40s
setup_trader : Start ToC Machine Trading ----------------------------------------------------------------------------------------------------------------------------------- 9.13s
setup_trader : Start node exporter ----------------------------------------------------------------------------------------------------------------------------------------- 8.77s
setup_trader : Start Nginx ------------------------------------------------------------------------------------------------------------------------------------------------- 8.73s
setup_trader : Check if is listening --------------------------------------------------------------------------------------------------------------------------------------- 5.61s
setup_trader : Login Docker Hub Container Registry ------------------------------------------------------------------------------------------------------------------------- 2.72s
Gathering Facts ------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.58s
setup_trader : Reload docker ----------------------------------------------------------------------------------------------------------------------------------------------- 1.53s
setup_trader : Get temp docker token --------------------------------------------------------------------------------------------------------------------------------------- 1.34s
setup_trader : Get remaining ----------------------------------------------------------------------------------------------------------------------------------------------- 1.29s
setup_trader : Enable loki ------------------------------------------------------------------------------------------------------------------------------------------------- 1.26s
setup_trader : Diable loki ------------------------------------------------------------------------------------------------------------------------------------------------- 1.06s
setup_trader : Configure Docker -------------------------------------------------------------------------------------------------------------------------------------------- 1.04s
setup_trader : Configure ToC Machine Trading Config ------------------------------------------------------------------------------------------------------------------------ 1.04s
setup_trader : Configure Nginx --------------------------------------------------------------------------------------------------------------------------------------------- 1.03s
setup_trader : Configure ToC Sinopac Python -------------------------------------------------------------------------------------------------------------------------------- 0.98s
setup_trader : Configure ToC Machine Trading Env --------------------------------------------------------------------------------------------------------------------------- 0.98s
像上面就是遠端部署到雲端的機器上
真正的達到一鍵部署
程式開發難免遇到 bug
甚至是 CPU、記憶體不如預期
但如果今天你把服務開在遠方
更是不可能直接看到終端上的 log
所以監控、報警就非常重要了
這邊提供一些我用過的方案
grafana: 一套很簡單架設的看板系統
loki: 可以掛載在 grafana
中的日誌收集系統
prometheus: 可以在各大語言中實作,最後在統一由一個 client
收集資訊,可以自定義很多資料型態
筆者分享一下我的看板
前面講到的都是後端
今天最後面的 Flutter APP
是否需要上架端看個人需求
如果要上 iOS App Store
那真的要做好資安管控,因為畢竟是面向大眾
除非你要申請企業方案,但我想那不符合成本
無論上架與否
至少需要有 Apple/Google
的開發者帳號
花了 30 天
來講述一個初級全棧程式交易的大專案歷程
希望有幫助到你們
我想致敬那些年完賽的前輩們
無論文章長度如何
要堅持 30 天,真的是挺不容易了
何況我中間還去了一趟日本🤣
最後再來回顧一下這次的成品