Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Workflow engine with go #2
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tsuji Daishiro
February 07, 2020
Technology
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Workflow engine with go #2
Tsuji Daishiro
February 07, 2020
Transcript
15 slides
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のサポート
楽しいワークフローエンジンライフを!
More Decks by Tsuji Daishiro
See All by Tsuji Daishiro
Starting static analysis with Go
tutuz
0
2.3k
実務で役立つTCPクライアントの作り方
tutuz
6
5.5k
What's new Context in Go1.14
tutuz
2
1.7k
Workflow engine with go
tutuz
0
2k
Nginx cache pitfalls
tutuz
0
300
Check inline expansion with Go
tutuz
0
3.2k
Parallel-Simulated-Annealing
tutuz
3
5.3k
Other Decks in Technology
See All in Technology
プラガブルで宣言的なソフトウェアファクトリーを支えるTypeScript
timakin
5
2k
成長するID管理基盤における運用もコストも犠牲にしないオブザーバビリティ向上の実践 / Improving Observability for a Growing Identity Platform Without Adding Operational Burden or Cost
kaminashi
1
140
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
2
480
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
5
18k
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
4
1.7k
その修正で本当に速くなったのか? k6とOpenTelemetryで確かめる性能改善 / Performance review with k6 and OpenTelemetry
ymotongpoo
3
480
攻撃と守りは何が変わり、何が変わらないのか~最近の不正アクセスから考える、リスク評価と標準の使いどころ
oidfj
2
370
エンタープライズIAMについて - ID・権限をどう統制するか
oidfj
1
360
gradle-best-practices 使ってみた
mikanichinose
0
240
AWS re:Invent 2026 FSI Pre-Event Networking Night
junjikoide
0
330
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
3
1.5k
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
170
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.2k
It's Worth the Effort
3n
188
30k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
370
The World Runs on Bad Software
bkeepers
PRO
72
12k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The browser strikes back
jonoalderson
0
2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
530
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Done Done
chrislema
187
17k
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k