Techblog Deep Dive Meetup #1

B8668563cbe87543c303dbb818cf9f02?s=47 onigra
July 05, 2016

Techblog Deep Dive Meetup #1

B8668563cbe87543c303dbb818cf9f02?s=128

onigra

July 05, 2016
Tweet

Transcript

  1. RailsΞϓϦͷ ߏ੒؅ཧɾσϓϩΠ౳ͷ࿩ TechBlog Deep Dive Meetup #1 2016-07-05 @onigra_

  2. onigra Yudai Suzuki / ླ໦༤େ onigra_ tenso, inc. / tensoגࣜձࣾ

  3. Monolithic PHP Application Micro Ruby Application Micro Ruby Application Micro

    Ruby Application Micro Ruby Application
  4. ·ͱΊ • AWSͷΑ͋͘Γͦ͏ͳߏ੒ͰɺͦΜͳʹಛघͳ͜ͱ͸΍ͬͯͳ͍ • ߏ੒؅ཧ: Terraform, Ansible • AMI࡞੒: ಠࣗPackerΫϩʔϯ

    • σϓϩΠ: Capistrano + AutoScalingGroupΛ࢖༻ͨ͠BlueGreenDeploy • ύϑΥʔϚϯε؂ࢹ: NewRelic (ࠓ೔࿩͞ͳ͍) • ΫϥογϡϨϙʔτ: Bugsnag (ࠓ೔࿩͞ͳ͍) • ϩάऩू: Fluentd + S3 (ࠓ೔࿩͞ͳ͍) • ݸਓతʹؾʹͳΔ΋ͷ: DeployBot, PaperTrail, Loggly, ClowdWatch Logs
  5. None
  6. Terraform

  7. ؅ཧʹ޲͘Ϧιʔεͱ޲͔ͳ͍ Ϧιʔε͕͋Δ • ܧଓతʹ؅ཧ • VPC, S3, IAM, Route53 •

    ߏங࣌ͷΈ • RDS, ElastiCache
  8. ՝୊ͱࠓޙͷల๬ • ϓϧϦΫ -> CircleCIͰద༻ͷྲྀΕΛ࡞Γ͍ͨ • օ͞ΜϦϙδτϦ͸Ͳ͏͍͏ײ͡Ͱ࡞ͬͯ·͔͢ʁ • طଘͷߏ੒؅ཧԽʹஔ͔Εͯͳ͍ϦιʔεΛͳΜ ͱ͔͍ͨ͠໰୊

    • TerraformingͰͳΜͱ͔͍͖͍ͯͨ͠
  9. Ansible

  10. ݸਓతͳࡶײΛ Ҏલ·ͱΊ·ͨ͠ • Ansibleࡶײ (https://gist.github.com/onigra/ 1fd3b6e744bc23071bf3) • v2.0͕ग़Δલͷ಺༰ͳͷͰ஫ҙ

  11. AMI࡞੒ ಠࣗPackerΫϩʔϯ

  12. ࡞ͬͨܦҢ • ౰࣌ɺPackerͷAnsibleϦϞʔτ࣮ߦ͕Ͱ͖ͳ ͔ͬͨ • LaunchConfigͷ࡞੒ͱAutoScalingGroupͷ੾ Γସ͑·Ͱ΍ͬͯ΄͍͠ • https://speakerdeck.com/onigra/about- tsudura

  13. Ͳ͜·Ͱ࣮ߦ͢Δ͔ܾΊΕΔ • Provisioning͚ͩͯ͠Πϯελϯε͸མͱ͞ͳ ͍ • Packerͱಉ͡AMIͷ࡞੒·Ͱ • LaunchConfig࡞Δॴ·Ͱ • AutoScalingGroup΁ͷඥ෇͚·Ͱ

  14. ࠓޙ΍Γ͍ͨ • PackerͰ΋AnsibleͷRemote࣮ߦ͕Ͱ͖ΔΑ ͏ʹͳͬͨͷͰɺ੾Γସ͍͖͍͑ͯͨ • ϓϧϦΫ -> CI͔ΒࣗಈϏϧυ͍͖͍ͯͨ͠

  15. Capistrano & AutoScalingGroupΛ ࢖༻ͨ͠BlueGreenDeploy

  16. ํ਑ • ιʔείʔυͷमਖ਼ͷΈ͸Capistrano • Πϯελϯεىಈ࣌ʹࣗ਎ͷΠϯελϯεʹ σϓϩΠ(Capistrano࣮ߦ) • ϛυϧ΢ΣΞͷΞοϓσʔτ౳͕͋Δ৔߹͸ BlueGreenDeploy

  17. ՝୊ • BlueGreenDeploy͕ࣗಈԽͰ͖ͯͳ͍ • ϒϥϯν੾Γସ͑ΊΜͲ͍͘͞໰୊

  18. master

  19. master rails5

  20. master rails5

  21. master rails5

  22. master rails5 Don’t Delete!

  23. master rails5 Merge

  24. master(New) rails5 Don’t Delete!

  25. master(New) rails5 Don’t Delete!

  26. master(New) rails5 Don’t Delete!

  27. ໰୊఺ • 2ճAMIͷϏϧυ͕ൃੜ͢Δ • AMIͷ࡞੒࣌ؒ΋അࣛʹͳΒͳ͍ • ϒϥϯνͳ͔ͳ͔ফͤͳ͍

  28. ൓ল఺ • ʮGit͸σϓϩΠπʔϧͰ͸͋Γ·ͤΜʯ • https://speakerdeck.com/fujiwara3/ awsfalseotosukerutonakayokufu-kihe-u • PullܕσϓϩΠ or Docker

  29. ͦͷଞࠓޙ΍Γ͍ͨ͜ͱ ڵຯͷ͋Δ͜ͱ • ServerspecʹΑΔΠϯϑϥςετ • ΧδϡΞϧʹϩάݟΔͷʹLogglyͱ͔PaperTrail ͱ͔ClowdWatch Logsͱ͔࢖ͬͯΈ͍ͨ • ੩తίϯςϯπͷΈ؅ཧͯ͠ΔϦϙδτϦ͕͋ͬ

    ͯɺͦ͜ͰσβΠφʔ΋σϓϩΠ͠΍͘͢͢ΔΑ ͏ʹɺDeployBot࢖͍͍ͨ
  30. ͜ͷޙ࿩ͤͨΒخ͍͜͠ͱ • ϩάऩू • σϓϩΠ • TerraformϦιʔεͷϦϙδτϦߏ੒ • Docker