Skip to content

Fix autoscaler warm runners by aligning DB + runner dirs#18

Merged
depoll merged 6 commits intomainfrom
feature/edit-pool-attributes
Jan 12, 2026
Merged

Fix autoscaler warm runners by aligning DB + runner dirs#18
depoll merged 6 commits intomainfrom
feature/edit-pool-attributes

Conversation

@depoll
Copy link
Copy Markdown
Owner

@depoll depoll commented Jan 11, 2026

Fixes a multi-instance race where the reconciler could delete in-progress runner directories because RUNNERS_DIR defaulted to ~/.action-packer while the DB defaulted to repo-local backend/data.

Changes:

  • Default DB path moved under ACTION_PACKER_HOME (~/.action-packer/data) to match runner storage
  • One-time migration copies legacy backend/data/action-packer.db into the new default if DATA_DIR isn’t set
  • RUNNERS_DIR default now derived from ACTION_PACKER_HOME
  • Tests set isolated DATA_DIR/ACTION_PACKER_HOME in setup

Result: pools maintain warm runners reliably even when multiple Action Packer instances exist.

Copilot AI review requested due to automatic review settings January 11, 2026 20:05
Copy link
Copy Markdown

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 fixes a multi-instance race condition where the reconciler could delete in-progress runner directories because the database and runner storage were using different default locations. The fix aligns both under a common ACTION_PACKER_HOME directory (~/.action-packer) and includes a one-time migration for existing databases.

Changes:

  • Moved default database location from backend/data to ~/.action-packer/data to match runner storage
  • Implemented one-time migration to copy legacy database to new location
  • Updated test setup to use isolated temporary directories for both database and runners

Reviewed changes

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

File Description
backend/src/db/schema.ts Introduces ACTION_PACKER_HOME constant, updates DB default path to use it, adds legacy database migration logic
backend/src/services/runnerManager.ts Adds ACTION_PACKER_HOME constant, derives RUNNERS_DIR from it instead of hardcoding the path
backend/tests/setup.ts Sets isolated ACTION_PACKER_HOME and DATA_DIR environment variables for test isolation, adds cleanup logic

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

Comment thread backend/src/db/schema.ts Outdated
Comment thread backend/src/services/runnerManager.ts Outdated
Comment thread backend/src/db/schema.ts Outdated
Comment thread backend/src/db/schema.ts Outdated
Copy link
Copy Markdown

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 1 comment.


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

Comment thread backend/src/db/schema.ts Outdated
@depoll depoll force-pushed the feature/edit-pool-attributes branch from 6057665 to a78268f Compare January 12, 2026 06:37
- Add back os import in runnerManager.ts (needed for os.homedir() in cleanupGlobalBuildCaches)
- Add getRunnerDownloads mock to test setup (required by runner creation tests)
@depoll depoll merged commit 1372429 into main Jan 12, 2026
4 checks passed
@depoll depoll deleted the feature/edit-pool-attributes branch January 12, 2026 07:32
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