Jupyter deployment models from local to production

栏目: IT技术 · 发布时间: 6年前

Model 2: running JupyterLab on a remote server where your datasets live

Maybe you’ve heard the saying that “data science is anything that causes Excel to crash” The next stage after that is anything that doesn’t fit on a laptop. As your experiments scale, you may run into either

  • not enough compute on your laptop
  • not enough storage on your laptop

Either way, the solution will probably be for you to get a beefy dev server from your DevOps/IT team. That dev server will be hosted in a lab somewhere that you never physically see. You just access it remotely.

Or maybe it’s simply WFH during Covid that’s caused you to work remotely with machines that you usually work directly on.

The challenge with starting Jupyter on a remote machine is accessing the UI.

Scenario A: there’s no firewall between you and the remote machine

Add the --ip parameter to your jupyter launch command. It sets the IP address that the notebook server listens on (default value = “localhost”).

jupyter notebook --ip=<remote server IP address> --port=8888

In your laptop browser, instead of navigating to http://localhost:8888/, you can connect directly to the server at http://<remote server IP address>:8888/ instead.

Get fancy:

Are you restarting your Jupyter on your remotehost every time you open your laptop?

You can use a terminal multiplexer such as tmux or screen to essentially detach the session on your remotehost. That way, the session doesn’t depend on the connection from your localhost.

For a comparison between tmux and screen, you can check out this StackExchange post , but as the header warning states, it’s an opinion-based question.

Scenario B: your notebook server is running somewhere behind a firewall, like in the public cloud.

Instructions vary per cloud vendor (see below), but the high level steps are:

  1. Launch jupyter from within your remote server
  2. From your local machine, configure port forwarding.

Port forwarding?

When you start a Jupyter server, by default, the GUI is hosted on a port on the machine where the server is launched . In this scenario, port forwarding tells your local machine to take any traffic for a specific local port and forward it to a port on a remote machine. ( Further reading: The Missing Semester of Your CS Education )

Vendor specific instructions:

AWS

– Official documentation: Set up Jupyter for the AWS Deep Learning AMI

– User example

GCP

– Official documentation: Connecting to JupyterLab for the Deep Learning VM Image

– User example (includes changing your instance’s firewall settings as an alternative to port forwarding)

Azure

– Official documentation: Configure Jupyter in a Azure Machine Learning dev environment (uses Azure Notebooks as the server)

Request for deletion

About

MC.AI – Aggregated news about artificial intelligence

MC.AI collects interesting articles and news about artificial intelligence and related areas. The contributions come from various open sources and are presented here in a collected form.

The copyrights are held by the original authors, the source is indicated with each contribution.

Contributions which should be deleted from this platform can be reported using the appropriate form (within the contribution).

MC.AI is open for direct submissions, we look forward to your contribution!

Search on MC.AI

mc.ai aggregates articles from different sources - copyright remains at original authors


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

数据挖掘

数据挖掘

(美)Jiawei Han、(加)Micheline Kamber、(加)Jian Pei / 范明、孟小峰 / 机械工业出版社 / 2012-8 / 79.00元

数据挖掘领域最具里程碑意义的经典著作 完整全面阐述该领域的重要知识和技术创新 这是一本数据挖掘和知识发现的优秀教材,结构合理、条理清晰。本书既保留了相当篇幅讲述数据挖掘的基本概念和方法,又增加了若干章节介绍数据挖掘领域最新的技术和发展,因此既适合初学者学习又适合专业人员和实践者参考。本书视角广阔、资料翔实、内容全面,能够为有意深入研究相关技术的读者提供足够的参考和支持。总之, 强烈推荐......一起来看看 《数据挖掘》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

html转js在线工具
html转js在线工具

html转js在线工具