-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate Python Language Server to Monaco Editor (Closes #1908, #571) #1910
Open
umesh-timalsina
wants to merge
43
commits into
master
Choose a base branch
from
1908-pyls-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
542f549
WIP #1908: Add working example with basic pyls
umesh-timalsina 7aeebe0
Provide Dockerfile and build for a separate language servers service
umesh-timalsina da381fb
WIP- Update deployment of language servers and minor eslint fixes
umesh-timalsina 2802a5d
Use microsoft's python language server in favor of pyls(palantir)
umesh-timalsina 4503ae4
WIP- Fix deployment issue with language servers
umesh-timalsina 29775a7
WIP- Use components.json for languageserver configuration
umesh-timalsina b777e43
Merge remote-tracking branch 'origin/master' into 1908-pyls-integration
umesh-timalsina 08291c5
WIP- Fix languageServers.json file; jq deployment; uninstall jsonrpc-…
umesh-timalsina dd9fe28
Merge remote-tracking branch 'origin/master' into 1908-pyls-integration
umesh-timalsina 37c1ddc
WIP- Fix typo in config.extensions, rename token to tokens in languag…
umesh-timalsina 03b41f5
WIP- Fix jsonrpc-ws-proxy call in Dockerfile.langservers entrypoint
umesh-timalsina c0fc77f
WIP-Fix jsonrpc-ws-proxy in langserver-entrypoint.sh
umesh-timalsina 376fbc6
WIP_ Remove python-language-server from requirements
umesh-timalsina dcd5ae5
WIP- Fix typo in DeepforgeLanguageClient
umesh-timalsina e26e7c3
WIP- Use python3.7 anaconda in docker image
umesh-timalsina f4facd8
WIP- Move languageServers.json to .deployment
umesh-timalsina 5ca1db3
WIP- Use inmemory models instead of file models
umesh-timalsina 9e2525a
Resolve merge conflicts and merge branch master
umesh-timalsina 8bd0f3e
Merge remote-tracking branch 'origin/1908-pyls-integration' into 1908…
umesh-timalsina ddbf23a
Update README for deployment
umesh-timalsina b1df3f6
WIP- Use componentSettings for LanguageServers; Docker build for lang…
umesh-timalsina 2bd224e
Merge remote-tracking branch 'origin/master' into 1908-pyls-integration
umesh-timalsina 21ad734
WIP- Test docker build for language servers
umesh-timalsina c8227d1
WIP- Fix Dockerfile.langservers path
umesh-timalsina a339b9c
WIP- Add npm install step in github workflows
umesh-timalsina 087323b
WIP- Don't update conda in Dockerfile
umesh-timalsina aa84bc2
WIP- Use latest anaconda docker image
umesh-timalsina a9e321a
Merge remote-tracking branch 'origin/master' into 1908-pyls-integration
umesh-timalsina 10bec66
WIP- Use anaconda3:2019.10 as image base
umesh-timalsina 89b2e68
Revert to pip installing packages
umesh-timalsina 20bd21f
WIP- Fix Keras version in dockerfile
umesh-timalsina 193698d
Merge remote-tracking branch 'origin/master' into 1908-pyls-integration
umesh-timalsina d7b9a0d
WIP- Minor fixes to the language server settings
umesh-timalsina aa60904
Merge remote-tracking branch 'origin/master' into 1908-pyls-integration
umesh-timalsina 61bd70f
WIP- Deploy Branch for Testing
umesh-timalsina f75f652
WIP- Publish KitchenSink image for testing
umesh-timalsina c45823b
WIP- Publish kitchen sink image for testing
umesh-timalsina 3d84cdb
WIP- Add Push Tags
umesh-timalsina d5bfa3f
WIP- Fix Tags for kitchensink image
umesh-timalsina ff110bc
WIP- Fix docker-compose for testing
umesh-timalsina 36c6723
WIP- Checkout branch in deployment script
umesh-timalsina 81657c3
WIP- Fix branch checkout in workflow
umesh-timalsina 71979a3
WIP- Fix entrypoint and setup debugging.
umesh-timalsina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,13 @@ The script `deploy-deepforge` is used for standard deployment of deepforge using | |
|
||
Additionally, this contains a file with customizations to the standard docker-compose.yml file which allows us to modify the entrypoint and install a version of tensorflow [compatible with the CPU of the deployment machine](https://github.com/deepforge-dev/deepforge/issues/1561). | ||
|
||
The deployment is updated by first creating the custom docker compose file using [yaml-merge](https://github.com/alexlafroscia/yaml-merge): | ||
Moreover, we also a proxy server with that spins up different language servers that we provide for | ||
intelligent syntax | ||
highlighting in deepforge's browser. For more information checkout the language server's docker [file](../docker/Dockerfile.langservers) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "in deepforge's browser" -> "in DeepForge" |
||
|
||
The deployment is updated by first creating the custom docker compose file using [yq](https://github.com/mikefarah/yq): | ||
``` | ||
yaml-merge docker-compose.yml .deployment/docker-compose-overrides.yml > custom-docker-compose.yml | ||
yq m -a docker/docker-compose.yml "$DEEPFORGE_DEPLOYMENT_DIR"/docker-compose-overrides.yml > custom-docker-compose.yml | ||
``` | ||
Next, the generated file can be used with docker-compose: | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# Remove pypi tensorflow in favor of conda installation | ||
source activate base | ||
pip uninstall tensorflow -y | ||
conda install tensorflow==1.14 -y | ||
|
||
node $(npm root -g)/jsonrpc-ws-proxy/dist/server.js --port $PORT --languageServers ~/language-servers.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
const components = require('./components.json'); | ||
|
||
function getLanguageServersConfig () { | ||
if(components.LanguageServers) { | ||
return { | ||
hostName: process.env.DEEPFORGE_LANGUAGE_SERVER_HOST || components.LanguageServers.hostName, | ||
servers: components.LanguageServers.servers | ||
}; | ||
} | ||
} | ||
|
||
|
||
module.exports = config => { | ||
config.extensions = {}; | ||
config.extensions.InteractiveComputeHost = process.env.DEEPFORGE_INTERACTIVE_COMPUTE_HOST; | ||
config.extensions.LanguageServers = getLanguageServersConfig(); | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM continuumio/anaconda3 | ||
|
||
LABEL maintainer1.name="Brian Broll"\ | ||
maintainer1.email="[email protected]" | ||
|
||
LABEL maintainer2.name="Umesh Timalsina"\ | ||
maintainer2.email="[email protected]" | ||
|
||
EXPOSE 5000 | ||
|
||
ENV PORT 5000 | ||
|
||
RUN apt-get update && curl -sL https://deb.nodesource.com/setup_12.x | bash - &&\ | ||
apt-get install -y nodejs && apt-get install unzip | ||
|
||
RUN npm install -g npm && npm -g config set user root && npm install -g jsonrpc-ws-proxy js-yaml | ||
|
||
RUN conda update conda -yq && conda install python=3.7 | ||
|
||
COPY src/plugins/GenerateJob/templates/environment.worker.yml . | ||
|
||
COPY utils/install-microsoft-python-langserver.sh . | ||
|
||
COPY docker/create-servers-yml.js . | ||
|
||
COPY utils/languageServers.json utils/ | ||
|
||
RUN ./install-microsoft-python-langserver.sh && npm link js-yaml &&\ | ||
node ./create-servers-yml.js && rm create-servers-yml.js | ||
|
||
RUN conda env update -n base --file environment.worker.yml && rm environment.worker.yml && conda clean -afy | ||
|
||
ENTRYPOINT node $(npm root -g)/jsonrpc-ws-proxy/dist/server.js --port $PORT --languageServers ~/languageServers.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const yaml = require('js-yaml'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const langServers = require(path.resolve(__dirname, '..', 'utils', 'languageServers')); | ||
|
||
function dumpLangServerYaml(fileName) { | ||
const serversYml = { | ||
langservers: {} | ||
}; | ||
|
||
Object.keys(langServers.servers).forEach(server => { | ||
const command = langServers.servers[server].command; | ||
serversYml.langservers[server] = Array.isArray(command) ? command : [command]; | ||
}); | ||
|
||
fs.writeFileSync(fileName, yaml.safeDump(serversYml)); | ||
} | ||
|
||
|
||
if (require.main === module) { | ||
dumpLangServerYaml('languageServers.yml'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
name: deepforge | ||
dependencies: | ||
- python=3.7 | ||
- python-language-server | ||
umesh-timalsina marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like some odd line breaking...