How newrelic/open-install-library works
Project type and purpose
• This is an open-source “install library” tool (not a typical web app). It provides:
• A command-line interface (newrelic-cli)
• A collection of YAML “recipes” for automated installation of New Relic products
• A validator component to enforce recipe schemas
• An automated test framework that provisions cloud or local environments, runs recipes, validates data ingestion, and tears down resources
• CI/CD pipelines via GitHub Actions
File structure
• Top-level:
• Dockerfile.validator, validator/ → Node.js validator for recipe schema
• recipes/ → YAML definitions of install recipes per product, platform, language
• test/ → test definitions (test/definitions) + ansible/Terraform-based test deploy scripts (test/deploy)
• .github/workflows/ → CI workflows (cleanup, non-regression, smoke, release)
• README.md, docs/ → user and developer documentation
• Patterns:
• Plugin-style architecture: recipes are “plugins” loaded by the CLI
• Validator enforces recipe structure against schema (validator/schema-v1.json)
• Test framework uses Deployer + Terraform + Ansible roles to verify each recipe
• Key config/build:
• validator/package.json → Node.js module
• GitHub Actions YAML → CI orchestration
README for additional insights
• Describes mission, usage, testing approach
• Explains test framework relies on Deployer and definitions under test/definitions
Main components
a. newrelic-cli
• Downloads via install.sh / install.ps1
• Loads recipes (recipes/)
• Invokes validator module
• Executes selected recipe (Ansible playbooks under recipes/)
• Calls New Relic REST API to register instrumentation
b. Validator service
• Node.js process
• Validates recipe YAML against JSON schema
c. Recipes
• YAML files per product/platform
• Mapped to Ansible roles, templates, handlers
d. Test Framework
• Definitions (test/definitions): JSON describing cloud infra needs
• Deployer (external GitHub project): provisions AWS/Azure/GCP or local resources
• Terraform & Ansible roles (test/deploy): executes recipe, runs assertions
• Validates that telemetry arrives in New Relic
e. CI/CD (GitHub Actions)
• Workflows: cleanup, validation, non-regression, smoke tests, release
• Steps: run validator → run test framework → report → publish
f. External services
• Cloud providers (AWS, Azure, GCP)
• New Relic APIs
• DNS, artifact hosting (GitHub Releases, npm for validator)
Relationships and interactions
• User invokes newrelic-cli → reads recipes → passes recipe to validator → if valid, CLI triggers
recipe execution
→ Ansible roles configure components on target host or provisioned infra
→ Agents forward data to New Relic APIs
• Test framework triggered by CI: definitions → Deployer → provision infra → run recipe → assertions → teardown
• CI orchestrates validator, test framework, release publication
Architectural patterns and design principles
• Modular/Plugin: recipes are independent modules
• Separation of concerns: CLI, validator, recipes, and tests are decoupled
• Infrastructure-as-Code: long-lived test definitions drive Terraform/Ansible provisioning
• Schema-driven validation: recipes must conform to a JSON schema
• GitOps/CI: automated pipeline ensures quality gates
Technologies, frameworks, libraries
• Node.js for validator
• Bash/PowerShell for CLI install script
• Ansible roles embedded in recipes and test/deploy
• Terraform (test/deploy/terraform)
• GitHub Actions for CI
• Deployer (external) for provisioning
• Docker for validator container
• YAML/JSON for recipes and definitions
Detail
• Data-flow directions
• Break out test framework subcomponents (definitions, deployer, Terraform, assertions)
• Validator schema file as supporting artifact