Skip to content

Development Workflows Build Monitoring Guide

Alex J Lennon edited this page Oct 6, 2025 · 1 revision

Build Monitoring and Debugging Guide

This guide covers advanced build monitoring capabilities that go beyond what fioctl can provide.

The fioctl Limitation Problem

Critical Issue: fioctl targets list only shows completed builds, not builds that are currently:

  • RUNNING
  • QUEUED
  • FAILED (early failures)

This creates a blind spot for monitoring build progress and accessing failure logs.

Solution: fio-api.sh Script

The scripts/fio-api.sh script provides real-time build monitoring using the Foundries.io REST API.

Key Capabilities

Feature fioctl fio-api.sh
Show running builds
Real-time log access
Search build logs
Follow logs live
Build failure analysis

Quick Start

Monitor Build Status

# Show recent builds with live status
./scripts/fio-api.sh builds list

# Get detailed build information
./scripts/fio-api.sh builds status 2133

Access Build Logs

# Get recent log lines
./scripts/fio-api.sh builds logs 2133 imx93-jaguar-eink 50

# Follow logs in real-time
./scripts/fio-api.sh builds follow 2133 imx93-jaguar-eink 10

# Search for specific errors
./scripts/fio-api.sh builds search 2133 "ERROR.*dependency"

Build Failure Debugging Workflow

1. Identify Failed Build

./scripts/fio-api.sh builds list

Look for builds with status:

  • FAILED (completed with errors)
  • RUNNING_WITH_FAILURES (still running but has failures)

2. Get Build Details

./scripts/fio-api.sh builds status <build_id>

This shows:

  • Overall build status
  • Individual run status (main + mfgtools)
  • Direct links to logs

3. Analyze Failure Logs

# Get recent error context
./scripts/fio-api.sh builds logs <build_id> <run_name> 100

# Search for specific error patterns
./scripts/fio-api.sh builds search <build_id> "ERROR\|FAILED\|Nothing RPROVIDES"

4. Common Error Patterns

Error Pattern Likely Cause
Nothing RPROVIDES Invalid package dependency
No rule to make target Missing source files
configure: error Missing build dependencies
Permission denied File permissions issue
Host contamination Build environment issue

Example: Build 2133 Failure Analysis

Problem Discovery

$ ./scripts/fio-api.sh builds status 2133
🏗️  Build 2133: RUNNING_WITH_FAILURES
🔧 Runs:
  • imx93-jaguar-eink: FAILED
  • imx93-jaguar-eink-mfgtools: RUNNING

Error Identification

$ ./scripts/fio-api.sh builds search 2133 "ERROR.*RPROVIDES"
ERROR: Nothing RPROVIDES 'coreutils-stty' (but eink-power-cli_git.bb RDEPENDS on it)

Root Cause

  • Recipe had invalid dependency: coreutils-stty
  • Correct package name: coreutils
  • Fix: Update RDEPENDS in recipe

Script Technical Details

Authentication

The script uses your fioctl token:

TOKEN=$(grep access_token ~/.config/fioctl.yaml | cut -d' ' -f4)

API Endpoints

  • Builds: https://api.foundries.io/projects/{factory}/lmp/builds/
  • Logs: https://api.foundries.io/projects/{factory}/lmp/builds/{id}/runs/{run}/console.log
  • Config: https://api.foundries.io/ota/factories/{factory}/config/

Redirect Handling

The script handles redirects to signed Google Storage URLs:

curl -s -L -H "Authorization: Bearer $TOKEN" "$API_BASE/$endpoint"

Advanced Usage

Continuous Monitoring

# Monitor build progress every 30 seconds
while true; do
    echo "$(date): Checking build status..."
    ./scripts/fio-api.sh builds list | head -8
    sleep 30
done

Build Trigger Workflow

# 1. Make changes and commit
git add . && git commit -m "Fix issue"

# 2. Trigger build from meta-subscriber-overrides
cd ../meta-subscriber-overrides
echo "# Trigger $(date)" >> README.md
git add . && git commit -m "Trigger new build"
git push

# 3. Monitor new build
cd ../meta-dynamicdevices
./scripts/fio-api.sh builds list

Troubleshooting

Script Issues

# Check token availability
grep access_token ~/.config/fioctl.yaml

# Test API connectivity
curl -s -H "Authorization: Bearer $(grep access_token ~/.config/fioctl.yaml | cut -d' ' -f4)" \
     "https://api.foundries.io/projects/dynamic-devices/lmp/builds/" | jq '.[0]'

Common Problems

  • "Authorization Required": Token expired, run fioctl login
  • HTML redirect pages: Script needs -L flag for curl (fixed in current version)
  • Empty responses: Check factory name and build ID

See Also

Clone this wiki locally