github.com/apache/beam/sdks/v2@v2.48.2/python/apache_beam/runners/interactive/extensions/apache-beam-jupyterlab-sidepanel/README.md (about) 1 <!-- 2 Licensed to the Apache Software Foundation (ASF) under one 3 or more contributor license agreements. See the NOTICE file 4 distributed with this work for additional information 5 regarding copyright ownership. The ASF licenses this file 6 to you under the Apache License, Version 2.0 (the 7 "License"); you may not use this file except in compliance 8 with the License. You may obtain a copy of the License at 9 http://www.apache.org/licenses/LICENSE-2.0 10 Unless required by applicable law or agreed to in writing, 11 software distributed under the License is distributed on an 12 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 KIND, either express or implied. See the License for the 14 specific language governing permissions and limitations 15 under the License. 16 --> 17 18 # apache-beam-jupyterlab-sidepanel 19 20 Includes two different side panels: 21 * The Inspector side panel provides information and controls to run Apache Beam notebooks interactively. 22 * The Clusters side panel displays all Dataproc clusters managed by Interactive Beam and provides controls to configure cluster usage. 23 24 ## Requirements 25 26 | JupyterLab version | Extension version | 27 | ------------------ | ----------------- | 28 | v3 | >=v2.0.0 | 29 | v2 | v1.0.0 | 30 31 ## Install 32 33 ```bash 34 jupyter labextension install apache-beam-jupyterlab-sidepanel 35 ``` 36 37 ## Contributing 38 39 ### Install 40 41 The `jlpm` command is JupyterLab's pinned version of 42 [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use 43 `yarn` or `npm` in lieu of `jlpm` below. 44 45 ```bash 46 # Clone the repo to your local environment 47 # Move to apache-beam-jupyterlab-sidepanel directory 48 49 # Install dependencies 50 jlpm 51 # Build Typescript source 52 jlpm build 53 # Link your development version of the extension with JupyterLab 54 jupyter labextension link . 55 56 # Rebuild Typescript source after making changes 57 jlpm build 58 # Rebuild JupyterLab after making any changes 59 jupyter lab build 60 ``` 61 62 You can watch the source directory and run JupyterLab in watch mode to watch for changes in the extension's source and automatically rebuild the extension and application. 63 64 ```bash 65 # Watch the source directory in another terminal tab 66 jlpm watch 67 # Run jupyterlab in watch mode in one terminal tab 68 jupyter lab --watch 69 ``` 70 71 Now every change will be built locally and bundled into JupyterLab. Be sure to refresh your browser page after saving file changes to reload the extension (note: you'll need to wait for webpack to finish, which can take 10s+ at times). 72 73 ### Test 74 75 To run all tests, under `apache-beam-jupyterlab-sidepanel` directory, simply do: 76 77 ```bash 78 # Make sure all dependencies are installed. 79 jlpm 80 81 # Run all tests. 82 jlpm jest 83 ``` 84 85 This project uses `ts-jest` to test all ts/tsx files under `src/__tests__` directory. 86 87 To run a single test, find out the name of a test in the source code that looks like: 88 89 ```javascript 90 it('does ABC', () => {...}) 91 ``` 92 93 Then run: 94 95 ```bash 96 jlpm jest -t 'does ABC' 97 ``` 98 99 ### Format and lint 100 101 The project uses prettier for formatting and eslint for lint. 102 Prettier is configured as a plugin used by eslint. 103 There are pre-configured yarn scripts to execute them. 104 105 ```bash 106 # Under apache-beam-jupyterlab-sidepanel directory. 107 108 # Make sure dependencies are installed. 109 # Prettier and eslint are both installed as dev dependencies. 110 jlpm 111 112 # Check format and lint issues. 113 jlpm eslint:check 114 115 # Check then fix in place format and lint issues. 116 jlpm eslint 117 ``` 118 119 ### Uninstall 120 121 ```bash 122 jupyter labextension uninstall apache-beam-jupyterlab-sidepanel 123 ```