Skip to content

contrib/dev-util: make the cluster script work on macOS - #6122

Draft
emelialei88 wants to merge 1 commit into
bloomberg:mainfrom
emelialei88:fix/cluster-script
Draft

contrib/dev-util: make the cluster script work on macOS#6122
emelialei88 wants to merge 1 commit into
bloomberg:mainfrom
emelialei88:fix/cluster-script

Conversation

@emelialei88

@emelialei88 emelialei88 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🎯 The "Why" (Intent)

contrib/dev-util/cluster assumed a Linux host and an image that only ran a
host-built binary. On macOS init, run, tmux and test all broke: no systemd, no
docker group, no /proc, and a Mach-O binary Linux containers cannot execute.
Getting it working surfaced breakage that was never host-specific.

🛠️ The "What" (Critical Changes)

  • update builds Comdb2 inside a node; the bind-mounted source means one build
    serves the cluster, in build-docker/ so it does not fight a host cmake cache.
  • Linux-only checks — systemctl, docker group, /proc, sudo rm — are guarded
    by uname; figlet falls back to a plain banner.
  • Fixes unrelated to the host: the image would not build where the host uid
    collides with the stock ubuntu account (uid 1000) in noble and later;
    start brought up nothing; setup ran a copy of this script frozen into the
    image; the client config went where cdb2api never reads it; and the persist=0
    tmpfs mounted on a literal /opt/bb:exec.
  • db becomes startdb; stopdb, rmdb and set are new; status names the
    databases. Matching is by command line — comdb2 renames its main thread, so
    matching the process name misses a live server.
  • tmux targets its own window, so panes cannot land in an unrelated attached
    session; gdb refuses under CPU emulation, where ptrace cannot read
    registers, and gdb/vg stop a running database first.

@roborivers roborivers 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.

Cbuild submission: Success ✓.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_resume_logicalsc_generated **quarantined**
cdb2jdbc
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_nosource_generated [timeout]
phys_rep_tiered_firstfile_generated [timeout]

@roborivers roborivers 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.

Cbuild submission: Success ✓.
Regression testing: Success ✓.

The first 10 failing tests are:
cdb2jdbc
reco-ddlk-sql **quarantined**
timepart_retro
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_firstfile_generated [timeout]
phys_rep_tiered_nosource_generated [timeout]

@emelialei88
emelialei88 force-pushed the fix/cluster-script branch 4 times, most recently from bd26dde to 351697e Compare August 12, 2026 17:58

@roborivers roborivers 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.

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_truncate [db unavailable at finish]
cdb2jdbc
ssl_san
consumer_non_atomic_default_consumer_generated **quarantined**
ssl_set_cmd
ssl_prefer
ssl_dbname
sc_downgrade [timeout] **quarantined**
reco-ddlk-sql [timeout] **quarantined**

@roborivers roborivers 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.

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_resume_logicalsc_generated **quarantined**
queuedb_rollover **quarantined**
cdb2jdbc
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**

The helper assumed a Linux host and a runtime-only image. Guard the
Linux-only bits behind uname, and build comdb2 inside the containers so
the same flow works on Linux and Mac.

Fix the host-agnostic breakage that surfaced along the way: "start"
brought up nothing, "setup" ran a copy of this script frozen into the
image, the client config was shipped where cdb2api never reads it, the
persist=0 tmpfs mounted on a literal "/opt/bb:exec", and the image
failed to build on any host whose uid collides with the stock "ubuntu"
account that ubuntu:noble and later ship on uid 1000.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Emelia Lei <wlei29@bloomberg.net>

@roborivers roborivers 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.

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_resume
cdb2jdbc
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**

@roborivers roborivers 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.

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_truncate_multiddl_generated [db unavailable at finish] **quarantined**
queuedb_rollover_noroll1_generated **quarantined**
cdb2jdbc
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**

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