Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Yohei Kawahara
August 25, 2017
730

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

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

Yohei Kawahara

August 25, 2017
Tweet

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  5. ࣌୅͸αʔόʔϨεɺόον΋αʔόʔͰͷՔಇ͸
    ࢭΊͯ-BNCEBʹҠߦ͢Ε͹͍͍ΜͫΌͳ͍͔ͳ

    View full-size slide

  6. ͱ͜Ζ͕

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

    View full-size slide

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

    View full-size slide

  8. ͱ͜Ζ͕

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

    View full-size slide

  9. ͦ͜Ͱ4UFQ'VODUJPOT

    ‘ SF*OWFOUͰൃද
    ‘ -BNCEB౳ͷෳ਺ΞϓϦέʔγϣϯΛͭͷ
    ϫʔΫϑϩʔͱͯ͠ఆٛɺ࣮ߦ
    ‘ ฒྻॲཧɺ࿈ଓॲཧɺ෼ذ౳Λ+40/ϕʔεͷ
    %4-Ͱهड़
    ‘ ॲཧͷྲྀΕ΍࣮ߦ݁ՌΛΠΠײ͡ʹՄࢹԽ

    View full-size slide

  10. ͦ͜Ͱ4UFQ'VODUJPOT
    ϫʔΫϑϩʔ

    $IPJDFεςʔτ
    ύϥϨϧ
    +PCTUBUVTQPMMFS
    ଞʹ΋͋ΔΑΧελϚΠζ΋ग़དྷΔΑ

    View full-size slide

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

    View full-size slide

  12. ͦ͜Ͱ4UFQ'VODUJPOT
    ༻ޠ

    ‘ 4UBUF.BDIJOFϫʔΫϑϩʔ
    ‘ 4UBUFछྨͷ4UBUFʢ5BTL $IPJDF
    1BSBMMFMʜ౳ʣ
    ‘ 5BTL-BNCEB౳ͷΞϓϦέʔγϣϯ
    ‘ "NB[PO4UBUF-BOHVBHF+40/ϕʔε
    Ͱ4UBUF.BDIJOFΛهड़

    View full-size slide

  13. ͦ͜Ͱ4UFQ'VODUJPOT
    "4-

    {
    "Comment": “HelloWorld Sample",
    "StartAt": "HelloWorld",
    "States": {
    "HelloWorld": {
    "Type": "Pass",
    "Result": "Hello World!",
    "End": true
    }
    }
    }

    View full-size slide

  14. ͰɺDSPOͷόονॲཧ͸Ͳ͏͢Μͷʁ
    ‘ &$΍ΦϯϓϨαʔόʔ্ͷॲཧ΋λεΫͱ͠
    ͯར༻Մೳʢ"DUJWJUZ5BTLʣ
    ‘ "DUJWJUZ5BTLΛ࣮ߦ͢Δ8PSLFS͸"84
    $-*΍"844%,Ͱཁ࣮૷ʢࠓճ͸(PMBOH
    Ͱʣ
    ‘ 8PSLFS͸ఆظతʹ4UFQ'VODUJPOTΛϙʔ
    Ϧϯάͯ͠ݺͼग़͠Λ଴ͭ

    View full-size slide

  15. "DUJWJUZ5BTL
    Λར༻ͯ͠όονΛ࣮ߦ͢Ε͹Α͛͞

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. "844UFQ'VODUJPOTͷؾʹͳΔͱ͜Ζ
    ‘ λεΫؒͷೖग़ྗ͸+40/Ͱ΍ΓͱΓ͞ΕΔ
    ‘ "DUJWJUZ5BTL8PSLFS͸ࣗ࡞͢Δඞཁ͋Γ
    ‘ 4UFQ'VODUJPOTͷར༻ࣗମʹֻ͓͕͔ۚΔ

    View full-size slide

  19. ࢀߟ
    ‘ IUUQTXXXTMJEFTIBSFOFU"NB[PO8FC4FSWJDFT+BQBO
    CMBDLCFMUTUFQGVODUJPOT
    ‘ IUUQTXXXTMJEFTIBSFOFUTLJLVDIJBXTTUFQGVODUJPOT
    ‘ IUUQEFWDMBTTNFUIPEKQSFGFSFODFDBUBXTTUFQ
    GVODUJPOT
    ‘ IUUQTTQFBLFSEFDLDPNEBJLJNPSJBXTTUFQ
    GVODUJPOTGBMTFJSPIB
    ‘ IUUQJOPLBSBIBUFCMPKQFOUSZ

    View full-size slide