AWS Step Functions で検討する crontabless architecture/20170824_serverless_meetup_fukuoka#1

26c17d2f70a57a8fd9a70885682fcd74?s=47 Yohei Kawahara
August 25, 2017
640

AWS Step Functions で検討する crontabless architecture/20170824_serverless_meetup_fukuoka#1

Serverless Meetup Fukuoka #1 でお話した資料でごわす。

26c17d2f70a57a8fd9a70885682fcd74?s=128

Yohei Kawahara

August 25, 2017
Tweet

Transcript

  1. "844UFQ'VODUJPOTͰݕ౼͢Δ DSPOUBCMFTTBSDIJUFDUVSF 2017.08.25 4FSWFSMFTT.FFUVQ'VLVPLB ͔ͬͺ !JOPLBSB

  2. ஫ҙ ‘ ຊࢿྉʹ͸TFSWFSMFTTNFFUVQͳͷʹ &$΍αʔόʔͱݴͬͨ༻ޠ͕ਵॴʹݱΕ·͢ ͷͰ෦԰Λ໌Δͯ͘͠ޚཡ͍ͩ͘͞ ‘ ਵॴͰ৭ʑͳ৘ใΛ୺ંͬͯ͠·͍ͬͯΔͷͰɺ ৄࡉʹ͍ͭͯ͸8FCαΠτ౳Λޚ֬ೝԼ͍͞

  3. ࿩͍ͨ͜͠ͱΛࡾߦͰ ‘ DSPOͰಈ͘όονॲཧΛ ‘ 4UFQ'VODUJPOTʹஔ͖׵͑ͯ ‘ DSPOUBCMFTTΛໝ૝͓ͨ͠࿩Ͱ͢

  4. Ϟνϕʔγϣϯ ͜ΜͳDSPOUBC͕ఆٛ͞Εͨ&$͕͋ͬͨͱ͞ */3 * * * * batch /path/to/batch1 >

    /dev/null 2>&1 30 1 * * * batch /path/to/batch2 > ./log/batch2.log 30 3 * * * batch /path/to/batch3 > ./log/batch3.log
  5. ࣌୅͸αʔόʔϨεɺόον΋αʔόʔͰͷՔಇ͸ ࢭΊͯ-BNCEBʹҠߦ͢Ε͹͍͍ΜͫΌͳ͍͔ͳ

  6. ͱ͜Ζ͕  ͜Ε͸໘౗ ‘ όον͕-BNCEBͰͦͷ··ಈ͔ͳ͍ ‘ -BNCEBͰ͸αϙʔτ͞Ε͍ͯͳ͍ݴޠͰ࣮૷ ‘ Ҡ২ʹ͸ͦΕͳΓͷ͕͔͔࣌ؒΔ

  7. Ͳ͏͔ͬ͢ͳ ‘ όονΛىಈ͍͚ͨ࣌ͩ͠&$Λىಈͯ͠ʜ ‘ &$͕ىಈͨ͠ޙʹόονΛ࣮ߦͯ͠ʜ ‘ όον͕ऴྃͨ͠Β&$Λఀࢭ -BNCEBͱ&$ͷϋΠϒϦουͰΠέͦ͏͹͍

  8. ͱ͜Ζ͕  ‘ όονॲཧऴྃલʹ&$͕ఀࢭ͠ͳ͍ʁ ‘ όονʹґଘؔ܎͕͋ΔΜ͚ͩͲʜ ‘ ෳ਺όονॲཧ͕ฒߦͰ૸Β͍ͤͨΜ͚ͩͲʜ ‘ ॲཧϑϩʔΛՄࢹԽ͍ͨ͠Μ͚ͩͲʜ

    ‘ ॲཧϑϩʔΛίʔυԽ͍ͨ͠Μ͚ͩͲʜ ͍Ζ͍ΖؾʹͳΔʜ
  9. ͦ͜Ͱ4UFQ'VODUJPOT  ‘ SF*OWFOUͰൃද ‘ -BNCEB౳ͷෳ਺ΞϓϦέʔγϣϯΛͭͷ ϫʔΫϑϩʔͱͯ͠ఆٛɺ࣮ߦ ‘ ฒྻॲཧɺ࿈ଓॲཧɺ෼ذ౳Λ+40/ϕʔεͷ %4-Ͱهड़

    ‘ ॲཧͷྲྀΕ΍࣮ߦ݁ՌΛΠΠײ͡ʹՄࢹԽ
  10. ͦ͜Ͱ4UFQ'VODUJPOT  ϫʔΫϑϩʔ $IPJDFεςʔτ ύϥϨϧ +PCTUBUVTQPMMFS ଞʹ΋͋ΔΑΧελϚΠζ΋ग़དྷΔΑ

  11. ͦ͜Ͱ4UFQ'VODUJPOT  ࣮ߦ؅ཧ

  12. ͦ͜Ͱ4UFQ'VODUJPOT  ༻ޠ ‘ 4UBUF.BDIJOFϫʔΫϑϩʔ ‘ 4UBUFछྨͷ4UBUFʢ5BTL $IPJDF  1BSBMMFMʜ౳ʣ

    ‘ 5BTL-BNCEB౳ͷΞϓϦέʔγϣϯ ‘ "NB[PO4UBUF-BOHVBHF+40/ϕʔε Ͱ4UBUF.BDIJOFΛهड़
  13. ͦ͜Ͱ4UFQ'VODUJPOT  "4- { "Comment": “HelloWorld Sample", "StartAt": "HelloWorld", "States":

    { "HelloWorld": { "Type": "Pass", "Result": "Hello World!", "End": true } } }
  14. ͰɺDSPOͷόονॲཧ͸Ͳ͏͢Μͷʁ ‘ &$΍ΦϯϓϨαʔόʔ্ͷॲཧ΋λεΫͱ͠ ͯར༻Մೳʢ"DUJWJUZ5BTLʣ ‘ "DUJWJUZ5BTLΛ࣮ߦ͢Δ8PSLFS͸"84 $-*΍"844%,Ͱཁ࣮૷ʢࠓճ͸(PMBOH Ͱʣ ‘ 8PSLFS͸ఆظతʹ4UFQ'VODUJPOTΛϙʔ

    Ϧϯάͯ͠ݺͼग़͠Λ଴ͭ
  15. "DUJWJUZ5BTL Λར༻ͯ͠όονΛ࣮ߦ͢Ε͹Α͛͞

  16. ͱ͍͏͜ͱͰɺ͜Μͳײ͡ʹͳΓ·ͨ͠

  17. None
  18. "844UFQ'VODUJPOTͷΠΠͱ͜ ‘ $MPVE8BUDI&WFOUTͱͷ૊Έ߹ΘͤͰϦο νͳ4FSWFSMFTTDSPOͱͳΔ ‘ -BNCEBΛύʔπͱͯࣗ͠༝ʹϫʔΫϑϩʔΛ σβΠϯՄೳ ‘ &$͢ΒλεΫΛॲཧ͢ΔҝͷϦιʔεͱͳΔ ‘

    ॲཧϑϩʔ΍݁Ռ͕͍͍ײ͡ͰՄࢹԽ͞Ε͑Δ
  19. "844UFQ'VODUJPOTͷؾʹͳΔͱ͜Ζ ‘ λεΫؒͷೖग़ྗ͸+40/Ͱ΍ΓͱΓ͞ΕΔ ‘ "DUJWJUZ5BTL8PSLFS͸ࣗ࡞͢Δඞཁ͋Γ ‘ 4UFQ'VODUJPOTͷར༻ࣗମʹֻ͓͕͔ۚΔ

  20. ࢀߟ ‘ IUUQTXXXTMJEFTIBSFOFU"NB[PO8FC4FSWJDFT+BQBO CMBDLCFMUTUFQGVODUJPOT ‘ IUUQTXXXTMJEFTIBSFOFUTLJLVDIJBXTTUFQGVODUJPOT ‘ IUUQEFWDMBTTNFUIPEKQSFGFSFODFDBUBXTTUFQ GVODUJPOT ‘

    IUUQTTQFBLFSEFDLDPNEBJLJNPSJBXTTUFQ GVODUJPOTGBMTFJSPIB ‘ IUUQJOPLBSBIBUFCMPKQFOUSZ