{ "info": { "author": "Bernhard Walter", "author_email": "b_walter@arcor.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# SSH Kernel - an ipykernel over ssh\n\nA remote jupyterkernel via ssh\n\n* Free software: MIT license\n\nThe ideas are heavily based on [remote_ikernel](https://bitbucket.org/tdaff/remote_ikernel), however `ssh_ipykernel`adds some important features\n\n* `jupyter_client`'s function `write_connection_file` is used on the remote server to get free ports\n* Local ports (obtained by jupyter also via `write_connection_file`) will be ssh forwarded to the remote ports\n* The ssh connection and the tunnel command will be retried in case of network or similar errors\n* introduced signal handling with python's `signal` module\n\n## Usage\n\n* Usage of ssh_ipykernel\n\n ```text\n $ python -m ssh_ipykernel -h\n usage: __main__.py [--help] [--timeout TIMEOUT] [--env [ENV [ENV ...]]] [-s]\n --file FILE --host HOST --python PYTHON\n\n optional arguments:\n --help, -h show this help message and exit\n --timeout TIMEOUT, -t TIMEOUT\n timeout for remote commands\n --env [ENV [ENV ...]], -e [ENV [ENV ...]]\n environment variables for the remote kernel in the\n form: VAR1=value1 VAR2=value2\n -s sudo required to start kernel on the remote machine\n\n required arguments:\n --file FILE, -f FILE jupyter kernel connection file\n --host HOST, -H HOST remote host\n --python PYTHON, -p PYTHON\n remote python_path\n ```\n\n* Creation of kernel specification\n\n * from python\n\n ```python\n import ssh_ipykernel.manage\n ssh_ipykernel.manage.add_kernel(\n host=\"btest\",\n display_name=\"SSH btest:demo(abc)\",\n local_python_path=\"/opt/miniconda/envs/test36/bin/python\",\n remote_python_path=\"/opt/anaconda/envs/python36\",\n sudo=False,\n env=\"VAR1=demo VAR2=abc\",\n timeout=10\n )\n ```\n\n * from terminal\n\n ```bash\n python -m ssh_ipykernel.manage --display-name \"SSH btest:demo(abc) \\\n --host btest \\\n --python /opt/anaconda/envs/python36 \\\n --env \"VAR1=demo VAR2=abc\"\n ```\n\n ```bash\n $ python -m ssh_ipykernel.manage --help\n\n usage: manage.py [--help] [--display-name DISPLAY_NAME] [--sudo]\n [--timeout TIMEOUT] [--env [ENV [ENV ...]]] --host HOST\n --python PYTHON\n\n optional arguments:\n --help, -h show this help message and exit\n --display-name DISPLAY_NAME, -d DISPLAY_NAME\n kernel display name (default is host name)\n --sudo, -s sudo required to start kernel on the remote machine\n --timeout TIMEOUT, -t TIMEOUT\n timeout for remote commands\n --env [ENV [ENV ...]], -e [ENV [ENV ...]]\n environment variables for the remote kernel in the\n form: VAR1=value1 VAR2=value2\n\n required arguments:\n --host HOST, -H HOST remote host\n --python PYTHON, -p PYTHON\n remote python_path\n ```\n\n\n* Checking of kernel specification\n\n ```bash\n $ jupyter-kernelspec list\n Available kernels:\n ssh__ssh_btest_demo_abc_ /Users/bernhard/Library/Jupyter/kernels/ssh__ssh_btest_demo_abc_\n ```\n\n ```bash\n $ cat /Users/bernhard/Library/Jupyter/kernels/ssh__ssh_btest_demo_abc_/kernel.json\n {\n \"argv\": [\n \"/opt/miniconda/envs/test36/bin/python\",\n \"-m\",\n \"ssh_ipykernel\",\n \"--host\",\n \"btest\",\n \"--python\",\n \"/opt/anaconda/envs/python36\",\n \"--timeout\",\n \"10\",\n \"--env\",\n \"VAR1=demo VAR2=abc\",\n \"-f\",\n \"{connection_file}\"\n ],\n \"display_name\": \"SSH btest:demo(abc)\",\n \"language\": \"python\"\n }\n ```\n\n## Credits\n\nThe ideas are heavily based on\n\n* [remote_ikernel](https://bitbucket.org/tdaff/remote_ikernel)\n\n\n# History\n\n## 0.1.0 (2019-09-01)\n\n* First release on github\n\n## 0.9.0 (2019-09-03)\n\n* Restructured pxssh calls\n* Rewrote keeping alive routine\n* Stabilized error detection (cluster not reachable, VPN cut, ipykernel missing)\n\n## 0.9.2 (2019-09-20)\n\n* Added code to call ssh_ipykernel as a module to add a kernel\n* Added doc strings to all classes and methods\n\n## 0.9.3 (2019-09-20)\n\n* Fixed argument error for env variables in ssh_ipykernel.manage\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bernhard-42/ssh_ipykernel", "keywords": "ssh_ipykernel", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "ssh-ipykernel", "package_url": "https://pypi.org/project/ssh-ipykernel/", "platform": "", "project_url": "https://pypi.org/project/ssh-ipykernel/", "project_urls": { "Homepage": "https://github.com/bernhard-42/ssh_ipykernel" }, "release_url": "https://pypi.org/project/ssh-ipykernel/0.9.3/", "requires_dist": [ "pexpect (==4.7.0)", "tornado (>=6.0.3)", "jupyter-client (<5.4.0,>=5.3.1)" ], "requires_python": ">=3.6", "summary": "A remote jupyter ipykernel via ssh", "version": "0.9.3" }, "last_serial": 5863590, "releases": { "0.9.3": [ { "comment_text": "", "digests": { "md5": "59950beee10c1e23b556a8254739b9f6", "sha256": "33b7ad005ab61ef51603960867f94a375a00d065403f534309d99334ae2db2e3" }, "downloads": -1, "filename": "ssh_ipykernel-0.9.3-py3-none-any.whl", "has_sig": false, "md5_digest": "59950beee10c1e23b556a8254739b9f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12257, "upload_time": "2019-09-20T18:33:15", "url": "https://files.pythonhosted.org/packages/20/fd/c531ad1dfff518f577871e15fd82bc9c9324c67b962d23f397e18fea8851/ssh_ipykernel-0.9.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd39fbe8acbbb9c5bf9acf4e7b86ffa0", "sha256": "8b1ec12b86907295383348640d43b84341e9a58db08e49aa6623df5b1ef604f8" }, "downloads": -1, "filename": "ssh_ipykernel-0.9.3.tar.gz", "has_sig": false, "md5_digest": "cd39fbe8acbbb9c5bf9acf4e7b86ffa0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11560, "upload_time": "2019-09-20T18:33:16", "url": "https://files.pythonhosted.org/packages/5c/2a/4e391b2c480fb7d8f1516bc6565cb37a887739307ad60b08c7afe172950f/ssh_ipykernel-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "59950beee10c1e23b556a8254739b9f6", "sha256": "33b7ad005ab61ef51603960867f94a375a00d065403f534309d99334ae2db2e3" }, "downloads": -1, "filename": "ssh_ipykernel-0.9.3-py3-none-any.whl", "has_sig": false, "md5_digest": "59950beee10c1e23b556a8254739b9f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12257, "upload_time": "2019-09-20T18:33:15", "url": "https://files.pythonhosted.org/packages/20/fd/c531ad1dfff518f577871e15fd82bc9c9324c67b962d23f397e18fea8851/ssh_ipykernel-0.9.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd39fbe8acbbb9c5bf9acf4e7b86ffa0", "sha256": "8b1ec12b86907295383348640d43b84341e9a58db08e49aa6623df5b1ef604f8" }, "downloads": -1, "filename": "ssh_ipykernel-0.9.3.tar.gz", "has_sig": false, "md5_digest": "cd39fbe8acbbb9c5bf9acf4e7b86ffa0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11560, "upload_time": "2019-09-20T18:33:16", "url": "https://files.pythonhosted.org/packages/5c/2a/4e391b2c480fb7d8f1516bc6565cb37a887739307ad60b08c7afe172950f/ssh_ipykernel-0.9.3.tar.gz" } ] }