Skip to content

Commit aad0c7e

Browse files
Deprecated JL1 extension support.
1 parent cc153da commit aad0c7e

File tree

16 files changed

+18
-7346
lines changed

16 files changed

+18
-7346
lines changed

install-scripts/notebook-instances/setup-codeserver.sh

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ EXTENSION_GALLERY_CONFIG='{{\"serviceUrl\":\"\",\"cacheUrl\":\"\",\"itemUrl\":\"
2020
LAUNCHER_ENTRY_TITLE='Code Server'
2121
PROXY_PATH='codeserver'
2222
LAB_3_EXTENSION_DOWNLOAD_URL='https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/sagemaker-jproxy-launcher-ext-0.1.3.tar.gz'
23-
INSTALL_LAB1_EXTENSION=1
24-
LAB_1_EXTENSION_DOWNLOAD_URL='https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amzn-sagemaker-jproxy-launcher-ext-jl1-0.1.4.tgz'
2523

2624
#############
2725
# INSTALL #
@@ -77,31 +75,11 @@ fi
7775
if [[ $JUPYTER_LAB_VERSION == 1* ]]
7876
then
7977
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
80-
pip install jupyter-server-proxy
78+
echo "Installing jupyter-server-proxy."
79+
pip install jupyter-server-proxy==1.6.0
8180
conda deactivate
8281
83-
if [ $INSTALL_LAB1_EXTENSION -eq 1 ]
84-
then
85-
rm -f $CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh
86-
cat >>$CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh <<- JL1EXT
87-
sleep 15
88-
89-
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
90-
91-
mkdir -p $CODE_SERVER_INSTALL_LOC/lab_ext
92-
curl -L $LAB_1_EXTENSION_DOWNLOAD_URL > $CODE_SERVER_INSTALL_LOC/lab_ext/amzn-sagemaker-jproxy-launcher-ext-jl1.tgz
93-
94-
cd $CODE_SERVER_INSTALL_LOC/lab_ext
95-
jupyter labextension install amzn-sagemaker-jproxy-launcher-ext-jl1.tgz --no-build
96-
jlpm config set cache-folder /tmp/yarncache
97-
jupyter lab build --debug --minimize=False
98-
99-
conda deactivate
100-
101-
JL1EXT
102-
chmod +x $CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh
103-
sh $CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh
104-
fi
82+
echo "JupyterLab extension for JupyterLab 1 is not supported. You can still access code-server by typing the code-server URL in the browser address bar."
10583
else
10684
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
10785
@@ -116,4 +94,9 @@ else
11694
fi
11795
EOF
11896

119-
sudo systemctl restart jupyter-server
97+
if [[ -f /home/ec2-user/bin/dockerd-rootless.sh ]]; then
98+
echo "Running in rootless mode; please restart Jupyter Server from the 'File' > 'Shut Down' menu and re-open Jupyter/JupyterLab."
99+
else
100+
echo "Root mode. Restarting Jupyter Server..."
101+
sudo systemctl restart jupyter-server
102+
fi

install-scripts/notebook-instances/uninstall-codeserver.sh

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ CONDA_ENV_LOCATION='/home/ec2-user/SageMaker/.cs/conda/envs/codeserver_py39'
1515

1616
PROXY_PATH='codeserver'
1717
LAB_3_EXTENSION_NAME='sagemaker-jproxy-launcher-ext'
18-
INSTALL_LAB1_EXTENSION=1
19-
LAB_1_EXTENSION_NAME='@amzn/sagemaker-jproxy-launcher-ext-jl1'
2018

2119
###############
2220
# UNINSTALL #
2321
###############
2422

25-
JUPYTER_LAB_VERSION=$(/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/jupyter-lab --version)
26-
2723
echo "Killing running code-server processes..."
2824
ps uxa | grep code-server | awk '{print $2}' | xargs -i sh -c "kill {} -9 || true"
2925

@@ -48,24 +44,12 @@ sudo rm -rf $CODE_SERVER_INSTALL_LOC
4844

4945
sudo -u ec2-user -i <<EOF
5046
51-
if [[ $JUPYTER_LAB_VERSION == 1* ]]
52-
then
53-
if [ $INSTALL_LAB1_EXTENSION -eq 1 ]
54-
then
55-
echo "Uninstalling JL1 extension..."
47+
echo "Uninstalling JL3 extension..."
5648
57-
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
58-
jupyter labextension uninstall $LAB_1_EXTENSION_NAME
59-
conda deactivate
60-
fi
61-
else
62-
echo "Uninstalling JL3 extension..."
63-
64-
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
65-
pip uninstall -y $LAB_3_EXTENSION_NAME
66-
jupyter labextension enable jupyterlab-server-proxy
67-
conda deactivate
68-
fi
49+
source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv
50+
pip uninstall -y $LAB_3_EXTENSION_NAME
51+
jupyter labextension enable jupyterlab-server-proxy
52+
conda deactivate
6953
7054
sudo systemctl restart jupyter-server
7155

install-scripts/studio/install-codeserver.sh

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ EXTENSION_GALLERY_CONFIG='{{\"serviceUrl\":\"\",\"cacheUrl\":\"\",\"itemUrl\":\"
2222
LAUNCHER_ENTRY_TITLE='Code Server'
2323
PROXY_PATH='codeserver'
2424
LAB_3_EXTENSION_DOWNLOAD_URL='https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/sagemaker-jproxy-launcher-ext-0.1.3.tar.gz'
25-
INSTALL_LAB1_EXTENSION=1
26-
LAB_1_EXTENSION_DOWNLOAD_URL='https://github.com/aws-samples/amazon-sagemaker-codeserver/releases/download/v0.1.5/amzn-sagemaker-jproxy-launcher-ext-jl1-0.1.4.tgz'
2725

2826
#############
2927
# INSTALL #
@@ -130,30 +128,6 @@ then
130128
restart-jupyter-server
131129

132130
sleep 10
133-
fi
134-
135-
if [ "$AWS_SAGEMAKER_JUPYTERSERVER_IMAGE" = "jupyter-server" ]
136-
then
137-
nohup supervisorctl -c /etc/supervisor/conf.d/supervisord.conf restart jupyterlabserver
138-
139-
# Install JL1 extension
140-
if [ $INSTALL_LAB1_EXTENSION -eq 1 ]
141-
then
142-
rm -f $CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh
143-
cat >>$CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh <<- JL1EXT
144-
sleep 15
145-
146-
mkdir -p $CODE_SERVER_INSTALL_LOC/lab_ext
147-
curl -L $LAB_1_EXTENSION_DOWNLOAD_URL > $CODE_SERVER_INSTALL_LOC/lab_ext/amzn-sagemaker-jproxy-launcher-ext-jl1.tgz
148-
149-
cd $CODE_SERVER_INSTALL_LOC/lab_ext
150-
jupyter labextension install amzn-sagemaker-jproxy-launcher-ext-jl1.tgz --no-build
151-
jlpm config set cache-folder /tmp/yarncache
152-
jupyter lab build --debug --minimize=False
153-
154-
supervisorctl -c /etc/supervisor/conf.d/supervisord.conf restart jupyterlabserver
155-
JL1EXT
156-
sudo chmod +x $CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh
157-
nohup $CODE_SERVER_INSTALL_LOC/install-jl1-extension.sh &
158-
fi
131+
else
132+
echo "JupyterLab extension is supported only for JupyterLab 3. You can still access code-server by typing the code-server URL in the browser address bar."
159133
fi

install-scripts/studio/uninstall-codeserver.sh

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ CONDA_ENV_LOCATION='/opt/.cs/conda/envs/codeserver_py39'
1515

1616
PROXY_PATH='codeserver'
1717
LAB_3_EXTENSION_NAME='sagemaker-jproxy-launcher-ext'
18-
INSTALL_LAB1_EXTENSION=1
19-
LAB_1_EXTENSION_NAME='@amzn/sagemaker-jproxy-launcher-ext-jl1'
2018

2119
###############
2220
# UNINSTALL #
@@ -56,16 +54,6 @@ then
5654

5755
restart-jupyter-server
5856
sleep 10
59-
fi
60-
61-
if [ "$AWS_SAGEMAKER_JUPYTERSERVER_IMAGE" = "jupyter-server" ]
62-
then
63-
if [ $INSTALL_LAB1_EXTENSION -eq 1 ]
64-
then
65-
echo "Uninstalling JL1 extension..."
66-
jupyter labextension uninstall $LAB_1_EXTENSION_NAME --no-build
67-
jupyter lab build --debug --minimize=False
68-
fi
69-
70-
nohup supervisorctl -c /etc/supervisor/conf.d/supervisord.conf restart jupyterlabserver
57+
else
58+
echo "Only JupyterLab 3 is supported."
7159
fi

server-proxy-lab-extension-jl1/.eslintrc.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

server-proxy-lab-extension-jl1/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

server-proxy-lab-extension-jl1/LICENSE

Lines changed: 0 additions & 14 deletions
This file was deleted.

server-proxy-lab-extension-jl1/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)