料理を支える技術2012

2997ec7879942bd0415690c85731e328?s=47 Yuichi Tateno
September 18, 2012
10k

 料理を支える技術2012

2997ec7879942bd0415690c85731e328?s=128

Yuichi Tateno

September 18, 2012
Tweet

Transcript

  1. ྉཧΛࢧ͑Δ ٕज़  ؘ໺༞Ұ

  2. ఏڙ

  3. JETFDPOEMJGF ؘ໺༞Ұ :VJDIJ5BUFOP

  4. @hotchpotch

  5. Shibuya.js

  6. ༓ྶ෦һ

  7. None
  8. ྉཧΛࢧ͑Δ ٕज़ 

  9. 2011 ↓ 2012

  10. 2011 http://techlife.cookpad.com/2011/07/19/rubykaigi2011/

  11. 2012

  12. - Rails 2.3 + Rails 3.0 2012

  13. 3BJMT ΁ͷಓ http://www.flickr.com/photos/skreuzer/4285271145/

  14. ݄ؒར༻ऀ ສҎ্ Ϩγϐ਺ສҎ্ Ͳ͏΍ͬͯ େن໛3BJMTΞϓϦΛ όʔδϣϯΞοϓͨ͠ͷ͔

  15. ͳͥ3BJMTͷόʔδϣϯΛ ্͛Δඞཁ͕͋Δͷ͔

  16. ✓3BJMTʹू໿͞Ε͍ͯΔɺ ༷ʑͳϥΠϒϥϦΛ ར༻Ͱ͖ͳ͘ͳΔ

  17. http://www.flickr.com/photos/dskley/4669454041/ ৽͍͠3BJMʹ ✓৐Δ ৐Βͳ͍

  18. )PXUP Ͳ͏΍Δͷʁ

  19. Rails 2.3 -> 3.0 RSpec 1.3 -> 2.2

  20. $  bundle  exec  rake  cookpad:spec

  21. $  bundle  exec  rake  cookpad:spec F

  22. $  bundle  exec  rake  cookpad:spec FFFF

  23. $  bundle  exec  rake  cookpad:spec FFFFFFFFFFFFFFFFFFFFFFFFFFFFF

  24. $  bundle  exec  rake  cookpad:spec FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFF...F....F.FFFFFFFFF FFFFFF.FFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

    FFFFFFFFFFFFFF...FFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFF.FFFFFFFFFFFFFFF..FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFF...FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFF..F.FFFFFFFF.FFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFF....F...FFFFF
  25. $  bundle  exec  rake  cookpad:spec FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFF...F....F.FFFFFFFFF FFFFFF.FFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

    FFFFFFFFFFFFFF...FFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFF.FFFFFFFFFFFFFFF..FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFF...FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFF..F.FFFFFFFF.FFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFF....F...FFFFF ʗ ?P? ʘ
  26. http://www.flickr.com/photos/aizaz/3512778599/ ஍ಓʹ ͭͿ͍ͯ͘͠࡞ۀ

  27. http://www.flickr.com/photos/aizaz/3512778599/ ✓Կ͔Λ౗͢ͱҰؾʹݮΔ ✓ϘεతͳϠπ΋͍Δ ✓౗͢ͱผͷϠπ͕෮׆͢Δ ׂͱήʔϜͬΆ͍

  28. http://www.flickr.com/photos/aizaz/3512778599/ ✓Կ͔Λ౗͢ͱҰؾʹݮΔ ✓ϘεతͳϠπ΋͍Δ ׂͱήʔϜͬΆ͍ ࢲ͸ ΍ͬͯͳ͍Μ Ͱ͚͢ͲͶ ʢʍТɾʣ

  29. Team 34QFD૊ !TIJOHP<Խ> !B@NBUTVEB<༭ฌ> ͦͷଞ !IPUDIQPUDI

  30. ࣗಈ IUNMFTDBQF ରԠ

  31. <%=  "<hello>"  %>

  32. <%=  "<hello>"  %> Rails  2.3 #=>  <hello>

  33. <%=  "<hello>"  %> Rails  3.0 #=>  &lt;hello&gt; Rails  2.3 #=>

     <hello>
  34. ඪ४ͰϏϡʔ͕ IUNMFTDBQF͞ΕΔ ˺ IUNMFTDBQFલఏ΁ͱ ͢΂ͯͷίʔυΛॻ͖௚͢

  35. rails_xss plugin https://github.com/nzkoz/rails_xss ✓3BJMT؀ڥʹಋೖՄೳ

  36. <%=  "<hello>"  %> Rails  3.0 #=>  &lt;hello&gt; Rails  2.3 #=>

     &lt;hello&gt;
  37. rails_xss plugin https://github.com/nzkoz/rails_xss ✓3BJMT؀ڥʹಋೖՄೳ ✓3BJMTͰSBJMT@YTT༗ޮͰ໰୊ͳ ͍˺SBJMTͰ΋໰୊ͳ͍

  38. ࢗ਎ http://www.flickr.com/photos/htakashi/5696799508/

  39. spec ↓ html

  40. ✓ functional test 34QFD $POUSPMMFS ✓ integration test $BQZCBSB 8FCSBU

    3300+ examples
  41. RSpec Capybara, Webrat dirty hack !

  42. $  spec  -­‐l  139  spec/controller/ recipe_spec.rb write:  normal/spec/controller/ recipe_spec.rb:139.html $

     RAILS_XSS=1  spec  -­‐l  139  spec/ controller/recipe_spec.rb write:  htmlsafe/spec/controller/ recipe_spec.rb:139.html
  43. None
  44. IUNMFTDBQFͷ lࠩҧ͚ͩz ஌Γ͍ͨ

  45. IUNMFTDBQFͷ lࠩҧ͚ͩz ஌Γ͍ͨ git  diff -­‐-­‐word-­‐diff-­‐regex

  46. $  git  diff  -­‐-­‐word-­‐diff-­‐regex=    '(&lt;)|(&amp;)|(&gt;)|(&quot;)|(&apos;)'    -­‐-­‐color  -­‐-­‐ignore-­‐all-­‐space  

     -­‐-­‐word-­‐diff=plain    -­‐-­‐no-­‐index  -­‐-­‐    #{normal}  #{htmlsafe}
  47. None
  48. None
  49. http://www.flickr.com/photos/aizaz/3512778599/ $  ./script/escape_spec        spec/**/*

  50. $  bundle  exec  rake  cookpad:spec

  51. $  bundle  exec  rake  cookpad:spec ......FFF...................... ...............F...FFF......... ............................... ............................... ....FFF........................

    ............................... ..............................F ..............................F ............................... ..............FF............... ............................... ...............F.F............. ....FFFFFF..................... ......................F..F.....
  52. $  bundle  exec  rake  cookpad:spec ......FFF...................... ...............F...FFF......... ............................... ............................... ....FFF........................

    ............................... ..............................F ..............................F ............................... ..............FF............... ............................... ...............F.F............. ....FFFFFF..................... ......................F..F..... $  RAILS_ENV=production bundle  exec  rails  server
  53. http://www.flickr.com/photos/naotakem/3524078643/ performance performance

  54. http://www.flickr.com/photos/naotakem/3524078643/ performance performance performance

  55. ✓BC BQBDIFCFODI ✓+.FUFS http://www.flickr.com/photos/wwarby/3296379139/ #FODINBSL

  56. ݁Ռ 3VCZ ˣ 3&& UDNBMMPDແޮ  ˣ 3&& UDNBMMPD ˣ

  57. ݁Ռ 3VCZ ˣ 3&& UDNBMMPDແޮ  ˣ 3&& UDNBMMPD ˣ

    ஗͍
  58. ଎͕͞଍Γͳ͍ʂʂ

  59. ʮͦΜͳ࣌͸ϓϩϑΝΠϦϯάͷ࣌ؒͰ͢Ͷɻʯ

  60. None
  61. Α͘Θ͔Βͳ͍

  62. ຖճωοΫͱͳΔ ৔ॴ͕มΘΔ ($

  63. Passenger ↓ Unicorn

  64. Unicorn module   Unicorn::OobGC

  65. GC timing request GC

  66. GC timing request GC.start GC.disable

  67. GC timing

  68. GC timing FAST

  69.    disabled  =  GC.enable    GC.start    GC.disable  if  disabled

    after_fork  do  |server,  worker|    GC.disable  if  RAILS_ENV=='production'
  70. None
  71. None
  72. None
  73. 150% fast !

  74. http://www.flickr.com/photos/adamkr/4650637393/ ύϑΥʔϚϯε ղܾʂʂ

  75. !NJSBLVJ ✓3BJMTߴ଎Խ ✓ϓϩϑΝΠϥ ✓6OJDPSO ✓Ωϟογϡ ✓ύϯμ

  76. $  bundle  exec  rake  cookpad:spec ............................... .....................F......... ............................... ............................... .....F.........................

    ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... .........................F.....
  77. ࠷ऴ ֬ೝ ✓

  78. ςετͰ ൃݟͰ͖ͳ͍໰୊Λ Ͳ͏ղܾ͢Δ͔

  79. ✓ຊ൪ϦΫΤετΛ ࣮ࡍʹྲྀ͢

  80. em-proxy https://github.com/igrigorik/em-proxy EventMachine Proxy DSL for writing high-performance transparent /

    intercepting proxies in Ruby.
  81. em-proxy app Rails 2.3 app Rails 3.0 (readonly) proxy request

    only https://github.com/igrigorik/em-proxy/blob/master/examples/duplex.rb dup request
  82. [app-­‐rails-­‐3.0] $  tail  -­‐f  produciton.log  |  grep  500

  83. $  bundle  exec  rake  cookpad:spec ............................... ............................... ............................... ............................... ...............................

    ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ...............................
  84. /FYU 4UFQ ࣍ͷ ֬ೝεςοϓ

  85. Ұ෦Ϣʔβʹ ࣮ࡍʹϦϦʔε͢Δ

  86. ໰୊ ͳ͠ʁ 3BJMT ✓ςετ ✓ύϑΥʔϚϯε ✓ෳ੡ϦΫΤετ

  87. Cookie:   r3balance=xxx YYY͕ಛఆ஋ͷ ϢʔβΛ3BJMT ʹྲྀ͢

  88. ✓4FTTJPO4UPSF$BDIF γϦΞϥΠζܗࣜͷҧ͍ ✓.Z42-΁ͷ ͓͔͠ͳNBTUFS΁ͷΫΤϦ ✓+BWB4DSJQUΤϥʔ ൃݟ

  89. ✓ςετ ✓ύϑΥʔϚϯε ✓ෳ੡ϦΫΤετ ✓࣮ΞΫηε

  90. ϦϦʔε࡞ۀ ✓ςετ ✓ύϑΥʔϚϯε ✓ෳ੡ϦΫΤετ ✓࣮ΞΫηε

  91. AWS EC2 app Rails 2.3 app Rails 2.3 app Rails

    2.3 app Rails 2.3 x50 proxy app Rails 3.0 app Rails 3.0 app Rails 3.0 app Rails 3.0 x50
  92. AWS EC2 app Rails 2.3 app Rails 2.3 app Rails

    2.3 app Rails 2.3 x50 proxy app Rails 3.0 app Rails 3.0 app Rails 3.0 app Rails 3.0 x50
  93. http://www.flickr.com/photos/skreuzer/4285271145/ ೥݄೔ 3BJMT ϦϦʔεʂʂ

  94. http://www.flickr.com/photos/skreuzer/4285271145/ ೥݄೔ 3BJMT ϦϦʔεʂʂ େ͖ͳ ໰୊ͳ͠ʂ

  95. http://www.flickr.com/photos/skreuzer/4285271145/ ೥݄೔ 3BJMT ϦϦʔεʂʂ ࡀͷ ஀ੜ೔ ʘ ?P? ʗ

  96. 2012

  97. + Sara Framework 2012

  98. http://www.flickr.com/photos/norio_nomura/4713348873/ ࡼ ϑϨʔϜϫʔΫ

  99. 2TBSBGSBNFXPSLͬͯ "5XJUUFS#PPUTUSBQ Έ͍ͨͳ෺ͷ$00,1"%൛

  100. ͳͥ 5XJUUFS#PPUTUSBQ Ͱ͸ͳ͍ͷʁ ͳͥ ಠࣗʹ࡞Δͷʁ

  101. l$00,1"%z σβΠϯͷந৅Խ

  102. l$00,1"%z Ͱ͸͜͏͋Δ΂͖ 6*69ͷந৅Խ

  103. l$00,1"%σβΠϯz ͷந৅Խ 㾎σβΠϯͷ஌ࣝ 㾎6*69ͷ஌ࣝ 㾎͜͏͋Δ΂͖ͱ͍͏ߟ͑ 㾎$44 4BTT ͷ࣮૷ྗ

  104. None
  105. !UJLFEB

  106. http://www.flickr.com/photos/norio_nomura/4713348873/ ࡼ ϑϨʔϜϫʔΫ

  107. σβΠϯΛ౰ͯΔ ෛ୲͕ݮগ ΑΓ෼ۀ͠΍͘͢

  108. 2012

  109. 2012 Android App + html5 (webview) - native

  110. 2012 2011 native html5

  111. 2012 2011 㾎3BJMT্Ͱͷػೳ։ൃɾΤϯδ χΞ୭Ͱ΋͍͡ΕΔ 㾎εϚʔτϑΥϯ޲͚IUNMͱಉ ࣌։ൃՄೳ 㾎OBUJWFͷػೳΛ࢖͏৔߹ɺ+4 Ͱ௨৴

  112. 2012 2011 㾎3BJMT্ͷ࣮૷Ͱػೳ։ൃɾΤ ϯδχΞ୭Ͱ΋͍͡ΕΔ 㾎εϚʔτϑΥϯϒϥ΢βͱಉ࣌ ։ൃՄೳ 㾎OBUJWFͷػೳΛ࢖͏৔߹ɺ+4 Ͱ௨৴ )5.-ʹౌ͚ͨͷ͸ ࣦഊͩͬͨ

    ϚʔΫ
  113. 2012 2011 㾎3BJMT্Ͱػೳ։ൃɾΤϯδχ Ξ୭Ͱ΋͍͡ΕΔ 㾎εϚʔτϑΥϯ޲͚IUNMͱಉ ࣌։ൃՄೳ 㾎OBUJWFͷػೳΛ࢖͏৔߹ɺ+4 Ͱ௨৴

  114. 2012 + fluentd

  115. 2012 + fluentd 㾎3BJMTΞϓϦέʔγϣϯαʔόͰͷ ϩάू໿ 㾎਺ඦ୆ͰՔಇ 㾎3VCZͰ࣮૷͞Ε͍ͯΔ 㾎3VCZͰϓϥάΠϯهड़

  116. 2012 + fluentd 㾎਺ඦ୆ͷ3BJMTΞϓϦέʔγϣϯ αʔόͰͷϩάू໿ 㾎3VCZͰ࣮૷ 㾎3VCZͰϓϥάΠϯهड़ http://www.slideshare.net/hotchpotch/20120204fluent-logging

  117. 2012 + fluentd 㾎਺ඦ୆ͷ3BJMTΞϓϦέʔγϣϯ αʔόͰͷϩάू໿ 㾎3VCZͰ࣮૷ 㾎3VCZͰϓϥάΠϯهड़

  118. 2012 + Code Review w/GHE

  119. 2012 + Code Review w/GHE 㾎ຖ݄໿ݸͷQVMMSFRVFTU  

  120. 2012 + Code Review w/GHE 㾎ຖ݄໿ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 

  121. 2012 + Code Review w/GHE 㾎ຖ݄໿ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 㾎ϞώΧϯͷි౤͛·Ͱ

  122. 2012 + Code Review w/GHE 㾎ຖ݄ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 㾎ϞώΧϯͷි౤͛·Ͱ ˡ3VCZίϛολ ˡ3VCZίϛολ

  123. 2012 + Code Review w/GHE 㾎ຖ݄ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 㾎ϞώΧϯͷි౤͛·Ͱ

  124. 2012 + Code Review w/GHE 9/15 (sat) LT @takai Code

    Review in Action
  125. 2012 + Code Review w/GHE 9/15 (sat) LT @takai Code

    Review in Action
  126. 2012 + Distributed CI

  127. 2012 + Distributed CI

  128. 2012 + Distributed CI

  129. 2012 + Distributed CI 㾎૿͑ଓ͚Δςετ 㾎ऴΘΒͳ͍ܧଓతΠϯςάϨʔγϣϯ 㾎Ͳ͏΍ͬͯ෼ࢄ34QFDΛ҆ఆͤ͞Δ͔ 㾎"84&$Λར༻ͨ͠αʔόͷࣗಈॖୀ

  130. 2012 + Distributed CI 9/16 (sun) 10:30 @mrkn Distributed RSpec

  131. + AWS + Chanko (open source) + kuroko (new batch

    system) + IMon (new monitoring system) etcetc...
  132. 2011 ↓ 2012

  133. ఏڙ

  134. ͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ Thank You