Skip to content

feat: [ENG-2203] node create accepts cloud-init user data script#189

Merged
sigmachirality merged 2 commits into
mainfrom
dt/support-startup-scripts
Sep 5, 2025
Merged

feat: [ENG-2203] node create accepts cloud-init user data script#189
sigmachirality merged 2 commits into
mainfrom
dt/support-startup-scripts

Conversation

@sigmachirality
Copy link
Copy Markdown
Member

@sigmachirality sigmachirality commented Sep 5, 2025

image

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Sep 5, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  deno.lock Unsupported file format
  package.json  0% smaller
  src/lib/nodes/create.ts  0% smaller

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements cloud-init user data script support for the node create command, enabling users to provide startup scripts that run during VM boot. The changes add two new mutually exclusive command-line options: --user-data for inline scripts and --user-data-file for reading scripts from files.

The implementation follows established CLI patterns by adding the new options to the Commander.js configuration with proper conflict resolution. When users provide user data, it's converted to a byte array using TextEncoder and passed to the nodes SDK as the cloud_init_user_data parameter. The file reading functionality includes appropriate error handling that throws descriptive CommanderError messages when files cannot be read.

To support this functionality, the PR also upgrades the @sfcompute/nodes-sdk-alpha dependency from version 0.1.0-alpha.10 to 0.1.0-alpha.12. This SDK upgrade was necessary to access the updated API interface that includes the new cloud_init_user_data parameter in the NodeCreateParams interface. The feature integrates seamlessly with the existing node creation workflow, enhancing the CLI's capabilities for VM customization and automated setup during boot time.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it adds optional functionality without modifying existing behavior
  • Score reflects well-structured implementation following existing patterns and proper error handling, though the alpha SDK dependency introduces some uncertainty
  • Pay close attention to the SDK version compatibility and ensure the alpha.12 version is stable for production use

2 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Comment thread src/lib/nodes/create.ts
@sigmachirality sigmachirality merged commit 3f8688a into main Sep 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants