isle/docs/dev/daemon-process-tree.svg
Brian Picciano 5e08061cd6 Factor out garage-entrypoint
The daemon entrypoint now starts the garage child processes directly,
without the extra step of indirection
2022-10-16 20:48:33 +02:00

86 lines
17 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="750px" preserveAspectRatio="none" style="width:2047px;height:750px;background:#FFFFFF;" version="1.1" viewBox="0 0 2047 750" width="2047px" zoomAndPan="magnify"><defs/><g><!--MD5=[94d69829b8642ebae4272c0fe4460dd1]
cluster AppDir--><g id="cluster_AppDir"><path d="M19.5,110 L2021.5,110 A12.5,12.5 0 0 1 2034,122.5 L2034,136.2969 L7,136.2969 L7,122.5 A12.5,12.5 0 0 1 19.5,110 " fill="#F1F1F1" style="stroke:#F1F1F1;stroke-width:1.0;"/><rect height="634" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;fill:none;" width="2027" x="7" y="110"/><line style="stroke:#181818;stroke-width:0.5;fill:none;" x1="7" x2="2034" y1="136.2969" y2="136.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="46" x="997.5" y="126.9951">AppDir</text></g><!--MD5=[08fd51992b07af842a340419e4e827c0]
cluster garageChildren--><g id="cluster_garageChildren"><path d="M1323.5,505 L1997.5,505 A12.5,12.5 0 0 1 2010,517.5 L2010,531.2969 L1311,531.2969 L1311,517.5 A12.5,12.5 0 0 1 1323.5,505 " fill="#F1F1F1" style="stroke:#F1F1F1;stroke-width:1.0;"/><rect height="120" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;fill:none;" width="699" x="1311" y="505"/><line style="stroke:#181818;stroke-width:0.5;fill:none;" x1="1311" x2="2010" y1="531.2969" y2="531.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="390" x="1465.5" y="521.9951">Garage processes (only if any storage allocs are defined)</text></g><g id="elem_N1"><path d="M1404.5,159 L1404.5,184.1328 L1767.5,184.1328 L1767.5,169 L1757.5,159 L1404.5,159 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1757.5,159 L1757.5,169 L1767.5,169 L1757.5,159 " fill="#FEFFDD" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="342" x="1410.5" y="176.0669">All relative paths are relative to the root of the AppDir</text></g><rect fill="#F1F1F1" height="40" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="407" x="23.5" y="688"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="397" x="28.5" y="712.8467">./bin/dnsmasq -d -C $_RUNTIME_DIR_PATH/dnsmasq.conf</text><rect fill="#F1F1F1" height="40" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="380" x="466" y="688"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="370" x="471" y="712.8467">./bin/nebula -config $_RUNTIME_DIR_PATH/nebula.yml</text><g id="AppDir.AppRun"><rect fill="#F1F1F1" height="52.5938" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="196" x="922" y="145"/><line style="stroke:#181818;stroke-width:0.5;" x1="922" x2="1118" y1="171.2969" y2="171.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="64" x="988" y="162.9951">./AppRun</text><ellipse cx="932.5" cy="185.0938" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="163" x="940" y="189.292">Set PATH to APPDIR/bin</text></g><g id="AppDir.entrypoint"><rect fill="#F1F1F1" height="166.6719" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="434" x="803" y="275"/><line style="stroke:#181818;stroke-width:0.5;" x1="803" x2="1237" y1="301.2969" y2="301.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="395" x="822.5" y="292.9951">./bin/cryptic-net-main entrypoint daemon -c ./daemon.yml</text><ellipse cx="813.5" cy="315.0938" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="299" x="821" y="319.292">Create runtime dir at $_RUNTIME_DIR_PATH</text><ellipse cx="813.5" cy="331.3906" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="110" x="821" y="335.5889">Lock runtime dir</text><ellipse cx="813.5" cy="347.6875" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="285" x="821" y="351.8857">Merge given and default daemon.yml files</text><ellipse cx="813.5" cy="363.9844" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="401" x="821" y="368.1826">Copy bootstrap.tgz into $_DATA_DIR_PATH, if it's not there</text><ellipse cx="813.5" cy="380.2813" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="305" x="821" y="384.4795">Merge daemon.yml config into bootstrap.tgz</text><ellipse cx="813.5" cy="396.5781" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="306" x="821" y="400.7764">Create $_RUNTIME_DIR_PATH/garage-N.toml</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="190" x="816" y="417.0732">(one per storage allocation)</text><ellipse cx="813.5" cy="429.1719" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="141" x="821" y="433.3701">Run child processes</text></g><g id="AppDir.dnsmasqEntrypoint"><rect fill="#F1F1F1" height="52.5938" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="340" x="23" y="548"/><line style="stroke:#181818;stroke-width:0.5;" x1="23" x2="363" y1="574.2969" y2="574.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="174" x="106" y="565.9951">./bin/dnsmasq-entrypoint</text><ellipse cx="33.5" cy="588.0938" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="307" x="41" y="592.292">Create $_RUNTIME_DIR_PATH/dnsmasq.conf</text></g><g id="AppDir.nebulaEntrypoint"><rect fill="#F1F1F1" height="52.5938" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="316" x="398" y="548"/><line style="stroke:#181818;stroke-width:0.5;" x1="398" x2="714" y1="574.2969" y2="574.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="272" x="420" y="565.9951">./bin/cryptic-net-main nebula-entrypoint</text><ellipse cx="408.5" cy="588.0938" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="283" x="416" y="592.292">Create $_RUNTIME_DIR_PATH/nebula.yml</text></g><g id="AppDir.updateGlobalBucket"><rect fill="#F1F1F1" height="68.8906" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="542" x="749" y="540"/><line style="stroke:#181818;stroke-width:0.5;" x1="749" x2="1291" y1="566.2969" y2="566.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="298" x="871" y="557.9951">./bin/cryptic-net-main update-global-bucket</text><ellipse cx="759.5" cy="580.0938" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="147" x="767" y="584.292">Runs once then exits</text><ellipse cx="759.5" cy="596.3906" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="509" x="767" y="600.5889">Updates the bootstrap data for the host in garage for other hosts to query</text></g><rect fill="#F1F1F1" height="40" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="417" x="1326.5" y="554.5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="407" x="1331.5" y="579.3467">./bin/garage -c $_RUNTIME_DIR_PATH/garage-N.toml server</text><g id="AppDir.garageChildren.garageApplyLayoutDiff"><rect fill="#F1F1F1" height="68.8906" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="215" x="1778.5" y="540"/><line style="stroke:#181818;stroke-width:0.5;" x1="1778.5" x2="1993.5" y1="566.2969" y2="566.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="195" x="1788.5" y="557.9951">./bin/garage-apply-layout-diff</text><ellipse cx="1789" cy="580.0938" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="147" x="1796.5" y="584.292">Runs once then exits</text><ellipse cx="1789" cy="596.3906" fill="#000000" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:0.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="145" x="1796.5" y="600.5889">Updates cluster topo</text></g><rect fill="#F1F1F1" height="40" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="267" x="886.5" y="7"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="257" x="891.5" y="31.8467">./cryptic-net daemon -c ./daemon.yml</text><!--MD5=[99e1226540a30c5125aeac95dc2932fd]
link init to AppRun--><g id="link_init_AppRun"><path d="M1020,47.22 C1020,70.96 1020,111.66 1020,139.76 " fill="none" id="init-to-AppRun" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="1020,144.85,1024,135.85,1020,139.85,1016,135.85,1020,144.85" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="1021" y="90.0669">exec</text></g><!--MD5=[973be3d7ea581194d5ee3fc39a24a200]
link AppRun to entrypoint--><g id="link_AppRun_entrypoint"><path d="M1020,198.22 C1020,216.93 1020,243.44 1020,269.48 " fill="none" id="AppRun-to-entrypoint" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="1020,274.68,1024,265.68,1020,269.68,1016,265.68,1020,274.68" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="1021" y="241.0669">exec</text></g><!--MD5=[083a25c5b19d53ca66969ca5947a1cf6]
link entrypoint to dnsmasqEntrypoint--><g id="link_entrypoint_dnsmasqEntrypoint"><path d="M802.76,396.49 C677.99,420.15 519.12,454.4 381,497 C337.33,510.47 289.67,529.92 253.26,545.84 " fill="none" id="entrypoint-to-dnsmasqEntrypoint" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="248.42,547.96,258.2686,548.0285,253.0031,545.9612,255.0705,540.6956,248.42,547.96" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="29" x="467" y="485.0669">child</text></g><!--MD5=[c7ea69d4ff6721f817d13683540cf18f]
link dnsmasqEntrypoint to dnsmasq--><g id="link_dnsmasqEntrypoint_dnsmasq"><path d="M199.64,601.17 C205.74,624.79 214.74,659.58 220.73,682.75 " fill="none" id="dnsmasqEntrypoint-to-dnsmasq" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="222.04,687.8,223.6772,678.0882,220.7971,682.9569,215.9283,680.0768,222.04,687.8" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="215" y="654.0669">exec</text></g><!--MD5=[e57db689e698a4cac2a90f0a38fcb110]
link entrypoint to nebulaEntrypoint--><g id="link_entrypoint_nebulaEntrypoint"><path d="M840.94,442.08 C761.4,478.77 673.08,519.5 616.17,545.75 " fill="none" id="entrypoint-to-nebulaEntrypoint" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="611.44,547.93,621.2876,547.7726,615.976,545.8265,617.9221,540.515,611.44,547.93" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="29" x="775" y="485.0669">child</text></g><!--MD5=[b8917cf0c8fa712950e6c2e129fc0a6a]
link nebulaEntrypoint to nebula--><g id="link_nebulaEntrypoint_nebula"><path d="M575.52,601.17 C593.71,625.09 620.61,660.46 638.22,683.62 " fill="none" id="nebulaEntrypoint-to-nebula" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="641.4,687.8,639.1232,678.2179,638.3681,683.8242,632.7618,683.069,641.4,687.8" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="618" y="654.0669">exec</text></g><!--MD5=[dfc682edd6f75b156d1c4e2d31fc76ae]
link entrypoint to garage--><g id="link_entrypoint_garage"><path d="M1218.74,442.08 C1314.93,482.06 1422.68,526.83 1484.32,552.44 " fill="none" id="entrypoint-to-garage" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="1489.04,554.4,1482.2598,547.2566,1484.4217,552.484,1479.1942,554.6459,1489.04,554.4" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="210" x="1324" y="485.0669">child (one per storage allocation)</text></g><!--MD5=[acaf0598dc7a7d048b3826b328f66e81]
link entrypoint to garageApplyLayoutDiff--><g id="link_entrypoint_garageApplyLayoutDiff"><path d="M1237.27,378.69 C1388.07,397.04 1591.5,431.97 1761,497 C1787.17,507.04 1813.96,522.6 1835.99,537.08 " fill="none" id="entrypoint-to-garageApplyLayoutDiff" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="1840.34,539.96,1835.0703,531.6395,1836.1797,537.1865,1830.6327,538.2959,1840.34,539.96" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="29" x="1723" y="485.0669">child</text></g><!--MD5=[4233354f179cceff861e35de62bdca51]
link entrypoint to updateGlobalBucket--><g id="link_entrypoint_updateGlobalBucket"><path d="M1020,442.24 C1020,474.1 1020,509 1020,534.8 " fill="none" id="entrypoint-to-updateGlobalBucket" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="1020,539.83,1024,530.83,1020,534.83,1016,530.83,1020,539.83" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="29" x="1021" y="485.0669">child</text></g><!--MD5=[e9a8e0e5ac3aebd4696d0254464dfa86]
@startuml
hide empty description
state "./cryptic-net daemon -c ./daemon.yml" as init
state AppDir {
note "All relative paths are relative to the root of the AppDir" as N1
state "./AppRun" as AppRun {
AppRun : * Set PATH to APPDIR/bin
}
state "./bin/cryptic-net-main entrypoint daemon -c ./daemon.yml" as entrypoint {
entrypoint : * Create runtime dir at $_RUNTIME_DIR_PATH
entrypoint : * Lock runtime dir
entrypoint : * Merge given and default daemon.yml files
entrypoint : * Copy bootstrap.tgz into $_DATA_DIR_PATH, if it's not there
entrypoint : * Merge daemon.yml config into bootstrap.tgz
entrypoint : * Create $_RUNTIME_DIR_PATH/garage-N.toml\n (one per storage allocation)
entrypoint : * Run child processes
}
init - -> AppRun : exec
AppRun - -> entrypoint : exec
state "./bin/dnsmasq-entrypoint" as dnsmasqEntrypoint {
dnsmasqEntrypoint : * Create $_RUNTIME_DIR_PATH/dnsmasq.conf
}
state "./bin/dnsmasq -d -C $_RUNTIME_DIR_PATH/dnsmasq.conf" as dnsmasq
entrypoint - -> dnsmasqEntrypoint : child
dnsmasqEntrypoint - -> dnsmasq : exec
state "./bin/cryptic-net-main nebula-entrypoint" as nebulaEntrypoint {
nebulaEntrypoint : * Create $_RUNTIME_DIR_PATH/nebula.yml
}
state "./bin/nebula -config $_RUNTIME_DIR_PATH/nebula.yml" as nebula
entrypoint - -> nebulaEntrypoint : child
nebulaEntrypoint - -> nebula : exec
state "Garage processes (only if any storage allocs are defined)" as garageChildren {
state "./bin/garage -c $_RUNTIME_DIR_PATH/garage-N.toml server" as garage
state "./bin/garage-apply-layout-diff" as garageApplyLayoutDiff {
garageApplyLayoutDiff : * Runs once then exits
garageApplyLayoutDiff : * Updates cluster topo
}
}
entrypoint - -> garage : child (one per storage allocation)
entrypoint - -> garageApplyLayoutDiff : child
state "./bin/cryptic-net-main update-global-bucket" as updateGlobalBucket {
updateGlobalBucket : * Runs once then exits
updateGlobalBucket : * Updates the bootstrap data for the host in garage for other hosts to query
}
entrypoint - -> updateGlobalBucket : child
}
@enduml
PlantUML version 1.2022.5(Sat Apr 30 10:55:52 UTC 2022)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: ANSI_X3.4-1968
Language: en
Country: US
--></g></svg>