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
The Design Philosophy of Kuroko2
Search
Naoto Takai
January 18, 2017
Programming
2.3k
3
Share
The Design Philosophy of Kuroko2
Internal lightning talks in Cookpad
Naoto Takai
January 18, 2017
More Decks by Naoto Takai
See All by Naoto Takai
Building the Perfect Custom Keyboard
takai
2
730
キースイッチ潤滑入門 / A Brief Introduction to Lube MX Switches
takai
2
850
みなさん、分かっていますか / What is a difference?
takai
1
970
Agile and DevOps with Ruby
takai
2
1.2k
Software Quality and Testing #1
takai
6
730
Microservices in Action
takai
36
5.4k
Ruby App on Netflix Microservices Stack
takai
6
1.1k
How We Use Jenkins?
takai
21
8.6k
COOKPAD and Test Automation
takai
19
2.9k
Other Decks in Programming
See All in Programming
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
6.4k
実用!Hono RPC2026
yodaka
2
170
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
890
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
220
Exploring RuboCop with MCP
koic
0
570
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
410
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
330
Vibe NLP for Applied NLP
inesmontani
PRO
0
410
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
170
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
320
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
270
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
The SEO identity crisis: Don't let AI make you average
varn
0
440
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
180
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
350
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
290
The Mindset for Success: Future Career Progression
greggifford
PRO
0
310
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
130
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Transcript
The Design Philosophy of
• Web-based (not “enterprisy”) • Embedded workflow engine (ruote). •
Distributed architecture • with on demand EC2 provisioning. • communicates with message queue. Kuroko1
kuroko-console RabbitMQ kuoko-worker workflow engine worker process EC2 API launch
exec command web interface web workflow Kuroko1 Overview
kuroko-console RabbitMQ kuoko-worker workflow engine worker process EC2 API launch
exec command web interface web workflow Kuroko1 Pitfalls × × × × × × × × × ×
• It’s really hard to isolate the problem in a
distributed environment. • “Programmable” means programming is always needed. • Nothing is reliable except MySQL. Lessons from Kuroko1
There is data inconsistency between the actual state and the
stored state. Lessons from Kuroko1 (cont.)
State management is a key factor.
• Monolithic is the best. • Data oriented, not process
oriented. • Monitor as possible. Kuroko2
Monolithic Architecture kuroko-console kuoko-worker workflow engine worker process exec command
web interface DB
Kuroko2 Job State job_definitions job_instances tokens noop noop noop noop
/0-noop A job definition A launched job A job state
it do engine.process(token) expect(token.path).to eq '/0-noop' engine.process(token) expect(token.path).to eq '/1-noop'
engine.process(token) expect(token).to be_finished expect(Kuroko2::Token.all.count).to eq 0 end
Kuroko2 Execution State kuroko-worker kuroko-console executions workflow-processor command-executor exec command
loop do execution = Execution.unstarted.take() execution.touch(:started_at) execute_shell(execution.shell) execution.update(exit_status: exit_status, finished_at:
Time.current) execution.finish() end
kuroko-worker kuroko-console executions workflow-processor command-executor exec command Kuroko2 Pitfalls ×
× ×
Kuroko2 Worker Processes command-executor kill process monitor process shell process
exec command
def check_assignment_delay(exec_no_pid) if exec_no_pid.started_at < 1.minutes.ago Kuroko2::Notifications .not_assigned(exec_no_pid, @hostname).deliver_now exec_no_pid.touch(:mailed_at)
end end
def check_process_absence(execution) begin Process.kill(0, execution.pid) rescue Errno::EPERM true rescue Errno::ESRCH
if Execution.exists?(execution.id) notify_process_absence(execution) end end end
• /v1/stats/waiting_execution • /v1/stats/instance Kuroko2 Monitoring API
• State management is a key factor: • monolithic is
the best. • data oriented, not process oriented. • monitor as possible. Kuroko2
is open source product. We are waiting your contributions!