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

Data Science Env with Docker

Data Science Env with Docker

Dockerを使って研究環境を整備する
Lightning Talk at みんなのPython勉強会 #45

hyga2c

May 15, 2019
Tweet

Other Decks in Technology

Transcript

  1. %PDLFSΛ࢖ͬͯ
    ݚڀ؀ڥΛ੔උ͢Δ
    ΈΜͳͷ1ZUIPOษڧձ

    View full-size slide

  2. rOJLLJF!ΈΜͳͷ1ZUIPOษڧձ

    l؀ڥߏஙΛ৐Γӽ͑ͯ࠷ॳͷ੒ޭΛମݧͨ͠ΒɺTUBQZͰ-5͠·ͤΜ͔ʁz

    View full-size slide

  3. ࣗݾ঺հ
    w ฌݿ३ࢤ
    w !):0@(0
    w ๭੡ༀձࣾͷݚڀ։ൃ෦໳*5اը͓ੈ࿩܎
    w झຯͰσʔλݚڀ໨ࢦͯ͠·͢

    ໨ࢦͤ͞ΜͰʙͰʙͨʙ͍͑͞Μͯ͌͢ͱ
    w ݩੜԽֶݚڀऀɺݩҩༀ඼։ൃʢن੍Պֶʣݚڀऀ

    View full-size slide

  4. .PUJWBUJPO
    w ʢझຯͷʣݚڀͷͨΊʹ1ZUIPOͰσʔλαΠΤϯε͍ͨ͠
    w ʢͰ͖ΔݶΓʣ࠷৽ͷख๏΋छछͷσʔλ΋ࢼͯ͠Έ͍ͨ
    w 5FOTPS'MPX $IBJOFS
    w 3%,JU 1VCDIFNQZ

    View full-size slide

  5. .PUJWBUJPO
    ͳͷͰ

    View full-size slide

  6. .PUJWBUJPO
    w ͍Ζ͍Ζ΍ͬͯΈΔˠࣦഊ͢Δ
    w QJQͱBOBDPOEB·ࣦͥͯഊ
    w $BOPQZͱ1ZDIBSNڞଘʹࣦഊ
    w 1ZUIPOͷόʔδϣϯ্͛ͨΒ5FOTPS'MPXಈ͔ͳ͍
    w DVEBͷόʔδϣϯ͕ɻɻɻ
    w QZFOWͱDPOEBͱQJQͱ͔ɺ·͢·͢Θ͔Βͳ͘ͳ͖ͬͯͨ

    View full-size slide

  7. .PUJWBUJPO
    ؀ڥߏஙʹ࢖͏͕࣌ؒഅࣛʹͳΒͳ͍
    Ͳ͏ͨ͠Βʁ
    Ͳ͏΍Β%PDLFSΛ࢖͏ͱ޾ͤʹͳΕΔΒ͍͠

    View full-size slide

  8. ࠷ॳͷ੒ޭ
    w ʢࣦഊͷੵΈॏͶͷޙʹʣ5FOTPS'MPX؀ڥͷߏஙʹ੒ޭ
    w %PDLFSલɿ5FOTPS'MPXͷόʔδϣϯͱ͔DVEBͷόʔδϣϯͱ͔શ͘
    ཧղग़དྷࣦͣഊͷ࿈ଓʼ͍ͭʹ6CVOUVͷ࠶Πϯετʔϧ·Ͱ
    w %PDLFSಋೖτϥΠޙ
    w ࠷ॳͷࣦഊˠ2JJUBͷݹ͍هࣄΛࢀর͍ͯͨ͠

    ཧ༝ɿࣗ෼ͷ؀ڥͷDVEBͷόʔδϣϯ͕৽͗ͨ͢͠
    w ೋ౓໨Ͱ੒ޭˠ੒ޭͷݪҼɿ5FOTPS'MPXެࣜΛࢀর
    w IUUQTXXXUFOTPSqPXPSHJOTUBMMEPDLFS
    w ڭ܇ɿͱʹ͔͘ݪయʹ͋ͨΔ

    View full-size slide

  9. ࣍ͷஈ֊΁
    w ͜Ε͸ศར͔΋͠Εͳ͍
    w Ͱ΋ɺ5FOGPS'MPXެࣜͷͱ͓Γʹ΍͍ͬͯΔz͚ͩzͳͷͰ
    w ԿΛ΍͍ͬͯΔ͔͕Θ͔Βͳ͍

    View full-size slide

  10. ࣍ͷஈ֊΁
    wͦ͏ͩɻɻɻษڧ͠Α͏
    wϚϯΨͰΘ͔Δ%PDLFSͰ֓೦ཧղͯ͠
    wϚϯΨͰΘ͔Δ%PDLFSͰ΋͏গ͠ৄ͘͠ͳͬͯ
    w%PDLFS,VCFSOFUFT࣮ફίϯςφ։ൃೖ໳ΛಡΈ࢝ΊͨɹˡɹΠϚίί

    View full-size slide

  11. ͭΊͷ੒ޭ
    w 4DJQZ+BQBOͰσʔλαΠΤϯεݚڀͷ࠶ݱੑͷॏཁੑΛ࠶
    ೝࣝ
    w "OBDPOEBc4DJQZ+VQZUFSͷ෼ੳ؀ڥ΋%PDLFSͰ࡞ͬͨ
    Β࠶ݱੑ֬อʹ༗ޮͳͷͰ͸ʁʁʁ
    w ͦ͏͍͑͹ɺϚϯΨͰΘ͔Δ%PDLFSʹ΋ɺ%PDLFSΛ࢖͏
    ͱႈ౳ੑ͕อͨΕΔͬͯදݱ͕ɻɻɻ
    ϚϯΨͰΘ͔Δ%PDLFSɹື઒͍͋ஶɹΑΓ

    View full-size slide

  12. ͭΊͷ੒ޭɿ%PDLFSͰ+VQZUFS
    w %PDLFS࢖ͬͨ+VQZUFS؀ڥߏஙͷ
    ެࣜ(JUIVC΋ެࣜϖʔδ΋͋Δʂ
    w ࢀߟɿ%PDLFSͰجຊతͳ%BUB
    4DJFODF؀ڥ +VQZUFS 1ZUIPO
    3 +VMJB ఆ൪ϥΠϒϥϦ
    Λߏங
    ͢Δɻ

    View full-size slide

  13. ͭΊͷ੒ޭɿ%PDLFSͰ+VQZUFS
    w ϝϦοτ
    w ඞཁͳύοέʔδΛ·ͱΊ֤ͨछͷ
    %PDLFS*NBHF͕छྨ४උ͞Ε͍ͯΔ
    w %PDLFS*NBHFΛSVO͢ΔࡍʹUBHΛࢦఆ
    ͢Ε͹ຖճಉ͡؀ڥ͕ߏங͞ΕΔ
    w ඞཁͳΒ͹%PDLFS'JMFΛฤूͯ͠ಠࣗͷ
    ؀ڥ΋࡞੒Մೳʢݚڀதʣ

    View full-size slide

  14. ࣮ࡍʹԿΛ΍͍ͬͯΔ͔
    w SNίϯςφऴྃ࣌ʹίϯςφࣗಈ࡟আ
    w Qϙʔτࢦఆɹʢ%PDLFSίϯςφʹΞΫηε͢Δϙʔτ൪߸ͱGPXBSEJOHΛࢦఆʣ
    w F؀ڥม਺ࢦఆʢࠓճ͸ىಈޙʹKVQZUFSMBCTΛىಈʣ
    w OBNFίϯςφͷ໊લࢦఆʢŠSN͢ΔͳΒ͹
    w WσΟϨΫτϦͷڞ༗ˠϗετଆͷσΟϨΫτϦ NOUTTEXPSL
    ͱίϯςφ಺ͷʢIPNF
    KPWZBOXPSL
    σΟϨΫτϦΛಉظ
    w
    $ docker run --rm -p 8888:8888 \
    -e JUPYTER_ENABLE_LAB=yes\
    --name jupyter-labs\
    -v /mnt/ssd/work/:/home/jovyan/work\
    jupyter/scipy-notebook

    View full-size slide

  15. ࣮ࡍʹԿΛ΍͍ͬͯΔ͔
    w ίϯςφىಈޙʹλʔϛφϧʹදࣔ͞ΕΔτʔ
    ΫϯΛίϐʔɻ
    w ϒϥ΢βͰIUUQMPDBMIPTU ʹΞΫη
    ε

    View full-size slide

  16. ࠷ޙʹ
    w σʔλαΠΤϯεʹ΋%PDLFS͓͢͢ΊͰ͢
    w ϩʔΧϧͰ΋ಈ͖·͢
    w αʔόʔ্ʹཱͯͯ΋࢖͍΍͍͢Ͱ͢
    w "84ͱ͔($1ͱ͔Ͱ΋ಈ͖·͢ʢ͜Ε͸ࢼ͍ͯ͠·ͤΜʣ
    w ଟ෼ΞϓϦ։ൃͱ͔8FC։ൃʹ΋༗ޮͳ͸ͣʢσϓϩΠ·Ͱ΋ʁʣ
    w -FU`T&OKPZ1ZUIPO-JGFXJUI%PDLFS

    View full-size slide