Skip to content

Conversation

@nuhakala
Copy link
Member

@nuhakala nuhakala commented Dec 2, 2025

This PR adds a python script with a Dockerfile which can be primarily used to collect cloud-init logs but also something else if needed. This PR also adds this container to the workflow to be automatically build, so that it can be included in other workflows.

This tool can be used to fetch cloud-init status as requested here metal3-io/metal3-dev-env#955

@metal3-io-bot metal3-io-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 2, 2025
@nuhakala nuhakala changed the title Add a tool to collect cloud-init logs 🌱 Add a tool to collect cloud-init logs Dec 2, 2025
@nuhakala nuhakala force-pushed the nuhakala/cloud-init-tool branch from 49e2408 to aa983a1 Compare December 2, 2025 13:49
@nuhakala
Copy link
Member Author

nuhakala commented Dec 3, 2025

/cc @tuminoid @kashifest

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new cloud-init log collection tool designed to fetch cloud-init status and logs from BareMetal hosts via SSH. The tool is containerized for easy deployment and integrated into the CI/CD pipeline for automated builds. It addresses the need to monitor and debug cloud-init bootstrapping processes on Metal3 nodes.

Key Changes:

  • Python script implementing SSH-based log collection with configurable targets and commands
  • Containerized deployment with Alpine-based Docker image
  • GitHub Actions workflow integration for automated container image builds

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 17 comments.

File Description
cloud-init-tool/main.py Core Python script implementing SSH log collection, environment variable parsing, and bootstrap status checking
cloud-init-tool/README.md Documentation covering usage, configuration, and exit status behavior
cloud-init-tool/Dockerfile Alpine-based container definition with OpenSSH and Python3 dependencies
.github/workflows/build-images-action.yml CI/CD workflow addition to build and push the cloud-init-tool container image
Comments suppressed due to low confidence (1)

cloud-init-tool/main.py:68

  • File is opened but is not closed.
                f = open(file, "w", encoding="utf-8")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kashifest
Copy link
Member

I will check back the copilot review comments when I manage time. Meanwhile feel free to react to those you feel are ok to address

@tuminoid
Copy link
Member

Some are valid, some are too nit-picky. I commented on those I felt need to comment, the rest is more or less cleanup or code quality things.

@nuhakala nuhakala force-pushed the nuhakala/cloud-init-tool branch from aa983a1 to 8b57e01 Compare December 10, 2025 08:11
@kashifest
Copy link
Member

/approve

kashifest
kashifest previously approved these changes Dec 11, 2025
Copy link
Member

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

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

/approve
Thanks for contributing this tool, I think it will help a lot with debugging. 🌟

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 11, 2025
@tuminoid tuminoid requested a review from Copilot December 12, 2025 06:27
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

This needs rebase. It is missing the new signing stuff.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Some typo fix proposals from bot and rebase + sbom/signing enable from me.

@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest, Rozzii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

2 similar comments
@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest, Rozzii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest, Rozzii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 19, 2025
@metal3-io-bot metal3-io-bot merged commit c0fcc42 into metal3-io:main Dec 19, 2025
9 checks passed
@metal3-io-bot metal3-io-bot deleted the nuhakala/cloud-init-tool branch December 19, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants