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

flynnの時代 #dockerjp

flynnの時代 #dockerjp

taichi nakashima

July 04, 2014
Tweet

More Decks by taichi nakashima

Other Decks in Technology

Transcript

  1. rbdock dmux https://github.com/tcnksm/dmux https://github.com/tcnksm/rbdock - docker + tmux = dmux

    ! - generate Dockerfile for ruby, rails and sinatra cli-init https://github.com/tcnksm/cli-init - TheThe easy way to start building Golang CLI docc https://github.com/tcnksm/docc - docc open your project document
  2. • DockerΛ࢖ͬͨϚϧνϗετରԠͷPlatform as a Service • Jeff Lindsay (dokkuͷ࡞ऀ) ΍Jonathan

    Rudenberg • Φʔϓϯιʔε & Ϋϥ΢υϑΝϯσΟϯά • Goݴޠ What is flynn ?
  3. Goal of flynn “The product that ops provides to developers”

    • ؆୯͔ͭҰ؏ͨ͠ํ๏ͰσϓϩΠͰ͖Δ • git pushͰ, Docker containerͰ • ͲΜͳݴޠ/ϑϨʔϜϫʔΫͰ΋ಈ͔ͤΔ • ؆୯ʹεέʔϧͰ͖Δ • ৽ͨʹϊʔυΛ௥Ճ͢Δ͚ͩ
  4. dokku (https://github.com/progrium/dokku) • 100ߦఔ౓ͷbashͰॻ͔ΕͨγϯϓϧͳPaaS → flynn͸ϚϧνϗετʹରԠ ! Deis (http://deis.io/) •

    ≒ flynn • CoreOSΛར༻ͨ͠ϚϧνϗετͷDocker PaaS → flynn͸ϗετOSΛݶఆ͠ͳ͍ OSS PaaS by Docker
  5. Architecture of Flynn layer0 (The Grid) • ௿ҐͳϦιʔεϑϨʔϜϫʔΫ૚ • FlynnͷશͯͷΞϓϦέʔγϣϯ΍αʔϏεͷجૅ

    • ίϯςφ؅ཧ, αʔϏεσΟεΧόϦʔ, λεΫεέδϡʔϥʔ, ෼ࢄܕKVS layer1 • ߴҐͳίϯϙʔωϯτ૚ • PaaSͷػೳ: Git-receiveɼHeroku BuildpackɼDBɼHTTP Routing • αʔϏε (ΞϓϦέʔγϣϯ)
  6. flynn/discoverd D αʔϏεσΟεΧόϦʔ ػೳ • ϗετͷΫϥελͷߏங • ৽ͨͳϗετͷࢀՃ/཭୤Πϕϯτͷଞϗετ΁ͷ௨஌ • ΫϥελͷϦʔμʔͷબग़

    ΫϥΠΞϯτ (flynn/go-discoverd) • Ϋϥελ΁ͷϗετͷొ࿥/࡟আ • ֤ϗετͷΞυϨε΍ϝλ৘ใɼ৽͍͠ϗετͷࢀՃ/཭୤Πϕϯτͷߪಡ όοΫΤϯυ • etcdʢzookeeperʣ
  7. ίϯςφ؅ཧ ػೳ • HTTP APIܦ༝ͰϗετͷDockerίϯςφΛ؅ཧ ໾ׂ • Ϧʔμʔ → ΫϥελશମͷϗετͷҰཡͱͦΕΒ͕࣮ߦ͍ͯ͠Δδϣϒͷ؅ཧ

    → ৽͍͠δϣϒͷొ࿥/ґཔ • ͦͷଞ → Ϧʔμ͔ΒͷδϣϒΛDockerίϯςφͰ࣮ߦ → ࣮ߦதͷδϣϒɼࢦఆ͞Εͨδϣϒͷ৘ใͷฦ౴ flynn/flynn-host D H
  8. HOST A HOST B HOST C H H H D

    D D https://flynn.io/blog/demo-roadmap
  9. HOST A HOST B HOST C H H H D

    D D https://flynn.io/blog/demo-roadmap R
  10. HOST A HOST B HOST C H H H D

    D D S https://flynn.io/blog/demo-roadmap R
  11. HOST A HOST B HOST C H H H D

    D D S https://flynn.io/blog/demo-roadmap R HOST D
  12. HOST A HOST B HOST C H H H D

    D D S https://flynn.io/blog/demo-roadmap R HOST D H D
  13. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap R
  14. Overview of Layer1 G D flynn/flynn-controller flynn/gitreceived https://github.com/flynn/flynn-controller https://github.com/flynn/gitreceived -

    HTTP API αʔό - git pushઐ༻ͷSSHαʔό flynn/slugbuilder https://github.com/flynn/slugbuilder - (Herokuతͳ) slugͷ࡞੒ flynn/slugrunner https://github.com/flynn/slugrunner - (Herokuతͳ) slugͷ࣮ߦ C SB SR
  15. Overview of Layer1 D flynn/strowger flynn/flynn-cli https://github.com/flynn/strowger https://github.com/flynn/flynn-cli - TCP/HTTP

    ϧʔλ - ίϚϯυϥΠϯΫϥΠΞϯτ R flynn/flynn-postgres https://github.com/flynn/flynn-postgres - flynn༻ͷPostgreSQL DB
  16. flynn/flynn-controller D HTTP APIαʔόʔ ػೳ • Flynn্Ͱಈ͘શͯͷΞϓϦέʔγϣϯ (αʔϏε) ΛHTTP APIͰૢ࡞͢Δ

    • ≒ Heroku Platform API ΫϥΠΞϯτ (flynn/flynn-cli) • Controllerʹରͯ͠ίϚϯυΛൃߦ͢Δ • ≒ Heroku Toolbelt D C
  17. flynn/slugbuilder D DockerͱBuildpackͰʢHerokuతͳʣslugͷ࡞੒ D SB $ id=$(git archive master |

    docker run -i -a stdin flynn/slugbuilder) $ docker wait $id $ docker cp $id:/tmp/slug.tgz .
  18. flynn/slugrunner D slugbuilderͰ࡞੒͞ΕͨʢHerokuతͳʣslugͷ࣮ߦ D SR Herokuͷ৔߹ • Dyno (LXCϕʔε)ʹslugΛϩʔυ͢Δ •

    ProcfileΛ΋ͱʹΞϓϦέʔγϣϯΛىಈ͢Δ flynnͷ৔߹ • Dockerίϯςφ಺ʹslug(.tgz)Λϩʔυ͢Δ • ProcfileΛ΋ͱʹΞϓϦέʔγϣϯ (Dockerίϯςφ) Λىಈ͢Δ
  19. flynn/strowger D TCP/HTTP ϧʔλ ػೳ • ϥϯμϜϩʔυόϥϯγϯάͷͨΊͷϦόʔεϓϩΩγͱͯ͠ಈ࡞ e.g., ෳ਺ͷslugrunnerʹରͯ͠ϥϯμϜʹϦΫΤετΛৼΓ෼͚Δ •

    αʔϏεσΟεΧόϦʔʹΑΓόοΫΤϯυͰԿ͕ىಈ͔ͨ͠Λৗʹ؂ࢹ vs. HAProxy/nginx • αʔϏεσΟεΧόϦʔʹΑΔಈతͳઃఆมߋ͕Մೳ • HAProxy΍nginx͸ઃఆߋ৽ͷͨΊʹ৽͍͠ϓϩηε͕ඞཁʹͳΔ D R
  20. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap
  21. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22
  22. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C
  23. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB
  24. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB SR
  25. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB SR R
  26. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB SR R port 80/443
  27. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB SR R port 80/443 DB
  28. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB SR R port 80/443 DB SR
  29. HOST A HOST B HOST C HOST D H H

    H H D D D D S https://flynn.io/blog/demo-roadmap G port 22 C SB SR R port 80/443 DB SR SR
  30. References • Flynn - Open source Platform as a Service

    powered by Docker • https://flynn.io/ • The Start of the Age of Flynn • http://progrium.com/blog/2014/02/06/the-start-of-the-age-of-flynn/ • Unveiling Flynn, a new PAAS based on Docker • http://jpetazzo.github.io/2013/11/17/flynn-docker-paas/ • 5by5 | The Changelog #99: Flynn, Tent, open source PaaSes and more with Jeff Lindsay and Jonathan Rudenberg • http://5by5.tv/changelog/99 • 5by5 | The Changelog #115: Flynn updates with Jonathan Rudenberg and Jeff Lindsay • http://5by5.tv/changelog/115
  31. References • Container Independence • https://flynn.io/blog/container-indepedence • Deis: Evolution of

    a Docker PAAS • http://gabrtv.github.io/deis-dockercon-2014/#/ • Flynn vs. Deis: The Tale of Two Docker Micro-PaaS Technologies | CenturyLink Labs • http://www.centurylinklabs.com/flynn-vs-deis-the-tale-of-two-docker-micro-paas- technologies/ • Inside Dokku in 5 minutes • http://banyan.me/slides/20140116/slides.html
  32. References • Discoverd - r7km/s • http://r7kamura.github.io/2014/06/24/discoverd.html • Flynn Host

    - r7km/s • http://r7kamura.github.io/2014/06/26/flynn-host.html • Beyond Flynn, or Flynn-as-a-Worldview • http://progrium.com/blog/2014/07/01/beyond-flynn-or-flynn-as-a-worldview/