Add mu2edaq-discovery auto-discovery support - #9
Merged
Conversation
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>
There was a problem hiding this comment.
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.Responderstartup/shutdown wrapper inserver/mu2e-resource-manager.py. - Adds the
mu2edaq-discoverydependency torequirements.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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #6.
mu2edaq_discovery.Responder(multicast 239.255.42.99:28999 protocol) inserver/mu2e-resource-manager.py, advertising the HTTP port (scheme="http"), so the app appears inmu2edaq-discoverscans and the control room browser.MU2E-RM-DISCOVER-V1on port 8088), which is left intact — that protocol is not the onemu2edaq-discoverspeaks.uvicorn.runand stopped on shutdown (try/finally). Best-effort import.mu2edaq-discoverytorequirements.txt.Closes #6
🤖 Generated with Claude Code