Slide 1

Slide 1 text

Tiny Port Forward Manger for Data Scientists Takahiko Ito

Slide 2

Slide 2 text

Self-Introduction • Software engineer working in Cookpad Inc. • Ph.D • Research topics: graph analysis, natural Language processing, data mining etc… • Today I talk about a tool applicable to machine learning experiments. 2

Slide 3

Slide 3 text

Preliminaries: port forwarding • Limited resources in local machines • Data scientists work in multiple remote computers with ssh • To connect the UI of the servers (Jupyter Notebook) we need to add port forwarding settings. 3

Slide 4

Slide 4 text

Sample: ssh parameters ssh -A -L 8888:localhost:8888 takahi-i-workbench-001.ml.aws.ckpd.co 4 Port forward setting Remote host We need to remember the combinations among task, remote host, and forwarded port for each project

Slide 5

Slide 5 text

Solution: pfm • I made a tiny command line tool to manage port forward settings for data scientists. • URL: https://github.com/takahi-i/pfm 5

Slide 6

Slide 6 text

pfm keeps a table Table contains port forward settings • Task name • Type of port forwarding • Name of remote host • Remote port number • Login user • ssh-server 6

Slide 7

Slide 7 text

Example: pfm table pfm shows the list of port forward settings with `pfm list` command. 7 my-ml-instance-001.aws.com my-ml-instance-001.aws.com

Slide 8

Slide 8 text

Register the settings 8 $ pfm add --name food-nonfood --local-port 7777 --remote-port 8888 --ssh-server my-ml-instance-2.aws.com --remote-host localhost --login-user takahi-i

Slide 9

Slide 9 text

Ssh connection with port forward settings with pfm • Simplify ssh commands • Example: • ssh -A `pfm param recipe-calssification` or • pfm connect recipe-classification 9

Slide 10

Slide 10 text

Demo: port forwarding to Jupyter server in Docker container with pfm Note: port forward settings from a Docker container is done with Cookiecutter Docker Science • URL: https://docker-science.github.io/ 10

Slide 11

Slide 11 text

Usage: provided commands Usage: pfm [OPTIONS] COMMAND [ARGS]... Options: -c, --config TEXT configuration file (DEFAULT $HOME/.pfm) --help Show this message and exit. Commands: add Add port forward setting delete Delete specified setting list List existing port forward settings param Generate ssh port forward parameters update Update registered port forward setting version Show version number 11

Slide 12

Slide 12 text

Future work • Register working directory in remote machines • Make `pfm connect` go to the working directory • Make pfm shows available list of port used in port forwarding 12

Slide 13

Slide 13 text

Thank you for your attention!