常识Jupyter/Docker/Git集成。
gsmo的Python项目详细描述
gsmo公司
常识Jupyter/Docker/Git集成。在
gsmo
简化Docker容器中Git存储库的安装和使用。在
创建一个专门构建的Docker image+容器(有关配置选项,请参见^{
本地笔记本或脚本可以执行non-interactively(结果自动提交给Git),或者启动Jupyter server或{a4}进行交互式工作。在
使用
gsmo run
:以非交互方式执行笔记本
gsmo
帮助以可复制的方式(在Docker容器内)运行笔记本和脚本,并将更改(尤其是Git提交)传递到主机:
运行中:
gsmo run
在项目目录中:
- 加载配置(^{
} ) - 构建Docker映像
- 从该图像运行一个容器
- 在该容器中运行项目的
run.ipynb
笔记本 - Git提交结果
交互式
Jupyter服务器从当前目录构建一个Docker映像,并启动一个安装了当前目录的Jupyter服务器(并设置了各种Git和OS级别的配置,以便更改/提交反映在主机上):
^{pr2}$- 在“随机”但稳定的端口上运行(从模块名的哈希派生)
- 使用^{
} 轻松配置Python/Linux环境
Bash shell
Build a Docker image from the current directory, and launch a Bash shell with it mounted (and various Git- and OS-level configs set, so that changes/commits are reflected on the host machine):
^{pr 3}$Module configuration:
^{}
When you run ^{
Docker configs
- ^{
} (^{ }; default: project directory's basename): module name; also used as repository for built Docker image - ^{
} (^{ } or ^{ }): ^{ } libraries to install - ^{
} (^{ } or ^{ }): ^{ } libraries to install - ^{
} (^{ } or ^{ }): environment variables to set - ^{
} (^{ }): file with environment variables - ^{
} (^{ } or ^{ }): OS groups to add to the user inside the container - paths are accepted, in which case the group that owns that path will be used
- ^{
} (^{ } or ^{ }): additional Docker tags within ^{ } repository - ^{
} (^{ } or ^{ }): Docker mounts, in several convenient formats: - ^{
}: equivalent to ^{ }; easily pass local project subdirectories into Docker container, e.g. ^{ }, ^{ }, etc. - standard Docker ^{
} syntax is also supported - in all cases, ^{
} and env vars are expanded
- ^{
- ^{
} (^{ }; default: ^{ }): base Docker image to build from; ^{ } will be the pip version of ^{ } that was installed - ^{
} (^{ }; default ^{ }) - when set, run as ^{
} inside container - by default, host-machine uid+gid are used
- when set, run as ^{
- ^{
} (^{ }: default ^{ }): path inside container to mount current directory to
^{} configs
These configs are passed into the Docker container / pertain to the running of a script or notebook inside the container (see non-interactive mode):
run
(str
;默认值:run.ipynb
):要运行的笔记本dir
(str
;默认:当前目录):解析与此目录相关的路径(包括装载)yaml
(str
或List[str]
):带有正在运行的模块的配置设置的YAML字符串yaml_path
(str
或List[str]
):带有正在运行的模块的配置设置的YAML文件commit
(str
或List[str]
;默认值:out
config dir):运行后Git提交的路径(在非交互模式下)out
(str
;默认nbs
):将执行的笔记本写入的目录
gsmo jupyter
配置
Dockerfile
在构建Docker映像时(在上述任何模式下),如果存储库中存在Dockerfile
,那么它将被构建并用作基础映像(以及应用于其之上的任何gsmo.yml
配置)。在
- 项目
标签: