Skip to content

Extension to visualize metadata provided externally #1418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

leman31
Copy link

@leman31 leman31 commented Jan 17, 2025

No description provided.

@mciprian13
Copy link

@lutzroeder The build problems were fixed.
Please have a look on the features by looking into the provided archive (one of the links above):
https://github.com/user-attachments/files/18619053/Package.zip
We can continue the discussions on the features, code review, etc.
Thank you!

@mciprian13
Copy link

@lutzroeder Can you please have another look? We are available to answer your questions and requests related to this PR. Thank you!

@lutzroeder lutzroeder force-pushed the main branch 5 times, most recently from 3a62144 to 1c38361 Compare March 30, 2025 16:32
@mciprian13
Copy link

@lutzroeder Kind reminder to help us, based on your availability, to review and land this feature which is important to us.

@lutzroeder lutzroeder force-pushed the main branch 2 times, most recently from c0a8d0d to 94c2a0e Compare April 7, 2025 01:23
lutzroeder added a commit that referenced this pull request Apr 11, 2025
@lutzroeder
Copy link
Owner

lutzroeder commented Apr 11, 2025

Hi @mciprian13 @leman31 — to help move this forward:

  • Let's revert all security-related changes, including the use of unsafe-inline and unsafe-eval.

  • The idea of enabling actions is interesting. However, allowing arbitrary executables to be invoked based on a metrics file introduces significant security concerns — e.g., could a metrics file be crafted to execute malicious code? Also, referencing specific executables isn't portable across platforms. Have you considered using protocol handlers instead?

  • The current pull request modifies and cleans HTML directly, rather than building on the existing data model and sidebar integration. I pushed a change to main that extends the current metrics implementation to support external .metrics.json files using the existing sidebar logic. Would it be possible to shift to that approach as a baseline?

See #1240 for examples. If you open the attached model files and drag a .json file into the view, its metrics will appear in the sidebar alongside built-in and model-derived metrics.

lutzroeder added a commit that referenced this pull request Apr 11, 2025
lutzroeder added a commit that referenced this pull request Apr 12, 2025
@lutzroeder lutzroeder force-pushed the main branch 2 times, most recently from 6e60e95 to df7f56d Compare April 13, 2025 15:58
@mciprian13
Copy link

Hi @mciprian13 @leman31 — to help move this forward:

  • Let's revert all security-related changes, including the use of unsafe-inline and unsafe-eval.
  • The idea of enabling actions is interesting. However, allowing arbitrary executables to be invoked based on a metrics file introduces significant security concerns — e.g., could a metrics file be crafted to execute malicious code? Also, referencing specific executables isn't portable across platforms. Have you considered using protocol handlers instead?
  • The current pull request modifies and cleans HTML directly, rather than building on the existing data model and sidebar integration. I pushed a change to main that extends the current metrics implementation to support external .metrics.json files using the existing sidebar logic. Would it be possible to shift to that approach as a baseline?

For example, if you open the attached model file and drag a .metrics.json file into the view, its metrics will appear in the sidebar alongside built-in and model-derived metrics.

mnist.metrics.zip model.metrics.zip

To your points:

  1. We can revert those changes although we will have to reevaluate to see whether some features are impacted or not.
  2. Having actions by running executables/commands is a very powerful way to add all sort of functionality. For us the security aspect is irrelevant because we are creating the meta files and we are consuming the meta files. The meta files are ways to add extra information/functionality to Netron from outside. This is good enough for us.
  3. Having the same meta in JSON format is a small change but changing the way the same information is imported in the tool is a very significant change and I am afraid we don't have time for such a big change. We will have to evaluate the effort needed but if it is too large we will have to drop the path of upstreaming this.

@lutzroeder lutzroeder force-pushed the main branch 3 times, most recently from dd68bee to a2041e3 Compare May 6, 2025 02:06
@lutzroeder lutzroeder force-pushed the main branch 5 times, most recently from cb704d1 to 32e7ebe Compare May 17, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants