Skip to content

Cross-platform updates to DSC code in SMA DLL - #13399

Merged
Dongbo Wang (daxian-dbw) merged 70 commits into
PowerShell:masterfrom
anmenaga:JsonWork
Feb 2, 2021
Merged

Cross-platform updates to DSC code in SMA DLL#13399
Dongbo Wang (daxian-dbw) merged 70 commits into
PowerShell:masterfrom
anmenaga:JsonWork

Conversation

@anmenaga

@anmenaga Andrew (anmenaga) commented Aug 11, 2020

Copy link
Copy Markdown

PR Summary

This PR is in context of DSC changes for PowerShell 7.
P0 end-to-end scenario that we are enabling here consists of 3 components: PowerShell core (SMA dll), PSDesiredStateConfiguration module, GuestConfigAgent.
This PR addresses the first part - updates to DSC code in SMA dll to remove dependency on MOF/MMI APIs, therefore making DSC cross-platform and enabling GuestConfigAgent scenarios.
Focus is on class-based DSC resources.

PR Context

Fix #13731

At this point this PR is not a breaking change: existing (MOF/MMI-based) DSC code will continue to work as it was and will continue to be the default mechanism for DSC operations (for now).
Cross-platform DSC updates of this PR are done as an alternative mechanism for DSC operations; to use them:

  1. PSDesiredStateConfiguration v3 module has to be installed;
  2. PS7DscSupport experimental feature has to be enabled.

Example:
U18ClassDscCapture

PR Checklist

@iSazonov

Copy link
Copy Markdown
Collaborator

Are there performance comparisons? It would be very amazing if new schema worked slower than original.

Comment thread src/System.Management.Automation/DscSupport/MofDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/MofDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/engine/InitialSessionState.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/MofCimDSCParser.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonCimDSCParser.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonCimDSCParser.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDeserializer.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDeserializer.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/engine/InitialSessionState.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDeserializer.cs Outdated
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Aug 11, 2020
@ThomasNieto

Copy link
Copy Markdown
Contributor

The cmdlet name to convert MOF to JSON doesn't fit the naming conversions. It looks only to be one directional not bi-directional. Convert-CimMofToJson to something like ConvertTo-DscJsonSchema. The PS verb description for Convert indicates bi-directional and ConvertTo is one directional.

Convert - Changes the data from one representation to another when the cmdlet supports bidirectional conversion or when the cmdlet supports conversion between multiple data types.
ConvertTo - Converts from one or more types of input to a primary output type (the cmdlet noun indicates the output type).

Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonCimDSCParser.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/ConvertCimMofToJsonCommand.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Aug 12, 2020
Comment thread src/System.Management.Automation/DscSupport/CimDSCParser.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/CimDSCParser.cs
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated

@TravisEz13 Travis Plunk (TravisEz13) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes to build.psm1 and the changes to find PSDesiredStateConfiguration.

Comment thread src/System.Management.Automation/engine/parser/Parser.cs Outdated
Comment thread src/System.Management.Automation/engine/parser/Parser.cs
Comment thread src/System.Management.Automation/engine/parser/Parser.cs
Comment thread src/System.Management.Automation/engine/parser/Parser.cs Outdated
Comment thread src/System.Management.Automation/engine/parser/Parser.cs Outdated
Comment thread build.psm1 Outdated
Comment thread src/System.Management.Automation/DscSupport/CimDSCParser.cs Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daxian-dbw

Copy link
Copy Markdown
Member

Rob Holt (@rjmholt) Can you please update your review? Thanks

Comment thread src/System.Management.Automation/DscSupport/JsonCimDSCParser.cs
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
Comment thread src/System.Management.Automation/DscSupport/JsonDscClassCache.cs Outdated
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 8e3c3e0 into PowerShell:master Feb 2, 2021
@daxian-dbw Dongbo Wang (daxian-dbw) added CL-Engine Indicates that a PR should be marked as an engine change in the Change Log and removed CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Feb 2, 2021
@iSazonov

Copy link
Copy Markdown
Collaborator

Andrew (@anmenaga) Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support only DSC class based resources

10 participants