You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/06/19 02:29:09 UTC

[GitHub] [beam] aaltay commented on a change in pull request #11884: [BEAM-7923] Initialize an empty Jupyter labextension with README

aaltay commented on a change in pull request #11884:
URL: https://github.com/apache/beam/pull/11884#discussion_r442596473



##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/.github/workflows/build.yml
##########
@@ -0,0 +1,38 @@
+name: Build

Review comment:
       This is a github action for what? Should we use jenkins?
   
   We areso planning to workflows at top level .github/workflows similar to other infra bits, to keep them all in one place. (see related PRs for wheel files.)

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/.prettierignore
##########
@@ -0,0 +1,20 @@
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+node_modules

Review comment:
       What is the difference between this and eslint?
   
   Why are we using both?

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/setup.py
##########
@@ -0,0 +1,104 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+Setup Module to setup Python Handlers for the interactive_beam_side_panel extension.
+"""
+import os
+
+import setuptools
+
+from jupyter_packaging import combine_commands
+from jupyter_packaging import create_cmdclass
+from jupyter_packaging import ensure_python
+from jupyter_packaging import ensure_targets
+from jupyter_packaging import get_version
+from jupyter_packaging import install_npm
+
+HERE = os.path.abspath(os.path.dirname(__file__))
+
+# The name of the project
+name = "interactive_beam_side_panel"

Review comment:
       package name probably needs to be something like apache_beam_...

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/tsconfig.json
##########
@@ -0,0 +1,24 @@
+{

Review comment:
       Why these options?
   
   Also do we need the license header here?

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/README.md
##########
@@ -0,0 +1,111 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# interactive_beam_side_panel
+
+![Github Actions Status](https://github.com/apache/beam/workflows/Build/badge.svg)
+
+A side panel providing information of current interactive environment, data sets associated with PCollections, pipeline state, job status and source capture.
+
+
+This extension is composed of a Python package named `interactive_beam_side_panel`
+for the server extension and a NPM package named `interactive-beam-side-panel`
+for the frontend extension.
+
+
+## Requirements
+
+* JupyterLab >= 2.0
+
+## Install
+
+Note: You will need NodeJS to install the extension.
+
+```bash
+pip install interactive_beam_side_panel
+jupyter lab build
+```
+
+## Troubleshoot
+
+If you are seeing the frontend extension but it is not working, check
+that the server extension is enabled:
+
+```bash
+jupyter serverextension list
+```
+
+If the server extension is installed and enabled but you are not seeing
+the frontend, check the frontend is installed:
+
+```bash
+jupyter labextension list
+```
+
+If it is installed, try:
+
+```bash
+jupyter lab clean
+jupyter lab build
+```
+
+## Contributing
+
+### Install

Review comment:
       Related to @robertwb 's distribution story comment. How often we will release this? Who will release it? Releasing this will require a vote and a PMC approval, if you would like to add it to beam repo.

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/src/index.ts
##########
@@ -0,0 +1,41 @@
+// Licensed under the Apache License, Version 2.0 (the 'License'); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+import {
+  JupyterFrontEnd,
+  JupyterFrontEndPlugin
+} from '@jupyterlab/application';
+
+import { requestAPI } from './interactivebeamsidepanel';
+
+/**
+ * Initialization data for the interactive_beam_side_panel extension.
+ */
+const extension: JupyterFrontEndPlugin<void> = {
+  id: 'interactive-beam-side-panel',
+  autoStart: true,
+  activate: (app: JupyterFrontEnd) => {
+    console.log('JupyterLab extension interactive-beam-side-panel is activated!');
+
+    requestAPI<any>('get_example')
+      .then(data => {
+        console.log(data);

Review comment:
       Do you need this data log?

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/interactive_beam_side_panel/_version.py
##########
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+version_info = (0, 1, 0)

Review comment:
       should the version match beam version? We do not have other sub-components with their own versions.

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/setup.py
##########
@@ -0,0 +1,104 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+Setup Module to setup Python Handlers for the interactive_beam_side_panel extension.
+"""
+import os
+
+import setuptools
+
+from jupyter_packaging import combine_commands
+from jupyter_packaging import create_cmdclass
+from jupyter_packaging import ensure_python
+from jupyter_packaging import ensure_targets
+from jupyter_packaging import get_version
+from jupyter_packaging import install_npm
+
+HERE = os.path.abspath(os.path.dirname(__file__))
+
+# The name of the project
+name = "interactive_beam_side_panel"
+
+# Ensure a valid python version
+ensure_python(">=3.5")
+
+# Get our version
+version = get_version(os.path.join(name, "_version.py"))
+
+lab_path = os.path.join(HERE, name, "labextension")
+
+# Representative files that should exist after a successful build
+jstargets = [
+    os.path.join(HERE, "lib", "interactivebeamsidepanel.js"),
+]
+
+package_data_spec = {name: ["*"]}
+
+data_files_spec = [
+    ("share/jupyter/lab/extensions", lab_path, "*.tgz"),
+    (
+        "etc/jupyter/jupyter_notebook_config.d",
+        "jupyter-config",
+        "interactive_beam_side_panel.json"),
+]
+
+cmdclass = create_cmdclass(
+    "jsdeps",
+    package_data_spec=package_data_spec,
+    data_files_spec=data_files_spec)
+
+cmdclass["jsdeps"] = combine_commands(
+    install_npm(HERE, build_cmd="build:all", npm=["jlpm"]),
+    ensure_targets(jstargets),
+)
+
+with open("README.md", "r") as fh:
+  long_description = fh.read()
+
+setup_args = dict(
+    name=name,
+    version=version,
+    url="https://github.com/apache/beam",
+    author="ningk",

Review comment:
       author would be the project.

##########
File path: sdks/python/apache_beam/runners/interactive/extensions/interactive_beam_side_panel/package.json
##########
@@ -0,0 +1,75 @@
+{
+  "name": "interactive-beam-side-panel",
+  "version": "0.1.0",
+  "description": "A side panel providing information of current interactive environment, data sets associated with PCollections, pipeline state, job status and source capture.",
+  "keywords": [
+    "jupyter",
+    "jupyterlab",
+    "jupyterlab-extension"
+  ],
+  "homepage": "https://github.com/apache/beam",
+  "bugs": {
+    "url": "https://github.com/apache/beam/issues"
+  },
+  "license": "BSD-3-Clause",
+  "author": "ningk",
+  "files": [
+    "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
+    "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
+  ],
+  "main": "lib/index.js",
+  "types": "lib/index.d.ts",
+  "style": "style/index.css",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/beam.git"
+  },
+  "scripts": { 
+    "build": "jlpm run build:lib",
+    "build:labextension": "cd interactive_beam_side_panel && rimraf labextension && mkdirp labextension && cd labextension && npm pack ../..",
+    "build:lib": "tsc",
+    "build:all": "jlpm run build:labextension",
+    "clean": "jlpm run clean:lib",
+    "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
+    "clean:labextension": "rimraf interactive_beam_side_panel/labextension",
+    "clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
+
+    "eslint": "eslint . --ext .ts,.tsx --fix",
+    "eslint:check": "eslint . --ext .ts,.tsx",
+    "prepare": "jlpm run clean && jlpm run build",
+    "watch": "tsc -w"
+  },
+  "dependencies": {

Review comment:
       I do not know much about js dependencies. Is it the normal standard to use a lower bound version only for dependencies?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org