jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.77k stars 144 forks source link

Installing in a docker image #942

Open perllaghu opened 1 year ago

perllaghu commented 1 year ago

Description

Trying to install language servers into a dockerised notebook-server, and jupyterlab-lsp is not able to find the language server

no_typescript

For clarification, notebook servers are run in a cluster, and "home directories" are mounted from an external filestore - this means I cannot install libraries under $HOME, or assume any such files may exist.

Reproduce

My testing Dockerfile is:

FROM jupyter/minimal-notebook:python-3.9.13

ENV JUPYTER_RUNTIME_DIR=/tmp/.jupyter_runtime \
    JUPYTERLAB_ENABLED=true

RUN mamba install --quiet --yes \
  'jupyterlab-lsp' \
  'jedi-language-server' \
  'nodejs>=18.0' \
  &&  mamba clean --all -f -y

RUN jlpm add --modules-folder /opt/conda/lib/node_modules/ typescript-language-server
  1. Build & run the image (docker build -t test . & docker run -it --rm -p 8888:8888 docker.io/library/test)
    • note that Skipped non-installed server(s): .... in the logging includes typescript-language-server
  2. Create a new file, and rename to test.ts
  3. See the error from the Language Server in the footer of the notebook-server

Expected behavior

Having installed the language server, I would expect it to be accessible

Context

node --version ==> v18.15.0 jlpm info typescript-language-server | grep version ==> 3.3.2


<details><summary>Required: installed server extensions</summary>
<pre>
(base) jovyan@d9b0e2bc868b:~$ jupyter server extension list
Config dir: /home/jovyan/.jupyter

Config dir: /opt/conda/etc/jupyter
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.1.0 OK
    jupyter_server_fileid enabled
    - Validating jupyter_server_fileid...
      jupyter_server_fileid 0.9.0 OK
    jupyter_server_ydoc enabled
    - Validating jupyter_server_ydoc...
      jupyter_server_ydoc 0.8.0 OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.6.3 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic 0.4.5 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK

Config dir: /usr/local/etc/jupyter
</pre>
</details>

<details><summary>Required: installed lab extensions</summary>
<pre>
(base) jovyan@d9b0e2bc868b:~$ jupyter labextension list
JupyterLab v3.6.3
/opt/conda/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        @jupyter-lsp/jupyterlab-lsp v4.1.0 enabled OK (python, jupyterlab-lsp)
</pre>
</details>

<!--The more content you provide, the more we can help! Please fill in the below:-->

<details><summary>Troubleshoot Output</summary>
<pre>
(base) jovyan@d9b0e2bc868b:~$ jupyter troubleshoot
$PATH:
        /opt/conda/bin
        /opt/conda/condabin
        /opt/conda/bin
        /usr/local/sbin
        /usr/local/bin
        /usr/sbin
        /usr/bin
        /sbin
        /bin

sys.path:
        /opt/conda/bin
        /opt/conda/lib/python39.zip
        /opt/conda/lib/python3.9
        /opt/conda/lib/python3.9/lib-dynload
        /opt/conda/lib/python3.9/site-packages

sys.executable:
        /opt/conda/bin/python

sys.version:
        3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) 
        [GCC 10.3.0]

platform.platform():
        Linux-5.15.0-72-generic-x86_64-with-glibc2.35

which -a jupyter:
        /opt/conda/bin/jupyter
        /opt/conda/bin/jupyter

pip list:
        Package                       Version
        ----------------------------- -----------
        aiofiles                      22.1.0
        aiosqlite                     0.19.0
        alembic                       1.8.1
        anyio                         3.6.1
        argon2-cffi                   21.3.0
        argon2-cffi-bindings          21.2.0
        asttokens                     2.0.8
        async-generator               1.10
        attrs                         22.1.0
        Babel                         2.10.3
        backcall                      0.2.0
        backports.functools-lru-cache 1.6.4
        beautifulsoup4                4.11.1
        bleach                        5.0.1
        blinker                       1.5
        brotlipy                      0.7.0
        certifi                       2023.5.7
        certipy                       0.1.3
        cffi                          1.15.1
        charset-normalizer            2.1.1
        colorama                      0.4.5
        conda                         22.9.0
        conda-package-handling        1.9.0
        cryptography                  40.0.2
        debugpy                       1.6.3
        decorator                     5.1.1
        defusedxml                    0.7.1
        docstring-to-markdown         0.12
        entrypoints                   0.4
        executing                     1.1.1
        fastjsonschema                2.16.2
        flit_core                     3.7.1
        greenlet                      1.1.3
        idna                          3.4
        importlib-metadata            4.11.4
        importlib-resources           5.10.0
        ipykernel                     6.16.0
        ipython                       8.5.0
        ipython-genutils              0.2.0
        jedi                          0.18.0
        jedi-language-server          0.34.8
        Jinja2                        3.1.2
        json5                         0.9.5
        jsonschema                    4.17.3
        jupyter_client                7.3.5
        jupyter_core                  4.11.1
        jupyter-events                0.6.3
        jupyter-lsp                   2.1.0
        jupyter-server                1.23.4
        jupyter_server_fileid         0.9.0
        jupyter_server_ydoc           0.8.0
        jupyter-telemetry             0.1.0
        jupyter-ydoc                  0.2.3
        jupyterhub                    3.0.0
        jupyterlab                    3.6.3
        jupyterlab-lsp                4.1.0
        jupyterlab-pygments           0.2.2
        jupyterlab_server             2.22.1
        libmambapy                    1.4.2
        Mako                          1.2.3
        mamba                         1.4.2
        MarkupSafe                    2.1.1
        matplotlib-inline             0.1.6
        mistune                       2.0.4
        nbclassic                     0.4.5
        nbclient                      0.7.0
        nbconvert                     7.2.1
        nbformat                      5.6.1
        nest-asyncio                  1.5.6
        notebook                      6.4.12
        notebook-shim                 0.1.0
        oauthlib                      3.2.1
        packaging                     21.3
        pamela                        1.0.0
        pandocfilters                 1.5.0
        parso                         0.8.3
        pexpect                       4.8.0
        pickleshare                   0.7.5
        pip                           22.2.2
        pkgutil_resolve_name          1.3.10
        prometheus-client             0.14.1
        prompt-toolkit                3.0.31
        psutil                        5.9.2
        ptyprocess                    0.7.0
        pure-eval                     0.2.2
        pycosat                       0.6.3
        pycparser                     2.21
        pycurl                        7.45.1
        pydantic                      1.8.2
        pygls                         0.11.3
        Pygments                      2.13.0
        PyJWT                         2.5.0
        pyOpenSSL                     23.1.1
        pyparsing                     3.0.9
        pyrsistent                    0.18.1
        PySocks                       1.7.1
        python-dateutil               2.8.2
        python-json-logger            2.0.7
        pytz                          2022.4
        PyYAML                        6.0
        pyzmq                         24.0.1
        requests                      2.28.1
        rfc3339-validator             0.1.4
        rfc3986-validator             0.1.1
        ruamel.yaml                   0.17.21
        ruamel.yaml.clib              0.2.6
        ruamel-yaml-conda             0.15.80
        Send2Trash                    1.8.0
        setuptools                    65.4.1
        six                           1.16.0
        sniffio                       1.3.0
        soupsieve                     2.3.2.post1
        SQLAlchemy                    1.4.41
        stack-data                    0.5.1
        terminado                     0.16.0
        tinycss2                      1.1.1
        tomli                         2.0.1
        toolz                         0.12.0
        tornado                       6.2
        tqdm                          4.64.1
        traitlets                     5.4.0
        typeguard                     2.13.3
        typing_extensions             4.4.0
        urllib3                       1.26.11
        wcwidth                       0.2.5
        webencodings                  0.5.1
        websocket-client              1.4.1
        wheel                         0.37.1
        y-py                          0.5.9
        ypy-websocket                 0.8.2
        zipp                          3.9.0

conda list:
        # packages in environment at /opt/conda:
        #
        # Name                    Version                   Build  Channel
        _libgcc_mutex             0.1                 conda_forge    conda-forge
        _openmp_mutex             4.5                       2_gnu    conda-forge
        aiofiles                  22.1.0             pyhd8ed1ab_0    conda-forge
        aiosqlite                 0.19.0             pyhd8ed1ab_0    conda-forge
        alembic                   1.8.1              pyhd8ed1ab_0    conda-forge
        anyio                     3.6.1              pyhd8ed1ab_1    conda-forge
        argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
        argon2-cffi-bindings      21.2.0           py39hb9d737c_2    conda-forge
        asttokens                 2.0.8              pyhd8ed1ab_0    conda-forge
        async_generator           1.10                       py_0    conda-forge
        attrs                     22.1.0             pyh71513ae_1    conda-forge
        babel                     2.10.3             pyhd8ed1ab_0    conda-forge
        backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
        backports                 1.0                        py_2    conda-forge
        backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
        beautifulsoup4            4.11.1             pyha770c72_0    conda-forge
        bleach                    5.0.1              pyhd8ed1ab_0    conda-forge
        blinker                   1.5                pyhd8ed1ab_0    conda-forge
        brotlipy                  0.7.0           py39hb9d737c_1004    conda-forge
        bzip2                     1.0.8                h7f98852_4    conda-forge
        c-ares                    1.18.1               h7f98852_0    conda-forge
        ca-certificates           2023.5.7             hbcca054_0    conda-forge
        certifi                   2023.5.7           pyhd8ed1ab_0    conda-forge
        certipy                   0.1.3                      py_0    conda-forge
        cffi                      1.15.1           py39he91dace_0    conda-forge
        charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
        colorama                  0.4.5              pyhd8ed1ab_0    conda-forge
        conda                     22.9.0           py39hf3d152e_1    conda-forge
        conda-package-handling    1.9.0            py39hb9d737c_0    conda-forge
        configurable-http-proxy   4.5.4                he2f69ee_2    conda-forge
        cryptography              40.0.2           py39h079d5ae_0    conda-forge
        debugpy                   1.6.3            py39h5a03fae_0    conda-forge
        decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
        defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
        docstring-to-markdown     0.12               pyhd8ed1ab_0    conda-forge
        entrypoints               0.4                pyhd8ed1ab_0    conda-forge
        executing                 1.1.1              pyhd8ed1ab_0    conda-forge
        flit-core                 3.7.1              pyhd8ed1ab_0    conda-forge
        fmt                       9.1.0                h924138e_0    conda-forge
        greenlet                  1.1.3            py39h5a03fae_0    conda-forge
        icu                       72.1                 hcb278e6_0    conda-forge
        idna                      3.4                pyhd8ed1ab_0    conda-forge
        importlib-metadata        4.11.4           py39hf3d152e_0    conda-forge
        importlib_metadata        4.11.4               hd8ed1ab_0    conda-forge
        importlib_resources       5.10.0             pyhd8ed1ab_0    conda-forge
        ipykernel                 6.16.0             pyh210e3f2_0    conda-forge
        ipython                   8.5.0              pyh41d4057_1    conda-forge
        ipython_genutils          0.2.0                      py_1    conda-forge
        jedi                      0.18.0           py39hf3d152e_3    conda-forge
        jedi-language-server      0.34.8             pyhd8ed1ab_0    conda-forge
        jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
        json5                     0.9.5              pyh9f0ad1d_0    conda-forge
        jsonschema                4.17.3             pyhd8ed1ab_0    conda-forge
        jupyter-lsp               2.1.0              pyhd8ed1ab_0    conda-forge
        jupyter_client            7.3.5              pyhd8ed1ab_0    conda-forge
        jupyter_core              4.11.1           py39hf3d152e_0    conda-forge
        jupyter_events            0.6.3              pyhd8ed1ab_0    conda-forge
        jupyter_server            1.23.4             pyhd8ed1ab_0    conda-forge
        jupyter_server_fileid     0.9.0              pyhd8ed1ab_0    conda-forge
        jupyter_server_ydoc       0.8.0              pyhd8ed1ab_0    conda-forge
        jupyter_telemetry         0.1.0              pyhd8ed1ab_1    conda-forge
        jupyter_ydoc              0.2.3              pyhd8ed1ab_0    conda-forge
        jupyterhub                3.0.0              pyhd8ed1ab_0    conda-forge
        jupyterhub-base           3.0.0              pyhd8ed1ab_0    conda-forge
        jupyterlab                3.6.3              pyhd8ed1ab_0    conda-forge
        jupyterlab-lsp            4.1.0              pyhd8ed1ab_0    conda-forge
        jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
        jupyterlab_server         2.22.1             pyhd8ed1ab_0    conda-forge
        keyutils                  1.6.1                h166bdaf_0    conda-forge
        krb5                      1.20.1               h81ceb04_0    conda-forge
        ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
        libarchive                3.6.2                h039dbb9_1    conda-forge
        libcurl                   8.1.1                h409715c_0    conda-forge
        libedit                   3.1.20191231         he28a2e2_2    conda-forge
        libev                     4.33                 h516909a_1    conda-forge
        libffi                    3.4.2                h7f98852_5    conda-forge
        libgcc-ng                 12.1.0              h8d9b700_16    conda-forge
        libgomp                   12.1.0              h8d9b700_16    conda-forge
        libiconv                  1.17                 h166bdaf_0    conda-forge
        libmamba                  1.4.2                hcea66bb_0    conda-forge
        libmambapy                1.4.2            py39hf0aba66_0    conda-forge
        libnghttp2                1.52.0               h61bc06f_0    conda-forge
        libnsl                    2.0.0                h7f98852_0    conda-forge
        libsodium                 1.0.18               h36c2ea0_1    conda-forge
        libsolv                   0.7.23               h3eb15da_0    conda-forge
        libsqlite                 3.39.4               h753d276_0    conda-forge
        libssh2                   1.10.0               hf14f497_3    conda-forge
        libstdcxx-ng              12.1.0              ha89aaad_16    conda-forge
        libuuid                   2.32.1            h7f98852_1000    conda-forge
        libuv                     1.44.2               h166bdaf_0    conda-forge
        libxml2                   2.11.4               h0d562d8_0    conda-forge
        libzlib                   1.2.13               h166bdaf_4    conda-forge
        lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
        lzo                       2.10              h516909a_1000    conda-forge
        mako                      1.2.3              pyhd8ed1ab_0    conda-forge
        mamba                     1.4.2            py39hc5d2bb1_0    conda-forge
        markupsafe                2.1.1            py39hb9d737c_1    conda-forge
        matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
        mistune                   2.0.4              pyhd8ed1ab_0    conda-forge
        nbclassic                 0.4.5              pyhd8ed1ab_0    conda-forge
        nbclient                  0.7.0              pyhd8ed1ab_0    conda-forge
        nbconvert                 7.2.1              pyhd8ed1ab_0    conda-forge
        nbconvert-core            7.2.1              pyhd8ed1ab_0    conda-forge
        nbconvert-pandoc          7.2.1              pyhd8ed1ab_0    conda-forge
        nbformat                  5.6.1              pyhd8ed1ab_0    conda-forge
        ncurses                   6.3                  h27087fc_1    conda-forge
        nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
        nodejs                    18.15.0              h4abf6b9_1    conda-forge
        notebook                  6.4.12             pyha770c72_0    conda-forge
        notebook-shim             0.1.0              pyhd8ed1ab_0    conda-forge
        oauthlib                  3.2.1              pyhd8ed1ab_0    conda-forge
        openssl                   3.1.0                hd590300_3    conda-forge
        packaging                 21.3               pyhd8ed1ab_0    conda-forge
        pamela                    1.0.0                      py_0    conda-forge
        pandoc                    2.19.2               ha770c72_0    conda-forge
        pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
        parso                     0.8.3              pyhd8ed1ab_0    conda-forge
        pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
        pickleshare               0.7.5                   py_1003    conda-forge
        pip                       22.2.2             pyhd8ed1ab_0    conda-forge
        pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
        prometheus_client         0.14.1             pyhd8ed1ab_0    conda-forge
        prompt-toolkit            3.0.31             pyha770c72_0    conda-forge
        psutil                    5.9.2            py39hb9d737c_0    conda-forge
        ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
        pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
        pybind11-abi              4                    hd8ed1ab_3    conda-forge
        pycosat                   0.6.3           py39hb9d737c_1010    conda-forge
        pycparser                 2.21               pyhd8ed1ab_0    conda-forge
        pycurl                    7.45.1           py39h9297c8b_3    conda-forge
        pydantic                  1.8.2            py39h3811e60_2    conda-forge
        pygls                     0.11.3             pyhd8ed1ab_0    conda-forge
        pygments                  2.13.0             pyhd8ed1ab_0    conda-forge
        pyjwt                     2.5.0              pyhd8ed1ab_0    conda-forge
        pyopenssl                 23.1.1             pyhd8ed1ab_0    conda-forge
        pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
        pyrsistent                0.18.1           py39hb9d737c_1    conda-forge
        pysocks                   1.7.1              pyha2e5f31_6    conda-forge
        python                    3.9.13          h2660328_0_cpython    conda-forge
        python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
        python-fastjsonschema     2.16.2             pyhd8ed1ab_0    conda-forge
        python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
        python_abi                3.9                      2_cp39    conda-forge
        pytz                      2022.4             pyhd8ed1ab_0    conda-forge
        pyyaml                    6.0              py39hb9d737c_5    conda-forge
        pyzmq                     24.0.1           py39headdf64_0    conda-forge
        readline                  8.1.2                h0f457ee_0    conda-forge
        reproc                    14.2.3               h7f98852_0    conda-forge
        reproc-cpp                14.2.3               h9c3ff4c_0    conda-forge
        requests                  2.28.1             pyhd8ed1ab_1    conda-forge
        rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
        rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
        ruamel.yaml               0.17.21          py39hb9d737c_1    conda-forge
        ruamel.yaml.clib          0.2.6            py39hb9d737c_1    conda-forge
        ruamel_yaml               0.15.80         py39hb9d737c_1007    conda-forge
        send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
        setuptools                65.4.1             pyhd8ed1ab_0    conda-forge
        six                       1.16.0             pyh6c4a22f_0    conda-forge
        sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
        soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
        sqlalchemy                1.4.41           py39hb9d737c_0    conda-forge
        sqlite                    3.39.4               h4ff8645_0    conda-forge
        stack_data                0.5.1              pyhd8ed1ab_0    conda-forge
        terminado                 0.16.0             pyh41d4057_0    conda-forge
        tinycss2                  1.1.1              pyhd8ed1ab_0    conda-forge
        tk                        8.6.12               h27826a3_0    conda-forge
        tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
        toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
        tornado                   6.2              py39hb9d737c_0    conda-forge
        tqdm                      4.64.1             pyhd8ed1ab_0    conda-forge
        traitlets                 5.4.0              pyhd8ed1ab_0    conda-forge
        typeguard                 2.13.3             pyhd8ed1ab_0    conda-forge
        typing-extensions         4.4.0                hd8ed1ab_0    conda-forge
        typing_extensions         4.4.0              pyha770c72_0    conda-forge
        tzdata                    2022d                h191b570_0    conda-forge
        urllib3                   1.26.11            pyhd8ed1ab_0    conda-forge
        wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
        webencodings              0.5.1                      py_1    conda-forge
        websocket-client          1.4.1              pyhd8ed1ab_0    conda-forge
        wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
        xz                        5.2.6                h166bdaf_0    conda-forge
        y-py                      0.5.9            py39h50f1755_0    conda-forge
        yaml                      0.2.5                h7f98852_2    conda-forge
        yaml-cpp                  0.7.0                h27087fc_2    conda-forge
        ypy-websocket             0.8.2              pyhd8ed1ab_0    conda-forge
        zeromq                    4.3.4                h9c3ff4c_1    conda-forge
        zipp                      3.9.0              pyhd8ed1ab_0    conda-forge
        zlib                      1.2.13               h166bdaf_4    conda-forge
        zstd                      1.5.2                h6239696_4    conda-forge

conda env:
        name: base
        channels:
          - conda-forge
        dependencies:
          - _libgcc_mutex=0.1=conda_forge
          - _openmp_mutex=4.5=2_gnu
          - aiofiles=22.1.0=pyhd8ed1ab_0
          - aiosqlite=0.19.0=pyhd8ed1ab_0
          - alembic=1.8.1=pyhd8ed1ab_0
          - anyio=3.6.1=pyhd8ed1ab_1
          - argon2-cffi=21.3.0=pyhd8ed1ab_0
          - argon2-cffi-bindings=21.2.0=py39hb9d737c_2
          - asttokens=2.0.8=pyhd8ed1ab_0
          - async_generator=1.10=py_0
          - attrs=22.1.0=pyh71513ae_1
          - babel=2.10.3=pyhd8ed1ab_0
          - backcall=0.2.0=pyh9f0ad1d_0
          - backports=1.0=py_2
          - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
          - beautifulsoup4=4.11.1=pyha770c72_0
          - bleach=5.0.1=pyhd8ed1ab_0
          - blinker=1.5=pyhd8ed1ab_0
          - brotlipy=0.7.0=py39hb9d737c_1004
          - bzip2=1.0.8=h7f98852_4
          - c-ares=1.18.1=h7f98852_0
          - ca-certificates=2023.5.7=hbcca054_0
          - certifi=2023.5.7=pyhd8ed1ab_0
          - certipy=0.1.3=py_0
          - cffi=1.15.1=py39he91dace_0
          - charset-normalizer=2.1.1=pyhd8ed1ab_0
          - colorama=0.4.5=pyhd8ed1ab_0
          - conda=22.9.0=py39hf3d152e_1
          - conda-package-handling=1.9.0=py39hb9d737c_0
          - configurable-http-proxy=4.5.4=he2f69ee_2
          - cryptography=40.0.2=py39h079d5ae_0
          - debugpy=1.6.3=py39h5a03fae_0
          - decorator=5.1.1=pyhd8ed1ab_0
          - defusedxml=0.7.1=pyhd8ed1ab_0
          - docstring-to-markdown=0.12=pyhd8ed1ab_0
          - entrypoints=0.4=pyhd8ed1ab_0
          - executing=1.1.1=pyhd8ed1ab_0
          - flit-core=3.7.1=pyhd8ed1ab_0
          - fmt=9.1.0=h924138e_0
          - greenlet=1.1.3=py39h5a03fae_0
          - icu=72.1=hcb278e6_0
          - idna=3.4=pyhd8ed1ab_0
          - importlib-metadata=4.11.4=py39hf3d152e_0
          - importlib_metadata=4.11.4=hd8ed1ab_0
          - importlib_resources=5.10.0=pyhd8ed1ab_0
          - ipykernel=6.16.0=pyh210e3f2_0
          - ipython=8.5.0=pyh41d4057_1
          - ipython_genutils=0.2.0=py_1
          - jedi=0.18.0=py39hf3d152e_3
          - jedi-language-server=0.34.8=pyhd8ed1ab_0
          - jinja2=3.1.2=pyhd8ed1ab_1
          - json5=0.9.5=pyh9f0ad1d_0
          - jsonschema=4.17.3=pyhd8ed1ab_0
          - jupyter-lsp=2.1.0=pyhd8ed1ab_0
          - jupyter_client=7.3.5=pyhd8ed1ab_0
          - jupyter_core=4.11.1=py39hf3d152e_0
          - jupyter_events=0.6.3=pyhd8ed1ab_0
          - jupyter_server=1.23.4=pyhd8ed1ab_0
          - jupyter_server_fileid=0.9.0=pyhd8ed1ab_0
          - jupyter_server_ydoc=0.8.0=pyhd8ed1ab_0
          - jupyter_telemetry=0.1.0=pyhd8ed1ab_1
          - jupyter_ydoc=0.2.3=pyhd8ed1ab_0
          - jupyterhub=3.0.0=pyhd8ed1ab_0
          - jupyterhub-base=3.0.0=pyhd8ed1ab_0
          - jupyterlab=3.6.3=pyhd8ed1ab_0
          - jupyterlab-lsp=4.1.0=pyhd8ed1ab_0
          - jupyterlab_pygments=0.2.2=pyhd8ed1ab_0
          - jupyterlab_server=2.22.1=pyhd8ed1ab_0
          - keyutils=1.6.1=h166bdaf_0
          - krb5=1.20.1=h81ceb04_0
          - ld_impl_linux-64=2.36.1=hea4e1c9_2
          - libarchive=3.6.2=h039dbb9_1
          - libcurl=8.1.1=h409715c_0
          - libedit=3.1.20191231=he28a2e2_2
          - libev=4.33=h516909a_1
          - libffi=3.4.2=h7f98852_5
          - libgcc-ng=12.1.0=h8d9b700_16
          - libgomp=12.1.0=h8d9b700_16
          - libiconv=1.17=h166bdaf_0
          - libmamba=1.4.2=hcea66bb_0
          - libmambapy=1.4.2=py39hf0aba66_0
          - libnghttp2=1.52.0=h61bc06f_0
          - libnsl=2.0.0=h7f98852_0
          - libsodium=1.0.18=h36c2ea0_1
          - libsolv=0.7.23=h3eb15da_0
          - libsqlite=3.39.4=h753d276_0
          - libssh2=1.10.0=hf14f497_3
          - libstdcxx-ng=12.1.0=ha89aaad_16
          - libuuid=2.32.1=h7f98852_1000
          - libuv=1.44.2=h166bdaf_0
          - libxml2=2.11.4=h0d562d8_0
          - libzlib=1.2.13=h166bdaf_4
          - lz4-c=1.9.3=h9c3ff4c_1
          - lzo=2.10=h516909a_1000
          - mako=1.2.3=pyhd8ed1ab_0
          - mamba=1.4.2=py39hc5d2bb1_0
          - markupsafe=2.1.1=py39hb9d737c_1
          - matplotlib-inline=0.1.6=pyhd8ed1ab_0
          - mistune=2.0.4=pyhd8ed1ab_0
          - nbclassic=0.4.5=pyhd8ed1ab_0
          - nbclient=0.7.0=pyhd8ed1ab_0
          - nbconvert=7.2.1=pyhd8ed1ab_0
          - nbconvert-core=7.2.1=pyhd8ed1ab_0
          - nbconvert-pandoc=7.2.1=pyhd8ed1ab_0
          - nbformat=5.6.1=pyhd8ed1ab_0
          - ncurses=6.3=h27087fc_1
          - nest-asyncio=1.5.6=pyhd8ed1ab_0
          - nodejs=18.15.0=h4abf6b9_1
          - notebook=6.4.12=pyha770c72_0
          - notebook-shim=0.1.0=pyhd8ed1ab_0
          - oauthlib=3.2.1=pyhd8ed1ab_0
          - openssl=3.1.0=hd590300_3
          - packaging=21.3=pyhd8ed1ab_0
          - pamela=1.0.0=py_0
          - pandoc=2.19.2=ha770c72_0
          - pandocfilters=1.5.0=pyhd8ed1ab_0
          - parso=0.8.3=pyhd8ed1ab_0
          - pexpect=4.8.0=pyh9f0ad1d_2
          - pickleshare=0.7.5=py_1003
          - pip=22.2.2=pyhd8ed1ab_0
          - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
          - prometheus_client=0.14.1=pyhd8ed1ab_0
          - prompt-toolkit=3.0.31=pyha770c72_0
          - psutil=5.9.2=py39hb9d737c_0
          - ptyprocess=0.7.0=pyhd3deb0d_0
          - pure_eval=0.2.2=pyhd8ed1ab_0
          - pybind11-abi=4=hd8ed1ab_3
          - pycosat=0.6.3=py39hb9d737c_1010
          - pycparser=2.21=pyhd8ed1ab_0
          - pycurl=7.45.1=py39h9297c8b_3
          - pydantic=1.8.2=py39h3811e60_2
          - pygls=0.11.3=pyhd8ed1ab_0
          - pygments=2.13.0=pyhd8ed1ab_0
          - pyjwt=2.5.0=pyhd8ed1ab_0
          - pyopenssl=23.1.1=pyhd8ed1ab_0
          - pyparsing=3.0.9=pyhd8ed1ab_0
          - pyrsistent=0.18.1=py39hb9d737c_1
          - pysocks=1.7.1=pyha2e5f31_6
          - python=3.9.13=h2660328_0_cpython
          - python-dateutil=2.8.2=pyhd8ed1ab_0
          - python-fastjsonschema=2.16.2=pyhd8ed1ab_0
          - python-json-logger=2.0.7=pyhd8ed1ab_0
          - python_abi=3.9=2_cp39
          - pytz=2022.4=pyhd8ed1ab_0
          - pyyaml=6.0=py39hb9d737c_5
          - pyzmq=24.0.1=py39headdf64_0
          - readline=8.1.2=h0f457ee_0
          - reproc=14.2.3=h7f98852_0
          - reproc-cpp=14.2.3=h9c3ff4c_0
          - requests=2.28.1=pyhd8ed1ab_1
          - rfc3339-validator=0.1.4=pyhd8ed1ab_0
          - rfc3986-validator=0.1.1=pyh9f0ad1d_0
          - ruamel.yaml=0.17.21=py39hb9d737c_1
          - ruamel.yaml.clib=0.2.6=py39hb9d737c_1
          - ruamel_yaml=0.15.80=py39hb9d737c_1007
          - send2trash=1.8.0=pyhd8ed1ab_0
          - setuptools=65.4.1=pyhd8ed1ab_0
          - six=1.16.0=pyh6c4a22f_0
          - sniffio=1.3.0=pyhd8ed1ab_0
          - soupsieve=2.3.2.post1=pyhd8ed1ab_0
          - sqlalchemy=1.4.41=py39hb9d737c_0
          - sqlite=3.39.4=h4ff8645_0
          - stack_data=0.5.1=pyhd8ed1ab_0
          - terminado=0.16.0=pyh41d4057_0
          - tinycss2=1.1.1=pyhd8ed1ab_0
          - tk=8.6.12=h27826a3_0
          - tomli=2.0.1=pyhd8ed1ab_0
          - toolz=0.12.0=pyhd8ed1ab_0
          - tornado=6.2=py39hb9d737c_0
          - tqdm=4.64.1=pyhd8ed1ab_0
          - traitlets=5.4.0=pyhd8ed1ab_0
          - typeguard=2.13.3=pyhd8ed1ab_0
          - typing-extensions=4.4.0=hd8ed1ab_0
          - typing_extensions=4.4.0=pyha770c72_0
          - tzdata=2022d=h191b570_0
          - urllib3=1.26.11=pyhd8ed1ab_0
          - wcwidth=0.2.5=pyh9f0ad1d_2
          - webencodings=0.5.1=py_1
          - websocket-client=1.4.1=pyhd8ed1ab_0
          - wheel=0.37.1=pyhd8ed1ab_0
          - xz=5.2.6=h166bdaf_0
          - y-py=0.5.9=py39h50f1755_0
          - yaml=0.2.5=h7f98852_2
          - yaml-cpp=0.7.0=h27087fc_2
          - ypy-websocket=0.8.2=pyhd8ed1ab_0
          - zeromq=4.3.4=h9c3ff4c_1
          - zipp=3.9.0=pyhd8ed1ab_0
          - zlib=1.2.13=h166bdaf_4
          - zstd=1.5.2=h6239696_4
        prefix: /opt/conda
(base) jovyan@d9b0e2bc868b:~$ 
</pre>
</details>

<details><summary>Command Line Output</summary>
(Started as a docker server)
<pre>
❯ docker run -it --rm -p 8888:8888 docker.io/library/test
Entered start.sh with args: jupyter lab
Executing the command: jupyter lab
[I 2023-05-30 10:37:39.635 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-05-30 10:37:39.640 ServerApp] jupyter_server_fileid | extension was successfully linked.
[I 2023-05-30 10:37:39.644 ServerApp] jupyter_server_ydoc | extension was successfully linked.
[I 2023-05-30 10:37:39.652 ServerApp] jupyterlab | extension was successfully linked.
[W 2023-05-30 10:37:39.655 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 2023-05-30 10:37:39.655 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-05-30 10:37:39.655 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2023-05-30 10:37:39.659 ServerApp] nbclassic | extension was successfully linked.
[I 2023-05-30 10:37:39.660 ServerApp] Writing Jupyter server cookie secret to /tmp/.jupyter_runtime/jupyter_cookie_secret
[I 2023-05-30 10:37:39.791 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-05-30 10:37:39.805 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-05-30 10:37:39.806 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-05-30 10:37:39.807 FileIdExtension] Configured File ID manager: ArbitraryFileIdManager
[I 2023-05-30 10:37:39.807 FileIdExtension] ArbitraryFileIdManager : Configured root dir: /home/jovyan
[I 2023-05-30 10:37:39.807 FileIdExtension] ArbitraryFileIdManager : Configured database path: /home/jovyan/.local/share/jupyter/file_id_manager.db
[I 2023-05-30 10:37:39.807 FileIdExtension] ArbitraryFileIdManager : Successfully connected to database file.
[I 2023-05-30 10:37:39.807 FileIdExtension] ArbitraryFileIdManager : Creating File ID tables and indices with journal_mode = DELETE
[I 2023-05-30 10:37:39.839 ServerApp] jupyter_server_fileid | extension was successfully loaded.
[I 2023-05-30 10:37:39.841 ServerApp] jupyter_server_ydoc | extension was successfully loaded.
[I 2023-05-30 10:37:39.843 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.9/site-packages/jupyterlab
[I 2023-05-30 10:37:39.843 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 2023-05-30 10:37:39.846 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-05-30 10:37:39.849 ServerApp] nbclassic | extension was successfully loaded.
[I 2023-05-30 10:37:39.849 ServerApp] Serving notebooks from local directory: /home/jovyan
[I 2023-05-30 10:37:39.849 ServerApp] Jupyter Server 1.23.4 is running at:
[I 2023-05-30 10:37:39.849 ServerApp] http://d9b0e2bc868b:8888/lab?token=aac514859066c908c1fddc4aaf610726e9364c90037143ec
[I 2023-05-30 10:37:39.849 ServerApp]  or http://127.0.0.1:8888/lab?token=aac514859066c908c1fddc4aaf610726e9364c90037143ec
[I 2023-05-30 10:37:39.849 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-05-30 10:37:39.851 ServerApp] 

    To access the server, open this file in a browser:
        file:///tmp/.jupyter_runtime/jpserver-7-open.html
    Or copy and paste one of these URLs:
        http://d9b0e2bc868b:8888/lab?token=aac514859066c908c1fddc4aaf610726e9364c90037143ec
     or http://127.0.0.1:8888/lab?token=aac514859066c908c1fddc4aaf610726e9364c90037143ec
[I 2023-05-30 10:37:39.863 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[W 2023-05-30 10:37:49.354 ServerApp] 404 GET /api/me?1685443069300 (172.17.0.1) 10.85ms referer=http://127.0.0.1:8888/lab
[I 2023-05-30 10:37:51.047 LabApp] Build is up to date
[I 2023-05-30 10:37:54.952 ServerApp] Creating new file in 
[I 2023-05-30 10:38:07.194 ServerApp] Saving file at /untitled.txt
[I 2023-05-30 10:39:52.986 ServerApp] New terminal with automatic name: 1

</pre>
</details>
perllaghu commented 1 year ago

OK, getting there.....

  1. I needed to install using npm install -g typescript-language-server
  2. I needed to put a config file in a config dir

In this case, I created a file called typescript-language-server-implimentation.json, and put it in typescript-language-server-implimentation.json. The contents of that file are:

{
  "LanguageServerManager": {
    "language_servers": {
      "typescript-language-server-implimentation": {
        "version": 2,
        "argv": ["/opt/conda/bin/typescript-language-server", "--stdio"],
        "languages": ["typescript", "javascript"],
        "mime_types": ["text/typescript", "text/x-typescript", "text/javascript", "text/x-javascript"],
        "display_name": "Typescript/Javascript server"
      }
    }
  }
}

With a .ts file loaded, the footer menu is saying ... initializing, however the list shows it Connected. Whilst I'm getting tab-completion, I'm not getting any of the hinting or auto-completion that I get from the python-lsp-server

Winnus commented 1 year ago

Do you need to use the jupyter/minimal-notebook:python-3.9.13 ?

For me it worked by using the standart ferdora image, then creating a virtual environment and within that install all jupyterlab and lsp as well as the language server.

Heres the example:

FROM docker.io/library/fedora:latest

# ------------------------------
# install os libs
# ------------------------------
RUN dnf update -y && \
    dnf install -y python3-pip python3-virtualenv wget python3.8 htop && \
    dnf clean all

# ------------------------------
# add and use jupyter user
# also switch workdir
# ------------------------------
RUN useradd -ms /bin/bash juppy
USER juppy
WORKDIR /home/juppy
# make dir where host files can appear
RUN mkdir hostshared

# ------------------------------
# install jupyterlab and extensions
# ------------------------------
RUN virtualenv venv_juppy && \
    source venv_juppy/bin/activate && \
    pip install 'jupyterlab>=3.0.0,<4.0.0a0' jupyterlab-lsp && \
    pip install 'python-lsp-server[all]' && \
    pip install jupyterlab-code-formatter black isort && \
    pip cache purge && \
    deactivate && \
    ln -s / .lsp_symlink

# ------------------------------
# install different venvs
# and have them as kernels in the lab
# ------------------------------
# Evolution venv
RUN virtualenv venv_evolution && \
    source venv_evolution/bin/activate && \
    pip install --upgrade pip && \
    pip install numpy matplotlib && \
    pip install ipykernel && \
    python -m ipykernel install --user --name venv_evolution && \
    pip cache purge

# ------------------------------
# Final run cmd
# ------------------------------
# generate runscript
RUN echo "source venv_juppy/bin/activate && jupyter-lab --ContentsManager.allow_hidden=True --no-browser --ip 0.0.0.0 --port 8080" > juppy.sh
RUN chmod +x juppy.sh
CMD ["/home/juppy/juppy.sh"]

I then compile and run the container with podman, but docker should be like

docker build --no-cache -t juppy:latest -f juppy.dockerfile .
docker run -p 8080:8080  -v "${PWD_TO_BE_SHARED}":/home/juppy/hostshared:Z -i -t juppy bash