From 8bf20df2eb60b80018991a3da1fbf69537cc700c Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 27 Nov 2018 14:59:32 +0000 Subject: [PATCH 1/3] lisa_shell: Add JupyterLab support and use it by default Since we are at that, let's also better check that Vagrant and Jupyter usages do not overlap, since they are both configured to use the same ports by default (8888). Signed-off-by: Patrick Bellasi --- setup.py | 2 +- shell/lisa_shell | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 550cd5373..17be17283 100755 --- a/setup.py +++ b/setup.py @@ -104,7 +104,7 @@ setup( extras_require={ "notebook": [ "ipython", - "jupyter" + "jupyterlab" ], "doc": [ diff --git a/shell/lisa_shell b/shell/lisa_shell index 904aa863d..44a51984e 100755 --- a/shell/lisa_shell +++ b/shell/lisa_shell @@ -265,11 +265,10 @@ function _lisa-jupyter-start { echo echo "could not determine IP address of $NETIF" echo - echo "Usage: $0 " - echo " NETIF - The network interface to start the server on" - echo + _lisa-jupyter-usage return 1 fi + # Setup paths PYDIR="$LISA_HOME/ipynb" LOGFILE="$PYDIR/server.log" @@ -288,6 +287,16 @@ function _lisa-jupyter-start { return 1 fi + # Check required port is available (e.g. Vagrant could using the same port) + if netstat -nlt | grep $PORT &>/dev/null; then + echo + echo "ERROR: required port [$PORT] already in use" + echo " try again with a different PORT option" + echo + _lisa-jupyter-usage + return 1 + fi + # Start the server bound to the specified interface echo echo 'Notebook server configuration:' @@ -299,9 +308,9 @@ function _lisa-jupyter-start { cd $PYDIR echo echo -n 'Notebook server task: ' - nohup jupyter notebook --ip="$IPADDR" --port="$PORT" \ - --NotebookApp.token="$TOKEN" \ - >"$LOGFILE" 2>&1 & + nohup jupyter lab --ip="$IPADDR" --port="$PORT" \ + --NotebookApp.token="$TOKEN" \ + >"$LOGFILE" 2>&1 & echo $! >"$PIDFILE" echo $URL >"$URLFILE" cd - >/dev/null -- GitLab From 271206f1aef96a0f8b86ddedf0500a6d24f616ce Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 27 Nov 2018 16:29:06 +0000 Subject: [PATCH 2/3] install: Install only most recent Android SDK tools This speeds up quite a lot the first provisioning of the VM since we download only the last version of tools and platform-tools. Signed-off-by: Patrick Bellasi --- install_base_ubuntu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_base_ubuntu.sh b/install_base_ubuntu.sh index 06ee507a0..ffee69ee9 100755 --- a/install_base_ubuntu.sh +++ b/install_base_ubuntu.sh @@ -22,7 +22,8 @@ install_sdk() { wget -qO- $ANDROID_SDK_URL | tar xz -C $SCRIPT_DIR/tools/ expect -c " set timeout -1; - spawn $SCRIPT_DIR/tools/android-sdk-linux/tools/android update sdk --no-ui + spawn $SCRIPT_DIR/tools/android-sdk-linux/tools/android \ + update sdk --no-ui -t tools,platform-tools expect { \"Do you accept the license\" { exp_send \"y\r\" ; exp_continue } eof -- GitLab From 420e5d7399e1890fbcbf7789d13fd19a97473eac Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Tue, 27 Nov 2018 16:33:05 +0000 Subject: [PATCH 3/3] gitignore: Ignore venv/pip installation products Signed-off-by: Patrick Bellasi --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d630b10d5..4276b4cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ server.url /tools/wa_venv /tools/wa_user_directory/dependencies src/buildroot +*.egg-info -- GitLab