OpenFaaSとは

5e3812168e73d09304da6959a40155c8?s=47 kenev
October 18, 2017

 OpenFaaSとは

Serverless FrameworkなOpenFaaS
その概要について説明します。

※Serverless Meetup Osaka #4 のLTにて講演した内容です

5e3812168e73d09304da6959a40155c8?s=128

kenev

October 18, 2017
Tweet

Transcript

  1. 4FSWFSMFTT'SBNFXPSL 0QFO'BB4ͱ͸        

       4 F S W F S M F T T  . F F U V Q  0 T B L B   
  2. ࣗ ݾ ঺ հ  ෱ ࢁ  ݈ Fukuyama

    Ken !LFOGEFW ˔ ϑϩϯτΤϯυɺόοΫΤϯυɺΠϯϑϥ ˔ "84ιϦϡʔγϣϯΞʔΩςΫτΞιγΤΠτ ˔ 6EFNZߨࢣ ˔ ʲੈքͰສਓ͕डߨʳ࣮ફʂ"OHVMBS+4ߨ࠲ ˔ 0QFO'BB4ίϯτϦϏϡʔλʔ ˔ 3BODIFS.FFUVQ0TBLBӡӦ 3BODIFS+1
  3. ձ ࣾ ঺ հ  ˔ ೥ઃཱͷιϑτ΢ΣΞ։ൃձࣾ ˔ ڌ఺ɿେࡕ ຊࣾ

    ɺ౦ژɺ޿ౡɺ෱Ԭ ˔ ૊ΈࠐΈ͔ΒεϚϗΞϓϦɺ"*·Ͱ৭ʑ΍͍ͬͯ·͢ ϚωʔδυΫϥ΢υαʔϏεɿ$BQTVMF$MPVE I U U Q T    D B Q T V M F D M P V E  J P ג ࣜ ձ ࣾ ε ʔ ύ ʔ ι ϑ τ ΢ Τ Ξ 4 V Q F S 4 P G U X B S F  $ P  - U E ΦϦδφϧΞχϝɿϖʔύʔͷதʹ͋ΔΧϛΛ৯΂Δ I U U Q T    Z P V U V  C F  %  4 + [ N 1 J W  : εϚϗΞϓϦ ɿອըΧϝϥ
  4. ࠓ ճ ͷ ͓ ࿩ ͸ ʜ 

  5.  ͷ ঺ հ Λ ͠ · ͢ 4 F

    S W F S M F T T  ' S B N F X P S L
  6.  0 Q F O ' B B 4 ͱ

    ͸ %PDLFS্Ͱಈ͘4FSWFSMFTTͳ'SBNFXPSL ίϯςφʹೖ͍ͬͯΕ͹ԿͰ΋'VODUJPOʹͳΓಘΔ ʜ %PDLFS4XBSNͱ,VCFSOFUFTͰͷಈ࡞͕αϙʔτ͞Ε͍ͯΔ
  7.  0 Q F O ' B B 4 ͱ

    ͸ ਓؾٸ্ঢதʂ
  8.  0 Q F O ' B B 4 ͱ

    ͸
  9. ྫ ͑ ͹ ʜ 

  10. 4FSWFSMFTTͳ࣮ྫʢ"84ʣ "MFYB )PX`T
 UIFXFBUIFS  - B N C E

    B 
 ' V O D U J P O T \lJOUFOUz l'JOE8FBUIFSz^ \lTQFFDIz l*U`TEFHSFFTz^
  11. 0 Q F O ' B B 4 ࢖ ͏

    ͱ ʁ 
  12. 4FSWFSMFTTͳ࣮ྫʢ0QFO'BB4ʣ "MFYB )PX`T
 UIFXFBUIFS  \lJOUFOUz l'JOE8FBUIFSz^ \lTQFFDIz l*U`TEFHSFFTz^

  13. 4 F S W F S M F T T

    ʁ ʁ 
  14. ͬ ͯ ͳ Μ ͩ Ζ ͏ ʁ 

  15.  4 F S W F S M F T

    T ͱ ͸
  16.  4 F S W F S M F T

    T ͱ ͸ “there are still servers required to run a serverless platform. The provider will need to manage servers (or virtual machines or containers), and will have some cost for running the platform, even when idle. A self-hosted system can still be considered serverless: typically one team acts as the provider and another developer team.” Š$/$'8(4FSWFSMFTT1BQFSΑΓ IUUQTHPPHMVE%'Y
  17. େ ࣄ ͳ ͷ ͸ Ξ ʔ Ω ς Ϋ

    ν ϟ  architecture ͖ͬͱ
  18. 0 Q F O ' B B 4 ͷ ࢓

    ૊ Έ  gateway L V C F S O F U F T 4 X B S N / /F U D  'O" Deploy Deploy Orchestrator API 'VODUJPO4UBDL 'O# Invoke Metrics/Scale جຊߏ੒
  19. 0 Q F O ' B B 4 ͷ ࢓

    ૊ Έ  gateway L V C F S O F U F T 4 X B S N / /F U D  'O" Deploy Deploy Orchestrator API 'VODUJPO4UBDL 'O# Invoke Metrics/Scale 'O" 'O" Scale ΍͹͘ͳͬͨΒࣗಈతʹεέʔϧʂ
  20. ' V O D U J P O ͷ ࢓

    ૊ Έ ͸ ʁ  watchdog
  21. ' V O D U J P O  8

    B U D I E P H  HTTP )FBEFST #PEZ )FBEFST #PEZ /usr/bin/node handler.js SFRVFTU ඪ४ೖྗ TUEJO TUEPVU ඪ४ग़ྗ SFTQPOTF
  22. ' V O D U J P O ͷ ࡞

    ੒ ϑ ϩ ʔ  QBDLBHFKTPO IBOEMFSKT faas-cli new Template Docker Image faas-cli build $POUBJOFS3FHJTUSZ faas-cli push جຊతʹ࣮૷͢Δͷ͸͚ͩ͜͜ʂ
  23. ' V O D U J P O ͷ σ

    ϓ ϩ Π  $POUBJOFS3FHJTUSZ faas-cli deploy gateway L V C F S O F U F T 4 X B S N / /F U D  'VODUJPO 'VODUJPO 'VODUJPO Pull Pull Deploy Deploy Orchestrator API
  24. ಉ ظ ɾ ඇ ಉ ظ  sync async

  25. ಉ ظ ݺ ͼ ग़ ͠  Gateway Func: resizer

    marshal request HTTP 200 ը૾ॖখ ґཔ
  26. ඇ ಉ ظ ݺ ͼ ग़ ͠  Gateway Func:

    resizer X-Callback-Url Queue http://x.y.z X-Callback-Url: http://x.y.z NATS ը૾ॖখ ґཔ
  27. ࿈ ܞ  integration

  28.  faas-netes L V C F S O F U

    F T 'VODUJPO 'VODUJPO 'VODUJPO Deploy Deploy Orchestrator API L  T  ࿈ ܞ gateway Invoke 3FWFSTF 1SPYZ https://github.com/openfaas/faas-netes
  29.  faas-<x> Orchestrator X 'VODUJPO 'VODUJPO 'VODUJPO Deploy Deploy Orchestrator

    API ଞ 1 S P W J E F S  ࿈ ܞ gateway Invoke 3FWFSTF 1SPYZ
  30.  faas-rancher 'VODUJPO 'VODUJPO 'VODUJPO Deploy Deploy Orchestrator API 3

    B O D I F S  ࿈ ܞ gateway Invoke 3FWFSTF 1SPYZ https://github.com/kenfdev/faas-rancher
  31. ͦ ͷ ଞ ॾ ʑ  and more

  32. H P  U F N Q M B U

    F  https://blog.alexellis.io/serverless-golang-with-openfaas/ (PݴޠͷUFNQMBUF΋༻ҙ͞Ε͍ͯ·͢ʂ faas-cli new --lang go
  33. % F C V H H J O H ʂ

     ίϯςφʹΞλον͢Ε͹σόοά΋Մೳ
  34. $ *  $ %  1 J Q F

    M J O F  https://github.com/kenfdev/faas-echo
  35. 1SPWJEFST *OUFHSBUJPOTBOE6TFST 

  36. )BDLUPCFSGFTUͰ͢Αʂ 

  37. ࢀߟ  ˔ IUUQTHJUIVCDPNPQFOGBBTGBBT ˔ 0QFO'BB4ͷίΞϓϩδΣΫτ ˔ IUUQTHJUIVCDPNPQFOGBBTGBBTDMJ ˔ 0QFO'BB4Λศརʹ࢖͏ͨΊͷ$-*

    ˔ IUUQTHJUIVCDPNPQFOGBBTGBBTOFUFT ˔ LVCFSOFUFT্Ͱ0QFO'BB4Λಈ͔ͨ͢Ίͷ֦ுػೳ ˔ IUUQTHJUIVCDPNGBBTBOEGVSJPVT ˔ 0QFO'BB4ͷ044ͳ'VODUJPO͕ू·͍ͬͯΔ৔ॴ
  38. ϔ ϧ ϓ ʂ 

  39.  ೔ຊޠ৘ใ͕΄ͱΜͲ͋Γ·ͤΜɻɻɻ 2JJUBͰ΋·ͩ̎݅ʂ ϔ ϧ ϓ ʂ ͥͻ࢖ͬͯΈͯϑΟʔυόοΫΛΞ΢τϓοτ͍ͯͩ͘͠͞ʂ

  40. ͝ ਗ਼ ௌ ͋ Γ ͕ ͱ ͏ ͝ ͟

    ͍ · ͠ ͨ ʂ  @ k e n f d e v