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
CNDF2023前夜祭 - 玄界灘のクラウドネイティブなデータ基盤運用の実践
Search
Kazuhiko Yamashita
August 02, 2023
Technology
1
590
CNDF2023前夜祭 - 玄界灘のクラウドネイティブなデータ基盤運用の実践
CNDF2023前夜祭で話したデータ基盤のSREに関連する話です。
Kazuhiko Yamashita
August 02, 2023
Tweet
Share
More Decks by Kazuhiko Yamashita
See All by Kazuhiko Yamashita
Tuning GraphQL on Rails
pyama86
2
670
ttlcacheのここがスゴい
pyama86
1
63
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
450
実践ARMアーキテクチャ移行
pyama86
2
2.1k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
970
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
59
ペパボOpenTelemetry革命
pyama86
2
1.9k
Site Reliability Engineering for GMO
pyama86
10
1.2k
PHPアプリケーションのスケーラビリティと 信頼性を革新する nginx+ngx_mrubyとGoの融合
pyama86
2
450
Other Decks in Technology
See All in Technology
WebRTC と Wasm の関係を振り返ってみた
tetter27
0
230
What's in a Postgres major release? An analysis of contributions in the v17 timeframe | Claire Giordano | PGConf EU 2024
clairegiordano
1
660
研究の再現性を高める 仕組みをGoでつくる / Creating a system to improve the reproducibility of research using go
linyows
1
100
30万人が利用するチャットをFirebase Realtime DatabaseからActionCableへ移行する方法
ryosk7
2
230
端末が簡単にリモートから操作されるデモを通じて ソフトウェアサプライチェーン攻撃対策の重要性を理解しよう
kitaji0306
0
130
JPOUG_10_20241018_OracleDB_AWS_v1.3.pdf
asahihidehiko
1
240
AWS CDK を活用した 大量 AWS アカウントへのプロビジョニング例 〜 SaaSus Platform の場合 〜 於 JAWS-UG CDK支部 #17
yaggy
1
220
ActiveRecord SQLインジェクションクイズ (Rails 7.1.3.4)
kozy4324
8
2k
LLMアプリをRagasで評価して、Langfuseで可視化しよう!
minorun365
PRO
2
190
Databricksワークショップ - 生成AIとDWH
taka_aki
2
4.5k
Snowflakeでスロークエリ改善に取り組んだ話
tabata0208
0
160
CAMERA-Suite: 広告文生成のための評価スイート / ai-camera-suite
cyberagentdevelopers
PRO
1
130
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
Designing for humans not robots
tammielis
249
25k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
The Invisible Side of Design
smashingmag
297
50k
Statistics for Hackers
jakevdp
796
220k
YesSQL, Process and Tooling at Scale
rocio
167
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Transcript
ݰքṗͷΫϥυωΠςΟϒͳ σʔλج൫ӡ༻ͷ࣮ફ ʙॵ͍ʂʂՆͩʂʂʂૣ͘ϏΞΨʔσϯߦ͖͍ͨʂʂ̍ฤʙ
ࢁԼ!QZBNB (.0ϖύϘٕज़ج൫νʔϜ γχΞɾϓϦϯγύϧ ɹΩϟϯϓɺཱྀߦɺώϧτϯ८ΓɺιϫχΤ८Γ ($1ɺ"JS fl PXɺ1VC4VCɺ%BUB fl PX
ࠓ͢͜ͱ γεςϜ֓ཁ ͦ͜ʹ͋ͬͨ՝ ͲͷΑ͏ʹղܾͨ͠ͷ͔
ϗεςΟϯάࣄۀ &$ࢧԉࣄۀ ϋϯυϝΠυɾͦͷଞࣄۀ
γεςϜߏ Ingest Pipeline DataFlow CloudComposer Extract Analytics ML BigQuery Vertex
AI source monitor Cloud Logging Cloud Monitoring DBσʔλɺϩάΛBigQueryʹू Pub/Sub
σʔλج൫ͷར׆༻ ྨࣅը૾ݕࡧ ਪન ੜ࢈ੑࢦඪͷଌఆ
ͳ͕ͥʁʁʁ
https://note.com/udzura/n/n5c8647d38 ff f ΑΓҾ༻
ͦ͜ʹ͋ͬͨ՝ མͪଓ͚ΔDAGͱຫੑతͳτΠϧ ΤϯυϢʔβʔ͔ΒͷϑΟʔυόοΫͰݦࡏԽ͢Δো ޮͷѱ͍։ൃ
མͪଓ͚ΔDAGͱ ຫੑతͳτΠϧ
γεςϜߏ Ingest Pipeline DataFlow CloudComposer Extract Analytics ML BigQuery Vertex
AI source monitor Cloud Logging Cloud Monitoring DBσʔλɺϩάΛBigQueryʹू Pub/Sub
མͪଓ͚ΔDAGͱຫੑతͳτΠϧ DAG = Directed Acyclic Graph = ༗ඇ८ճάϥϑ https://air fl
ow.apache.org/docs/apache-air fl ow/stable/core-concepts/dags.html ΑΓҾ༻
DAGͷࣦഊཁҼ 1.༷ʑͳλΠϜΞτ 2.࿈ٳʹΑΔσʔλͷܽଛ 3.ιʔεͷσʔλߏͷมߋɺଐੑ 4.มߋʹΑΔΤϯόά
τΠϧͨΔॴҎ 1.༷ʑͳλΠϜΞτ → ϦτϥΠɺλΠϜΞτᮢมߋ 2.࿈ٳʹΑΔσʔλͷܽଛ → ϦτϥΠɺεΩοϓ 3.ιʔεͷσʔλߏɺଐੑͷมߋ → มߋ͓ͯ͠͠·͍
4.มߋʹΑΔΤϯόά → मਖ਼͓ͯ͠͠·͍
None
ॳख SLI/SLOͷࡦఆ
SLO/SLOͷࡦఆ ʮͳʹ͔ΒΔ͔ʁʯ - վળͷ༏ઌॱҐ ʮͲΕ͘Β͍Δ͔ʯ - Ͱվળͷ߹͍ΛܾΊΔ ·ͣࢦඪΛ࡞Δ͜ͱͰɺۦಈͰҙࢥܾఆͰ͖Δ
SLO/SLOͷࡦఆ SREϫʔΫϒοΫ - Ch 13. Data Processing Pipelines ͲͷΑ͏ʹܾΊΔ͔ʁ https://sre.google/workbook/data-processing/
https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/sli-metrics/data-proc-metrics?hl=ja Google Cloud ΦϖϨʔγϣϯεΠʔτ σʔλॲཧαʔϏε
SLO/SLOͷࡦఆ GrafanaͰ؆୯ʹμογϡϘʔυԽͰ͖Δ
SLO/SLOͷࡦఆ 1.DAGͷޭ 2.DataFlowδϣϒʹ͓͚ΔΤϥʔͷൃੜ 3.DataFlowδϣϒͷεςοϓʹ͓͚Δσʔλͷ
վળͷଧͪख λΠϜΞτͷཁҼͱͳΔɺԆΛऔΓআ͘ɺՁ؍Λৢ͢Δ λΠϜΞτʹ͍ͭͯɺϝτϦΫε͔Βଥͳ͔Λ֬ೝ͢Δ 1. ༷ʑͳλΠϜΞτ
վળͷଧͪख holiday-jpΛ׆༻ͯ͠ɺ࿈ٳ࣌ͷॲཧΛ࣮ BigQuery͔ΒUDFͰ࿈ٳͷ݅ΛఆٛͰ͖ΔΑ͏ʹͨ͠ 2.࿈ٳʹΑΔσʔλͷܽଛ
վળͷଧͪख DebeziumͰDDLΛݕͨ͠ΒSlack௨͢Δ σʔλͷNULLൺ͕૿͑ͨΒ௨͢Δ 3.ιʔεͷσʔλߏɺଐੑͷมߋ https://github.com/pyama86/debezium-ddl-noti fi er/
վળͷଧͪख ຖશDAGΛޕલɺޕޙʹ࣮ߦͯ͠ɺຊ൪࣮ߦΑΓ σʔλͷෆ߹ͳͲΛૣ͘ݕ Ϣχοτςετͷ֦ॆ 4. มߋʹΑΔΤϯόά
࠷͓ۙئ͍ͯ͠ɺTABΛԡ͚ͩ͢ͷࣄͰ͢ ## ೖྗ༷ - Air fl owͷDAGͷϑΝΠϧΛೖྗͱ͠·͢ ## αϯϓϧ࣮1 ```python
{sample1} ``` ## αϯϓϧ࣮2 ```python {sample2} ``` ## ࢦࣔ - ೖྗͱͯ͠͞ΕͨDAGͷςετίʔυΛpytestΛ༻͍࣮͍ͯͯͩ͘͠͞ɻ - Ϋϥεʹ͍ͭͯspymockΛ༻͍ͯϞοΫԽ͍ͯͩ͘͠͞ɻ - 2ͭͷαϯϓϧ࣮Λࣔ͠·͢ɻͦΕΛࢀߟʹ͍ͯͩ͘͠͞ɻ - ͋ͳ͕ͨੜͨ͠ςετͦͷ··ϑΝΠϧʹอଘͯ͠ɺ࣮ߦ͠·͢ɻग़ྗ༰ͷઆ໌ͳͲෆཁͰ͢ɻ ## ೖྗ ϑΝΠϧ໊:{dag_ fi le_path} ```python {dag_ fi le_content} ``` ... $ poetry run python bin/test_generator.py dags/example.py
ΤϯυϢʔβʔ͔Βͷ ϑΟʔυόοΫͰݦࡏԽ͢Δো
ʁʁʁʮࠓͷσʔλ͕ೖͬͯͳ͍Έ͍ͨ ͳΜͰ͚͢ͲɺͳΜ͔͋Γ·ͨ͠ʁʯ
ͳΜͱɺࢹ͕ ΄ͱΜͲͳ͍ͷͰ͋Δ (؆қతͳσʔλ߹ੑͷςετ͕͋Δ͚ͩ)
γεςϜߏ Ingest Pipeline DataFlow CloudComposer Extract Analytics ML BigQuery Vertex
AI source monitor Cloud Logging Cloud Monitoring DBσʔλɺϩάΛBigQueryʹू Pub/Sub
ࢹࣾձ AWSͰECS͍ͬͯΔͱ͜ΖMackerel Container Agentಋೖ Cloud MonitoringͷΞϥʔτఆٛΛSLIʹ߹ΘͤͯTerraformͰ࣮ GCPͱൺͯར༻ن͕খ͍ͨ͞ΊɺશࣾͰར༻͞Ε͍ͯΔMackerelΛར༻͢Δ͜ͱͰ ֶशɺಋೖίετͷݮ
σʔλύΠϓϥΠϯͷࢹ ΰʔϧσϯσʔλͷೖ <source> @type dummy @label @INPUT tag example dummy
{ "accessed_at": "2022-01-01T00:00:00Z", "account_id": 1, "client_id": "12345abcde", "event": "example_event", } </source> https://docs. fl uentd.org/v/0.12/input/dummy ຖඵμϛʔσʔλΛ ύΠϓϥΠϯʹྲྀ͠ɺ ΤϯυϙΠϯτͰࢹ
ޮͷѱ͍։ൃ
γεςϜߏ Ingest Pipeline DataFlow CloudComposer Extract Analytics ML BigQuery Vertex
AI source monitor Cloud Logging Cloud Monitoring DBσʔλɺϩάΛBigQueryʹू Pub/Sub
։ൃڥͱۚͱݖྗ Cloud ComposerͷڥͰ݁߹ςετΛ࣮ߦ͢ΔͨΊʹɺ ςετ༻ͷڥΛຖேࣗಈ࡞ɺຖ൩ࣗಈআ ίετͱνʔϜߏΛؑΈͯɺຖே̎ڥ࡞ͯ͠ɺڞ༻
։ൃڥͱۚͱݖྗ Cloud ComposerͷڥͰ݁߹ςετΛ࣮ߦ͢ΔͨΊʹɺ ςετ༻ͷڥΛຖேࣗಈ࡞ɺຖ൩ࣗಈআ → ো࣌ɺ࣌ؒ֎ʹ͑ͳ͍ ίετͱνʔϜߏ͔Β̎ڥ࡞ͯ͠ɺڞ༻ → ςετͪͷൃੜɺग़ྗ݁Ռͷࠞ߹
I'm Kubernetes Rock Star ΦϯϓϨϛεͷKubernetes্ͰPR͝ͱʹ࣮ߦڥΛ࡞ https://tech.pepabo.com/2023/07/07/data-platform-ci/
ਓͱνΣοΫϦετ DAG A DAG B ࣮ͷ֬ೝΛਓ͕͍ͬͯͨ EmptyOperator( taks_id="external_task_sensor_target )
ྲྀΕͷRuby Rock Star ʮͦΕASTݟͨΒ͍͍͡ΌΜʯ
Abstract Syntax Tree from air fl ow.operators.empty import EmptyOperator EmptyOperator(task_id="child_task3")
% python -m ast example.py Module( body=[ ImportFrom( module='air fl ow.operators.empty', names=[ alias(name='EmptyOperator')], level=0), Expr( value=Call( func=Name(id='EmptyOperator', ctx=Load()), args=[], keywords=[ keyword( arg='task_id', value=Constant(value='child_task3'))]))], type_ignores=[]) grepͰͰ͖ͳ͍͜ͱɺ੩తղੳͳΒղܾͰ͖Δ
͜͜·Ͱͨ͜͠ͱ σʔλج൫ͷ։ൃɺӡ༻ʹ͓͚Δ՝Λ SREͷεΩϧͰվળ
Ҿୀࣦഊʂʂ1
શํҐ࠾༻͍ͯ͠·͢ɻ .-ͬͱΓ͍ͨ͠ɺ43&ͬͱ͓͠Ζ͍ͨ͘͠ ࠷৽ͷ࠾༻ใΛνΣοΫˠ !QC@SFDSVJU
ಥવͰ͕͢ɺ ൧ͷΛ͠·͢
झຯιϫχΤΊ͙Γ https://www.web-soigner.jp/magazine_hakata_gourmet_guide/ Α͏ͦ͜Ԭʂʂ̍
ډञ
ར͖ͷ͔ͨࢤ ٬୯Ձ :4000ʙ6000ԁ ॴ: ᷫԂ ਪਓ: 2 - 4ਓ ਪ͠ɿڕ͔Βͳʹ·Ͱɺ͕ͯ͢ඒຯ͍ɺ
ຊञछྨ͕͋Γ๛ɻ ͦͯ͠ɺWEB༧Ͱ͖Δɻ ࢲతNo.1
͍ͤΜ͍ ٬୯Ձ :6000ʙ8000ԁ ॴ: தऱ ਪਓ: 2 - 8ਓ ਪ͠ɿ҆͘ͳ͍͕ɺԿ৯ͯඒຯ͍ɻ
ΤϏϑϥΠ͕৴͡ΒΕͳ͍σΧ͞ͳͷͱ ͠ඒຯ͍ɻ
ḉ ٬୯Ձ :4000ʙ8000ԁ ॴ: தऱ ਪਓ: 2 - 8ਓ ਪ͠ɿͱʹ͔͘ḉͱञɻ
͋Μ·ΓຊभͰ৯Εͳ͍ḉͩͱࢥ͏
ڕࡾಙ ٬୯Ձ :3000ʙ5000ԁ ॴ: ᷫԂ ਪਓ: 2 - 8ਓ ਪ͠ɿڕͱञ͕͍҆ɻͱʹ͔҆ͯ͘͘ɺඒຯ͍
ୋউ ٬୯Ձ :4000ʙ6000ԁ ॴ: தऱ ਪਓ: 2 - 8ਓ ਪ͠ɿ෦ͷ໊લ͕ϗʔΫεͷબखɻ
ΊͪΌඒຯ͍Θ͚͡Όͳ͍͚Ͳɺ ԿͰ͋Δɻศརɻ
ϥʔϝϯ
Ұ ٬୯Ձ :1000ԁ ॴ: ᷫԂɺതଟ ਪ͠ɿಲࠎofಲࠎ ͍͍ͩͨ৯͏ͱ͖ ᬦᬡͯ͠Δ͔Β ࣸਅͳ͔ͬͨ
໊ౡ ٬୯Ձ :1000ԁ ॴ: തଟɺ໊ౡ ਪ͠ɿͦΜͳʹ͍ڧ͘ͳͯ͘ɺ ɹɹɹόϥϯε͕͍͍ɻ͖
݉ދ ٬୯Ձ :1000ԁ ॴ: ఱਆɺതଟ ਪ͠ɿԬͰྲྀߦͬͯΔ͚ͭ໙ɻ ɹɹɹύϧί͕Ұ൪ฒͳ͍͔
φϯόʔϫϯ ٬୯Ձ :1000ԁ ॴ: ఱਆɺതଟɺᷫԂ ਪ͠ɿ͜ͷลͰ৯ΕΔܥͰҰ൪͖ɻ ී௨ͷϥʔϝϯʹމຑͱߚੜᇙ͍Εͯ ৯Δͷ͕͓͢͢Ί
ͦͷଞ
Τετ ٬୯Ձ :1000ԁ ॴ: Ͳ͜Ͱ͋Δ ਪ͠ɿϩʔΧϧ͏ͲΜνΣʔϯɻ ͏ͲΜࡉ໙ʹωΪଟΊ͕͖ɻ ډञͰɺ৴͡ΒΕͳ͍ίεύ
ؒඈߦ ٬୯Ձ :3000-5000ԁ ॴ: തଟ ਪ͠ɿޫʹೖͬͯΔϗςϧόʔɻ Ҝࢠ͕͍͍ͷͱΏͬ͘ΓͤΔɻ ɹɹɹτϫΠϥΠτͱ͍͏ΧΫςϧ͕͖
ϐΤτϩ ٬୯Ձ :1000-3000ԁ ॴ: Ͳ͜Ͱ͋Δ ਪ͠ɿϥϯνͰͰɺεύʔΫϦϯάͱ ɹɹɹύελorϐβͰܹ҆ඒຯ͍
࠷ߴͷCNDF2023ʹ ͠·͠ΐ͏ʂʂʂ