[PUP-8973] PAL API for compiling serialized AST to a catalog Created: 2018/06/28  Updated: 2018/09/19  Resolved: 2018/09/17

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 6.0.0

Type: Improvement Priority: Normal
Reporter: Michael Smith Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks BOLT-646 Migrate bolt_catalog to use PAL Resolved
Duplicate
duplicates PUP-8596 Add support for CatalogCompiler in PAL Closed
Template:
Epic Link: Apply from Plans
Team: Platform Core
Release Notes: Not Needed
Release Notes Summary: Not really releasing this yet - consider the feature experimental.
QA Risk Assessment: Needs Assessment

 Description   

It should generate a whole catalog from the AST, rather then allow interaction with a catalog object. We expect to apply the catalog directly with a custom Ruby script invoking Puppet.

Need to be able to

  • inject variables and facts
  • specify the modulepath
  • specify or unset $environment
  • supply other Puppet overrides, like bolt_pdb_client

Our datatypes need to be exposed. Believe this should work if they're in modules in the modulepath.

An initial effort exists at https://github.com/puppetlabs/bolt/blob/8d15b7120c58ecbdbcc6acc55e011b390f57f02d/lib/bolt/catalog.rb. It expects a request formatted as

{ "code_ast": "JSON serialized Puppet AST",
  "code_string": "String of code, ignored if AST is provided,
  "modulepath": "Array of directories to use as the modulepath for catalog compilation.
  "target": {
    "name": "the name of the node usually fqdn fro url",
    "facts": "Hash of facts to use for the node",
    "variables": "Hash of variables to use for compilation"
  }}



 Comments   
Comment by Michael Smith [ 2018/07/23 ]

The request format has added a few entries. See https://github.com/puppetlabs/bolt/blob/master/libexec/bolt_catalog#L8-L20 for the latest. pdb_config could be injected separately, but everything else seems directly relevant to compilation.

Comment by Michael Smith [ 2018/09/11 ]

Is all the expected work for this complete Henrik Lindberg?

Comment by Henrik Lindberg [ 2018/09/11 ]

Michael Smith Yes, I think so - pending any feedback (have not received any). Have used the API myself for small utilities (and found and corrected one bug; also merged).

Comment by Scott Garman [ 2018/09/17 ]

Since we had a green run of CI puppet-agent 6.0.0 last night, I'm bulk-changing these issues from Ready for CI -> Resolved in preparation of the release.

Generated at Wed Oct 16 02:38:04 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.