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

デプロイ今昔物語 〜CGIからサーバーレスまで〜 / The deployment technics

mackee
March 19, 2023

デプロイ今昔物語 〜CGIからサーバーレスまで〜 / The deployment technics

YAPC::Kyoto 2023

mackee

March 19, 2023
Tweet

More Decks by mackee

Other Decks in Programming

Transcript

  1. ొ৔͢Διϑτ΢ΣΞ΍؀ڥ • Perl 5.32.1(system perl), Perl 5.36.0 • Apache 2.4.54

    • mod_perl 2.0.11 • Debian 11 bullseye • ݕূ؀ڥͱ͜ͷϚγϯؒ͸tailscaleͰVPNΛு͍ͬͯ·͢
  2. CGI

  3. PSGIͷྨࣅ඼ • Java Servelet API • WSGI (Python) • Rack

    (Ruby) • ͜ͷॱ൪Ͱspecʹݴٴ͕͋Δ • PSGIʹ͸WSGIͱRackͱ”JSGI”ʹݴٴ͕͋Δ
  4. FTP

  5. Serverless/FaaSͷొ৔എܠ • ΞϓϦέʔγϣϯ੍࡞ऀ͕௚઀؅ཧ͢Δର৅͕࣌୅Λ௥͏͝ͱʹϨΠ Ϡʔ্͕΁ͱ্͕͍͍ͬͯͬͯͨ • ෺ཧαʔόʔ, Ծ૝αʔόʔ, IaaS, ίϯςφ •

    ϥϯλΠϜ΍ϓϩηεͷϥΠϑαΠΫϧ·ͰΫϥ΢υࣄۀऀʹ͓ئ͍ ͯ͠͠·͏ͷ͕Serverless • Ϩϯλϧαʔόʔ/CGI΁ͷճؼ, ΑΓޮ཰Խ͞Εͨ΋ͷ
  6. Serverless/FaaSͷྨࣅ඼ • PaaS • Heroku, Elastic Beanstalk, AppEngine(Flexible Environment)… •

    ϥϯλΠϜͷ੹຿͸Ϋϥ΢υࣄۀऀ • ͨͩ͠αʔόʔతଘࡏ͸࣮֬ʹײ͡Δ, εέʔϦϯάઃఆͳͲ
  7. ొஃऀͷײ૝ • σϓϩΠٕज़͸લʹ࢖ΘΕٕͨज़ͷ՝୊Λղফ͢ΔͨΊʹੜ·Ε͖ͯͨ • ࢼߦࡨޡͷ݁Ռࠓ͕͋Δɻͭ·Γ “try/catch” Ͱ͢Ͷ • ͦΕ͸ͦΕͱͯ͠ɺੲͷٕज़Ͱ΋ݟͲ͜Ζ͸͋Δ •

    CGI͕ಈ͘Ϩϯλϧαʔόʔ͸FaaSͱݴ͑Δ • ੲΑΓ΋WebΞϓϦέʔγϣϯ͕ղ͜͏ͱ͢Δ՝୊͕ෳࡶʹͳ͍ͬͯΔ ͷͰɺ؅ཧํ๏ͷҰͭͰ͋ΔʮσϓϩΠʯ΋ෳࡶʹͳΔ܏޲
  8. ࠙਌ձͱ͔࿓ԼͰ࿩ͯ͠ཉ͍͠࿩୊ ͦͷ2 • ϩʔϦϯάϦελʔτ, ϒϧʔάϦʔϯσϓϩΠ • graceful restart • PullܕσϓϩΠ+graceful

    restart͸σϓϩΠ͕ΊͪΌΊͪΌ଎͔ͬͨ • ΠϯϑϥͷઃఆσϓϩΠͱΞϓϦέʔγϣϯͷσϓϩΠͷڥ໨