BagToad / arc-log-collection-scripts

Shell scripts to dump diagnostic information and logs from your Actions Runner Controller deployment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ARC Log Collection Scripts

ARC Log Collection Scripts is a collection of Shell scripts to dump diagnostic information and logs from your Actions Runner Controller deployment.

  • bundle.sh collects logs from the ARC components and runner pods.
  • runner-monitor.sh monitors and collects logs from the runner pods until the monitor script is killed.

Anatomy of the ARC Log Bundle

A key output of the ARC log bundle is the bundle.md file, which contains a summary of the ARC deployment, metrics, and logs from ALL pods, including non-ARC pods.

The ARC Log Bundle consists of the following components:

  • πŸ“‚ arc-bundle-logs
    • πŸ“‚ helm_info
      • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_all.yaml
      • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_values.yaml
    • πŸ“‚ pod_logs
      • πŸ“‚ [PODNAME]_NS_[NAMESPACE].log
      • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_meta.txt
      • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_meta.yaml
    • πŸ“‚ kubectl-events.log
    • πŸ“‚ bundle.md

Anatomy of the Runner Monitor Log Directory

The Runner Monitor Log Directory consists of the following components:

  • πŸ“‚ runner-pod-logs
    • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_runner.log
    • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_runner_meta.txt
    • πŸ“‚ [PODNAME]_NS_[NAMESPACE]_runner_meta.yaml

Privacy

The ARC bundle logs collect logs from ALL pods, including non-ARC pods, in your ARC deployment because GitHub recommends deploying ARC in a dedicated cluster.

If you have deployed ARC in a shared cluster, the logs may contain sensitive information from other workloads. It is your responsiblity to review the logs before sharing them with others, including GitHub.

Efforts are made to sanitize sensitive information from the logs, such as removing github_token and github_app_private_key from the Helm configuration output.

It is your responsibility to review the logs before sharing them with others, including GitHub. Redact any sensitive information. If manual redaction is not reasonable, delete pod logs containing sensitive information.

Getting Started

Prerequisites

A BASH shell with the kubectl, helm, jq, and other standard Linux utilities installed.

Usage

  1. Clone the repository:
git clone https://github.com/BagToad/arc-log-collection-scripts.git
  1. Navigate to the directory where you've cloned the repository:
cd arc-log-collection-scripts

Run the desired scripts:

# Generate an ARC log bundle snapshot.
./bundle.sh

# Generate logs for runner pods only. 
./runner_monitor.sh
# CTRL+C when finished monitoring.

Examples

./bundle.sh -p 0 -d 0 -r 0         #Disable polling for ephemeralrunner pods and do not tail runner pod logs.
./bundle.sh -p 10 -d 5 -r 60       #Run the script with an ephemeralrunner poll count of 10, delay of 5 seconds, and runner pod log tail timeout of 60 seconds

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing and Support

Pull requests are welcome. For major changes, please open an issue first to discuss your change.

About

Shell scripts to dump diagnostic information and logs from your Actions Runner Controller deployment.

License:MIT License


Languages

Language:Shell 100.0%