Comments (8)
@michaeltlombardi yes, this type of resource would indicate in their manifest it's a "provider" of resources (I'm certainly open to other names) in that discovery would call these types of resources for enumeration.
As you noted, other languages with runtimes (basically any script-based language) would control their own lifetimes rather than spinning up a new process for every resource of that type. You got the intent correct, but I think it also solves other problems. In the case of Python, you can imagine a Python2 resource vs a Python3 resource or perhaps just a Python resource that had a property indicating the version.
from dsc.
In this specific case, I would think this PowerShellGroup
resource would be written in C# and could host the .NET CLR, but there would be problems between 5.1 and 7. Shelling out to a long lived powershell.exe and pwsh.exe may be simpler although the continuous interaction with those processes via STDIN and STDOUT would be more complex.
However, whether we decide this is the right direction should be independent of the engineering work until proven otherwise :)
from dsc.
I think this would be a great option and could really help for ruby/python/node resources. If I understand this proposal correctly, this is for being able to define a provider and have resources indicate that they belong to that provider?
I think that's a much more maintainable model than the Puppet providers, where you had one "resource" that could have many backends (so I could write a file
provider for Windows that reuses the same resource configuration surface as the one for Unix). My experience working on those is that the differences between providers became complex enough that we would've been better off having separate resources.
If the intent is "make it much easier to call resources written in interpreted languages without full overhead for each resource" then I think this is a stellar idea.
from dsc.
2 thoughts on this:
- This steps onto the territory of a "resource provider" concept in dscv3. So I'd prefer that this functionality to be generic enough so it can be used by other "resource providers" - API and interaction protocol "dscv3 <-> a resource provider" clearly defined; Then PS Classic resource provider can be an example for that.
- I'm fine with PS Classic resource handler to be implemented this way eventually; but as a first step it probably should be in dsc.exe Once the interface for resource providers becomes clear, it can be moved into a separate resource provider.
from dsc.
@anmenaga an additional benefit of this approach being outside of dsc
itself is that it can be implemented in C# instead of Rust which should make it faster to develop. In this case, I'd imagine we'd have a psdsc
executable (name pending) that exposes both a DSC/PowerShellGroup
and DSC/WindowsPowerShellGroup
resources. For execution, the only difference is that DSC/WindowsPowerShellGroup
would call psdsc
with a switch to indicate it should use powershell.exe
instead of pwsh.exe
(the default)
from dsc.
One other question this raises for me is what it looks like when I want to call dsc resource foo
for a PowerShell DSC Resource - does that need to be nested in a DSC/PowerShellGroup
Resource?
from dsc.
@michaeltlombardi that is true for any group resource, but presumably psresource
(or whatever we call it) would expose that capability if you don't want to craft a config for it or we could say you just use Invoke-DscResource
for direct execution.
from dsc.
Two things this made me think about:
- There is a long standing ask for resources to pass output/input from one to another. Could this work within a group, and then have the group pass through selected output to the next group or resource in a config?
- Would it make sense for groups to support a reference to an external file for composability?
from dsc.
Related Issues (20)
- Unable to reuse `reference()` in set operation from get and test
- The `int()` function incorrectly handles non-integer numbers HOT 4
- Update `dsc --version` to include build info
- Resources in parallel unless dependson HOT 4
- Create JSON/YAML for configs that only use /*powershell adapter, from PowerShell script HOT 1
- Installing resources HOT 1
- localization support
- Include metadata in result objects HOT 2
- Some static-analysis support HOT 1
- Intent for this implementation - will it only be an Intermediate language? HOT 3
- Extend exitCodes to support Hexidecimal error codes HOT 1
- Add tests for canonical schemas
- `IncludeGroup` to include an external configuration HOT 5
- Enable `dsc config resolve` for included configs HOT 2
- Install PowerShell7 resource HOT 6
- Long running mode for DSC HOT 2
- Resource to manage Windows env vars HOT 1
- Define semantic exit codes for the PowerShell adapters HOT 2
- Automatically handle messages from PSDSC resources
- Use trace messaging to indicate composite resources are being ignored HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsc.