Skip to content

Need resource definition caching #249

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

Closed
3 tasks done
anmenaga opened this issue Nov 1, 2023 · 4 comments
Closed
3 tasks done

Need resource definition caching #249

anmenaga opened this issue Nov 1, 2023 · 4 comments
Milestone

Comments

@anmenaga
Copy link

anmenaga commented Nov 1, 2023

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Currently each dsc.exe operation as a first step performs resource discovery available on the system.
This is relatively slow process especially for resource providers like DSC/PowerShellGroup.
On the other hand, resource definitions do not change often, so their caching will help a lot with speed of dsc.exe operations.

Expected behavior

NA

Actual behavior

NA

Error details

No response

Environment data

NA

Version

v1

Visuals

No response

@anmenaga anmenaga self-assigned this Nov 4, 2023
@mgreenegit
Copy link
Member

Here is the current list of properties

$resourceOutput = [resourceOutput]@{
                type          = $Type
                version       = $r.version.ToString()
                path          = $r.Path
                directory     = $r.ParentPath
                implementedAs = $r.ImplementationDetail
                author        = $r.CompanyName
                properties    = $r.Properties.Name
                requires      = $requiresString
            }

I would like to propose that we do not need "Directory" nor "Author". Thoughts?

I would also propose that we need a -full parameter on dsc resource list that returns all of this information.

Finally, I would suggest that dsc resource cache information could be stored in the following locations.

Windows:
[systemdrive]:/programdata/microsoft/dsc/resource.json
Linux:
/var/lib/microsoft/dsc/resource.json

@anmenaga
Copy link
Author

anmenaga commented Dec 1, 2023

@mgreenegit couple of thoughts:

  1. good idea on locations of cache file: [systemdrive]:/programdata/microsoft/dsc, /var/lib/microsoft/dsc
  2. the format of cache file: it probably should be the format that supports the fastest read/write to the cache. Usually this means a binary, not-human-readable (i.e. not JSON), format.

@anmenaga
Copy link
Author

This is implemented for PS-class-based DSC resources that go through PS adapter;
This also needs to be done for new DSCv3 native resources.

@SteveL-MSFT
Copy link
Member

Resolved for PowerShell group resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants