Open Beer Server - theory and the implementation

672ee2598bea695496f11022a9a9c4c8?s=47 moznion
December 03, 2016

Open Beer Server - theory and the implementation

Slide of builderscon Tokyo 2016

672ee2598bea695496f11022a9a9c4c8?s=128

moznion

December 03, 2016
Tweet

Transcript

  1. Open Beer Server theory and the implementation @moznion

  2. @moznion

  3. None
  4. օ͞ΜϏʔϧ͸
 ޷͖Ͱ͔͢ʂʂ

  5. օ͞ΜੜϏʔϧ͸ ޷͖Ͱ͔͢ʂʂ

  6. ͦ͏Ͱ΋ͳ͍ਓ͸ ͜ͷൃදඍົͰ͢

  7. ΤϯδχΞ Ͱ͔͢ʂʂ

  8. ͦ͏Ͱ΋ͳ͍ਓ͸ ྑ͍ػձͰ͢

  9. αʔόΤϯδχΞ ʹͳΕΔʂʂ

  10. Ϗʔϧαʔόʔ ͷ͸ͳ͠

  11. Ϗʔϧαʔόʔ ͱ͸……ੈքͱ͸……

  12. https://www.flickr.com/photos/50507715@N00/2892136399

  13. ࢓૊Έɼ
 ཧʹ͍ͭͯ……

  14. ࢓૊Έ is easy

  15. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  16. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ PDS
 (Presentation

    Domain Separation) Έ͍ͨͳ΋Μ΍ʂʂ
  17. Θ͔Γ·͔ͨ͠ʁ

  18. ͸͍

  19. Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ ѹྗ

  20. Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ ѹྗ

  21. Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ ѹྗ ։์

  22. Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ ѹྗ ։์ ѹʹΑͬͯӷ͕ग़Δ

  23. Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ ѹྗ Happy!!

  24. Θ͔Γ·ͨ͠Ͷʁ

  25. ؆୯Ͱ͸ʁ

  26. ͱ͍͏Θ͚Ͱ ͭ͘Γ·͢ (ͭ͘Γ͓͖Ͱ͢)

  27. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  28. ੜḺ

  29. None
  30. ੜḺ -ञ԰ʹཔΉͱങ͑·͢ -ඇίϛϡͷਓ͸ΧΫϠε ͱ͔ͰཔΈ·͠ΐ͏

  31. ੜḺϚδَ໳ (ͦ͏Ͱ΋ͳ͍)

  32. None
  33. None
  34. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  35. ϔου

  36. None
  37. ϔου -ੜḺͱͷΠϯλʔϑΣʔε -ΨεͱͷΠϯλʔϑΣʔε Ͱ΋͋Δ -ѹΛ༩͑ͭͭӷΛग़͢ਓ

  38. ϔουϚδَ໳ (ͦ͏Ͱ΋ͳ͍)

  39. ΩϦϯḺͱ
 ΞαώḺ͕͋Δ

  40. ϔουͷҧ͍ -ΩϦϯḺ༻ͷϔουͱ
 ΞαώḺ༻ͷϔου͕͋Δ -ޱۚͷܗঢ়͕ҧ͏ -ޓ׵ੑ͕ *ແ͍*

  41. ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου

  42. ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου

  43. ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου ͳͥͳͷͩ……

  44. ߹ͬͨϔουΛ ༻ҙ͠·͠ΐ͏

  45. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  46. Ψε

  47. None
  48. Ψε -ϔουͱ઀ଓͯ͠ΨεΛ ૹΔਓ -ΨεͱͷΠϯλϑΣʔε ٴͼѹྗௐ੔ث

  49. ΨεϚδَ໳ (ͦ͏Ͱ΋ͳ͍)

  50. ྘ͷϘϯϕ͸ ࣮͸ෆཁ

  51. None
  52. ίϯύΫτΨε ͕࢖͑Δ

  53. None
  54. STOP!!!!!!

  55. ίϯύΫτΨεΛ
 ࢖͏ͨΊʹ͸ ઐ༻ͷΞλονϝϯτ
 ͕ඞཁ

  56. None
  57. ͜Ε͕ແ͍ͱ࿙Ε·͢

  58. STOP!!!!!!!!!!!!!!!!!!!!!!

  59. खͰద౰ʹΞλονϝ ϯτకΊΔͱ࿙Ε·͢

  60. ϞϯΩʔϨϯνͰ
 కΊ·͠ΐ͏ (Ψε1ຊϩετ͠·ͨ͠)

  61. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  62. ྫྷ΍͢෦෼

  63. None
  64. ྫྷ΍͢෦෼ -ಔͷύΠϓΛྫྷ΍͢ -ϏʔϧΛྫྷ͑ͨಔͷύΠϓ ʹ௨͢ -ྫྷ͑Δʂʂʂʂ -ͱ͍͏࢓૊Έ

  65. None
  66. ྫྷ΍͢෦෼ -ද໘ੵ͕ଟ͚Ε͹ଟ͍΄ Ͳྑ͍ͷͰίΠϧঢ়ʹۂ ͛Δ

  67. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  68. λοϓ

  69. None
  70. λοϓ -Ϗʔϧग़͢ޱͷ෦෼Ͱ͢ -Ҏ্

  71. ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ΍͢
 ֓೦ λοϓ ΤϯυϢʔβ

  72. νϡʔϒ

  73. νϡʔϒ -֤ίϯϙʔωϯτΛ઀ଓ ͢Δ܅ -Micro servicesʹ͓͚ΔHTTP Έ͍ͨͳ΋ΜͰ͢

  74. νϡʔϒ -ͳΔ΂͘ݻ͍΋ͷΛ࢖͍ ·͠ΐ͏ -ݻ͘ͳ͍ͱϫϯλονܧ खͰ࢖͑ͳ͍

  75. νϡʔϒ -ࠔͬͨΒϗʔϜηϯλʔͰ ങ͍·͠ΐ͏

  76. None
  77. ܨ͗߹Θͤͯ
 ͍͖·͠ΐ͏

  78. None
  79. None
  80. None
  81. None
  82. None
  83. MEMO: ͜͜Ͱݱ෺͕ ग़·͢

  84. Ͱ͖ͨͰ͖ͨ

  85. ͔͜͠͠ΕͰ͸ ͨͩͷϏ ʔϧαʔόʔ

  86. ΋ͬͱศརʹ
 ͠·͠ΐ͏

  87. ͱ͍͏Θ͚Ͱ HTTPͷ෦෼

  88. લఏ

  89. Perl 5Ͱॻ͍ͯ·͢

  90. Why?

  91. None
  92. That's all

  93. Թ౓؅ཧ

  94. Թ౓؅ཧ Ϛδॏཁ

  95. ొ৔ਓ෺ -Raspberry Pi -DS18B20 (Թ౓ηϯα) -Mackerel

  96. None
  97. ొ৔ਓ෺ -Raspberry Pi -DS18B20 (Թ౓ηϯα) -Mackerel

  98. ొ৔ਓ෺ -Raspberry Pi -DS18B20 (Թ౓ηϯα) -Mackerel ͜ΕΛαʔόʔ಺ʹೖΕ͓ͯ͘

  99. ֓؍ Beer Server DS18B20 3.3V Temperature Custom Metrics (Temperature)

  100. None
  101. None
  102. -άϥϑग़͢

  103. None
  104. None
  105. MackerelͰ ͋ΒΏΔαʔόʔͷ ؂ࢹ͕Ͱ͖Δʂ

  106. None
  107. ࣏҆ҡ࣋ػೳ

  108. ະ੒೥ऀ͕ञΛ ҿΉͱേͤΒΕ·͢

  109. ະ੒೥ऀ͕ ञΛҿΊΔঢ়گΛ ࡞Βͳ͚Ε͹ྑ͍

  110. ະ੒೥ऀ͕ ञΛҿΊΔঢ়گΛ ࡞Βͳ͚Ε͹ྑ͍ ઃఆΑΓن໿ (Convention over Configuration)

  111. ೥ྸ͕20ࡀʹຬͪ ͍ͯͳ͍ਓ͸ 403͠·͠ΐ͏

  112. ۩ମతʹ
 => ະ੒೥ऀͱࢥ͖͠ ਓؒʹ͸ ϏʔϧΛग़͞ͳ͍

  113. ొ৔ਓ෺ -Raspberry Pi -C270 (Web camera) -Microsoft Azure -ιϨϊΠυόϧϒ

  114. ೥ྸਪఆ

  115. Azure Face API

  116. None
  117. Azure Face API -إը૾Λ౤͛Δͱͦͷը ૾ͷϝλ৘ใΈ͍ͨͳ΋ ͷ͕औΕΔ -ࠓճ͸೥ྸΛ࢖͏ -΢ΣϒΧϜͰࡱͬͨը૾ Λ࢖༻

  118. None
  119. ͜ΕͰإʹΑͬͯ ೥ྸ৘ใ͕Θ͔Δ

  120. ࣮ࡍʹαʔόࢭΊΔ ͷ͸Ͳ͏͢Δʁ

  121. ιϨϊΠυόϧϒ

  122. ιϨϊΠυόϧϒ - ి࣓ੴʢιϨϊΠυʣͷ࣓ྗΛ༻͍ͯϓ ϥϯδϟͱݺ͹ΕΔమยΛಈ͔͢͜ͱͰ หʢόϧϒʣΛ։ด͢Δ࢓૊ΈΛ࣋ͭ΋ ͷͰɺྲྀମʢ༉ѹɺۭѹɺਫѹͳͲʣΛ ௨͢؅ͰͷྲྀΕͷ։ด੍ޚʹ༻͍ΒΕΔ
 (https://ja.wikipedia.org/wiki/ %E9%9B%BB%E7%A3%81%E5%BC%81)

  123. ιϨϊΠυόϧϒ https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Solenoid_Valve.svg/300px-Solenoid_Valve.svg.png

  124. ֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control

    C270 Photo Face API
  125. ֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control

    C270 Photo Face API
  126. ֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control

    C270 Photo Face API ͜ͷ෦෼ σϑΥͩͱಈ͖·ͤΜ
  127. ιϨϊΠυόϧϒͱϥζύΠ - ιϨϊΠυόϧϒ͸͍͍ͩͨ12Vۦಈ - ϥζύΠͷग़ྗ͸5V/3.3V - ଍Γͳ͍ʂʂ

  128. ঢѹ

  129. None
  130. ͦΕͰ΋ແཧ

  131. ιϨϊΠυόϧϒͱϥζύΠ
 ͱঢѹث - ঢѹث͸5Vۦಈ - ೚ҙͰON/OFFͰ͖ΔϥζύΠͷGPIO ͸3.3V - ଍Γͳ͍ʂʂʂ

  132. ιϨϊΠυόϧϒͱϥζύΠ
 ͱঢѹث - ৗʹONͷ5VͷPINΛ࢖͑͹͍͚Δ - ͔ͦ͠͠ΕͰ͸εΠονग़དྷͳ͍ - ΋͏ͩΊͳͷ͔

  133. NPNτϥϯδελ

  134. None
  135. !!!!!!!

  136. - Base͕HighʹͳΔͱ - Collectorͷిྲྀ͕ - ૿෯͞Εͯ - EmitterʹྲྀΕΔ

  137. - BaseʹGPIOܨ͍Ͱ - CollectorΛGNDʹܨ͙ͱ - GPIO͕Highͷ࣌Emitter͕
 GNDʹམͪΔ

  138. ֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control

    C270 Photo Face API
  139. ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND

    12V
  140. ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND

    12V High
  141. ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND

    12V High
  142. ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND

    12V High
  143. ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND

    12V High
  144. ղܾʂ

  145. ૢ࡞͸͜Ε͚ͩͰՄೳ

  146. σϞ

  147. ࠓޙ

  148. ࠓޙ - ࢒ྔ؂ࢹ͕Ͱ͖ͳ͔ͬͨͷͰ
 ͳΜΒ͔ͷํ๏Ͱ΍Γ͍ͨ - ϒϨουϘʔυ΍Ί͍ͨ - ιϨϊΠυόϧϒ࢖͑͹
 HTTPӽ͠ʹϦϞʔτͰϏʔϧͷ
 ڙڅ͕ग़དྷͦ͏ͳͷͰ΍Δ

  149. ·ͱΊ

  150. ·ͱΊ - Ϗʔϧαʔό͸࡞ΕΔ

  151. ·ͱΊ - ࠓճͷ૯ίετ: 89,343JPY

  152. ͚ͨͯ͘͢Ε

  153. Q?