$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DEMO Apps recently implemented
Search
Drumato
August 08, 2021
Programming
0
100
DEMO Apps recently implemented
あるcommunityで発表した雑LT.
Drumato
August 08, 2021
Tweet
Share
More Decks by Drumato
See All by Drumato
仕様と実装で学ぶOpenTelemetry
drumato
2
2.8k
Activities about Kubernetes operation improvements as an SRE
drumato
3
660
Writing an experimental eBPF disassembler
drumato
0
360
An incremental approach to implement an admission controller
drumato
0
250
Components of Kubernetes Cluster
drumato
0
350
cybozu-labs-youth-10th
drumato
1
1.2k
Other Decks in Programming
See All in Programming
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
280
認証・認可の基本を学ぼう前編
kouyuume
0
260
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
410
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
100
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
140
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
0
120
認証・認可の基本を学ぼう後編
kouyuume
0
240
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
110
Developing static sites with Ruby
okuramasafumi
0
310
クラウドに依存しないS3を使った開発術
simesaba80
0
120
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.2k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
72
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Statistics for Hackers
jakevdp
799
230k
Prompt Engineering for Job Search
mfonobong
0
120
YesSQL, Process and Tooling at Scale
rocio
174
15k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
29
Leadership Guide Workshop - DevTernity 2021
reverentgeek
0
160
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
110
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Transcript
最近作ったもの紹介 Drumato
雑談 最近やっていること
Scrapboxになんでもない技術メモ
scrapboxは脳のL1 cacheに良さそう
Controller-runtime Code reading & understanding
本題
最近趣味codingしてない
なまっているか心配
LTのためになんか作る
即席で作ったもの2つ紹介
おもちゃ1
tinetdみたいなのを作る 所要時間: 2~3時間ぐらい
tinet,使わせてもらっています • よくわかっていなくても使える ◦ 適当にREADME読んだら使えました(便利! ◦ Examplesに要件を満たすものが落ちてれば新たに設定書くこともない • Scrap and
Buildがサクサクできる -> 検証に最適! ◦ いちいちVM image落としてきて, confして, FRR installして...とやるのは大変 ◦ Localで動いてすぐ消せる
以下のようなものを作ってみたくなった • なんとなく以下ができたら"楽しそう" ◦ 実行するとup - confを実行 ◦ Signal投げたら勝手にdownする ◦
設定追加したら自動で反映してくれる...? ▪ fileを監視するcodeを書いたことがないので,やってみたい ◦ testが断続的に動いてくれる • 結果的に本家tinetのほうが全然便利,だけど楽しかったのでよし
実装イメージ
Original behavior
tinetd behavior
作る
作り方 • tinet資源は利用せず,1から作る ◦ 理由1: コードが小さくわかりやすかったので十分理解できた ◦ 理由2: 一方でtinetの多機能に全部追従するのは大変そう ◦
結論: コードを読んで最低限の機能を移植すれば良さそう • fsnotifyとかsignalの使い方は勉強 • あとは頑張って作る
結果 • Goで400行くらいで出来た ◦ fsnotify/signal/tickerは使い方はかんたん • 設定とstateの差分でcommand execは意外と大変 ◦ 同じnode
nameはあるが中身は異なるかも -> reflect.DeepEqual() ◦ Nodeが減ってるかも -> map - mapにして差分はdownを実行すればできそう ▪ とりあえず無視
DEMO
None
tinetdから学んだこと • fsnotifyの仕組みはちゃんと知りたいな ◦ まずはinotifyとかから勉強することになるのかな • fsnotifyの用途はなんだろう ◦ "時々fileを開いて読む"で十分なことも多そうなイメージ ◦
Controller-runtimeはtls certificateの監視に使っている • tinetは便利 • それよりnetworkの勉強自体をしなきゃ
おもちゃ2
eBPF disassembler
ありがとうございました