Alexaスキルを安心安全に開発運用するためのAWS自動化ソリューション

46e8de7d6e95be6327e8c49bf3b0c028?s=47 chao2suke
February 23, 2019

 Alexaスキルを安心安全に開発運用するためのAWS自動化ソリューション

2019/02/23 JAWS Days 2019 登壇資料

46e8de7d6e95be6327e8c49bf3b0c028?s=128

chao2suke

February 23, 2019
Tweet

Transcript

  1. AlexaεΩϧΛ ҆৺ɾ҆શʹ։ൃӡ༻͢ΔͨΊͷ AWSࣗಈԽιϦϡʔγϣϯ Ϋϥεϝιουגࣜձࣾ ͤʔͷ

  2. ࣗݾ঺հ • ਗ਼໺߶࢙ʢͤʔͷʣ • Ϋϥεϝιουגࣜձࣾ
 AIιϦϡʔγϣϯ෦
 ࡳຈΦϑΟεॴଐ
 AlexaςΫχΧϧΤόϯδΣϦετ / 


    VUIΞʔΩςΫτ • ࠷ۙAWS Certified Alexa Skill Builder - SpecialtyΛड͚ͯ
 AWSࢼݧݴޠ͕ͳͯ͘ײಈ
  3. εΩϧΛͲͷΑ͏ʹ࡞͍ͬͯ·͔͢ʁ

  4. ؆୯͚ͩʹ༉அ͕ͪ͠ ɾ։ൃऀίϯιʔϧʢGUIʣ͸
 ͦͷ৔ͰͳΜͱͳܾ͘Ίͯ͠·͍͕ͪ ɾόοΫΤϯυʢLambdaʣ͕1ϖʔδʢindex.jsʣͷΈͰॻ ͚ΔαΠζͩͱɺ੎͍Ͱॻ͍ͯ͠·͍͕ͪ ͔ͭͯͷAWS͕ͦ͏ͩͬͨ

  5. AWSΤϯδχΞϦϯάͷ εςοϓΞοϓ ϚωʔδϝϯτίϯιʔϧͰϙνϙν࡞Δ CLI & APIͰίʔυԽͯ͠؅ཧ͢Δ όονԽ & ௨஌ػೳΛ௥Ճͯ͠CI/CD͢Δ

  6. AlexaΛίʔυ؅ཧ͢Δ ϑϩϯτΤϯυଆ ʢIntent/SlotɺΤϯυϙΠϯτ؅ཧ) όοΫΤϯυଆ ʢ࣮૷ίʔυʣ SMAPI (Skill Management API) ASK

    CLI AWS Lambda
  7. Codeܑఋ

  8. CodeܑఋΛ࢖ͬͨ Alexa؀ڥߏங

  9. Point ɾCodeStar(SAM)Λ࢖͏ͱLambdaͷFunction໊ʹ ༨ܭͳpostfix͕ͭ͘ͷ͕ݏ
 => Apex(SalesForceͷΞϨ͡Όͳ͍ํʣ
 Λ࢖ͬͯLambdaΛDeploy ɾApexΛೖΕͨDockerΛECRʹηοτ
 => ΧελϜϏϧυϞσϧͰୟ͘ ɾߏங͕࣌ؒ௕͍(ࣗಈπʔϧ͋Δ͋Δʣ


    => CodePipelineΛ࢖ͬͯSNSʹ݁ՌΛ௨஌ɺ
 ޙ͸޷͖ͳํ๏Ͱ௨஌͢Δ ɾΫϥΠΞϯτʹޙ΄Ͳ εΩϧτϥϯεϑΝʔ͢Δ͜ͱΛߟྀͯ͠ CodeCommitͰ͸ͳ͘GithubΛ࠾༻
  10. buildspec.yml version: 0.2 env: variables: SKILL_NAME: demo STAGE: dev AWS_ACCOUNT_ID:

    xxxxxxxxxxxx phases: pre_build: commands: - mkdir /root/.ask - "aws s3 sync s3://askconfig-${AWS_ACCOUNT_ID}-${AWS_REGION} /root/.ask/" - cd functions/skill - yarn - cd ../../
  11. buildspec.yml build: commands: - echo Build started on `date` -

    "/usr/local/bin/apex --env ${STAGE} deploy skill" - "aws lambda add-permission --statement-id 1 --function-name ${SKILL_NAME}_$ {STAGE} --action lambda:invokeFunction --principal alexa-appkit.amazon.com || true" - cd model - "sh build.${STAGE}.sh" post_build: commands: - echo Build completed on `date` 

  12. ෳ਺؀ڥ࡞ͬͯ·͔͢ʁ

  13. ࢓ࣄͰΤϯδχΞϦϯά͢Δ࣌ͷجૅ ։ൃ؀ڥͰ։ൃ εςʔδϯάͰ͓٬༷֬ೝɺOKͳΒຊ൪΁ ෆ۩߹͸εςʔδϯάͰ࠶ݱɺ։ൃ؀ڥͰम෮

  14. ຊ൪؀ڥ͸AmazonνʔϜʹΑΔ৹͕ࠪ͋Δ ʢ͍͍ͩͨ5Ӧۀ೔ʣ AlexaͰෳ਺؀ڥΛ࡞ΔϙΠϯτ όοΫΤϯυίʔυ͸৹ࠪର৅֎

  15. AlexaͰෳ਺؀ڥΛ࡞ΔϙΠϯτ ࣗಈͰΞοϓσʔτ͢ΔͱϑϩϯτͱόοΫʹ όʔδϣϯࠩҟ͕ग़Δ

  16. ΤΠϦΞεΛ࢖͏

  17. ΤΠϦΞεΛ༻͍ͨෳ਺؀ڥߏங

  18. ɾεςʔδϯάͱຊ൪͸ͳΔ΂͘ಉ͡ʹ͓͖͍ͯͨ͠ ͷͰReleaseϒϥϯνΛ࢖Θͣmasterʹ౷Ұ ɾώϡʔϚϯΤϥʔʹΑΔΦϖϛεΛ๷͙ͨΊ ΤΠϦΞεͱόʔδϣϯͷඥ෇͚͸ ͋͑ͯखಈͰߦ͏ ɾApexͷproject.json͸ project.dev.json / project.prd.jsonͷ2छྨɺ config(ϩάείʔϓͳͲΛ؅ཧʣ͸

    dev/stg/prdͷ3छྨ Point
  19. ଞʹ΋͍Ζ͍Ζ΍ͬͯ·͕͢ ͦΕ͸·ͨผͷ࿩

  20. ·ͱΊ ɾࠓ·Ͱͷ։ൃϊ΢ϋ΢͸ Alexa։ൃʹ΋ͦͷ··࢖͑·͢ ɾLambda͸όʔδϣχϯάͯ͠ ΤΠϦΞεͰ؅ཧ͠·͠ΐ͏ ɾCodeBuildʹςετπʔϧΛಥͬࠐΜͰ CI/CDͰճ͠·͠ΐ͏