Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
runn is a package/tool for running operations following a scenario. / golang.tokyo #32
Ken’ichiro Oyama
May 19, 2022
Technology
1
280
runn is a package/tool for running operations following a scenario. / golang.tokyo #32
https://golangtokyo.connpass.com/event/246982/
Ken’ichiro Oyama
May 19, 2022
Tweet
Share
More Decks by Ken’ichiro Oyama
See All by Ken’ichiro Oyama
GitHub Actions Deep Dive using PHP / PHPerKaigi 2022
k1low
0
900
io/fs.FS for testability. io/fs.FS for abstraction. / Go Conference 2021 Autumn (Online)
k1low
0
300
Continuous Documentation - CI/CDパイプラインを活用した文書化技術 - / Pepabo Tech Conference #16
k1low
1
160
システムの変化に追従可能でかつ理解し易いドキュメントシステムのモデル化 / Web System Architecture #8
k1low
9
3k
目的に沿ったDocumentation as Codeをいかにして実現していくか / PHPerKaigi 2021
k1low
15
4.3k
Documentation as Codeで継続的なドキュメント運用を実現する / July Tech Festa 2021 winter
k1low
6
5k
tblsで実現したいシステムとGoによるその実装 / Fukuoka.go#16
k1low
1
350
データ基盤のメタデータを継続的に管理できる仕組みを作る(ペパボ編) / pepabohatena
k1low
5
1.6k
知らないWebアプリケーションの開発に途中からJOINしたとき、どこから切り込むか? / PHPerKaigi 2020
k1low
30
11k
Other Decks in Technology
See All in Technology
Building smarter apps with machine learning, from magic to reality
picardparis
4
3.2k
ひとりでも安定して 組織を変える活動を続けていくための ストレスマネジメント
pastelinc
0
750
JJUG2022_spring_Keycloak (Red Hat Single Sign-on)
tinoue
0
190
GeoLocationAnchor and MKTileOverlay
toyship
0
100
組織の崩壊と再生、その中で何を考え、感じたのか。 そして本当に必要だったもの
kosako
0
950
はてなブログとチーム構成とスクラムのこの1年 #dmm_hatena
polamjag
0
1.1k
JUnit5.7, 5.8の新機能紹介 #jjug_ccc #jjug_ccc_b / junit 5.7, 5.8 new features
kyonmm
PRO
2
400
Istio入門
nutslove
15
4.8k
サーバレスECにおける Step Functions の使い方 〜ステートマシン全部見せます!〜
miu_crescent
0
140
出張スクラムマスターとしての FEARLESS CHANGE な生き方
naitosatoshi
1
1.1k
音のような言葉 〜ちゃちゃっとチャットで楽しむちょっとしたコツ〜 / words like sounds
satoryu
1
1.3k
JDK Flight Recorder入門
chiroito
1
470
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
238
11k
Atom: Resistance is Futile
akmur
255
20k
Building a Scalable Design System with Sketch
lauravandoore
447
30k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
52k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
315
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
119
28k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
11
4.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
236
1M
Rebuilding a faster, lazier Slack
samanthasiow
62
7.2k
Infographics Made Easy
chrislema
233
17k
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
940
Transcript
runn is a package/tool for running operations following a scenario.
খࢁ݈Ұ / GMO PEPABO inc. 2022.5.19 golang.tokyo #32 1
2
• GoͰAPIαʔόΛ։ൃ͍ͯ͠Δ • ୯ҰͷAPIΤϯυϙΠϯτͷςετͰͳͯ͘ෳͷAPIΤϯυϙΠϯτΛ·͍ͨͩ ςετΛॻ͖͍ͨ • ྫ: ϝʔϧೝূΛؚΜͩαΠϯΞοϓ • ྫ:
γϣοϐϯάΧʔτʢબ͔Βߪೖྃ·Ͱʣ • APIΤϯυϙΠϯτͰσʔλϕʔεૢ࡞͕͋ΔͷͰ͋ΕςετσʔλϕʔεΛ༻ҙ ࣮ͯ͠ࡍʹಡΈॻ͖ൃੜ͢ΔςετΛॻ͖͍ͨ 3 https://github.com/k1LoW/runn ։ൃͷϞνϕʔγϣϯ
• runn ( means "Run N" ) is a package/tool
for running operations following a scenario. • γφϦΦΛYAMLʹॻ͍ͯͦΕΛͬͨςετΛ࣮ߦͰ͖Δύοέʔδ/πʔϧ • ࣮ͷ͋ΔΑ͘ΒΕ͍ͯΔπʔϧͱͯ͠ https://github.com/zoncoen/scenarigo ͕͋Δ • ಛͱͯ͠ҎԼͷ௨Γ • γφϦΦ࣮ߦͷCLIίϚϯυʢπʔϧʣͱͯ͠༻Ͱ͖Δ • GoͷTest Helperʢύοέʔδʣͱͯ͠༻Ͱ͖Δ • γφϦΦϑΝΠϧͷϑΥʔϚοτ͕OpenAPI SpecϥΠΫ • γφϦΦͷεςοϓؒͷͷ࿈ܞ͕ߟྀ͞Ε͍ͯΔ 4 https://github.com/k1LoW/runn runn
• runn࠷ऴతʹ1ͭҎ্ͷγφϦΦΛ࣮ߦͯ͠ɺͦΕͧΕͷޭ/ࣦഊΛΈΔ • γφϦΦ1ͭҎ্ͷεςοϓ͔Βߏ͞Ε͍ͯΔ • 1γφϦΦ1YAMLϑΝΠϧʹͳ͍ͬͯΔʢRunbookͱݺΜͰ͍Δʣ • γφϦΦ͝ͱʹRunnerͱݺΜͰ͍Δεςοϓ࣮ߦίϯϙʔωϯτΛఆٛ͠ɺͦͷRunnerΛ֤ͬͯ εςοϓΛ࣮ߦ͍ͯ͘͠ •
RunnerʹγφϦΦʹఆ͕ٛඞཁͳ௨ৗͷRunnerͱɺطʹrunnͰ༻ҙ͍ͯ͠ΔBuilt-in runnerͷ2 छྨ͕͋Δ • Runner: HTTP Runner, DB Runner • Built-in runner: Exec runner, Test runner, Dump runner, Include runner, Bind runner 5 https://github.com/k1LoW/runn ΞʔΩςΫνϟ
6 γφϦΦʢRunbookʣΛॻ͘
7 https://github.com/k1LoW/runn
8 https://github.com/k1LoW/runn
9 https://github.com/k1LoW/runn
10 https://github.com/k1LoW/runn
11 https://github.com/k1LoW/runn
12 https://github.com/k1LoW/runn
13 https://github.com/k1LoW/runn
14 https://github.com/k1LoW/runn
15 https://github.com/k1LoW/runn
• runnTest helperͱͯ͠༻͢Δͱ͖ɺγφϦΦʹఆٛͯ͠ΔRunnerΛࠩ͠ସ͑Δ͜ͱ͕Ͱ͖Δ • HTTP RunnerͷϦΫΤετઌΛ httptest.Server ͷURLʹͨ͠Γ • http.HandlerΛͯ͠
http.Handler ʹϦΫΤετΛ͢Α͏ʹͨ͠Γ • DB RunnerͷΫΤϦ࣮ߦઌΛผͷςετσʔλϕʔεʹͨ͠Γ 16 https://github.com/k1LoW/runn Test helperͱͯ͠ͷརศੑΛ্ͤ͞Δ (1/2)
17 https://github.com/k1LoW/runn As a test helper using httptest.Server
18 https://github.com/k1LoW/runn As a test helper with http.Handler
• γφϦΦࣗମ͕ؒҧ͍ͬͯͳ͍Α͏ʹ͢Δͱͯ͠HTTP Runnerͷ߹ɺεΩʔϚʹԊͬͨόϦ σʔγϣϯΛಉ࣌ʹΒͤΔΈΛఏڙ͍ͯ͠Δʢݱࡏ OpenAPI Spec v3ͷΈରԠʣ • ʮͦͦͦͷγφϦΦͷϦΫΤετ͕ؒҧ͍ͬͯΔʯΛ͙ •
͍ͭͰʹʮϨεϙϯε͕ؒҧ͍ͬͯΔʯݟ͚ͭΔ 19 https://github.com/k1LoW/runn Test helperͱͯ͠ͷརศੑΛ্ͤ͞Δ (2/2)
͓ΘΓʹ 20
• ·͍ͩ࢝Ί͔ͨΓ͕ͩɺݸਓతʹେ͖Ίͷςετ͕ΧδϡΞϧʹॻ͖͘͢ ͳͬͨͱײ͍ͯ͡Δ • σʔλϕʔεͷΛ༻ͨ͠ςετ͕ॻ͚Δͷ͕Τά͍͕ศར • ࠓճհ͍ͯ͠ͳ͍Include runnerBind runnerͳͲʹڵຯ͕͋Δํ README
Λ ͝ཡ͍ͩ͘͞ • ࠓޙͷలͱͯ͠ɺgRPCରԠΛͯ͠Έ͍ͨ 21 https://github.com/k1LoW/runn ͓ΘΓʹ
ࣗݾհ ٕज़෦ɹٕज़ج൫νʔϜ 2018 த్ೖࣾ খࢁ ݈Ұ Ken’ichiro Oyama গ࣮͠༻తͰখ͞ͳOSSΛॻ͘ͷ͕झຯɻ •
GitHub : k1LoW • Twitter : @k1LoW 22 We are hiring!! @pb_recruit
Thank You! Thank You! 23
24 ͓·͚
• github.com/k1LoW/duration • “3 days 4 hours” Έ͍ͨͳจࣈྻ͔Β time.Duration Λੜ͢Δ
• github.com/k1LoW/expand • YAMLϑΝΠϧʹҰׅͰ os.ExpandEnv Λద༻ͨ͠Γ͢Δͷʹ༻͍ͯ͠Δ 25 ͓·͚ runnͷgo.modʹ͍ΔΦϨΦϨϥΠϒϥϦ2બ