databricks / containers

Sample base images for Databricks Container Services
Apache License 2.0
165 stars 116 forks source link

install the lsp environment in DCS #189

Closed smacke closed 5 months ago

smacke commented 5 months ago

In this PR, add the lsp virtual environment to DCS, so that users of databricks container services can benefit from Python LSP functionality, including features like go to definition, lsp-powered completions, ruff linting, as well as planned features like "rename variable". Also, it makes the DCS base environment closer to the DBR environment. The base environment only needs one additional (small) library (python-lsp-jsonrpc) since LSP runs in its own virtual environment now, so this shouldn't mess with any user configuration.

Test plan: built the docker image using the changes in this PR (though I had to use the 14.3-LTS tag instead of the experimental tag to get it to build, even without the changes in this PR) and uploaded to dockerhub

Then I started a 14.3 LTS cluster using that image via the "Docker" tab of advanced options in the cluster config UI:

image

Verified that I can use all the Python LSP features!

https://github.com/databricks/containers/assets/325653/c477fd4d-9faf-4847-b29c-4a43bb9e99b2