This repository serves as a common repository for Google-developed extensions for the Jupyter and JupyterLab environments.
The following steps only need to be completed once to setup your initial development environment.
Note: If at any point you want to go through these steps on a fresh
JupyterLab environment, you can run pipenv --rm
to remove the virtual
environment.
Clone this repository.
git clone [email protected]:GoogleCloudPlatform/jupyter-extensions.git
cd
into the repository directory and install the NPM dependencies
with npm install
.
Run npm run bootstrap
to install the dependencies for each of the extension
subfolders.
Run pipenv install
.
Run pipenv shell
to activate the virtual Python environment with the
necessary dependencies installed.
Run cd shared/
and then npm run install-shared
to install the shared
package.
Run npm run link
to link the gcp-jupyterlab-shared
package into the JupyterLab environment.
cd
into the folder of the extension you plan to develop and run
npm run install-extension
. This installs the extension in the
JupyterLab environment in development mode. Afterwards, cd
back to the root
of the repository.
jupyter labextension install @jupyter-widgets/[email protected]
if your extension requires ipywidget. Currently, this is a requirement for the jupyterlab_bigquery extension.Run npm run watch
to start the TypeScript compiler in watch mode. This will
watch for changes in any of the TypeScript sources.
npm run watch
command only in the packages
you are working in.In a seperate terminal, run pipenv shell
and then npm run devserver
.
This will start JupyterLab in watch mode to pick up any changes to either the
TypeScript or Python code.
watch
or devserver
tasks. This may occur when adding
a new file to the project.You can then open JupyterLab at one of the links shown in the logging output.
If you would like to test an extension in an AI Platform Notebook, you can do so by following these steps.
Create a new AI Platform Notebook from the Cloud Console.
cd
into the directory of the extension you wish to install.
Run ../scripts/deploy.sh
passing the instance's name and zone as arguments.
../scripts/deploy.sh test-instance us-east1-b