Skip to content

make bpm optional for bosh director workers#2771

Merged
mkocher merged 1 commit into
mainfrom
make-bpm-optional
Jul 14, 2026
Merged

make bpm optional for bosh director workers#2771
mkocher merged 1 commit into
mainfrom
make-bpm-optional

Conversation

@mkocher

@mkocher mkocher commented Jul 14, 2026

Copy link
Copy Markdown
Member

The warden CPI does not work under BPM for multiple reasons:

  • needs priveledged container to run sudo, but then must setpriv to run as vcap so the blobstore-config can be accessed by the director
  • needs /dev/ bind mounted into access loopback devices, but bind mounting /dev in causes other problems

Long term deprecating the warden CPI in favor of the docker CPI makes the most sense. In the short term this will do.

Does this PR introduce a breaking change?

No

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d7715ecc-f84d-402b-878a-c9870319ca2d

📥 Commits

Reviewing files that changed from the base of the PR and between e20dd90 and 4b9483f.

📒 Files selected for processing (4)
  • jobs/director/monit
  • jobs/director/spec
  • jobs/director/templates/bpm.yml
  • jobs/director/templates/worker_ctl.erb

Walkthrough

Adds the director.use_bpm_for_workers property, defaulting to true, and renders a new worker_ctl script. Director worker and dynamic-disk worker BPM definitions are generated conditionally. Monit selects BPM commands and pidfiles when enabled, or worker_ctl commands and legacy pidfiles when disabled.

Suggested reviewers: aramprice

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the problem and breaking change, but it omits most required template sections like tests, release notes, tags, and AI review feedback. Add the missing template sections: what/why, contextual links, tests run, release note text, tagging, and AI review feedback resolution status.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making BPM optional for Bosh Director workers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch make-bpm-optional

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@jobs/director/templates/worker_ctl.erb`:
- Around line 22-26: Update the legacy worker_ctl launcher command to export the
same QUEUE and RUBY_THREAD_* environment variables provided by BPM before
invoking bosh-director-worker. Use the worker configuration and existing symbols
in worker.rb as the source of truth, preserving the current non-BPM startup
command and log redirection.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d3ec6044-e044-4872-8e03-ebb60f1cb5fa

📥 Commits

Reviewing files that changed from the base of the PR and between 2090220 and b2075c9.

📒 Files selected for processing (4)
  • jobs/director/monit
  • jobs/director/spec
  • jobs/director/templates/bpm.yml
  • jobs/director/templates/worker_ctl.erb

Comment thread jobs/director/templates/worker_ctl.erb Outdated
Comment thread jobs/director/spec Outdated
aramprice
aramprice previously approved these changes Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a switch to optionally run BOSH Director worker processes outside BPM, intended to support environments (e.g., warden CPI in nested/containerized setups) where BPM isolation prevents required host access (like /dev).

Changes:

  • Added director.use_bpm_for_workers property (default true) to toggle BPM management of workers.
  • Updated the director BPM template and monit config to conditionally manage worker processes via BPM vs. monit.
  • Introduced a new worker_ctl helper script to start/stop worker processes when not using BPM.

Reviewed changes

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

File Description
jobs/director/templates/worker_ctl.erb Adds a monit-managed worker start/stop script for the non-BPM path.
jobs/director/templates/bpm.yml Makes worker process entries conditional on director.use_bpm_for_workers.
jobs/director/spec Adds the new director.use_bpm_for_workers property and installs worker_ctl.
jobs/director/monit Conditionally starts/stops workers via BPM or worker_ctl based on the new property.

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

Comment thread jobs/director/templates/worker_ctl.erb Outdated
Comment thread jobs/director/templates/worker_ctl.erb Outdated
aramprice
aramprice previously approved these changes Jul 14, 2026

@aramprice aramprice left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you close or address the dangling copilot comments

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@jobs/director/templates/worker_ctl.erb`:
- Around line 53-60: Update the worker launch flow in the start case of
worker_ctl.erb to run the setpriv-wrapped bosh-director-worker in the
background, remove the foreground exec behavior, and write the spawned process
ID from $! to PIDFILE instead of the shell’s $$ so Monit can return successfully
after startup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 12494a2c-f8fc-4550-8faf-8997ecf8a6b1

📥 Commits

Reviewing files that changed from the base of the PR and between b2075c9 and 9f38f59.

📒 Files selected for processing (4)
  • jobs/director/monit
  • jobs/director/spec
  • jobs/director/templates/bpm.yml
  • jobs/director/templates/worker_ctl.erb

Comment thread jobs/director/templates/worker_ctl.erb
aramprice
aramprice previously approved these changes Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 comments.

Comment thread jobs/director/templates/worker_ctl.erb
Comment thread jobs/director/templates/worker_ctl.erb
Comment thread jobs/director/templates/worker_ctl.erb Outdated
@github-project-automation github-project-automation Bot moved this from Waiting for Changes | Open for Contribution to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 14, 2026
@mkocher
mkocher force-pushed the make-bpm-optional branch from 7f9bf0e to e20dd90 Compare July 14, 2026 18:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@jobs/director/templates/worker_ctl.erb`:
- Around line 69-75: Update list_child_processes so it filters using the parent
PID rather than the function’s name argument, preferably by using pgrep -P with
the PID passed by callers. If retaining the pipeline, remove the ineffective
grep -v ^$1$ check and prevent self-matching with [b]osh-director-worker or an
equivalent grep exclusion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e7e5c9fc-1c1e-4b1e-8060-687f4092bd66

📥 Commits

Reviewing files that changed from the base of the PR and between 7f9bf0e and e20dd90.

📒 Files selected for processing (4)
  • jobs/director/monit
  • jobs/director/spec
  • jobs/director/templates/bpm.yml
  • jobs/director/templates/worker_ctl.erb

Comment thread jobs/director/templates/worker_ctl.erb
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Jul 14, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 14, 2026
@github-project-automation github-project-automation Bot moved this from Waiting for Changes | Open for Contribution to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 14, 2026
The warden CPI does not work under BPM for multiple reasons:
* needs priveledged container to run sudo, but then must setpriv
  to run as vcap so the blobstore-config can be accessed by the director
* needs /dev/ bind mounted into access loopback devices, but
  bind mounting /dev in causes other problems

Long term deprecating the warden CPI in favor of the docker CPI makes the most
sense. In the short term this will do.
@mkocher
mkocher dismissed stale reviews from coderabbitai[bot] and aramprice via 4b9483f July 14, 2026 21:12
@mkocher
mkocher force-pushed the make-bpm-optional branch from e20dd90 to 4b9483f Compare July 14, 2026 21:12
@mkocher
mkocher merged commit 0d5cc90 into main Jul 14, 2026
24 checks passed
@mkocher
mkocher deleted the make-bpm-optional branch July 14, 2026 21:35
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jul 14, 2026
mkocher added a commit to cloudfoundry/bosh-deployment that referenced this pull request Jul 17, 2026
the warden cpi does not work when run under BPM, so set the bosh property to
disable it.

cloudfoundry/bosh#2771
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants