From 8abfa8911290152e1dfd7ab3065eea802c1a96cc Mon Sep 17 00:00:00 2001 From: Philipp Schaad Date: Tue, 10 Jan 2023 09:32:30 +0100 Subject: [PATCH] Add RPC calls between extension components & SDFV as submodule (#206) --- .gitmodules | 3 + backend/run_dace.py | 27 +- media/components/analysis/index.html | 17 +- media/components/history/index.html | 2 +- media/components/outline/index.html | 2 +- media/components/sdfv/index.html | 6 +- media/components/transformations/index.html | 4 +- package-lock.json | 18785 +++++++++++----- package.json | 13 +- packages/sdfv | 1 + .../messaging/icpc_messaging_component.ts | 240 + src/components/analysis.ts | 87 +- src/components/base_component.ts | 15 +- .../messaging/component_message_handler.ts | 83 - .../icpc_extension_messaging_component.ts | 86 + .../messaging/message_receiver_interface.ts | 10 - src/components/outline.ts | 44 +- src/components/sdfg_breakpoints.ts | 67 +- src/components/sdfg_viewer.ts | 581 +- src/components/transformation_history.ts | 70 +- src/components/transformation_list.ts | 87 +- src/dace_interface.ts | 626 +- src/debugger/breakpoint_handler.ts | 97 +- src/debugger/sdfg_python_runtime.ts | 6 +- src/extension.ts | 85 +- src/modules.d.ts | 1 + .../components/analysis/analysis.ts | 593 +- .../components/breakpoints/breakpoints.ts | 198 +- .../history/transformation_history.css | 12 +- .../history/transformation_history.ts | 125 +- src/webclients/components/outline/outline.ts | 139 +- .../components/sdfv/analysis/analysis.ts | 103 - .../sdfv/analysis/analysis_controller.ts | 202 + .../sdfv/breakpoints/breakpoints.ts | 29 +- .../sdfv/messaging/message_handler.ts | 374 - .../components/sdfv/properties/properties.ts | 2 +- .../sdfv/renderer/vscode_renderer.ts | 122 +- .../sdfv/transformation/transformation.ts | 113 +- .../components/sdfv/utils/attributes_table.ts | 25 +- .../components/sdfv/utils/helpers.ts | 26 +- .../components/sdfv/vscode_sdfv.css | 18 + src/webclients/components/sdfv/vscode_sdfv.ts | 589 +- .../transformations/transformations.ts | 206 +- .../icpc_webclient_messaging_component.ts | 24 + tsconfig.json | 11 +- 45 files changed, 16495 insertions(+), 7461 deletions(-) create mode 160000 packages/sdfv create mode 100644 src/common/messaging/icpc_messaging_component.ts delete mode 100644 src/components/messaging/component_message_handler.ts create mode 100644 src/components/messaging/icpc_extension_messaging_component.ts delete mode 100644 src/components/messaging/message_receiver_interface.ts create mode 100644 src/modules.d.ts delete mode 100644 src/webclients/components/sdfv/analysis/analysis.ts create mode 100644 src/webclients/components/sdfv/analysis/analysis_controller.ts delete mode 100644 src/webclients/components/sdfv/messaging/message_handler.ts create mode 100644 src/webclients/messaging/icpc_webclient_messaging_component.ts diff --git a/.gitmodules b/.gitmodules index e69de29b..58b17ebc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "packages/sdfv"] + path = packages/sdfv + url = git@github.com:spcl/dace-webclient.git diff --git a/backend/run_dace.py b/backend/run_dace.py index 0102f053..4d7d1abb 100644 --- a/backend/run_dace.py +++ b/backend/run_dace.py @@ -6,11 +6,13 @@ import os import re import sys + try: - import dotenv import re import sys + import dotenv + # First, load the environment dotenv.load_dotenv() # Then, gather values @@ -39,23 +41,20 @@ sys.path.extend(paths) ##################################################################### +import inspect +import sys +from argparse import ArgumentParser +from os import path + # Then, load the rest of the modules import aenum -from argparse import ArgumentParser import dace -import inspect -from os import path -import sys sys.path.append(path.abspath(path.dirname(__file__))) -from dace_vscode.utils import ( - load_sdfg_from_file, - disable_save_metadata, - restore_save_metadata, - get_exception_message, -) -from dace_vscode import transformations, arith_ops +from dace_vscode import arith_ops, transformations +from dace_vscode.utils import (disable_save_metadata, get_exception_message, + load_sdfg_from_file, restore_save_metadata) meta_dict = {} @@ -73,9 +72,8 @@ def get_property_metadata(force_regenerate=False): } # Lazy import to cut down on module load time. - from dace.sdfg.nodes import full_class_path from dace.properties import TypeClassProperty - + from dace.sdfg.nodes import full_class_path # In order to get all transformation metadata the @make.properties # annotation for each transformation needs to have run, so the # transformations are registered in `dace.serialize._DACE_SERIALIZE_TYPES`. @@ -338,6 +336,7 @@ def specialize_sdfg(path, symbol_map, remove_undef=True): def run_daemon(port): from logging.config import dictConfig + from flask import Flask, request # Move Flask's logging over to stdout, because stderr is used for error diff --git a/media/components/analysis/index.html b/media/components/analysis/index.html index e025eb5d..edd76599 100644 --- a/media/components/analysis/index.html +++ b/media/components/analysis/index.html @@ -17,9 +17,9 @@
-