[英]how to load the saved work in jupyter lab running from docker powered by aws EC2Instance?
I am creating an EC2Instance and pulling some docker files through user-data script to launch jupyter lab for the first time when instance is created , now i save my work in jupyter lab and stop the EC2Instance and when i restart the instance after some time , i again pull the same files this time through rc.local (run on every boot) and it again launches my jupyter lab but i don't have my old saved files , Also i would like to mention that i am attaching EBS Volumes and once i am doing my work the volume size is getting increased , so how can i fix this issue ? 我正在创建一个EC2Instance并通过用户数据脚本提取一些docker文件,以在创建实例时首次启动jupyter lab,现在我将工作保存在jupyter lab中并停止EC2Instance,并且在一段时间后重新启动实例时,这次我再次通过rc.local(在每次启动时运行)提取相同的文件,它再次启动了我的jupyter实验室,但是我没有保存的旧文件,我还要提及我附加了EBS Volumes,我在做我的工作时,卷的大小正在增加,那么如何解决此问题?
Script i am using:- 我正在使用的脚本:-
sudo yum -y update docker login -u -p docker pull latest/jupyter-env docker run -p 8080:8890 latest/jupyter-env sudo yum -y更新docker登录-u -p docker pull Latest / jupyter-env docker run -p 8080:8890 Latest / jupyter-env
and this same script i have put in rc.local file and then created image of that in the first time so that it triggers automatically on every boot 并且我将相同的脚本放入rc.local文件,然后在第一次创建该文件的映像,以便在每次启动时自动触发
You can mount the host directory of EC2 machine to your docker container and work in that directory when inside jupyter lab. 您可以将 EC2计算机的主机目录挂载到docker容器中,并在jupyter实验室中时在该目录中工作。 All the work saved in that directory will remain intact even after you restart your EC2 machine or docker container.
即使重新启动EC2计算机或Docker容器,该目录中保存的所有工作也将保持不变 。
Command to mount a directory - 挂载目录的命令-
-v ~/ ~/mounted-directory
Updating your command - 更新命令-
sudo yum -y update docker login -u -p docker pull latest/jupyter-env docker run -p 8080:8890 latest/jupyter-env -v ~/ ~/mounted-directory
For further reference, you can check this link 有关更多参考,您可以检查此链接
yes the answer to the solution was similar as answered above by sat, 是的,解决方案的答案与上述sat的答案相似,
i logged in to my ec2- machine and created a directory test and then i went inside the rc.local file and i write the script there so that i can use this in the restart scenario and then i exit and created an ami out of that ec2-instance, and further use that ami-id and load the user-data script , my changed script which i used in user-data and rc.local file is:- 我登录到ec2-机器并创建了目录测试,然后进入rc.local文件,并在其中编写了脚本,以便可以在重启方案中使用它,然后退出并从中创建了一个ami。 ec2-instance,并进一步使用该ami-id并加载user-data脚本,我在user-data和rc.local文件中使用的更改后的脚本是:
sudo yum -y update docker login -u -p docker pull latest/jupyter-env docker run -v ~/test/:/home/ -p 8080:8890 latest/jupyter-env sudo yum -y更新docker登录-u -p docker pull Latest / jupyter-env docker run -v〜/ test /:/ home / -p 8080:8890 Latest / jupyter-env
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.