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

バッチ処理でhakoを使う話

 バッチ処理でhakoを使う話

hoshino tsuyoshi

October 13, 2016
Tweet

More Decks by hoshino tsuyoshi

Other Decks in Technology

Transcript

  1. όονॲཧͰhakoΛ࢖͏࿩
    @hoshinotsuyoshi / feedforce Inc.
    2016/10/12

    View full-size slide

  2. Me
    • @hoshinotsuyoshi
    • h,p:/
    /hoppie.hatenablog.com/


    • 2014ʙ feedforce Inc.

    View full-size slide

  3. όονॲཧ !
    • cronͩͱ
    • ߴ͍Մ༻ੑΛಘΔͷ͕೉͍͠
    • ϦιʔεʹԠͨ͡εέδϡʔϦϯά͕೉͍͠

    View full-size slide

  4. EC2 Container Service Product Details
    ❝ You can run anything: applica1ons, batch jobs, or microservices.

    View full-size slide

  5. ECSͰόονॲཧ͢Δʹ͸
    1. TaskDefini,onͷొ࿥ͯ͠
    • $ aws ecs register-task-definition
    2. TaskΛ࣮ߦ͢Δʂ
    • $ aws ecs run-task
    3. Ҏ্ʂ(جຊతʹ͸)

    View full-size slide

  6. ͦͷଞͷ໰୊
    • ΦʔτεέʔϦϯάͤ͞ͳ͖Ό… !
    • TaskDefini-on͕ࡍݶͳ͘૿Ճͯ͘͠… !
    • σϓϩΠͷͨͼʹTaskDefini-onొ࿥ͯͨ͠
    • ొ࿥ࡁΈ͔Ͳ͏͔ͷνΣοΫ͕ͩΔ͍
    • …

    View full-size slide

  7. (TaskDefini+on͕ແݶʹ૿͑ͯ͘Πϝʔδ)

    View full-size slide

  8. ?ʮhakoͷoneshot ! ྑͦ͞͏ʯ

    View full-size slide

  9. $ hako oneshot !
    ❝ hako oneshot ͸YAML ͷఆٛʹैͬͯ ECS ͷ RunTask API Λ
    ݺͼग़͢ίϚϯυ ❞
    - ECS Λར༻ͨ͠ΦϑϥΠϯδϣϒͷ࣮ߦ؀ڥ - ΫοΫύου։ൃऀϒϩά

    View full-size slide

  10. ͜Μͳ͔Μ͡ʹͳͬͨ

    View full-size slide

  11. ! TaskDefini+on͕૿͑ͮΒ͍ "
    • TaskDefini+onΛॏෳొ࿥͠ͳ͍࢓૊Έ͕͋Δ
    • (ͨ·ʹొ࿥͞ΕͪΌ͏ύλʔϯ͕͋ΔşŪƄ)
    • (ιʔεಡΜͰ௚ͨ͠Γɺyamlͷॻ͖ํͰճආ͢Δ)

    View full-size slide

  12. ! ࣗಈscale out "
    • Ϧιʔε͕଍Γͳ͍ͱ͖ͷࣗಈscale out
    • autoscaling_group_for_oneshot Λࢦఆ͢Ε͹͓̺
    • ઃఆྫ)
    • Ϧιʔε͕଍Γͳ͍৔߹͸desired͕ 1 ૿͑Δ
    • ͜ͷ 1 ͸ϋʔυίʔυ

    View full-size slide

  13. ·ͱΊ
    • hako oneshot ! Λ࢖͏͜ͱʹΑΓ
    • ༨෼ͳTaskDefini/onొ࿥͕ݮͬͨ
    • ࣗಈscale out΋໘౗ݟͯ͘ΕΔ
    • ECS APIୟࣗ͘લίʔυ͕ݮͬͨ

    View full-size slide

  14. ࢀߟจݙ
    • AWS _ Amazon EC2 Container Service _ Product Details
    • h/aws.amazon.com/ecs/details/?nc1=h_ls
    • eagletmt/hako
    • h/github.com/eagletmt/hako

    View full-size slide

  15. ࢀߟจݙ
    • ECS Λར༻ͨ͠ΦϑϥΠϯδϣϒͷ࣮ߦ؀ڥ - ΫοΫύου։
    ൃऀϒϩά
    • h(p:/
    /techlife.cookpad.com/entry/2016/09/09/235007

    View full-size slide