Skip to content
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

DEV-331: add plugins to Theia #52

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions singleuser/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@ RUN \
&& mkdir -p /etc/ipython \
&& echo "c.IPKernelApp.extensions = ['ipython_datajoint_creds_updater.extension']" > /etc/ipython/ipython_kernel_config.py

# Install Theia IDE
COPY ./theia/ /home/jovyan/.theia
ENV THEIA_DEFAULT_PLUGINS=local-dir:/home/jovyan/.theia/plugins
RUN \
cd /home/jovyan/.theia \
&& yarn \
&& yarn theia --app-target browser build \
&& chown -R "$(id -u):$(id -g)" /home/jovyan/.theia \
&& chmod -R g+rx,u+rwx,o+rwx /home/jovyan/.theia
ENV PATH="/home/jovyan/.theia/node_modules/.bin:${PATH}"

USER $NB_UID
RUN \
# remove default work directory
[ -d "/home/jovyan/work" ] && rm -r /home/jovyan/work \
# Install dependencies: pip
&& pip install /tmp/ipython-datajoint-creds-updater -r /tmp/config/pip_requirements.txt
WORKDIR /home/jovyan/.theia
9 changes: 7 additions & 2 deletions singleuser/config/apt_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
sudo apt update

# Install
sudo apt-get install mysql-client gcc -y --no-install-recommends
sudo apt-get install mysql-client gcc-12 build-essential pkg-config libsecret-1-dev nodejs npm -y --no-install-recommends
sudo apt-get clean
rm -rf /var/lib/apt/lists/*

# Install Yarn
# npm install --global yarn
corepack enable
npm i -g node-gyp

# Other installation
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
chmod +x /usr/bin/yq
chmod +x /usr/bin/yq
5 changes: 4 additions & 1 deletion singleuser/config/pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
gh
# jupyter-collaboration
# jupyter-collaboration
jupyter-server-proxy
jupyter-theia-proxy

17 changes: 17 additions & 0 deletions singleuser/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ services:
extends: singleuser
container_name: djlab
image: datajoint/djlab:inherit-hub-${JUPYTERHUB_VERSION}-py${PYTHON_VERSION}
theia:
extends: singleuser
container_name: theia
ports:
- 8080:8080
environment:
- DJLABHUB_REPO=
- DJLABHUB_REPO_BRANCH=
- DJLABHUB_REPO_INSTALL=FALSE
# command:
# - yarn
# - --cwd=/tmp/theia
# - theia
# - start
# - --plugins=local-dir:plugins
# - --hostname=0.0.0.0
# - --port=8080
45 changes: 45 additions & 0 deletions singleuser/theia/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"private": true,
"dependencies": {
"@theia/callhierarchy": "latest",
"@theia/file-search": "latest",
"@theia/git": "latest",
"@theia/markers": "latest",
"@theia/messages": "latest",
"@theia/mini-browser": "latest",
"@theia/navigator": "latest",
"@theia/outline-view": "latest",
"@theia/plugin-ext-vscode": "latest",
"@theia/preferences": "latest",
"@theia/preview": "latest",
"@theia/search-in-workspace": "latest",
"@theia/terminal": "latest"
},
"devDependencies": {
"@theia/cli": "latest"
},
"scripts": {
"prepare": "yarn run clean && yarn run build && yarn run download:plugins",
"clean": "theia --app-target=browser clean",
"build": "theia --app-target=browser build",
"start": "theia --app-target=browser start --plugins=local-dir:/home/jovyan/.theia/plugins /home/jovyan",
"download:plugins": "theia --app-target=browser download:plugins"
},
"theiaPluginsDir": "plugins",
"theiaPlugins": {
"vscode-builtin-extensions-pack": "https://open-vsx.org/api/eclipse-theia/builtin-extension-pack/1.50.1/file/eclipse-theia.builtin-extension-pack-1.50.1.vsix",
"ms-toolsai.jupyter-keymap": "https://open-vsx.org/api/ms-toolsai/jupyter/2024.6.0/file/ms-toolsai.jupyter-2024.6.0.vsix",
"ms-toolsai.jupyter-renderers": "https://open-vsx.org/api/ms-toolsai/jupyter/2024.6.0/file/ms-toolsai.jupyter-2024.6.0.vsix",
"ms-toolsai.vscode-jupyter-slideshow": "https://open-vsx.org/api/ms-toolsai/jupyter/2024.6.0/file/ms-toolsai.jupyter-2024.6.0.vsix",
"ms-toolsai.vscode-jupyter-cell-tags": "https://open-vsx.org/api/ms-toolsai/jupyter/2024.6.0/file/ms-toolsai.jupyter-2024.6.0.vsix"
},
"theiaPluginsExcludeIds": [
"ms-vscode.js-debug-companion",
"vscode.extension-editing",
"vscode.git",
"vscode.git-ui",
"vscode.github",
"vscode.github-authentication",
"vscode.microsoft-authentication"
]
}