V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
sadhen
V2EX  ›  Python

管理 Jupyter Labs 和 Notebooks 的最佳实践

  •  1
     
  •   sadhen ·
    darcy-shen · 2022-10-25 16:44:08 +08:00 · 2066 次点击
    这是一个创建于 521 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Template Project: https://github.com/da-tubi/jupyterlab-best-practice

    三个优点:

    • Free yourself of Python virtual environment
    • Reproducible because of the dependencies lock mechanism
    • As Easy as bin/lab xyz to launch a JupyterLab

    Hacknews (觉得可以,帮忙顶一下): https://news.ycombinator.com/item?id=33327866

    9 条回复    2022-11-09 03:52:43 +08:00
    c0xt30a
        1
    c0xt30a  
       2022-11-02 19:25:19 +08:00
    用个 docker 就完了啊……
    sadhen
        2
    sadhen  
    OP
       2022-11-02 19:34:24 +08:00
    @c0xt30a 改一个依赖,重新构建一次?

    那还不如用 conda 创建虚拟环境。
    c0xt30a
        3
    c0xt30a  
       2022-11-02 19:43:55 +08:00
    有之前的 cache ,滚动加依赖,构建起来不慢的。
    依赖于主系统最大的问题是将来系统升级的时候麻烦。
    sadhen
        4
    sadhen  
    OP
       2022-11-02 20:46:37 +08:00
    @c0xt30a 我大概知道你的思路了,比如新增一个依赖,就新增一个 docker 的 layer

    这确实是一个不错的思路。
    sadhen
        5
    sadhen  
    OP
       2022-11-02 20:47:37 +08:00
    还有一个小伙伴推荐我用 Nix 来解决这个问题。我觉得 Nix 和 Docker 都很好,就是有点杀鸡用牛刀的感觉。
    LINEX
        6
    LINEX  
       2022-11-08 11:51:09 +08:00
    @c0xt30a 这个也有各种问题,我们之前有个项目依赖一些库,opencv/lightgbm 之类的,每个库都很大,有时候最顶层需要升级版本打包一次非常耗时,是不是又其他更好的容器能解决这个痛点的?
    sadhen
        7
    sadhen  
    OP
       2022-11-08 21:33:37 +08:00
    @LINEX 你觉得我这个方案怎样?不会有 docker 这种额外的开销
    sadhen
        8
    sadhen  
    OP
       2022-11-08 23:19:43 +08:00
    这里有一个简化版: https://www.v2ex.com/t/893320
    c0xt30a
        9
    c0xt30a  
       2022-11-09 03:52:43 +08:00
    @LINEX 容器化是为了跟宿主系统解耦合,可以保证很多年之后这套系统依旧能用,一般用来做部署。我有很多 TF 1.x 时候写的模型现在只能在容器里运行 /训练了。 如果是当作开发环境而且经常更新,容器并不是一个合适的解决方案。个人看法。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2808 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:02 · PVG 23:02 · LAX 08:02 · JFK 11:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.