Skip to content

Commit

Permalink
fix: support lsp in docker (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Mar 27, 2024
1 parent 18caa8d commit 52fb30d
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 8 deletions.
7 changes: 7 additions & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ RUN pip install /dist/pyprojects/secretnote/dist/*.whl

WORKDIR /root

RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash -
RUN yum install -y nodejs
RUN npm install @difizen/libro-analyzer

COPY ./docker/app/root/scripts /root/scripts
COPY ./docker/app/root/.jupyter /root/.jupyter

RUN mkdir workspace

ENV SELF_PARTY=alice
ENV ALL_PARTIES=alice
Expand Down
45 changes: 45 additions & 0 deletions docker/app/root/.jupyter/jupyter_server_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from traitlets.config import get_config

c = get_config()

c.ServerApp.allow_origin = "*"

c.ServerApp.allow_remote_access = True

c.ServerApp.disable_check_xsrf = True

c.ServerApp.token = ""

c.ServerApp.ip = "*"

c.ServerApp.root_dir = "/root/workspace"

c.LanguageServerManager.autodetect = False

c.LanguageServerManager.language_servers = {
"ruff-lsp": {
# if installed as a binary
"argv": [
"ruff-lsp",
],
"languages": ["python"],
"version": 2,
"mime_types": ["text/x-python"],
"display_name": "ruff-lsp",
},
"libro-analyzer": {
# if installed as a binary
"argv": [
"node",
"node_modules/@difizen/libro-analyzer/index.js",
"--stdio",
],
"languages": ["python"],
"version": 2,
"mime_types": ["text/x-python"],
"display_name": "libro-analyzer",
},
}
4 changes: 0 additions & 4 deletions docker/sim/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ services:
# SecretNote
- 8090:8888
entrypoint: /root/scripts/start.sh
volumes:
- /root/scripts

bob:
image: 'secretflow/secretnote:unstable-amd64'
Expand All @@ -22,5 +20,3 @@ services:
# SecretNote
- 8092:8888
entrypoint: /root/scripts/start.sh
volumes:
- /root/scripts
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dev-dependencies = [
"mypy>=1.5.1",
"pip>=23.2.1",
"pytest>=7.4.0",
"ruff>=0.0.284",
"setuptools>=68.2.2",
"snakeviz>=2.2.0",
"uvicorn>=0.23.2",
Expand Down
2 changes: 1 addition & 1 deletion pyprojects/secretnote/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"stack_data>=0.6.3",
"tqdm>=4.66.1",
"dataset>=1.6.2",
"ruff-lsp==0.0.50",
"ruff-lsp>=0.0.53",
"python-lsp-server==1.8.2",
]
description = "Notebook suite for SecretFlow"
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ rich==13.7.0
rpds-py==0.17.1
rsa==4.9
ruff==0.1.15
ruff-lsp==0.0.50
ruff-lsp==0.0.53
safetensors==0.4.2
scikit-learn==1.1.3
scipy==1.10.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ rich==13.7.0
rpds-py==0.17.1
rsa==4.9
ruff==0.2.2
ruff-lsp==0.0.50
ruff-lsp==0.0.53
secretflow-ray==2.2.0
send2trash==1.8.2
simpervisor==1.0.0
Expand Down

0 comments on commit 52fb30d

Please sign in to comment.