Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Workflow engine with go #2
Search
Tsuji Daishiro
February 07, 2020
Technology
0
1.2k
Workflow engine with go #2
Tsuji Daishiro
February 07, 2020
Tweet
Share
More Decks by Tsuji Daishiro
See All by Tsuji Daishiro
Starting static analysis with Go
tutuz
0
2k
実務で役立つTCPクライアントの作り方
tutuz
6
5.2k
What's new Context in Go1.14
tutuz
2
1.5k
Workflow engine with go
tutuz
0
1.8k
Nginx cache pitfalls
tutuz
0
220
Check inline expansion with Go
tutuz
0
2.8k
Parallel-Simulated-Annealing
tutuz
3
4.8k
Other Decks in Technology
See All in Technology
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.2k
M3 Expressiveの思想に迫る
chnotchy
0
110
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
230
A2Aのクライアントを自作する
rynsuke
1
170
“社内”だけで完結していた私が、AWS Community Builder になるまで
nagisa53
1
400
Welcome to the LLM Club
koic
0
170
AIのAIによるAIのための出力評価と改善
chocoyama
2
560
フィンテック養成勉強会#54
finengine
0
180
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
180
Node-RED × MCP 勉強会 vol.1
1ftseabass
PRO
0
140
急成長を支える基盤作り〜地道な改善からコツコツと〜 #cre_meetup
stefafafan
0
120
25分で解説する「最小権限の原則」を実現するための AWS「ポリシー」大全 / 20250625-aws-summit-aws-policy
opelab
9
1.1k
Featured
See All Featured
Building Applications with DynamoDB
mza
95
6.5k
How to train your dragon (web standard)
notwaldorf
94
6.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Side Projects
sachag
455
42k
Site-Speed That Sticks
csswizardry
10
660
Art, The Web, and Tiny UX
lynnandtonic
299
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Unsuck your backbone
ammeep
671
58k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Embracing the Ebb and Flow
colly
86
4.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
Transcript
Goでワークフローエンジンを作る 2020/2/7(Fri) golang.tokyo #29 Future Architect Tsuji Daishiro
Who are you? 辻 大志郎(つじ だいしろう) @d_tutuz 渋谷区役所(~2014/9) Future Architect(2014/10~)
✓ 所属 Technology Innovation Group 競技プログラミング部 2
None
Goの標準コードリーディング会やってます ✓ 社内で標準コードリーディング会やってます ✓ 全12回で、3回まで開催済 ✓ 以下のパッケージ ✓ io ✓
errors ✓ hash/maphash ✓ context ✓ flag ✓ path ✓ testing ✓ iotest ✓ sort ✓ net/http 1 (client) ✓ net/http 2 (server) ✓ database/sql 4
ワークフローエンジンとは? ✓ 以下のようなことを実施するソフトウェア • 定期的なタスクの実行 • タスク間の依存関係を定義でき、順序関係を制御してタスクを実行 • タスクの実行状況/結果を管理 ✓
定型業務の自動化 5
タスクとフロー ✓ タスク:処理の単位 ✓ フロー:タスクの集合 6 タスク フロー タスク タスク
既存のワークフローエンジン 7 ✓ OSSにいろんなワークフローエンジンはある ✓ Apache Airflow ✓ Argo ✓
Rundeck … ✓ 高機能かつ自由度が高いので便利 ✓ 業務のニーズに合わないことも… ✓ タスクをGoで実装できなかったり…
None
Flowerを作った 9 ✓ フロー(Flow)を扱うソフトウェア(er)ということでFlower ✓ 以下を目指して作った ✓ タスクの管理が容易 ✓ タスクをGoで実装可能
✓ https://github.com/d-tsuji/flower
アーキテクチャ 10 ✓ Register(タスクの実行登録) ✓ Watcher(タスクの実行監視/制御) ✓ Worker(タスクの実行)
Flowerの特徴 11 ✓ タスク管理 ✓ タスクの順序をマスタで一括管理 ✓ パラメータなどの埋め込みが可能 ✓ タスクを構成する処理はComponentとしてGoで実装
✓ Exactly Once ✓ リカバリ/リラン ✓ エラー時にどのタスクでエラーになったかわかる仕組みを提供 ✓ テーブルのレコード更新でリランが可能 ✓ 並列実行 ✓ 流量制御
タスクの定義方法 12 ✓ タスクはGoのソースで、実行順序はマスタで管理できるようにしたかった ✓ ただRDSの常時起動はお高く、エコではないので、要検討。組み込みのデータベースを使うなどはある
タスク実行管理/制御 13 ✓ タスクは管理テーブルで永続化 ✓ タスクのロスト、重複実行の制御は最重要な要素の一つ ✓ RDBMSが一番扱いやすい タスク管理テーブル exec_status
0:実行待ち 1:実行中 3:完了
落ち葉拾い 14 ✓ タスク監視のポーリング ✓ キュー(SQSとか)をはさめばイベント通知にできる ✓ イベント or ポーリングをモードとして選択できると良さそう
✓ 内蔵スケジューラ ✓ 管理コンソール ✓ ほしいけどかつ必要だけど、未作成 ✓ GUIによるワークフロー開発 ✓ 任意のDAGのサポート
楽しいワークフローエンジンライフを!