- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试在 Kubernetes 中部署有状态的 jupyter notebook,但无法保存在 notebook 中编写的代码,每当 notebook pod 出现故障时,所有代码都会被删除。我尝试使用持久卷但无法达到预期的结果。
更新
将挂载路径更改为“/home/jovyan”,因为 jyputer 将 ipynb 保存在此位置。但是现在在部署 pod 时收到 PermissionError: [Errno 13] Permission denied: '/home/jovyan/.local'。
kind: Ingress
metadata:
name: jupyter-ingress
spec:
backend:
serviceName: jupyter-notebook-service
servicePort: 8888
---
kind: Service
apiVersion: v1
metadata:
name: jupyter-notebook-service
spec:
clusterIP: None
selector:
app: jupyter-notebook
ports:
- protocol: TCP
port: 8888
targetPort: 8888
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jupyter-notebook
labels:
app: jupyter-notebook
spec:
replicas: 1
serviceName: "jupyter-notebook-service"
selector:
matchLabels:
app: jupyter-notebook
template:
metadata:
labels:
app: jupyter-notebook
spec:
serviceAccountName: dsx-spark
volumes:
- name: jupyter-pv-storage
persistentVolumeClaim:
claimName: jupyter-pv-claim
containers:
- name: minimal-notebook
image: jupyter/pyspark-notebook:latest
ports:
- containerPort: 8888
command: ["start-notebook.sh"]
args: ["--NotebookApp.token=''"]
volumeMounts:
- mountPath: "/home/jovyan"
name: jupyter-pv-storage
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: jupyter-pv-claim
spec:
storageClassName: jupyter-pv-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: jupyter-pv-volume
labels:
type: local
spec:
storageClassName: jupyter-pv-storage
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/home/jovyan"
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: jupyternotebook-pv-storage
annotations:
storageclass.kubernetes.io/is-default-class: "true"
labels:
provisioner: kubernetes.io/vsphere-volume
parameters:
diskformat: zeroedthick
```
最佳答案
带有 jupyter notebook 的 Pod 是非 root 用户,因此无法挂载,所以我们是
在创建 Pod 之前使用 initContainers 更改 Persistent Volume Claim 的用户/权限。
kind: StatefulSet
metadata:
name: jupyter-notebook
labels:
app: jupyter-notebook
spec:
replicas: 1
serviceName: "jupyter-notebook-service"
selector:
matchLabels:
app: jupyter-notebook
template:
metadata:
labels:
app: jupyter-notebook
spec:
serviceAccountName: dsx-spark
volumes:
- name: ci-jupyter-storage-def
persistentVolumeClaim:
claimName: my-jupyter-pv-claim
containers:
- name: minimal-notebook
image: jupyter/pyspark-notebook:latest
ports:
- containerPort: 8888
command: ["start-notebook.sh"]
args: ["--NotebookApp.token=''"]
volumeMounts:
- mountPath: "/home/jovyan/work"
name: ci-jupyter-storage-def
initContainers:
- name: jupyter-data-permission-fix
image: busybox
command: ["/bin/chmod","-R","777", "/data"]
volumeMounts:
- name: ci-jupyter-storage-def
mountPath: /data```
关于kubernetes - kubernetes 中的有状态 jupyter 笔记本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61725121/
问题:将具有两个字符分隔符的数据文件加载到 Azure SQL Db 时,我们遇到以下错误。我们可能做错了什么以及如何解决这个问题? 在 Azure Databricks 中使用 Python 笔记本
我正在使用 ipython notebook 迈出第一步,我成功地将它安装在我的远程服务器上(通过 SSH),并使用以下命令启动它: ipython notebook --ip='*' ---pyla
我想知道对于一个网站来说,最好的数据库设计是什么,让用户(假设有 10k 个用户)给自己留下带有日期的注释。用户只能看到自己的笔记。 用户将看到的示例: 2014年9月28日 -去商店 -带狗去散步
我希望没有人会认为这个问题离题。我即将开始探索在 Jupyter 笔记本中使用 C# 内核。我看到有几种选择,有些似乎过时了。我对探索它们并不真正感兴趣,我只是想要一些能够很好地用于演示的东西。目的是
我已经使用此命令在 R 控制台中安装了 Rcpp,该命令直到现在通常用于安装要在 jupyter 笔记本上运行的软件包: install.packages('Rcpp', '/home/user/an
我已经使用更新了 Tornado sudo pip install --upgrade tornado 检查当前版本显示我已经有一个 4.0 以后的版本 找到命令的输出: pip 显示 Tornado
这个问题在这里已经有了答案: How can I share Jupyter notebooks with non-programmers? [closed] (6 个回答) 5年前关闭。 我安装了一
我有一个 IPython 笔记本,我不小心丢弃了一个巨大的输出 (15 MB),导致笔记本崩溃。现在,当我打开笔记本并尝试删除有问题的单元格时,笔记本又崩溃了——从而阻止了我解决问题并将笔记本恢复到稳
当我使用 ipython 笔记本(Windows 版本)运行任何 %R 代码时,输出在结果之前包含一个 480 x 480 的空白图像。我已经申请了fix #2433让 rmagic 在 Wind
大家好,我想使用新的.NET Jupyter笔记本,因此我准备了一个gitt的存储库,其中包含dockerfile(是正确的)和NuGet.config文件,例如: here the tuto 一切都
如何将本地镜像添加到 IJulia 笔记本?该图像与 IPYNB 文件位于同一本地网络文件夹中。该文件夹可通过符号链接(symbolic link)访问。我尝试过相对文件名和绝对文件名。 ![Ima
docs描述如何创建密码来保护您的 jupyter 笔记本。我希望能够创建并共享一个特定的笔记本,并为该笔记本设置特殊的密码。这可能吗? 最佳答案 不,这是不可能的。该密码保护整个 Jupyter 服
最近我了解到,使用 python 可以生成 IPython 笔记本 automatically .这看起来是个很酷的功能,我想用它来自动生成报告。但是用 julia 而不是 python。那么是否有一
我正在使用 Jupyter 笔记本,并且需要运行另一个 Jupyter 笔记本。这通常使用 %run 很简单,但另一个笔记本的路径是相对的并且包含空格。 这会产生以下错误: %run '..//../
我想在一个循环中运行完整的 Jupyter 笔记本,为笔记本的每次运行传递不同的参数。我可以使用插件传递参数,如下所述:Passing command line arguments to argv i
我真的很感谢这里的一些帮助,基本上我正在学习使用tensorflow,我决定最简单的方法是在VMware和/或Virtualbox上安装ubuntu,然后访问ipython笔记本(anaconda附带
有谁知道在执行单元格之前是否有选项(或建议的 hack)可以让 IPython 笔记本自动保存? 很多时候我一直在做一些事情而没有保存很长一段时间,然后我执行了一个愚蠢的命令,该命令在控制台上打印了如
我正在尝试在另一个文件中运行 .ipynb 文件。我想嵌套这两个的原因是因为在其中一个中,我安装了所有 conda 软件包、github 存储库,并且我不想为我将暂时使用的演示文件重做整个事情。我使用
我有多个相互链接的 Jupyter 笔记本,例如 Notebook1.ipydb 包含指向 Notebook2.ipydb 的链接,其 Markdown [Notebook2](Notebook2.i
我使用 jupyter python 中的 matplotlib 库生成了下图。正如你所看到的,我有两个不同的数据,一个是红色,另一个是绿色。我的问题是,有什么办法可以让我有一个小侧窗来说明每种颜色的
我是一名优秀的程序员,十分优秀!