https://pantsbuild.org/ logo
#general
Title
# general
n

nice-florist-55958

02/25/2022, 2:26 PM
Specific use case question. I want to package a PEX binary whos' entry point is a Jupyter server (thinking of the attendant notebooks as resources). I gave it an initial whirl and got it to mostly work, but for whatever reason, when ran from the PEX it does not pick up the configurations in the user's ~/.jupyter, and therefore the resulting server is always private (according to Jupyter's documentation, to expose a non-localhost entry point, you need to specify that in your configuration). When running w/ debug messages, it does state it's checking that location for configurations, which is strange. It also seems that Jupyter does not expose a CLI option to directly override the configuration location (which would be nice so it could just be bundled w/ the binary). I'm sure there are minor details I'm missing and will post more information / logs here later -- but I just wanted to reach out now in case this use case has already been addressed before and the best practices to follow perhaps documented.
e

enough-analyst-54434

02/25/2022, 2:32 PM
What
execution_mode
do you have set for your
pex_binary
?: https://www.pantsbuild.org/docs/reference-pex_binary#codeexecution_modecode
n

nice-florist-55958

02/25/2022, 2:36 PM
Whatever the default is, which looks like
zipapp
e

enough-analyst-54434

02/25/2022, 2:50 PM
Ok. You might try
venv
then.
Works for me in venv mode:
Copy code
$ 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.
Does not work in default (zipapp) mode:
Copy code
$ 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.
n

nice-florist-55958

02/25/2022, 3:29 PM
Got it. I suppose this is a lot to do with everything Jupyter needs to do to install itself (building assets and what not). "This mode also benefits from a traditional virtual environment 
sys.path
, giving maximum compatibility with stdlib and third party APIs."
Just curious, how long was your launch time in venv mode? Seems to take quite awhile -- is it using pip to download/install packages? Thought these would already be inside the PEX?
e

enough-analyst-54434

02/25/2022, 3:45 PM
No pip. Its just unpacking the distributions from inside the PEX zip and laying them out on the filesystem in the venv.
This is why the default is zipapp, its faster cold start.
The venv though is faster after this 1st run since it won't have to unpack and .pycs compile on 1st run, etc.
These results are for my 2 PEXes above - i.e. with just a
jupyter-server
transitive dependency set:
Copy code
$ 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'
So venv is slower cold start as advertised. But non-cold start: venv wins
Copy code
$ 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'
If you intend to use the PEX long term, you can shave off ~50ms more over venv by hand-installing the venv as outlined here: https://pex.readthedocs.io/en/v2.1.67/recipes.html#pex-app-in-a-container The 50ms comes from the initial execution - which is in the PEX zip
__main__.py
where the fact the venv PEX is already unpacked is determined and that already unpacked venv `exec`'d into.
Python is slow!
n

nice-florist-55958

02/25/2022, 4:01 PM
I traced the issue to packaging a first-party dependency. Strange it was working just fine a few days ago, and now suddenly it causes execution of this PEX to hang indefinitely (both venv and zipapp modes). When I ctrl+c the keyboard interrupt is at
.bootstrap/pex/common.py
line 461. I'll remove it for now just to make sure the Jupyter app works in venv mode.
e

enough-analyst-54434

02/25/2022, 4:02 PM
461 or 460?: https://github.com/pantsbuild/pex/blob/f931befd5ed96d343f2182f34c403bc8bfb188fe/pex/common.py#L457-L461 460 is what I expect with the NFS/NLM hypothesis from yesterday.
This NFS thing is going to be tough. I think I'll need to set up NFS in a docker-compose setup to get a repro and figure out how to do locking and still work with NFS.
Ah, yeah, 461. There was a 1-line change in that file due to mypy fixes in other functions 11 days ago (by me - forgetful).
Any info / lore you can get from your OPs folks about your NFS/NLM setup and
fcntl
byte range locks, which this uses under the hood via Python's
fcntl.lockf
, would be useful.
n

nice-florist-55958

02/25/2022, 5:24 PM
Indeed, will bring this up too. How can I resolve it in the meantime? Do I need to nuke ~/.pex or ~/.cache/pex? And I am not having success running w/ venv mode -- getting same problem w/ zipapp. Below are the verbose messages running from the built PEX and running main.py directly in the activated virtual environment. It looks like Jupyter is not even attempting to locate or ap_ply `jupyter_notebook_config`_ in the PEX case. And sorry, I know this is starting to err on the side of Jupyter-specific support...I just don't know if they'd be helpful without more information about what the execution environment is w/ PEX. Another strange issue is that it does not locate the application assets in the share folder of the venv PEX lays out like it does in my local installed virtual environment. That is relatively easy to fix by bundling those assets as a resource w/ the PEX, but it should not be necessary in the first place if PEX is properly laying out the virtual environment...
[[ Run from activated venv directly ]]
Copy code
(.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 ]]
Copy code
(.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 ]]
Copy code
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'
)
Here is the venv is is laying out. No share folder. Isn't that created automatically by the usual setuptools install of jupyter? Or is PEX doing its own custom install logic that's skipping this build step Jupyter kindly asks us to do:
Copy code
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
(The venv)
e

enough-analyst-54434

02/25/2022, 5:44 PM
Ah, great. Lots of details I needed there. Expect a Pex issue link soon. The share/ dir in a venv is something I've never seen before.
Oh, sorry - right share is your code.
@nice-florist-55958 what type of target is
./src:assets
?
Ah, sorry - read more. You acknowledge you can solve this using a
resources
target IIUC but you're wondering why that is needed at all?
Basically, the PEX needs to contain all your necessary files, resources, code and 3rdparty deps. For a reason I still don't understand, Pants (not Pex), refuses to package
files
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[…]24
Sorry for the piecemeal answers! So share/ is not part of jupyter-server at all.
Copy code
^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
Aha - at the root of the venv:
Copy code
(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.
n

nice-florist-55958

02/25/2022, 6:29 PM
Right, it creates a share folder in the venv you install it into where it dumps all of its non-Python stuff (js, css, etc.). Right now I have to copy all of it to my project's folder and bundle as a resource and then override the default paths Jupyter looks in. Though would be nice to get rid of this requirement as it's a lot of extra baggage for a small project), it's not really a problem at the moment because the bigger issue is still why Jupyter refuses to search for the notebook configuration even though it is clearly aware of the $HOME directory and ~/.jupyter when it searches for other configs.
e

enough-analyst-54434

02/25/2022, 6:32 PM
Alright - I'm sorry you keep hitting all these issues Taylor, but thank you for a great one. I fully understand what's going on now here and it's documented: https://github.com/pantsbuild/pex/issues/1630 I'll get that fixed and released in a Pex 2.1.68 today.
n

nice-florist-55958

02/25/2022, 6:36 PM
That's awesome, and n/w, just glad you're all around to help!! In your original test, you used pex directly it looks like, so do you have the same success when you package the target
pex_binary(..., execution_mode='venv')
and then run the pex file standalone?
e

enough-analyst-54434

02/25/2022, 6:37 PM
I have not tried via Pants.
There shouldn't be a difference though. I get this when I run like you but using Pex directly. As before:
Copy code
^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:
Copy code
^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
The lines from
Accepting 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.
Or if I open one of the URLs instead. All three work.
n

nice-florist-55958

02/25/2022, 6:46 PM
You're getting the same result I am. You don't notice the error because you have access to localhost and I don't 🙂
Copy code
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>
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.
Notice the difference in the links it subsequently gives me:
Copy code
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>
Versus:
Copy code
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>
The key difference is
<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).
e

enough-analyst-54434

02/25/2022, 7:03 PM
Works for me, note 9999 port and not default 8k series:
Copy code
^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
And to prove that out a bit more:
Copy code
^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>
So back to 8888.
Re-reading your stuff. I'm apparently missing a subtlety you pointed out...
Ok, @nice-florist-55958 you'll have to forgive my jupyter ignorance. Where exactly is the config file that prints
IN NOTBOOK CONFIGURATION
?
What's the relative path from your normal venv root directory and what contents can I use to emulate?
My experiment just above proves
~/.jupyter/jupyter_server_config.json
is being read, but apparently
IN NOTBOOK CONFIGURATION
is from a different config, resource, or python file.
n

nice-florist-55958

02/25/2022, 7:16 PM
Sorry, I wish I could be more helpful, just pressed for time at the moment, but the information is here: https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html. Basically follow the directions to create a configuration and edit the fields it describes to expose it publicly. Then we should be able to confirm if it's an infra issue on our side or a more general problem with Jupyter being packaged by Pex. I'll come back with explicit details later today when I get a chance if you don't want to read that!
And just for explicitness, this is my
main.py
for the pex_binary target:
Copy code
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())
e

enough-analyst-54434

02/25/2022, 7:25 PM
Ah perfect, that link is what I need.
Both json config:
Copy code
^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:
Copy code
^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.
N.B.: The designer of fjords makes his appearance in the second example; so the .py is definitely read!
Unless the mice truly are running their experiment and messing with me.
n

nice-florist-55958

02/25/2022, 8:22 PM
Ok good to know. This might be more NFS / env scrubbing / kerberos / etc. issues, but that strikes me as even less likely here than in previous scenarios we've looked at. I'm going to do a very simple test next and package a file that requires a kerberized connection to a database and see if it works. I'll also print the full set of environment variables running main.py directly and from the PEX, and see if there are any obvious differences.
@enough-analyst-54434 Do you have a suggestion on how I can deal with the lock condition? I tried nuking ~/.cache/pants but still hanging trying to run a PEX w/ a first-party dependency. Or can this never work? I had thought before in my testing I used first-party dependencies just fine, but maybe I just never did...
e

enough-analyst-54434

02/25/2022, 8:53 PM
If you're executing a
./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
.
And that speaks to your former as well. Pants scrubs env vars while it's running goals. Pex does not scrub your env vars ever (it does scrub its own
PEX*
).
n

nice-florist-55958

02/25/2022, 8:59 PM
As 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 executed
That'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.
e

enough-analyst-54434

02/25/2022, 9:00 PM
Yeah, there have been a myriad of problems here - all still unexplained save for: + Pex bug with share/ + LMDB definitely doesn't work over NFS
n

nice-florist-55958

02/25/2022, 9:04 PM
Yah, even after I remove ~/.pex, still locking. That's harsh 😞 Which option do I need to set to have ~/.pex be in /var/tmp?
e

enough-analyst-54434

02/25/2022, 9:18 PM
PEX_ROOT=/var/tmp ./my.pex
n

nice-florist-55958

02/25/2022, 9:25 PM
Ok, seems to be working now by moving to
/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.
e

enough-analyst-54434

02/25/2022, 10:10 PM
What distribution provides the
kerberos
package or module? Do you have a PyPI link?
I'm guess this: https://pypi.org/project/kerberos/ and that should map fine on its own. I think we still have a few mystery cases like this where the module mapping needs to be explicitly set despite the fact it shouldn't. See, for example here where an identity mapping for requests was needed: https://pantsbuild.slack.com/archives/C046T6T9U/p1642809295222900
n

nice-florist-55958

02/26/2022, 12:11 AM
Mapping was the first thing I checked and is 1:1 to exposed module.
But let me double check that for sure when I get a chance!
e

enough-analyst-54434

02/26/2022, 12:19 AM
Ok. But in case my point wasn't clear: we've seen 1:1 need a mapping anyhow sometimes for so far unexplained reasons.
Alright @nice-florist-55958 the
share/
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?
Alright - it took a while to work out a few follow-on issues, but the Pex fix for jupyter-server data files is in on main (2.11.x) and I have it being cherry-picked to 2.10.x here: https://github.com/pantsbuild/pants/pull/14703 and to 2.9.x here: https://github.com/pantsbuild/pants/pull/14704. All three should be getting releases ~today.
n

nice-florist-55958

03/08/2022, 8:25 PM
Thanks John! Will try it out. By the way, the kerberos dependency was not fixed by declaring the identity module mapping; only expressly declaring the dependency seems to work. The only thing I think of is maybe the oddity that the real version is
kerberos==1.3.0+krb1.16
even when specifying just
kerberos==1.3.0
to pip.
e

enough-analyst-54434

03/08/2022, 8:51 PM
Hrm, the
+
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.
n

nice-florist-55958

03/08/2022, 11:03 PM
Thanks for the heads up. Will keep an eye on the issue progress.
@enough-analyst-54434 Just wanted to let you know that I was able to get PEX'd Jupyter Lab working. The key insight came from when I added giant print statements in the various Jupyter configuration files (
jupyter_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.
e

enough-analyst-54434

03/11/2022, 10:24 PM
Hmm, ok. I've been heads down on https://github.com/pantsbuild/pex/pull/1661 which should be the final fixup related to the data files stuff. Let me use that and check this 3rd config type you've pointed out.
Ok @nice-florist-55958, afaict this all works with existing (2.1.70) Pex. There is alot of output here, but let me know what's off, it looks like the appropriate configs are loaded in each context, just look for the
Slartibartfast
lines with their provenance included:
Copy code
$ 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
n

nice-florist-55958

03/26/2022, 6:38 PM
@enough-analyst-54434 Quick update - upgraded to latest version of Pants v2.10.0 w/ Pex v2.1.71 and can confirm the above fixes are working for us now. And we have not had issues with repurposing other application libraries such as Airflow in this manner.
e

enough-analyst-54434

03/26/2022, 7:57 PM
Excellent.
10 Views