nice-florist-55958
02/25/2022, 2:26 PMenough-analyst-54434
02/25/2022, 2:32 PMexecution_mode
do you have set for your pex_binary
?: https://www.pantsbuild.org/docs/reference-pex_binary#codeexecution_modecodenice-florist-55958
02/25/2022, 2:36 PMzipapp
enough-analyst-54434
02/25/2022, 2:50 PMvenv
then.enough-analyst-54434
02/25/2022, 2:59 PM$ pex jupyter-server -ojupyter-server.venv.pex -cjupyter --venv
$ cat ~/.jupyter/jupyter_server_config.json
{
"ServerApp": {
"port": 9999
}
}
$ ./jupyter-server.venv.pex server --debug --show-config
[D 2022-02-25 06:58:57.054 ServerApp] Searching ['/home/jsirois', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/6931f727/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 06:58:57.054 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 06:58:57.054 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 06:58:57.054 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/6931f727/venv/etc/jupyter
[D 2022-02-25 06:58:57.054 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 06:58:57.054 ServerApp] Looking for jupyter_config in /home/jsirois
[D 2022-02-25 06:58:57.055 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 06:58:57.055 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 06:58:57.055 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/6931f727/venv/etc/jupyter
[D 2022-02-25 06:58:57.055 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
[D 2022-02-25 06:58:57.055 ServerApp] Loaded config file: /home/jsirois/.jupyter/jupyter_server_config.json
[D 2022-02-25 06:58:57.055 ServerApp] Looking for jupyter_server_config in /home/jsirois
[D 2022-02-25 06:58:57.056 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 06:58:57.056 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 06:58:57.057 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/6931f727/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 06:58:57.057 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
Loaded config files:
/home/jsirois/.jupyter/jupyter_server_config.json
ExtensionApp
.log_level = 'DEBUG'
ServerApp
.log_level = 'DEBUG'
.port = 9999
Took me a while to figure out the correct config file name.enough-analyst-54434
02/25/2022, 3:00 PM$ pex jupyter-server -ojupyter-server.pex -cjupyter
$ ./jupyter-server.pex server --debug --show-config
usage: jupyter-server.pex [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch
options:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable format.
--json output paths as machine-readable json
--debug output debug information about paths
Available subcommands: server.pex server.venv.pex
Jupyter command `jupyter-server` not found.
nice-florist-55958
02/25/2022, 3:29 PMsys.path
, giving maximum compatibility with stdlib and third party APIs."nice-florist-55958
02/25/2022, 3:30 PMenough-analyst-54434
02/25/2022, 3:45 PMenough-analyst-54434
02/25/2022, 3:46 PMenough-analyst-54434
02/25/2022, 3:46 PMenough-analyst-54434
02/25/2022, 3:49 PMjupyter-server
transitive dependency set:
$ hyperfine -p 'rm -rf ~/.pex' -w 1 './jupyter-server.pex --version' './jupyter-server.venv.pex --version'
Benchmark 1: ./jupyter-server.pex --version
Time (mean ± σ): 1.169 s ± 0.017 s [User: 1.062 s, System: 0.105 s]
Range (min … max): 1.127 s … 1.191 s 10 runs
Benchmark 2: ./jupyter-server.venv.pex --version
Time (mean ± σ): 1.477 s ± 0.027 s [User: 1.334 s, System: 0.141 s]
Range (min … max): 1.439 s … 1.518 s 10 runs
Summary
'./jupyter-server.pex --version' ran
1.26 ± 0.03 times faster than './jupyter-server.venv.pex --version'
enough-analyst-54434
02/25/2022, 3:50 PM$ hyperfine -w 1 './jupyter-server.pex --version' './jupyter-server.venv.pex --version'
Benchmark 1: ./jupyter-server.pex --version
Time (mean ± σ): 510.8 ms ± 11.9 ms [User: 476.4 ms, System: 34.8 ms]
Range (min … max): 490.9 ms … 534.5 ms 10 runs
Benchmark 2: ./jupyter-server.venv.pex --version
Time (mean ± σ): 256.8 ms ± 3.5 ms [User: 233.5 ms, System: 24.1 ms]
Range (min … max): 251.8 ms … 264.5 ms 11 runs
Summary
'./jupyter-server.venv.pex --version' ran
1.99 ± 0.05 times faster than './jupyter-server.pex --version'
enough-analyst-54434
02/25/2022, 3:53 PM__main__.py
where the fact the venv PEX is already unpacked is determined and that already unpacked venv `exec`'d into.enough-analyst-54434
02/25/2022, 3:55 PMnice-florist-55958
02/25/2022, 4:01 PM.bootstrap/pex/common.py
line 461. I'll remove it for now just to make sure the Jupyter app works in venv mode.enough-analyst-54434
02/25/2022, 4:02 PMenough-analyst-54434
02/25/2022, 4:04 PMenough-analyst-54434
02/25/2022, 4:06 PMenough-analyst-54434
02/25/2022, 4:12 PMfcntl
byte range locks, which this uses under the hood via Python's fcntl.lockf
, would be useful.nice-florist-55958
02/25/2022, 5:24 PMnice-florist-55958
02/25/2022, 5:25 PM(.venv) <http://ivapp1341241.howard.ms.com|ivapp1341241.howard.ms.com> /v/global/user/t/ta/taymarti/casper/codetree/codetree/src 43$ python proj/apps/oasnb/src/main.py --log-level 10
[D 2022-02-25 12:13:13.769 ServerApp] Searching ['/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src', '/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter', '/v/global/user/t/ta/taymarti/.local/etc/jupyter', '/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 12:13:13.770 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 12:13:13.770 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 12:13:13.770 ServerApp] Looking for jupyter_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter
[D 2022-02-25 12:13:13.770 ServerApp] Looking for jupyter_config in /v/global/user/t/ta/taymarti/.local/etc/jupyter
[D 2022-02-25 12:13:13.770 ServerApp] Looking for jupyter_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter
[D 2022-02-25 12:13:13.770 ServerApp] Looking for jupyter_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src
[D 2022-02-25 12:13:13.772 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 12:13:13.772 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 12:13:13.772 ServerApp] Looking for jupyter_server_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter
[D 2022-02-25 12:13:13.772 ServerApp] Looking for jupyter_server_config in /v/global/user/t/ta/taymarti/.local/etc/jupyter
[D 2022-02-25 12:13:13.772 ServerApp] Looking for jupyter_server_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter
[D 2022-02-25 12:13:13.772 ServerApp] Looking for jupyter_server_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src
[D 2022-02-25 12:13:13.775 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:13:13.775 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:13:13.776 ServerApp] Paths used for configuration of jupyter_server_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter/jupyter_server_config.d/jupyterlab.json
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter/jupyter_server_config.d/nbclassic.json
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:13:13.780 ServerApp] Paths used for configuration of jupyter_server_config:
/v/global/user/t/ta/taymarti/.local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:13:13.780 ServerApp] Paths used for configuration of jupyter_server_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter/jupyter_server_config.json
[I 2022-02-25 12:13:13.806 ServerApp] jupyterlab | extension was successfully linked.
IN NOTBOOK CONFIGURATION
[W 2022-02-25 12:13:13.814 NotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-02-25 12:13:13.814 NotebookApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[D 2022-02-25 12:13:14.246 ServerApp] Paths used for configuration of jupyter_notebook_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter/jupyter_notebook_config.json
[D 2022-02-25 12:13:14.247 ServerApp] Paths used for configuration of jupyter_notebook_config:
/etc/jupyter/jupyter_notebook_config.json
[D 2022-02-25 12:13:14.247 ServerApp] Paths used for configuration of jupyter_notebook_config:
/usr/local/etc/jupyter/jupyter_notebook_config.json
[D 2022-02-25 12:13:14.248 ServerApp] Paths used for configuration of jupyter_notebook_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/etc/jupyter/jupyter_notebook_config.json
[D 2022-02-25 12:13:14.250 ServerApp] Paths used for configuration of jupyter_notebook_config:
/v/global/user/t/ta/taymarti/.local/etc/jupyter/jupyter_notebook_config.json
[D 2022-02-25 12:13:14.251 ServerApp] Paths used for configuration of jupyter_notebook_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter/jupyter_notebook_config.json
[I 2022-02-25 12:13:14.251 ServerApp] nbclassic | extension was successfully linked.
[D 2022-02-25 12:13:14.252 ServerApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'ip': '0.0.0.0', 'password': '', 'log_level': 10, 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'nbclassic': True}>}}
[D 2022-02-25 12:13:14.253 ServerApp] Raising open file limit: soft 1024->4096; hard 16384->16384
[I 2022-02-25 12:13:14.326 ServerApp] nbclassic | extension was successfully loaded.
[I 2022-02-25 12:13:14.328 LabApp] JupyterLab extension loaded from /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/lib/python3.7/site-packages/jupyterlab
[I 2022-02-25 12:13:14.328 LabApp] JupyterLab application directory is /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src/.venv/share/jupyter/lab
[I 2022-02-25 12:13:14.334 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-02-25 12:13:14.334 ServerApp] The port 8888 is already in use, trying another port.
[I 2022-02-25 12:13:14.334 ServerApp] Serving notebooks from local directory: /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src
[I 2022-02-25 12:13:14.334 ServerApp] Jupyter Server 1.13.4 is running at:
[I 2022-02-25 12:13:14.334 ServerApp] <http://ivapp1341241.howard.ms.com:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
[I 2022-02-25 12:13:14.334 ServerApp] or <http://127.0.0.1:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
[I 2022-02-25 12:13:14.334 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-02-25 12:13:14.439 ServerApp]
To access the server, open this file in a browser:
file:///a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.local/share/jupyter/runtime/jpserver-19884-open.html
Or copy and paste one of these URLs:
<http://ivapp1341241.howard.ms.com:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
or <http://127.0.0.1:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
[[ Run from PEX binary ]]
(.venv) <http://ivapp1341241.howard.ms.com|ivapp1341241.howard.ms.com> /v/global/user/t/ta/taymarti/casper/codetree/codetree/src 44$ dist/proj.apps.oasnb/oasnb.pex --log-level 10
[D 2022-02-25 12:16:32.812 ServerApp] Searching ['/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src', '/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter', '/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/s/dfd46722/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 12:16:32.812 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 12:16:32.812 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 12:16:32.812 ServerApp] Looking for jupyter_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/s/dfd46722/venv/etc/jupyter
[D 2022-02-25 12:16:32.812 ServerApp] Looking for jupyter_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter
[D 2022-02-25 12:16:32.812 ServerApp] Looking for jupyter_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src
[D 2022-02-25 12:16:32.813 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 12:16:32.814 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 12:16:32.814 ServerApp] Looking for jupyter_server_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/s/dfd46722/venv/etc/jupyter
[D 2022-02-25 12:16:32.814 ServerApp] Looking for jupyter_server_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter
[D 2022-02-25 12:16:32.814 ServerApp] Looking for jupyter_server_config in /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src
[D 2022-02-25 12:16:32.816 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:16:32.817 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:16:32.817 ServerApp] Paths used for configuration of jupyter_server_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/s/dfd46722/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 12:16:32.817 ServerApp] Paths used for configuration of jupyter_server_config:
/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.jupyter/jupyter_server_config.json
[I 2022-02-25 12:16:32.833 ServerApp] jupyterlab | extension was successfully linked.
[D 2022-02-25 12:16:32.834 ServerApp] Raising open file limit: soft 1024->4096; hard 16384->16384
[I 2022-02-25 12:16:32.926 LabApp] JupyterLab extension loaded from /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/s/dfd46722/venv/lib/python3.7/site-packages/jupyterlab
[I 2022-02-25 12:16:32.926 LabApp] JupyterLab application directory is /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/988280cf22613661b344b8c2706e29e8a1d0d504/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/share/jupyter/lab
[E 2022-02-25 12:16:32.928 LabApp] JupyterLab application assets not found in "/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/988280cf22613661b344b8c2706e29e8a1d0d504/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/share/jupyter/lab"
[E 2022-02-25 12:16:32.928 LabApp] Please run `jupyter lab build` or use a different app directory
[I 2022-02-25 12:16:32.932 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-02-25 12:16:32.933 ServerApp] The port 8888 is already in use, trying another port.
[I 2022-02-25 12:16:32.933 ServerApp] Serving notebooks from local directory: /a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/casper/codetree/codetree/src
[I 2022-02-25 12:16:32.933 ServerApp] Jupyter Server 1.13.4 is running at:
[I 2022-02-25 12:16:32.933 ServerApp] <http://localhost:8889/lab?token=7fad596b5596ae4e993de79461aa4f56241d5151955116ee>
[I 2022-02-25 12:16:32.933 ServerApp] or <http://127.0.0.1:8889/lab?token=7fad596b5596ae4e993de79461aa4f56241d5151955116ee>
[I 2022-02-25 12:16:32.933 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-02-25 12:16:33.049 ServerApp]
To access the server, open this file in a browser:
file:///a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.local/share/jupyter/runtime/jpserver-21581-open.html
Or copy and paste one of these URLs:
<http://localhost:8889/lab?token=7fad596b5596ae4e993de79461aa4f56241d5151955116ee>
or <http://127.0.0.1:8889/lab?token=7fad596b5596ae4e993de79461aa4f56241d5151955116ee>
[[ BUILD ]]
pex_binary(
name='oasnb',
entry_point="./src/main.py",
shebang="/ms/dist/python/PROJ/core/3.7.5/exec/bin/python3",
dependencies=[
"./src:assets",
"./src",
],
execution_mode='venv'
)
nice-florist-55958
02/25/2022, 5:40 PMJupyterLab application assets not found in "/a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.pex/venvs/988280cf22613661b344b8c2706e29e8a1d0d504/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/share/jupyter/lab"
[E 2022-02-25 12:16:32.928 LabApp] Please run `jupyter lab build` or use a different app directory
nice-florist-55958
02/25/2022, 5:41 PMenough-analyst-54434
02/25/2022, 5:44 PMenough-analyst-54434
02/25/2022, 5:53 PMenough-analyst-54434
02/25/2022, 5:54 PM./src:assets
?enough-analyst-54434
02/25/2022, 5:59 PMresources
target IIUC but you're wondering why that is needed at all?enough-analyst-54434
02/25/2022, 6:02 PMfiles
targets sources in a PEX, so you're forced to use resources
: https://github.com/pantsbuild/pants/blob/12d56a388c1d0ee02523d19c7e7ad6b2b9550c33/src/python/pants/backend/python/goals/package_pex_binary.py#L[…]24enough-analyst-54434
02/25/2022, 6:09 PM^jsirois@gill ~ $ python -mvenv jupyter-server.venv
^jsirois@gill ~ $ source jupyter-server.venv/bin/activate
(jupyter-server.venv) ^jsirois@gill ~ $ pip -q install -U pip
(jupyter-server.venv) ^jsirois@gill ~ $ pip -q install jupyter-server
(jupyter-server.venv) ^jsirois@gill ~ $ cd jupyter-server.venv/lib/python3.10/site-packages/
(jupyter-server.venv) ^jsirois@gill ~/jupyter-server.venv/lib/python3.10/site-packages $ ls -1 | grep -i -E "^s"
send2trash
Send2Trash-1.8.0.dist-info
setuptools
setuptools-58.1.0.dist-info
six-1.16.0.dist-info
six.py
sniffio
sniffio-1.2.0.dist-info
enough-analyst-54434
02/25/2022, 6:11 PM(jupyter-server.venv) ^jsirois@gill ~/jupyter-server.venv $ ls -1
bin
include
lib
lib64
pyvenv.cfg
share
OK - yeah, Pex bug. Let me see what's up here and finally file a Pex bug.nice-florist-55958
02/25/2022, 6:29 PMenough-analyst-54434
02/25/2022, 6:32 PMnice-florist-55958
02/25/2022, 6:36 PMpex_binary(..., execution_mode='venv')
and then run the pex file standalone?enough-analyst-54434
02/25/2022, 6:37 PMenough-analyst-54434
02/25/2022, 6:41 PM^jsirois@gill /tmp/test $ pex jupyter-server -ojupyter-server.venv.pex -cjupyter --venv
^jsirois@gill /tmp/test $ cat ~/.jupyter/jupyter_server_config.json
{
"ServerApp": {
"port": 9999
}
}
^jsirois@gill /tmp/test $ ./jupyter-server.venv.pex server --debug --show-config
[D 2022-02-25 10:38:42.126 ServerApp] Searching ['/tmp/test', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_config in /tmp/test
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
[D 2022-02-25 10:38:42.127 ServerApp] Loaded config file: /home/jsirois/.jupyter/jupyter_server_config.json
[D 2022-02-25 10:38:42.127 ServerApp] Looking for jupyter_server_config in /tmp/test
[D 2022-02-25 10:38:42.129 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 10:38:42.129 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 10:38:42.129 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 10:38:42.129 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
Loaded config files:
/home/jsirois/.jupyter/jupyter_server_config.json
ExtensionApp
.log_level = 'DEBUG'
ServerApp
.log_level = 'DEBUG'
.port = 9999
And now like you:
^jsirois@gill /tmp/test $ ./jupyter-server.venv.pex server --log-level 10
[D 2022-02-25 10:39:11.459 ServerApp] Searching ['/tmp/test', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 10:39:11.459 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 10:39:11.459 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 10:39:11.459 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter
[D 2022-02-25 10:39:11.459 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 10:39:11.460 ServerApp] Looking for jupyter_config in /tmp/test
[D 2022-02-25 10:39:11.460 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 10:39:11.460 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 10:39:11.460 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter
[D 2022-02-25 10:39:11.460 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
[D 2022-02-25 10:39:11.460 ServerApp] Loaded config file: /home/jsirois/.jupyter/jupyter_server_config.json
[D 2022-02-25 10:39:11.460 ServerApp] Looking for jupyter_server_config in /tmp/test
[D 2022-02-25 10:39:11.461 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 10:39:11.461 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 10:39:11.462 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/45658ea9/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 10:39:11.462 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
[I 2022-02-25 10:39:11.473 ServerApp] Serving notebooks from local directory: /tmp/test
[I 2022-02-25 10:39:11.473 ServerApp] Jupyter Server 1.13.5 is running at:
[I 2022-02-25 10:39:11.473 ServerApp] <http://localhost:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
[I 2022-02-25 10:39:11.473 ServerApp] or <http://127.0.0.1:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
[I 2022-02-25 10:39:11.473 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-02-25 10:39:11.475 ServerApp]
To access the server, open this file in a browser:
file:///home/jsirois/.local/share/jupyter/runtime/jpserver-317652-open.html
Or copy and paste one of these URLs:
<http://localhost:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
or <http://127.0.0.1:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
[D 2022-02-25 10:39:43.538 ServerApp] Accepting token-authenticated connection from 127.0.0.1
[D 2022-02-25 10:39:43.540 ServerApp] Using contents: services/contents
[D 2022-02-25 10:39:43.555 ServerApp] Path favicon.ico served from /home/jsirois/.pex/venvs/s/45658ea9/venv/lib/python3.10/site-packages/jupyter_server/static/favicon.ico
[D 2022-02-25 10:39:43.556 ServerApp] Path style/bootstrap.min.css served from /home/jsirois/.pex/venvs/s/45658ea9/venv/lib/python3.10/site-packages/jupyter_server/static/style/bootstrap.min.css
[D 2022-02-25 10:39:43.556 ServerApp] Path style/bootstrap-theme.min.css served from /home/jsirois/.pex/venvs/s/45658ea9/venv/lib/python3.10/site-packages/jupyter_server/static/style/bootstrap-theme.min.css
[D 2022-02-25 10:39:43.556 ServerApp] Path style/index.css served from /home/jsirois/.pex/venvs/s/45658ea9/venv/lib/python3.10/site-packages/jupyter_server/static/style/index.css
[D 2022-02-25 10:39:43.556 ServerApp] Path logo/logo.png served from /home/jsirois/.pex/venvs/s/45658ea9/venv/lib/python3.10/site-packages/jupyter_server/static/logo/logo.png
[D 2022-02-25 10:39:43.557 ServerApp] 200 GET /?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3 (127.0.0.1) 19.06ms
[D 2022-02-25 10:39:43.582 ServerApp] 200 GET /static/style/bootstrap.min.css?v=0e8a7fbd6de23ad6b27ab95802a0a0915af6693af612bc304d83af445529ce5d95842309ca3405d10f538d45c8a3a261b8cff78b4bd512dd9effb4109a71d0ab (127.0.0.1) 1.20ms
[D 2022-02-25 10:39:43.584 ServerApp] 200 GET /static/style/bootstrap-theme.min.css?v=8b2f045cb5b4d5ad346f6e816aa2566829a4f5f2783ec31d80d46a57de8ac0c3d21fe6e53bcd8e1f38ac17fcd06d12088bc9b43e23b5d1da52d10c6b717b22b3 (127.0.0.1) 0.84ms
[D 2022-02-25 10:39:43.584 ServerApp] 200 GET /static/style/index.css?v=30372e3246a801d662cf9e3f9dd656fa192eebde9054a2282449fe43919de9f0ee9b745d7eb49d3b0a5e56357912cc7d776390eddcab9dac85b77bdb17b4bdae (127.0.0.1) 0.77ms
[D 2022-02-25 10:39:43.585 ServerApp] 200 GET /static/logo/logo.png?v=a2a176ee3cee251ffddf5fa21fe8e43727a9e5f87a06f9c91ad7b776d9e9d3d5e0159c16cc188a3965e00375fb4bc336c16067c688f5040c0c2d4bfdb852a9e4 (127.0.0.1) 0.39ms
[D 2022-02-25 10:39:43.660 ServerApp] 200 GET /static/favicon.ico?v=50afa725b5de8b00030139d09b38620224d4e7dba47c07ef0e86d4643f30c9bfe6bb7e1a4a1c561aa32834480909a4b6fe7cd1e17f7159330b6b5914bf45a880 (127.0.0.1) 0.75ms
[D 2022-02-25 10:40:10.001 ServerApp] Using contents: services/contents
[D 2022-02-25 10:40:10.002 ServerApp] 200 GET / (127.0.0.1) 2.28ms
[D 2022-02-25 10:40:10.038 ServerApp] 304 GET /static/logo/logo.png?v=a2a176ee3cee251ffddf5fa21fe8e43727a9e5f87a06f9c91ad7b776d9e9d3d5e0159c16cc188a3965e00375fb4bc336c16067c688f5040c0c2d4bfdb852a9e4 (127.0.0.1) 0.71ms
[D 2022-02-25 10:40:11.695 ServerApp] Accepting token-authenticated connection from 127.0.0.1
[D 2022-02-25 10:40:11.695 ServerApp] Using contents: services/contents
[D 2022-02-25 10:40:11.695 ServerApp] 304 GET /?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3 (127.0.0.1) 0.87ms
enough-analyst-54434
02/25/2022, 6:42 PMAccepting token-authenticated connection from 127.0.0.1
on down are emitted after I open file:///home/jsirois/.local/share/jupyter/runtime/jpserver-317652-open.html in a browser.enough-analyst-54434
02/25/2022, 6:42 PMnice-florist-55958
02/25/2022, 6:46 PMTo access the server, open this file in a browser:
file:///home/jsirois/.local/share/jupyter/runtime/jpserver-317652-open.html
Or copy and paste one of these URLs:
<http://localhost:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
or <http://127.0.0.1:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
Note that none of those URLs are publcily exposed. The $localhost should resolve to the real server and be accessible externally, but it won't be, even if you substitute it manually, because Jupyter servers are always private by default. You can only make it public by pointing it to a configuration that says how to make it so and what security policy to use.
According to your logs, it doesn't attempt to find your notebook configuration either. To see the point I'm making, look at the logs after the big echo statement I added in my configuration file in the [[ Run from activated venv directly ]] log.nice-florist-55958
02/25/2022, 6:47 PMTo access the server, open this file in a browser:
file:///a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.local/share/jupyter/runtime/jpserver-19884-open.html
Or copy and paste one of these URLs:
<http://ivapp1341241.howard.ms.com:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
or <http://127.0.0.1:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
nice-florist-55958
02/25/2022, 6:47 PMTo access the server, open this file in a browser:
file:///a/nyn183f2/vol/nyn183f2v18/u_t1445795813/taymarti/.local/share/jupyter/runtime/jpserver-21581-open.html
Or copy and paste one of these URLs:
<http://localhost:8889/lab?token=7fad596b5596ae4e993de79461aa4f56241d5151955116ee>
or <http://127.0.0.1:8889/lab?token=7fad596b5596ae4e993de79461aa4f56241d5151955116ee>
nice-florist-55958
02/25/2022, 6:49 PM<http://ivapp1341241.howard.ms.com:8889/lab?token=33bbeef1d996ea4e9d13b8d2bd723c1708d19d055b6d8821>
vs.
<http://localhost:9999/?token=68a515eb0fce27b9042cba32c639e2ddae9af977c5bc22e3>
where the latter is a result of it not looking for my configuration (ran from Pex build) and the former is a result of looking for and finding the jupyter_notebook_config (not to be confused with the other config types) in ~/.jupyter and applying the security policy there to make the server public.
Again, apologies for maybe going too far into Jupyter land, but you can probably appreciate now why they might not necessarily be able to help yet (but prob worth asking them under what scenarios this behavior could occur).enough-analyst-54434
02/25/2022, 7:03 PM^jsirois@gill ~/dev/pantsbuild/pants (main) $ cat BUILD.test
python_requirement(
name="jupyter-server",
requirements=["jupyter-server"],
)
pex_binary(
name="bin",
script="jupyter",
execution_mode="venv",
dependencies=[":jupyter-server"],
)
^jsirois@gill ~/dev/pantsbuild/pants (main) $ ./pants --no-python-enable-resolves package :bin
11:01:44.97 [INFO] Completed: Extracting 1 requirement to build bin.pex from other_lockfile.pex: jupyter-server
11:01:44.97 [INFO] Wrote dist/bin.pex
^jsirois@gill ~/dev/pantsbuild/pants (main) $ cat ~/.jupyter/jupyter_server_config.json
{
"ServerApp": {
"port": 9999
}
}
^jsirois@gill ~/dev/pantsbuild/pants (main) $ ./dist/bin.pex server --log-level 10
[D 2022-02-25 11:02:03.985 ServerApp] Searching ['/home/jsirois/dev/pantsbuild/pants', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 11:02:03.985 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 11:02:03.985 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 11:02:03.985 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:02:03.985 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 11:02:03.985 ServerApp] Looking for jupyter_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:02:03.986 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 11:02:03.986 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 11:02:03.986 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:02:03.986 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
[D 2022-02-25 11:02:03.986 ServerApp] Loaded config file: /home/jsirois/.jupyter/jupyter_server_config.json
[D 2022-02-25 11:02:03.986 ServerApp] Looking for jupyter_server_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:02:03.987 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:02:03.987 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:02:03.987 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:02:03.988 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
[I 2022-02-25 11:02:04.006 ServerApp] Serving notebooks from local directory: /home/jsirois/dev/pantsbuild/pants
[I 2022-02-25 11:02:04.006 ServerApp] Jupyter Server 1.13.5 is running at:
[I 2022-02-25 11:02:04.006 ServerApp] <http://localhost:9999/?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f>
[I 2022-02-25 11:02:04.006 ServerApp] or <http://127.0.0.1:9999/?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f>
[I 2022-02-25 11:02:04.006 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-02-25 11:02:04.008 ServerApp]
To access the server, open this file in a browser:
file:///home/jsirois/.local/share/jupyter/runtime/jpserver-327986-open.html
Or copy and paste one of these URLs:
<http://localhost:9999/?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f>
or <http://127.0.0.1:9999/?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f>
[D 2022-02-25 11:02:06.818 ServerApp] Accepting token-authenticated connection from 127.0.0.1
[D 2022-02-25 11:02:06.818 ServerApp] Using contents: services/contents
[D 2022-02-25 11:02:06.825 ServerApp] Path favicon.ico served from /home/jsirois/.pex/venvs/s/d8a26be2/venv/lib/python3.7/site-packages/jupyter_server/static/favicon.ico
[D 2022-02-25 11:02:06.826 ServerApp] Path style/bootstrap.min.css served from /home/jsirois/.pex/venvs/s/d8a26be2/venv/lib/python3.7/site-packages/jupyter_server/static/style/bootstrap.min.css
[D 2022-02-25 11:02:06.826 ServerApp] Path style/bootstrap-theme.min.css served from /home/jsirois/.pex/venvs/s/d8a26be2/venv/lib/python3.7/site-packages/jupyter_server/static/style/bootstrap-theme.min.css
[D 2022-02-25 11:02:06.826 ServerApp] Path style/index.css served from /home/jsirois/.pex/venvs/s/d8a26be2/venv/lib/python3.7/site-packages/jupyter_server/static/style/index.css
[D 2022-02-25 11:02:06.826 ServerApp] Path logo/logo.png served from /home/jsirois/.pex/venvs/s/d8a26be2/venv/lib/python3.7/site-packages/jupyter_server/static/logo/logo.png
[D 2022-02-25 11:02:06.827 ServerApp] 200 GET /?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f (127.0.0.1) 9.12ms
[D 2022-02-25 11:02:06.880 ServerApp] 200 GET /static/favicon.ico?v=50afa725b5de8b00030139d09b38620224d4e7dba47c07ef0e86d4643f30c9bfe6bb7e1a4a1c561aa32834480909a4b6fe7cd1e17f7159330b6b5914bf45a880 (127.0.0.1) 0.80ms
^C[I 2022-02-25 11:02:09.736 ServerApp] interrupted
Serving notebooks from local directory: /home/jsirois/dev/pantsbuild/pants
0 active kernels
Jupyter Server 1.13.5 is running at:
<http://localhost:9999/?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f>
or <http://127.0.0.1:9999/?token=e2f6dbd4bcb7368ad3e2999098e2e05295b128676eec061f>
Shutdown this Jupyter server (y/[n])? y
[C 2022-02-25 11:02:12.114 ServerApp] Shutdown confirmed
[I 2022-02-25 11:02:12.116 ServerApp] Shutting down 0 extensions
[I 2022-02-25 11:02:12.116 ServerApp] Shutting down 0 kernels
[I 2022-02-25 11:02:12.116 ServerApp] Shutting down 0 terminals
enough-analyst-54434
02/25/2022, 7:04 PM^jsirois@gill ~/dev/pantsbuild/pants (main) $ mv ~/.jupyter/jupyter_server_config.json ~/.jupyter/jupyter_server_config.json.disabled
^jsirois@gill ~/dev/pantsbuild/pants (main) $ ./dist/bin.pex server --log-level 10
[D 2022-02-25 11:03:54.422 ServerApp] Searching ['/home/jsirois/dev/pantsbuild/pants', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 11:03:54.422 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 11:03:54.422 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 11:03:54.422 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:03:54.422 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 11:03:54.422 ServerApp] Looking for jupyter_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:03:54.423 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 11:03:54.423 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 11:03:54.423 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:03:54.423 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
[D 2022-02-25 11:03:54.423 ServerApp] Looking for jupyter_server_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:03:54.424 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:03:54.424 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:03:54.424 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:03:54.425 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
[I 2022-02-25 11:03:54.434 ServerApp] Serving notebooks from local directory: /home/jsirois/dev/pantsbuild/pants
[I 2022-02-25 11:03:54.434 ServerApp] Jupyter Server 1.13.5 is running at:
[I 2022-02-25 11:03:54.434 ServerApp] <http://localhost:8888/?token=42a6b5140c45bb028374a0a102d319e62f1d5c8a32ae2efa>
[I 2022-02-25 11:03:54.434 ServerApp] or <http://127.0.0.1:8888/?token=42a6b5140c45bb028374a0a102d319e62f1d5c8a32ae2efa>
[I 2022-02-25 11:03:54.434 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2022-02-25 11:03:54.436 ServerApp]
To access the server, open this file in a browser:
file:///home/jsirois/.local/share/jupyter/runtime/jpserver-328389-open.html
Or copy and paste one of these URLs:
<http://localhost:8888/?token=42a6b5140c45bb028374a0a102d319e62f1d5c8a32ae2efa>
or <http://127.0.0.1:8888/?token=42a6b5140c45bb028374a0a102d319e62f1d5c8a32ae2efa>
enough-analyst-54434
02/25/2022, 7:04 PMenough-analyst-54434
02/25/2022, 7:05 PMenough-analyst-54434
02/25/2022, 7:07 PMIN NOTBOOK CONFIGURATION
?enough-analyst-54434
02/25/2022, 7:08 PMenough-analyst-54434
02/25/2022, 7:10 PM~/.jupyter/jupyter_server_config.json
is being read, but apparently IN NOTBOOK CONFIGURATION
is from a different config, resource, or python file.nice-florist-55958
02/25/2022, 7:16 PMnice-florist-55958
02/25/2022, 7:18 PMmain.py
for the pex_binary target:
import re
import sys
from jupyterlab.labapp import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
enough-analyst-54434
02/25/2022, 7:25 PMenough-analyst-54434
02/25/2022, 7:43 PM^jsirois@gill ~/dev/pantsbuild/pants (main) $ cat /home/jsirois/.jupyter/jupyter_server_config.json
{
"ServerApp": {
"password": "argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY",
"ip": "*",
"port": 9999
}
}
^jsirois@gill ~/dev/pantsbuild/pants (main) $ ./dist/bin.pex server --log-level 10
[D 2022-02-25 11:36:49.409 ServerApp] Searching ['/home/jsirois/dev/pantsbuild/pants', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 11:36:49.409 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 11:36:49.410 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:36:49.410 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
[D 2022-02-25 11:36:49.410 ServerApp] Loaded config file: /home/jsirois/.jupyter/jupyter_server_config.json
[D 2022-02-25 11:36:49.410 ServerApp] Looking for jupyter_server_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:36:49.411 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:36:49.411 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:36:49.411 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:36:49.411 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
[W 2022-02-25 11:36:49.420 ServerApp] WARNING: The Jupyter server is listening on all IP addresses and not using encryption. This is not recommended.
[I 2022-02-25 11:36:49.421 ServerApp] Serving notebooks from local directory: /home/jsirois/dev/pantsbuild/pants
[I 2022-02-25 11:36:49.421 ServerApp] Jupyter Server 1.13.5 is running at:
[I 2022-02-25 11:36:49.421 ServerApp] <http://gill:9999/>
[I 2022-02-25 11:36:49.421 ServerApp] or <http://127.0.0.1:9999/>
[I 2022-02-25 11:36:49.421 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
And py config:
^jsirois@gill ~/dev/pantsbuild/pants (main) $ cat ~/.jupyter/jupyter_server_config.py
print("Slartibartfast")
c.ServerApp.ip = '*'
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY'
c.ServerApp.port = 7777
^jsirois@gill ~/dev/pantsbuild/pants (main) $ ./dist/bin.pex server --log-level 10
[D 2022-02-25 11:41:49.972 ServerApp] Searching ['/home/jsirois/dev/pantsbuild/pants', '/home/jsirois/.jupyter', '/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-02-25 11:41:49.972 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2022-02-25 11:41:49.972 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_config in /home/jsirois/.jupyter
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_server_config in /home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_server_config in /home/jsirois/.jupyter
Slartibartfast
[D 2022-02-25 11:41:49.973 ServerApp] Loaded config file: /home/jsirois/.jupyter/jupyter_server_config.py
[D 2022-02-25 11:41:49.973 ServerApp] Looking for jupyter_server_config in /home/jsirois/dev/pantsbuild/pants
[D 2022-02-25 11:41:49.974 ServerApp] Paths used for configuration of jupyter_server_config:
/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:41:49.975 ServerApp] Paths used for configuration of jupyter_server_config:
/usr/local/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:41:49.975 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.pex/venvs/s/d8a26be2/venv/etc/jupyter/jupyter_server_config.json
[D 2022-02-25 11:41:49.975 ServerApp] Paths used for configuration of jupyter_server_config:
/home/jsirois/.jupyter/jupyter_server_config.json
[W 2022-02-25 11:41:49.983 ServerApp] WARNING: The Jupyter server is listening on all IP addresses and not using encryption. This is not recommended.
[I 2022-02-25 11:41:49.984 ServerApp] Serving notebooks from local directory: /home/jsirois/dev/pantsbuild/pants
[I 2022-02-25 11:41:49.984 ServerApp] Jupyter Server 1.13.5 is running at:
[I 2022-02-25 11:41:49.984 ServerApp] <http://gill:7777/>
[I 2022-02-25 11:41:49.984 ServerApp] or <http://127.0.0.1:7777/>
[I 2022-02-25 11:41:49.984 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Work for me via the Pants generated venv execution mode PEX.enough-analyst-54434
02/25/2022, 7:44 PMenough-analyst-54434
02/25/2022, 7:44 PMnice-florist-55958
02/25/2022, 8:22 PMnice-florist-55958
02/25/2022, 8:39 PMenough-analyst-54434
02/25/2022, 8:53 PM./pants
goal like run
or package
and there is a hang, then ~/.cache/pants/
is germaine. However, if you're running a PEX file directly, it's not. You're now no longer using Pants at all and it's the PEX cache you need to nuke ~/.pex
.enough-analyst-54434
02/25/2022, 8:55 PMPEX*
).nice-florist-55958
02/25/2022, 8:59 PMAs for comparing environment variables from PEX and Python, there is essentially no difference. The only differences are:
1. VIRTUAL_ENV is changed from the currently activated one to the PEX VENV
2. The /bin folder of the PEX VENV is inserted to the front of PATH
3. A variable "_" is added that is the name of the PEX file being executed
4. A variable "PEX" is added that is the fully expanded realpath of the PEX being executedThat's it. So my money is on Jupyter getting confused about the assets/virtual environment somewhere along its runpath, but you were able to succeed in spite of this, so I'm not really sure. I very sloppily bundled the resourced assets and directed Jupyter to them, so perhaps I need to look at that more closely, or just await the PEX bug fix.
enough-analyst-54434
02/25/2022, 9:00 PMnice-florist-55958
02/25/2022, 9:04 PMenough-analyst-54434
02/25/2022, 9:18 PMPEX_ROOT=/var/tmp ./my.pex
enough-analyst-54434
02/25/2022, 9:18 PMpex --help-variables
for more or https://pex.readthedocs.io/en/v2.1.67/api/vars.htmlnice-florist-55958
02/25/2022, 9:25 PM/var/tmp/.pex
. QQ, Pants isn't picking up on transitive dependency kerberos
from a direct dependency that imports it in its __init__.py
. I have [python-infer] inits = true
, so thought this should be easy? The package is in the constraints file Pants uses to resolve all third-party dependencies. Just asking if anything comes to mind, I'll directly import it for now.enough-analyst-54434
02/25/2022, 10:10 PMkerberos
package or module? Do you have a PyPI link?enough-analyst-54434
02/25/2022, 11:05 PMnice-florist-55958
02/26/2022, 12:11 AMnice-florist-55958
02/26/2022, 12:12 AMenough-analyst-54434
02/26/2022, 12:19 AMenough-analyst-54434
02/28/2022, 7:08 PMshare/
data files issue is fixed: https://github.com/pantsbuild/pex/pull/1632
I'll be getting out a Pex release today and upgrading Pants to it. Can you remind me of the Pants version you're using?enough-analyst-54434
03/04/2022, 4:11 PMnice-florist-55958
03/08/2022, 8:25 PMkerberos==1.3.0+krb1.16
even when specifying just kerberos==1.3.0
to pip.enough-analyst-54434
03/08/2022, 8:51 PM+
bit is interesting info, not sure if that's involved.
Re the Pant 2.10.x Pex fix for share/ data dirs in jupyter-server, that has caused a number of issues being worked here: https://github.com/pantsbuild/pex/issues/1656
You may need to wait a bit more.nice-florist-55958
03/08/2022, 11:03 PMnice-florist-55958
03/11/2022, 3:56 AMjupyter_lab_config.py, jupyter_notebook_config.py, jupyter_server_config.py)
and realized when running from PEX only lab/server configs were read, whereas running as jupyter lab
from the activatd venv, all three were read. Why that is the case, I don't know, and would be interesting to know why. But it turned out that my settings that tell Jupyter to make the server public were contained in jupyter_notebook_config.py
, so the PEX version, having not read that config, kept my server private. The state of Jupyter's configuration / app subsystem architecture is a bit of a mess (largely to maintain backwards compatibility) with quite a bit of redundancy and marshalling configuration fields in one config to the (now) correct config.enough-analyst-54434
03/11/2022, 10:24 PMenough-analyst-54434
03/11/2022, 10:44 PMSlartibartfast
lines with their provenance included:
$ pex jupyter-server jupyterlab -c jupyter -o jupyer-all-pex-2.1.70.pex --venv prepend
$ find ~/.jupyter -name "jupyter_*.py" | while read config; do echo $config && echo "---" && cat $config && echo; done
/home/jsirois/.jupyter/jupyter_lab_config.py
---
print(">>> [lab] Slartibartfast")
c.ServerApp.ip = '*'
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY'
c.ServerApp.port = 7777
/home/jsirois/.jupyter/jupyter_notebook_config.py
---
print("!!! [notebook] Slartibartfast")
c.ServerApp.ip = '*'
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY'
c.ServerApp.port = 7777
/home/jsirois/.jupyter/jupyter_server_config.py
---
print("@@@ [server] Slartibartfast")
c.ServerApp.ip = '*'
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY'
c.ServerApp.port = 7777
$ ./jupyer-all-pex-2.1.70.pex lab --show-config
@@@ [server] Slartibartfast
>>> [lab] Slartibartfast
[I 2022-03-11 14:41:24.013 ServerApp] jupyterlab | extension was successfully linked.
!!! [notebook] Slartibartfast
[I 2022-03-11 14:41:24.018 ServerApp] nbclassic | extension was successfully linked.
[I 2022-03-11 14:41:24.117 ServerApp] notebook_shim | extension was successfully linked.
[W 2022-03-11 14:41:24.127 ServerApp] WARNING: The Jupyter server is listening on all IP addresses and not using encryption. This is not recommended.
[I 2022-03-11 14:41:24.128 ServerApp] notebook_shim | extension was successfully loaded.
[I 2022-03-11 14:41:24.128 LabApp] JupyterLab extension loaded from /home/jsirois/.pex/venvs/s/3cf9d3d2/venv/lib/python3.10/site-packages/pex-ns-pkgs/1/jupyterlab
[I 2022-03-11 14:41:24.128 LabApp] JupyterLab application directory is /home/jsirois/.pex/venvs/311e4af492184589b9f254476178e38b6161fc86/0c2af63c3815d1d03077ee9c1f2cbc64e6c7925d/share/jupyter/lab
[I 2022-03-11 14:41:24.130 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-03-11 14:41:24.132 ServerApp] nbclassic | extension was successfully loaded.
Loaded config files:
/home/jsirois/.jupyter/jupyter_server_config.py
ServerApp
.default_url = '/lab'
.file_url_prefix = '/lab/tree'
.ip = '*'
.jpserver_extensions = <LazyConfigValue value={'jupyterlab': True, 'nbclassic': True, 'notebook_shim': True}>
.open_browser = True
.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY'
.port = 7777
$ ./jupyer-all-pex-2.1.70.pex notebook --show-config
!!! [notebook] Slartibartfast
>>> [lab] Slartibartfast
[W 2022-03-11 14:41:42.623 LabApp] 'show_config' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[W 2022-03-11 14:41:42.623 LabApp] 'show_config' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2022-03-11 14:41:42.627 LabApp] JupyterLab extension loaded from /home/jsirois/.pex/venvs/s/3cf9d3d2/venv/lib/python3.10/site-packages/pex-ns-pkgs/1/jupyterlab
[I 2022-03-11 14:41:42.627 LabApp] JupyterLab application directory is /home/jsirois/.pex/venvs/311e4af492184589b9f254476178e38b6161fc86/0c2af63c3815d1d03077ee9c1f2cbc64e6c7925d/share/jupyter/lab
Loaded config files:
/home/jsirois/.jupyter/jupyter_notebook_config.py
$ ./jupyer-all-pex-2.1.70.pex server --show-config
@@@ [server] Slartibartfast
>>> [lab] Slartibartfast
[I 2022-03-11 14:41:50.376 ServerApp] jupyterlab | extension was successfully linked.
!!! [notebook] Slartibartfast
[I 2022-03-11 14:41:50.381 ServerApp] nbclassic | extension was successfully linked.
[I 2022-03-11 14:41:50.476 ServerApp] notebook_shim | extension was successfully linked.
[W 2022-03-11 14:41:50.484 ServerApp] WARNING: The Jupyter server is listening on all IP addresses and not using encryption. This is not recommended.
[I 2022-03-11 14:41:50.485 ServerApp] notebook_shim | extension was successfully loaded.
[I 2022-03-11 14:41:50.486 LabApp] JupyterLab extension loaded from /home/jsirois/.pex/venvs/s/3cf9d3d2/venv/lib/python3.10/site-packages/pex-ns-pkgs/1/jupyterlab
[I 2022-03-11 14:41:50.486 LabApp] JupyterLab application directory is /home/jsirois/.pex/venvs/311e4af492184589b9f254476178e38b6161fc86/0c2af63c3815d1d03077ee9c1f2cbc64e6c7925d/share/jupyter/lab
[I 2022-03-11 14:41:50.488 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-03-11 14:41:50.490 ServerApp] nbclassic | extension was successfully loaded.
Loaded config files:
/home/jsirois/.jupyter/jupyter_server_config.py
ServerApp
.ip = '*'
.jpserver_extensions = <LazyConfigValue value={'jupyterlab': True, 'nbclassic': True, 'notebook_shim': True}>
.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$ZgZgGHSvS5mZNGdWTOkxYA$NWinn3fhdDUoAqif2DlDud4LjtKJFCqSivRK9HGV/aY'
.port = 7777
nice-florist-55958
03/26/2022, 6:38 PMenough-analyst-54434
03/26/2022, 7:57 PM