Skip to content

Commit

Permalink
Fix vscode bug when installing extensions (#1360)
Browse files Browse the repository at this point in the history
* rollback to code-server installation

* test if build passes

* bump dask-labextension to fix CI

* update image again test CI

* update image again test CI

* rollback to code-server installation

* rollback dask-lab version

* install extension from conda

* change install location to use local env

* change install location to use local env

* change install location to use local env

* change install location to use local env

* Update script installation

* Try to fix missing path

* Try to fix missing path

* try something else

* try something else

* Trigger CI build

* try something else

* Rollback to previous conda install

* Use jupyter proxy instead of changing installation

* Update install method

* rm proxy settings

* add code-server to path

* add code-server to path

* Will fix everything

* Will fix everything 2

* fix dir typo

* missed another typo again

* Will fix everything 3

* Will fix everything 4

* Will fix everything 4

* Will fix everything 5

* rm external proxy and use jupyter builtin

* rollback to using vscode proxy

* Update qhub/template/image/jupyterlab/environment.yaml

Co-authored-by: Vinicius D. Cerutti <[email protected]>

Co-authored-by: eskild <[email protected]>
  • Loading branch information
viniciusdc and iameskild authored Jul 6, 2022
1 parent 8355715 commit 4467325
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
4 changes: 4 additions & 0 deletions qhub/template/image/Dockerfile.jupyterlab
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ RUN \
fi ; \
/opt/scripts/install-conda-environment.sh "${ENV_FILE}" 'true'

# ========== code-server install ============
ENV PATH=/opt/conda/envs/${DEFAULT_ENV}/share/code-server/bin:${PATH}
COPY scripts/install-code-server.sh /opt/scripts/install-code-server.sh

COPY jupyterlab /opt/jupyterlab
RUN /opt/jupyterlab/postBuild

Expand Down
6 changes: 1 addition & 5 deletions qhub/template/image/jupyterlab/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- retrolab

# jupyterlab extensions
# - dask_labextension >=5.0.0
- dask_labextension >= 5.3.0
- jupyterlab-git >=0.30.0
- sidecar >=0.5.0
- jupyter-videochat >=0.5.0
Expand Down Expand Up @@ -48,10 +48,6 @@ dependencies:
- isort
- importnb

# vscode
- code-server >= 3.2

- pip:
# vscode jupyterlab launcher
- git+https://github.com/betatim/vscode-binder
- git+https://github.com/dask/dask-labextension.git@fc8de03447778e0605d0abafa3d3135f9e49e0d6
4 changes: 4 additions & 0 deletions qhub/template/image/jupyterlab/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set -x
# install classic notebook extensions
jupyter nbextension enable --py widgetsnbextension --sys-prefix

# install code-server extension
sh /opt/scripts/install-code-server.sh "/opt/conda/envs/${DEFAULT_ENV}/share"


# if DEFAULT_ENV is unset ${DEFAULT_ENV+x} expands to nothing otherwise
# it substitutes the string x. This allows us to check if the variable
# is set without triggering an unbound variable error
Expand Down
21 changes: 21 additions & 0 deletions qhub/template/image/scripts/install-code-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -xe
DEFAULT_PREFIX="${1}"; shift # path to environment yaml or lock file

mkdir -p ${DEFAULT_PREFIX}/code-server
cd ${DEFAULT_PREFIX}/code-server

# Fetch the snapshot of https://code-server.dev/install.sh as of the time of writing
wget --quiet https://raw.githubusercontent.com/coder/code-server/326a1d1862872955cec062030df2bd103799a1eb/install.sh
expected_sum=ed18563871beb535130019b6c5b62206cc4a60c8bf4256aae96ce737951fc253

if [[ ! $(sha256sum install.sh) == "${expected_sum} install.sh" ]];then
echo Unexpected hash from code-server install script
exit 1
fi

mkdir /opt/tmpdir
sh ./install.sh --method standalone --prefix /opt/tmpdir

mv /opt/tmpdir/lib/code-server-4.5.0/* ${DEFAULT_PREFIX}/code-server
rm -rf /opt/tmpdir

0 comments on commit 4467325

Please sign in to comment.