Slide 1

Slide 1 text

-BNCEB"QFYࣄྫ঺հ dશͯ͸"84ίετ࡟ݮͷͨΊʹd !LBLBLBLBLLV ࣾ಺ษڧձ

Slide 2

Slide 2 text

:PTIJBLJ:PTIJEB !LBLBLBLBLLV ‣ .BLVBLF$ZCFS"HFOU$SPXE'VOEJOH *OD ‣ 8FC0QFSBUJPOT&OHJOFFSٕ݉ज़޿ใ ‣ "84 3VCZ $FSUJpFE4DSVN.BTUFS ‣ ϓϩάϥϛϯάߨࢣͷ࢓ࣄΛ࢝Ί·ͨ͠ ‣ IUUQLBLBLBLBLLVIBUFOBCMPHDPN

Slide 3

Slide 3 text

ʘ࠷ۙ$ZCFS"HFOU%FWFMPQFST#MPHʹهࣄग़ͯ͠·͢ʗ IUUQTEFWFMPQFSTDZCFSBHFOUDPKQCMPHBSDIJWFT IUUQTEFWFMPQFSTDZCFSBHFOUDPKQCMPHBSDIJWFT

Slide 4

Slide 4 text

ʘϙουΩϟετσϏϡʔ͠·ͨ͠ʗ IUUQMFBOBHJMFGNFQJTPEF

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

"84-BNCEB ࢖ͬͯ·͔͢ʁ

Slide 7

Slide 7 text

։ൃ؀ڥͷ "84ίετ࡟ݮʹ࢖ͬͯ·͢

Slide 8

Slide 8 text

։ൃ؀ڥͷ "84ίετ࡟ݮʹ࢖ͬͯ·͢ ʁʁʁ

Slide 9

Slide 9 text

"848FMM"SDIJUFDUFE'SBNFXPSL

Slide 10

Slide 10 text

"848FMM"SDIJUFDUFE'SBNFXPSL $PTU0QUJNJ[BUJPO1JMMBS 5JNFCBTFEBQQSPBDI &YBNQMFTPGBUJNFCBTFEBQQSPBDIJODMVEFGPMMPXJOH UIFTVO UVSOJOHPGG%FWFMPQNFOUBOE5FTU JOTUBODFTPWFSUIFXFFLFOE GPMMPXJOH RVBSUFSMZPSBOOVBMTDIFEVMFT FH #MBDL'SJEBZ

Slide 11

Slide 11 text

"848FMM"SDIJUFDUFE'SBNFXPSL $PTU0QUJNJ[BUJPO1JMMBS 5JNFCBTFEBQQSPBDI &YBNQMFTPGBUJNFCBTFEBQQSPBDIJODMVEFGPMMPXJOH UIFTVO UVSOJOHPGG%FWFMPQNFOUBOE5FTU JOTUBODFTPWFSUIFXFFLFOE GPMMPXJOH RVBSUFSMZPSBOOVBMTDIFEVMFT FH #MBDL'SJEBZ ؆୯ʹݴ͏ͱ ʮि຤͸։ൃ༻ΠϯελϯεΛࢭΊΑ͏ʯ

Slide 12

Slide 12 text

.PO 5VF 5IV 8FE 'SJ 4BU 4VO

Slide 13

Slide 13 text

.PO 5VF 5IV 8FE 'SJ 4BU 4VO *OTUBODFIPVSTXFFL ࡟ݮͯ͠·͢

Slide 14

Slide 14 text

ΞʔΩςΫνϟ঺հ

Slide 15

Slide 15 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG <࣮ߦϑϩʔ>

Slide 16

Slide 16 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG <࣮ߦϑϩʔ>

Slide 17

Slide 17 text

ΠϯελϯεΛૢ࡞͢Δ ‣ "844%,GPS+BWB4DSJQU ‣ TUBSU*OTUBODFT QBSBNT\^ DBMMCBDL ‣ TUPQ*OTUBODFT QBSBNT\^ DBMMCBDL ‣ -BNCEB'VODUJPOͰΠϕϯτ͝ͱʹॲཧΛ෼ذ͍ͯ͠Δ ‣ \BDUJPOlTUBSU^ˠΠϯελϯεىಈ ‣ \BDUJPOlTUPQ^ˠΠϯελϯεఀࢭ QBSBNTʹ*OTUBODF*ETΛઃఆͯ͠ ෳ਺ΠϯελϯεΛૢ࡞͢Δ

Slide 18

Slide 18 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG <࣮ߦϑϩʔ>

Slide 19

Slide 19 text

"84$MPVE8BUDI&WFOUT ϞχλϦϯά ͚ͩ͡Όͳ͍Αʁ

Slide 20

Slide 20 text

εέδϡʔϦϯά࣮ߦ ‣ ୤+FOLJOT͍ͨ͠ ‣ "84$MPVE8BUDI&WFOUT ‣ DSPOࣜͰઃఆͨ͠εέδϡʔϦϯάͰ-BNCEBΛىಈͰ͖Δ ‣ ཁ஫ҙϙΠϯτ ‣ DSPOࣜ ‣ 65$લఏ

Slide 21

Slide 21 text

DSPOࣜ ෼࣌ؒ೔݄༵೔੡଄೥ .0/'3* ੡଄೥ ͸ΤϥʔʹͳΔ
 ยํΛ ʹ͢Δඞཁ͕͋Δ

Slide 22

Slide 22 text

65$લఏ ೔ຊ࣌ؒlՐਫ໦ۚ౔z TUPQ*OTUBODFT

Slide 23

Slide 23 text

.PO 5VF 5IV 8FE 'SJ 4BU 4VO

Slide 24

Slide 24 text

65$લఏ .0/'3* ௚ײతʹཧղ͠ʹ͍͘ ೔ຊ࣌ؒlՐਫ໦ۚ౔z TUPQ*OTUBODFT

Slide 25

Slide 25 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG <࣮ߦϑϩʔ>

Slide 26

Slide 26 text

"84-BNCEB Ͳ͏΍ͬͯ σϓϩΠ͢Δʁ

Slide 27

Slide 27 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG NFSHF IPPL BQFYEFQMPZ <࣮ߦϑϩʔ> <σϓϩΠϑϩʔ>

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

"QFY ‣ -BNCEB؅ཧπʔϧʢϏϧυˍσϓϩΠʣ ‣ ؔ࿈4FSWFSMFTT'SBNFXPSL -BNWFSZ "844".ͳͲ ‣ -BNCEBʹಛԽ͍ͯ͠ΔͨΊඇৗʹബ࣮͘૷͞Ε͍ͯΔ ‣ υΩϡϝϯτ΋ॆ࣮͍ͯ͠Δ ‣ 5FSSBGPSN࿈ܞ ‣ ABQFYJOGSBAίϚϯυ͸AUFSSBGPSNAίϚϯυͷϥούʔ

Slide 30

Slide 30 text

"QFYίϚϯυ঺հ ‣ BQFYJOJUॳظԽ͢Δʢ*".3PMFͱ*".1PMJDZͷࣗಈੜ੒΋ؚΉʣ ‣ BQFYEFQMPZ-BNCEB'VODUJPOΛσϓϩΠ͢Δ ‣ BQFYJOWPLF-BNCEB'VODUJPOΛ࣮ߦ͢Δ ‣ BQFYMPHT G $MPVE8BUDI-PHTΛ֬ೝ͢Δ ‣ BQFYEPDTυΩϡϝϯτΛࢀর͢Δ

Slide 31

Slide 31 text

{ "name": "project-name", "description": "project-name", "memory": 128, "timeout": 300, "role": "", "environment": { "DEBUG_SHIM": "true" } } "QFYઃఆϑΝΠϧ project.json -BNCEB'VODUJPOͷϝϞϦͱλΠϜΞ΢τ΋ઃఆͰ͖Δ

Slide 32

Slide 32 text

"QFYઃఆϑΝΠϧ { "name": "project-name", "description": "project-name", "memory": 128, "timeout": 300, "role": "", "environment": { "DEBUG_SHIM": "true" } "hooks": { "build": "cp ../../package.json . && npm install" } } project.json OQNϥΠϒϥϦΛؚΊΔ͜ͱ΋Ͱ͖Δ

Slide 33

Slide 33 text

$JSDMF$*͔ΒσϓϩΠ͢Δ machine: timezone: Asia/Tokyo dependencies: post: - curl https://raw.githubusercontent.com/apex/ apex/master/install.sh | sudo sh deployment: master: branch: master commands: - apex deploy test: pre: - npm install eslint --save-dev override: - ./node_modules/.bin/eslint . circle.yml NBTUFSʹϚʔδ͞ΕͨΒ ࣗಈతʹσϓϩΠ͢Δ &4-JOUΛ ࣮ߦ͢Δ

Slide 34

Slide 34 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG NFSHF IPPL BQFYEFQMPZ <࣮ߦϑϩʔ> <σϓϩΠϑϩʔ>

Slide 35

Slide 35 text

ؾ෇͖·ͨ͠ʁ

Slide 36

Slide 36 text

-BNCEB $MPVE8BUDI &WFOUT DSPO࣮ߦ &$ &$ &$ TUBSUTUPQ ϝϯςφϯεPOPGG NFSHF IPPL BQFYEFQMPZ <࣮ߦϑϩʔ> <σϓϩΠϑϩʔ> 4FSWFSMFTT "SDIJUFDUVSF

Slide 37

Slide 37 text

΋ͬͱৄ͘͠ʂ

Slide 38

Slide 38 text

BQFYBQFY

Slide 39

Slide 39 text

BQFYBQFY

Slide 40

Slide 40 text

BQFYBQFY

Slide 41

Slide 41 text

XJUI(PTVQQPSU

Slide 42

Slide 42 text

-BNCEBαϙʔτݴޠ ‣ /PEFKT ‣ +BWB ‣ 1ZUIPO ‣ $ SF*OWFOUͰ 3VCZͱ(PMBOHαϙʔτͷ ൃද͕ແͯ͘ ΨοΧϦͨ͠ਓ΋ଟ͍Ͱ͠ΐ͏

Slide 43

Slide 43 text

JOEFYKTΛಡΜͩ

Slide 44

Slide 44 text

var child = require('child_process') var byline = require('./byline') /** * Callback for the request. */ var callback /** * Child process for binary I/O. */ var proc = child.spawn('./main', { stdio: ['pipe', 'pipe', process.stderr] }) proc.on('error', function(err){ console.error('[shim] error: %s', err) process.exit(1) }) proc.on('exit', function(code, signal){ console.error('[shim] exit: code=%s signal=%s', code, signal) process.exit(1) }) index.js ࢠϓϩηεͰ (P NBJO Λಈ͔ͯ͠ ϓϩηεؒ௨৴Λ͢Δ ඪ४ೖྗ TUEJO ඪ४ग़ྗ TUEPVU ඪ४Τϥʔग़ྗ TUEFSS

Slide 45

Slide 45 text

/** * Newline-delimited JSON stdout. */ var out = byline(proc.stdout) out.on('data', function(line){ if (process.env.DEBUG_SHIM) console.log('[shim] parsing: `%s`', line) var msg = JSON.parse(line) callback(msg.error, msg.value) }) /** * Handle events. */ exports.handle = function(event, ctx, cb) { callback = cb ctx.callbackWaitsForEmptyEventLoop = false proc.stdin.write(JSON.stringify({ "event": event, "context": ctx })+'\n'); } index.js (Pͷඪ४ग़ྗΛฦ͢ \ ʢதུʣ FOWJSPONFOU\ %(@4)*.USVF ^ ^ ։ൃத͸σόοάϞʔυ ʹ͓ͯ͘͠ͱศར

Slide 46

Slide 46 text

؆ུԽ͢Δͱ

Slide 47

Slide 47 text

JOEFYKT BQFYTIJN NBJOHP 45%*/ 45%065 JOWPLF DIJME@QSPDFTTTQBXO 45%&33

Slide 48

Slide 48 text

Ͳ͏ͯ͠΋-BNCEBͰ (PΛಈ͔͍ͨ͠ͳΒ࢖͑Δ͔΋ʁ ʢެࣜαϙʔτΛ଴ͬͯ΋ྑͦ͞͏ʣ

Slide 49

Slide 49 text

"845JQT঺հ ࣌ؒ༨ͬͨΒ

Slide 50

Slide 50 text

BXTMPHT $MPVE8BUDI-PHTΛ؆୯ʹॲཧͰ͖Δ$-* ʢϑΟϧλ ΢Υον ೔࣌ࢦఆͳͲʣ

Slide 51

Slide 51 text

HJUTFDSFUT *".ΫϨσϯγϟϧͷޡίϛοτΛ๷ࢭ͢Δπʔϧ ʢҰݴͰݴ͑͹HJUIPPLTʣ

Slide 52

Slide 52 text

SPBEXPSLFS 3PVUFͷઃఆΛ*OGSBTUSVDUVSFBT$PEFԽ͢Δ ʢݸਓυϝΠϯͷ؅ཧʹ࢖ͬͯΔʣ

Slide 53

Slide 53 text

QJDVMFU ηΩϡϦςΟάϧʔϓΛ*OGSBTUSVDUVSFBT$PEFԽ͢Δ

Slide 54

Slide 54 text

·ͱΊ

Slide 55

Slide 55 text

-BNCEB"QFYศརʂ