-
Notifications
You must be signed in to change notification settings - Fork 635
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
Introduce Dynamo Service Mode as new CLI flag #13659
Conversation
* Removing CanToggleLoginState (#13657) * Dyn 5488 add horizontal scroll bar (#13661) * DYN-5488-Add-Horizontal-Scrollbar When showing the documentation for packages the PackageDetailView extension was not showing the horizontal scroll bar then I added a change so that will be shown when the content is bigger than the usual width. * DYN-5488-Add-Horizontal-Scrollbar The HorizontalScrollBar will be shown only in the DataGrid due that if is shown in the complete SideBar is showing a weird white box. * Disable loading extensions and view extensions in service mode. Co-authored-by: filipeotero <[email protected]> Co-authored-by: Roberto T <[email protected]>
I guess I could add one CLI test for this, but I am uncertain if this PR is meant for merge at all. Theoretically, we could just deploy this branch build. |
/// <param name="info">Host analytics info specifying Dynamo launching host related information.</param> | ||
/// <param name="isServiceMode">Boolean indication of launching Dynamo in service mode, this mode is optimized for minimal launch time.</param> | ||
/// <returns></returns> | ||
public static DynamoModel MakeCLIModel(string asmPath, string userDataFolder, string commonDataFolder, HostAnalyticsInfo info = new HostAnalyticsInfo(), bool isServiceMode = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also added a couple of flags last year :). I guess we need to think of something soon to better consolidate all the MakeModel constructs. Perhaps a startup config file where you can enable/disable features/extensions etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, currently the code (constructors) used for CLI are a bit messy
|
||
NodeFactory = new NodeFactory(); | ||
NodeFactory.MessageLogged += LogMessage; | ||
|
||
//Initialize the ExtensionManager with the CommonDataDirectory so that extensions found here are checked first for dll's with signed certificates | ||
extensionManager = new ExtensionManager(new[] { PathManager.CommonDataDirectory }); | ||
extensionManager.MessageLogged += LogMessage; | ||
var extensions = config.Extensions ?? LoadExtensions(); | ||
var extensions = config.Extensions ?? new List<IExtension>(); | ||
if (!extensions.Any() && !IsServiceMode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a list somewhere with all our default extensions and what are they doing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In code, we dont maintain a list. We only maintain the list using xml manifest files in extensions
and viewextensions
folder
src/DynamoCoreWpf/ViewModels/Core/DynamoViewModelDelegateCommands.cs
Outdated
Show resolved
Hide resolved
@@ -84,11 +84,13 @@ public override void Loaded(ViewLoadedParams viewLoadedParams) | |||
// as we may have installed a missing package. | |||
|
|||
DependencyView.CustomNodeManager = (CustomNodeManager)viewLoadedParams.StartupParams.CustomNodeManager; | |||
|
|||
pmExtension.PackageLoader.PackgeLoaded += (package) => | |||
if (pmExtension != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If pmExtenions does not exist does it makes sense to load this one or we can simply return here at the beginning ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other types of workspace dependencies (e.g. local dependency, custom node workspace dependency) that are not depending on pmExtension, so it still make sense to load I believe.
@mjkkirschner @BogdanZavu @reddyashish @zeusongit @pinzart @aparajit-pratap @sm6srw All tests are passing so if you would like to make this |
# Conflicts: # src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs
* Add ServiceMode to Linux * Load extensions in service mode * Do not load preference setting file in ServiceMode --------- Co-authored-by: Craig Long <[email protected]>
Both tests reported passing locally. Merging |
Please Note:
DynamoRevit
repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTM
label is added to the PR.Purpose
This is a PR introducing service mode
-s
as CLI flag to minimize code startup time. I have finished going through most of the initialization logic and decided to skip certain ones with graph opening tested.Here is the current list of steps that can be skipped:
DynamoModel:
DisableAnalytics
flag for Alias TeamDynamoViewModel:
Performance gain:
Test env: Macbook M1 - MacOS - Parallel - Win 11 setup
The memory diff of launching DynamoWPF CLI in keep-alive mode (what player is using)
Before: ~116mb
After: ~104mb roughly 10% gain.
The profiling time (DotTrace - Trace Mode) diff of launching DynamoWPF CLI in keep-alive mode (what player is using)
Before: ~10300ms
After: ~7900ms with roughly ~24% gain in the current state of PR. I suggest Team Morpheus wrap up the current work and introduce the service mode officially.
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Introduce Dynamo Service Mode for CLI usage and minimal cold start time.
Reviewers
@DynamoDS/dynamo
FYIs
@Amoursol