2019-04-25 CI/CD環境のデザインパターン/20190425-cicd-env-design-pattern

Ea29e2b19d11b48f867ae71d6a6de5df?s=47 opelab
April 25, 2019

2019-04-25 CI/CD環境のデザインパターン/20190425-cicd-env-design-pattern

JAWS-UGアーキテクチャ専門支部での議論資料です。

(運用設計ラボ合同会社 波田野裕一)

Ea29e2b19d11b48f867ae71d6a6de5df?s=128

opelab

April 25, 2019
Tweet

Transcript

  1. Operation Lab ӡ༻ઃܭϥϘ ӡ༻ઃܭϥϘ߹ಉձࣾ $*$%؀ڥͷσβΠϯύλʔϯ 1  Architecture 8BOUFE0VSPSJHJOBMMPHP JAWS-UG

    ARCH ΞʔΩςΫνϟઐ໳ࢧ෦ γχΞΞʔΩςΫτ೾ా໺༟Ұ
  2. ࡢࠓͷΤϯδχΞք۾ Operation Lab ӡ༻ઃܭϥϘ 2 $*$%ͬͯ΋͏౰ͨΓલͩΑͶ ύΠϓϥΠϯݟͯΔ͚ͩͰ൧΢Ϛʂ ͝൧ഋ͸ΠέΔʂ ͱ͍͏੠͕ͦ͜Β͡Ύ͏͔Βฉ͑͜Δ೥ͷय़Ͱ͕͢ɺ

  3. ͱ͸ݴ͏΋ͷͷ Operation Lab ӡ༻ઃܭϥϘ 3 ʮ$*$%΍ͬͨํ͕͍͍ͷ͸Θ͔Δ͚ͲɺͲ͜ ͔ΒखΛ෇͚͍͍ͯͷ͔Θ͔ΒΜʯ ʮ$*$%ɺͳʹͦΕඒຯ͍͠ͷʁʯ ʮϫλγɺ$*$%θϯθϯϫΧϥφʔΠʼʻʯ ͱ͍͏੠΋ͪΒ΄Βฉ͖͑ͯ͜·͢ɻ

  4. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷશମ૾ 4

  5. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷશମ૾ 5 CodePipeline CodeCommit ιʔείʔυ CodeBuild Ϗϧυςετ

    CodeDeploy σϓϩΠ CodeStar ͜ΕΒΛ૊Έ߹Θͤͯ$*$%ύΠϓϥΠϯΛ૊Ή
  6. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷਖ਼͍͠࢖͍ํ 6 ͜ΕΒΛ૊Έ߹Θͤͯ$*$%ύΠϓϥΠϯΛ૊Ή πʔϧʹࣗ෼ୡΛ߹ΘͤΔͷͰ͸ͳ͘ ࣗ෼ୡͷύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ΜͰ͢Α 4"େଜ͞Μ

    ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ
  7. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷਖ਼͍͠શମ૾ 7 CodePipeline CodeCommit ιʔείʔυ CodeBuild Ϗϧυςετ

    CodeDeploy σϓϩΠ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ໨త खஈ ࣗ෼ͨͪͷύΠϓϥΠϯ
  8. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓΛ࡞Ζ͏ 8 ࣗ෼ୡͷύΠϓϥΠϯΛ ͪΌΜͱ࿦ཧతʹઆ໌Ͱ͖Δਓ͸ গͳ͍ΜͰ͢Α 4"େଜ͞Μ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ

    ࣗ෼ୡͷ$*$%ύΠϓϥΠϯ૾Λ٬؍Խɾߏ଄Խ͢Δ ͦͷલʹ
  9. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓΛ࡞Ζ͏ 9 ιʔείʔυ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ σϓϩΠઌ ੒Ռ෺

    Ϧιʔε Ϧιʔε Ϧιʔε Ϧιʔε ੒Ռ෺ ఏڙऀ Ϣʔβ Ϗϧυςετ σϓϩΠ ੒Ռ෺ ੒Ռ෺
  10. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷ঺հ 10

  11. Operation Lab ӡ༻ઃܭϥϘ "84$*$%ؔ࿈αʔϏεͷશମ૾ 11 CodePipeline CodeCommit ιʔείʔυ CodeBuild Ϗϧυςετ

    CodeDeploy σϓϩΠ CodeStar
  12. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJU 12

  13. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJUͷ֓ཁ 13 CodeCommit ιʔείʔυ • (JU)VC૬౰ͷαʔϏε •

    *".ϢʔβຖʹΞΫηε੍ޚͰ͖Δɻ • JTTVF؅ཧ͸ແ͍ɻ "84ͷ$*$%ܥαʔϏεͰҰ൪͓खܰ
  14. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJUͷڝ߹αʔϏε 14 CodeCommit ιʔείʔυ • 4 •

    (JU)VC • #JUCVDLFU • (JU)VC&OUFSQSJTF
  15. Operation Lab ӡ༻ઃܭϥϘ $PEF#VJME 15

  16. Operation Lab ӡ༻ઃܭϥϘ $PEF#VJMEͷ֓ཁ 16 CodeBuild ιʔείʔυ Ϗϧυςετ ΞʔςΟϑΝΫτ ੒Ռ෺

    • ιʔείʔυʹಉࠝ͞ΕͨCVJMETQFDZNMʹैͬͯ Ϗϧυ΍ςετΛ࣮ߦ͢Δɻ • Ϗϧυͨ͠੒Ռ෺ ΞʔςΟϑΝΫτ ͕ग़ྗ͞ΕΔɻ ׂͱԿͰ΋Ͱ͖Δɻ ൿ఻ͷλϨԽ΋
  17. Operation Lab ӡ༻ઃܭϥϘ $PEF#VJMEͱ࿈ܞͰ͖ΔαʔϏε 17 CodeBuild ςετϏϧυ ΞʔςΟϑΝΫτ ੒Ռ෺ ιʔείʔυ

    • $PEF1JQFMJOF • 4 • $PEF$PNNJU • (JU)VC • #JU#VDLFU • (JU)VC&OUFSQSJTF • /0@4063$& • $PEF1JQFMJOF • 4 • /0@4063$& • CVJMETQFDZNMʹهड़ͨ͠৔ॴ • ྫ &$3 https://docs.aws.amazon.com/ja_jp/codebuild/latest/userguide/create-project.html ࣌఺
  18. Operation Lab ӡ༻ઃܭϥϘ $PEF%FQMPZ 18

  19. Operation Lab ӡ༻ઃܭϥϘ $PEF%FQMPZͷ֓ཁ 19 CodeDeploy σϓϩΠ • ιʔείʔυʹಉࠝ͞ΕͨBQQTQFDZNMʹैͬͯσϓϩΠ͢Δɻ •

    4FSWFSEFQMPZΤʔδΣϯτͷೖ͍ͬͯΔ&$΍ΦϯϓϨʹσϓϩΠɻ • -BNCEBͱ&$4΁ͷσϓϩΠʹ΋ରԠɻ • #MVF(SFFOσϓϩΠʹରԠ ΦϯϓϨΛআ͘ ΞʔςΟϑΝΫτ ੒Ռ෺ • Server • Lambda • ECS ͦΕͧΕΞϓϦέʔγϣϯλΠϓ͕ҟͳΔͷͰɺޙ͔ΒมߋͰ͖ͳ͍ɻ
  20. Operation Lab ӡ༻ઃܭϥϘ $PEF%FQMPZͱ࿈ܞͰ͖ΔαʔϏε 20 CodeDeploy σϓϩΠ ΞʔςΟϑΝΫτ ੒Ռ෺ •

    Server • Lambda • ECS • 4 • 4FSWFS &$  • 4FSWFS ΦϯϓϨ  • -BNCEB • &$4 https://docs.aws.amazon.com/ja_jp/codedeploy/latest/userguide/applications-create.html ࣌఺ ΦϯϓϨҎ֎͸#MVF(SFFOՄೳ
  21. Operation Lab ӡ༻ઃܭϥϘ $PEF1JQFMJOF 21

  22. Operation Lab ӡ༻ઃܭϥϘ $PEF1JQFMJOFͷ֓ཁ 22 CodePipeline • $*$%αʔϏεΛͭͳ͙໾ׂɻ • جຊతʹ+40/Ͱߏ੒Λॻ͘ɻ

    • ϚϧνιʔεʹରԠ ೥݄  • $MPVE8BUDI&WFOUTʹରԠ ೥݄
  23. Operation Lab ӡ༻ઃܭϥϘ • खಈ • S3 • CodeDeploy •

    ECS • CloudFormation • ElasticBeanstalk • OpsWorks • ServiceCatalog • Alexa skiils kit • ֤छSaaS $PEF1JQFMJOFͱ࿈ܞͰ͖ΔαʔϏε 23 • CodeCommit • S3 • ECR • GitHub IUUQTEPDTBXTBNB[PODPNKB@KQDPEFQJQFMJOFMBUFTUVTFSHVJEFJOUFHSBUJPOTBDUJPOUZQFIUNMJOUFHSBUJPOTUFTU • CodeBuild • DeviceFirm • Jenkins • ֤छSaaS • CodeBuild • Jenkins • ֤छSaaS ঝೝ ιʔε Ϗϧυ ςετ ࣮ߦ CodePipeline σϓϩΠ • Lambda ࣌఺
  24. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ 24

  25. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ 25 ιʔείʔυ ࣗ෼ୡͷ$*$%ύΠϓϥΠϯʹπʔϧΛ૊ΈࠐΉ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ σϓϩΠઌ ੒Ռ෺

    Ϧιʔε Ϧιʔε Ϧιʔε Ϧιʔε ੒Ռ෺ ఏڙऀ Ϣʔβ Ϗϧυςετ σϓϩΠ ੒Ռ෺ ੒Ռ෺
  26. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓͰେࣄͳࣄ 26 ιʔείʔυ Ϗϧυςετ σϓϩΠ ࣗ෼ͨͪͷύΠϓϥΠϯͷߦઌ͸Ϣʔβ σϓϩΠઌ

    ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ੒Ռ෺ ఏڙऀ Ϣʔβ ΞʔςΟϑΝΫτ ;JQ தؒ੒Ռ෺ • $PEF$PNNJU • 4 • &$3 • (JU)VC • #JU#VDLFU • (JU)VC&OUFSQSJTF • /0@4063$& • $PEF%FQMPZ • TDQͳͲ • $BQJTUSBOPͳͲ • 4 • &$ • ΦϯϓϨ • &$4 #MVF(SFFO  • 'BSHBUF • -BNCEB • &MBTUJD#FBOTUBML • 0QT8PSLT • $MPVE'PSNBUJPO • 4FSWJDF$BUBMPH • "MFYBTLJJMTLJU • $PEF#VJME • +FOLJOT • ֤छ4BB4 πʔϧ͸ԿͰ΋ྑ͍͠ɺ࣌୅ͰมΘΔ
  27. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓͷ࿦఺ 27

  28. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓͷ࿦఺ 28 ιʔείʔυ ςετ σϓϩΠ σϓϩΠઌ •

    ιʔείʔυ؅ཧ • ϦϦʔεઌ؀ڥ • EFWTUH • ϦϦʔεํ๏ • ΠϯϓϨʔε • #MVF(SFFO Ϗϧυ • ঝೝͷ༗ແ • ΞʔςΟϑΝ Ϋτͷܗࣜ • ;*1 • ίϯςφΠ ϝʔδ • ".* • ഑෍ܗଶ • ϓϧ • ϓογϡ • ՝୊؅ཧ • ΞΫηε੍ޚ • ϦϦʔεઌEFWTUH • ϒϥϯν • $* • ϦϦʔεઌQSE • Ϛελϒϥϯ ν • $% • &$ɻΦϯϓϨ • 4ɻ&$4 • 'BSHBUFɻ-BNCEB • $MPVE'PSNBUJPO • ϦϦʔεઌ؀ڥ • QSE
  29. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓͷ࿦఺ େاۀ 29 ιʔείʔυ ςετ σϓϩΠ σϓϩΠઌ

    • ιʔείʔυ؅ཧ • ϦϦʔεઌ؀ڥ • EFWTUH • ϦϦʔεํ๏ • ΠϯϓϨʔε • #MVF(SFFO Ϗϧυ • ঝೝͷ༗ແ • ΞʔςΟϑΝ Ϋτͷܗࣜ • ;*1 • ίϯςφΠ ϝʔδ • ".* • ഑෍ܗଶ • ϓϧ • ϓογϡ • ՝୊؅ཧ • ΞΫηε੍ޚ • ϦϦʔεઌEFWTUH • ϒϥϯν • $* • ϦϦʔεઌQSE • Ϛελϒϥϯ ν • $% • &$ɻΦϯϓϨ • 4ɻ&$4 • 'BSHBUFɻ-BNCEB • $MPVE'PSNBUJPO • ϦϦʔεઌ؀ڥ • QSE ӡ༻ ։ൃ
  30. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ͔Βݟ͑ͯ͘Δܗ 30 ೖ໳ฤ

  31. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJU $PEF1JQFMJOF 4 31 ιʔείʔυ ςετϏϧυ σϓϩΠ

    σϓϩΠઌ ੒Ռ෺ ੒Ռ෺ ఏڙऀ Ϣʔβ ΞʔςΟϑΝΫτ ;JQ தؒ੒Ռ෺ 4 4 Tutorial: Create a Pipeline That Uses Amazon S3 as a Deployment Provider IUUQTEPDTBXTBNB[PODPNKB@KQDPEFQJQFMJOFMBUFTUVTFSHVJEFUVUPSJBMTTEFQMPZIUNM ୯७ͳ্ॻ͖ͳͷͰɺҠಈ΍࡟আʹ͸௥ਵͰ͖ͳ͍ɻ WebSite Hosting 4 CodePipeline
  32. Operation Lab ӡ༻ઃܭϥϘ $PEF$PNNJU $PEF1JQFMJOF 4 32 ιʔείʔυ ςετ σϓϩΠ

    σϓϩΠઌ • ϦϦʔεઌ؀ڥ • EFWTUHQSE • ϦϦʔεํ๏ • ΠϯϓϨʔε • #MVF(SFFO Ϗϧυ • Ϧιʔε؅ཧ • ࣗલ • Ϛωʔδυ ௿  • Ϛωʔδυ த • ঝೝͷ༗ແ • ΞʔςΟϑΝ Ϋτͷܗࣜ • ;*1 • ίϯςφΠ ϝʔδ • ".* • ഑෍ܗଶ • ϓϧ • ϓογϡ • ιʔείʔυ؅ཧ • ՝୊؅ཧ • ΞΫηε੍ޚ 4 4 4 CodePipeline ੒Ռ෺ ੒Ռ෺ தؒ੒Ռ෺
  33. Operation Lab ӡ༻ઃܭϥϘ $*$%ͷσβΠϯϚοϓ͔Βݟ͑ͯ͘Δܗ 33 ॳڃฤ

  34. Operation Lab ӡ༻ઃܭϥϘ Πϯελϯεܕͷ$*$% $PEF%FQMPZ 34 ιʔείʔυ؅ཧ • ϦϦʔεઌ؀ڥ •

    EFWTUH • ϦϦʔεํ๏ • ΠϯϓϨʔε • #MVF(SFFO • εςʔτϑϧ 4PSSZϝϯςܕ • ঝೝͷ༗ແ • ΞʔςΟϑΝ Ϋτͷܗࣜ • ;*1 • ίϯςφΠ ϝʔδ • ".* • ഑෍ܗଶ • ϓϧ • ϓογϡ • ՝୊؅ཧ • ΞΫηε੍ޚ • ϦϦʔεઌEFWTUH • ϒϥϯν • $* • ϦϦʔεઌQSE • Ϛελϒϥϯ ν • $% • &$ɻΦϯϓϨ • 4ɻ&$4 • 'BSHBUFɻ-BNCEB • $MPVE'PSNBUJPO • ϦϦʔεઌ؀ڥ • QSE
  35. ࠓޙͷٞ࿦ωλ Ұ෦ • ίϯύΠϧͱඇίϯύΠϧͰҧ͍͕͋Γͦ͏ • $44΍ϑϩϯτ΋ίϯύΠϧ͢ΔΑͶ  • ".*Λར༻ͨ͠σϓϩΠ͸Ͳ͏΍Δ Operation

    Lab ӡ༻ઃܭϥϘ 35
  36. Operation Lab ӡ༻ઃܭϥϘ 36 IUUQXXXPQFSBUJPOMBCDPKQ OperationLab ӡ༻ઃܭ