Skip to content

Add mu2edaq-discovery auto-discovery support - #9

Merged
normanajn merged 1 commit into
mainfrom
add-discovery-support
Jun 29, 2026
Merged

Add mu2edaq-discovery auto-discovery support#9
normanajn merged 1 commit into
mainfrom
add-discovery-support

Conversation

@normanajn

Copy link
Copy Markdown
Contributor

Implements #6.

  • Embeds a standard mu2edaq_discovery.Responder (multicast 239.255.42.99:28999 protocol) in server/mu2e-resource-manager.py, advertising the HTTP port (scheme="http"), so the app appears in mu2edaq-discover scans and the control room browser.
  • This is separate from the resource manager's existing UDP-broadcast discovery (MU2E-RM-DISCOVER-V1 on port 8088), which is left intact — that protocol is not the one mu2edaq-discover speaks.
  • Started before uvicorn.run and stopped on shutdown (try/finally). Best-effort import.
  • Adds mu2edaq-discovery to requirements.txt.

Verified: Responder start/stop smoke-tested against the sibling library. Full end-to-end not run here.

Closes #6

🤖 Generated with Claude Code

Embeds a standard mu2edaq-discovery Responder (multicast protocol) in the
server so the app appears in mu2edaq-discover scans and the control room
browser. Advertises the HTTP port (scheme http). This is separate from the
resource manager's existing UDP-broadcast discovery (MU2E-RM-DISCOVER-V1),
which is left intact. Started before uvicorn serves and stopped on
shutdown; best-effort import. Adds mu2edaq-discovery to requirements.txt.

Closes #6

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 29, 2026 19:48

Copilot AI 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.

Pull request overview

Adds support for the standard Mu2e DAQ multicast discovery protocol so the resource manager can be found by mu2edaq-discover and the control-room discovery browser, while keeping the existing RM UDP-broadcast discovery intact.

Changes:

  • Adds a best-effort mu2edaq_discovery.Responder startup/shutdown wrapper in server/mu2e-resource-manager.py.
  • Adds the mu2edaq-discovery dependency to requirements.txt.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
server/mu2e-resource-manager.py Starts/stops a mu2edaq-discovery responder to advertise the HTTP service via multicast discovery.
requirements.txt Adds the mu2edaq-discovery dependency for installation.

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

Comment on lines +236 to +254
# Mu2e DAQ service discovery (standard multicast protocol): advertise the
# HTTP port so the app appears in mu2edaq-discover scans and the control
# room browser. Separate from the resource manager's own UDP broadcast
# discovery above. Best-effort so a missing package never blocks startup.
mu2e_responder = None
try:
from mu2edaq_discovery import Responder
mu2e_responder = Responder(name="Resource Manager",
app="resource-manager",
port=args.port, scheme="http")
mu2e_responder.start()
except Exception as exc:
print(f"[Discovery] mu2edaq responder not started: {exc}")

try:
uvicorn.run(app, host=args.host, port=args.port)
finally:
if mu2e_responder is not None:
mu2e_responder.stop()
@normanajn
normanajn merged commit e001497 into main Jun 29, 2026
1 check passed
@normanajn
normanajn deleted the add-discovery-support branch June 29, 2026 22:12
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.

Add mu2edaq-discovery auto-discovery support

2 participants