-
Notifications
You must be signed in to change notification settings - Fork 55
Add pulsar relay mode #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
59b7bef
First version of long-polling proxy integration
mvdbeek b2d5a08
Add docs
mvdbeek f3669cd
Type fixes
mvdbeek 54dc8a2
Rename proxy to relay
mvdbeek 7cedf05
Doc-lint fixes
mvdbeek e8f347a
Add a no-ack consumer
mvdbeek 39c38b6
Mark pulsar-relay experimental in the docs
mvdbeek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,6 +222,190 @@ In the event that the connection to the AMQP server is lost during message | |
| publish, the Pulsar server can retry the connection, governed by the | ||
| ``amqp_publish*`` options documented in `app.yml.sample`_. | ||
|
|
||
| Message Queue (Pulsar-Proxy) | ||
| ----------------------------- | ||
|
|
||
| Pulsar can also communicate with Galaxy via **pulsar-proxy**, an HTTP-based | ||
| message proxy. This mode is similar to the AMQP message queue mode but uses | ||
| HTTP long-polling instead of a message broker like RabbitMQ. This is ideal when: | ||
|
|
||
| * Galaxy cannot directly reach Pulsar (e.g., due to firewall restrictions) | ||
| * You want to avoid deploying and managing a RabbitMQ server | ||
| * You prefer HTTP-based communication for simplicity and observability | ||
|
|
||
| Architecture | ||
| ```````````` | ||
|
|
||
| In this mode: | ||
|
|
||
| 1. **Galaxy → Pulsar**: Galaxy posts control messages (job setup, status requests, | ||
| kill commands) to the proxy via HTTP POST | ||
| 2. **Pulsar → Galaxy**: Pulsar polls the proxy via HTTP long-polling to receive | ||
| these messages | ||
| 3. **Pulsar → Galaxy**: Pulsar posts status updates to the proxy | ||
| 4. **Galaxy → Pulsar**: Galaxy polls the proxy to receive status updates | ||
|
Comment on lines
+241
to
+246
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be:
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, and I thought I changed the language to relay 🤔 |
||
| 5. **File Transfers**: Pulsar transfers files directly to/from Galaxy via HTTP | ||
| (not through the proxy) | ||
|
|
||
| :: | ||
|
|
||
| Galaxy ──POST messages──> pulsar-proxy ──poll──> Pulsar Server | ||
| │ | ||
| │ | ||
| Galaxy <────────direct HTTP for file transfers─────────┘ | ||
|
|
||
| Pulsar Configuration | ||
| ```````````````````` | ||
|
|
||
| To configure Pulsar to use pulsar-proxy, set the ``message_queue_url`` in | ||
| ``app.yml`` with a ``http://`` or ``https://`` prefix:: | ||
|
|
||
| message_queue_url: http://proxy-server.example.org:9000 | ||
| message_queue_username: admin | ||
| message_queue_password: your_secure_password | ||
|
|
||
| The ``http://`` / ``https://`` prefix tells Pulsar to use the proxy communication mode instead | ||
| of AMQP. | ||
|
|
||
| .. note:: | ||
|
|
||
| Unlike AMQP mode, the pulsar-proxy mode does **not** require the ``kombu`` | ||
| Python dependency. It only requires the ``requests`` library, which is a | ||
| standard dependency of Pulsar. | ||
|
|
||
| Galaxy Configuration | ||
| ```````````````````` | ||
|
|
||
| In Galaxy's job configuration (``job_conf.yml``), configure a Pulsar destination | ||
| with proxy parameters:: | ||
|
|
||
| runners: | ||
| pulsar: | ||
| load: galaxy.jobs.runners.pulsar:PulsarMQJobRunner | ||
| # Proxy connection | ||
| proxy_url: http://proxy-server.example.org:9000 | ||
| proxy_username: admin | ||
| proxy_password: your_secure_password | ||
|
|
||
|
|
||
| execution: | ||
| default: pulsar_proxy | ||
| environments: | ||
| pulsar_proxy: | ||
| runner: pulsar | ||
| # Galaxy's URL (for Pulsar to reach back for file transfers) | ||
| url: http://galaxy-server.example.org:8080 | ||
| # Remote job staging directory | ||
| jobs_directory: /data/pulsar/staging | ||
|
|
||
|
|
||
| Authentication | ||
| `````````````` | ||
|
|
||
| The pulsar-proxy uses JWT (JSON Web Token) authentication. Galaxy and Pulsar | ||
| authenticate with the proxy using the username and password provided in the | ||
| configuration. Tokens are automatically managed and refreshed as needed. | ||
|
|
||
| .. tip:: | ||
|
|
||
| In production, always use HTTPS for the proxy URL to encrypt credentials | ||
| and message content during transit:: | ||
|
|
||
| message_queue_url: https://proxy-server.example.org:443 | ||
|
|
||
| Security Considerations | ||
| ``````````````````````` | ||
|
|
||
| * **Use HTTPS**: Always use HTTPS for the proxy URL in production | ||
| * **Strong Passwords**: Use strong, unique passwords for proxy authentication | ||
| * **Network Isolation**: Deploy the proxy in a DMZ accessible to both Galaxy | ||
| and Pulsar | ||
| * **Firewall Rules**: | ||
| * Galaxy → Proxy: Allow outbound HTTPS | ||
| * Pulsar → Proxy: Allow outbound HTTPS | ||
| * Pulsar → Galaxy: Allow outbound HTTP/HTTPS for file transfers | ||
|
|
||
| Multiple Pulsar Instances | ||
| `````````````````````````` | ||
|
|
||
| You can deploy multiple Pulsar instances with different managers, all using the | ||
| same proxy. Messages are routed by topic names that include the manager name. | ||
|
|
||
| For example, configure two Pulsar servers: | ||
|
|
||
| **Pulsar Server 1** (``app.yml``):: | ||
|
|
||
| message_queue_url: http://proxy-server:9000 | ||
| message_queue_username: admin | ||
| message_queue_password: password | ||
| managers: | ||
| cluster_a: | ||
| type: queued_slurm | ||
|
|
||
| **Pulsar Server 2** (``app.yml``):: | ||
|
|
||
| message_queue_url: http://proxy-server:9000 | ||
| message_queue_username: admin | ||
| message_queue_password: password | ||
| managers: | ||
| cluster_b: | ||
| type: queued_condor | ||
|
|
||
| In Galaxy's job configuration, route jobs to specific clusters using the | ||
| ``manager`` parameter:: | ||
|
|
||
| execution: | ||
| environments: | ||
| cluster_a_jobs: | ||
| runner: pulsar | ||
| proxy_url: http://proxy-server:9000 | ||
| manager: cluster_a | ||
| # ... other settings | ||
|
|
||
| cluster_b_jobs: | ||
| runner: pulsar | ||
| proxy_url: http://proxy-server:9000 | ||
| manager: cluster_b | ||
| # ... other settings | ||
|
|
||
| Topic Naming | ||
| ```````````` | ||
|
|
||
| Messages are organized by topic with automatic naming based on the manager name: | ||
|
|
||
| * Job setup: ``job_setup_{manager_name}`` or ``job_setup`` (for default manager) | ||
| * Status requests: ``job_status_request_{manager_name}`` | ||
| * Kill commands: ``job_kill_{manager_name}`` | ||
| * Status updates: ``job_status_update_{manager_name}`` | ||
|
|
||
| This allows multiple Pulsar instances to share the same proxy without message | ||
| conflicts. | ||
|
|
||
| Comparison with AMQP Mode | ||
| `````````````````````````` | ||
|
|
||
| +------------------------+---------------------------+-------------------------+ | ||
| | Feature | AMQP (RabbitMQ) | Pulsar-Proxy | | ||
| +========================+===========================+=========================+ | ||
| | Protocol | AMQP over TCP | HTTP/HTTPS | | ||
| +------------------------+---------------------------+-------------------------+ | ||
| | Dependencies | kombu, RabbitMQ server | requests (built-in) | | ||
| +------------------------+---------------------------+-------------------------+ | ||
| | Deployment Complexity | Moderate (broker setup) | Simple (HTTP service) | | ||
| +------------------------+---------------------------+-------------------------+ | ||
| | Message Delivery | Push-based | Long-polling | | ||
| +------------------------+---------------------------+-------------------------+ | ||
| | Observability | Queue monitoring tools | HTTP access logs | | ||
| +------------------------+---------------------------+-------------------------+ | ||
| | SSL/TLS | Via AMQPS | Via HTTPS | | ||
| +------------------------+---------------------------+-------------------------+ | ||
| | Firewall Friendly | Moderate | High (standard HTTP) | | ||
| +------------------------+---------------------------+-------------------------+ | ||
|
|
||
| For more information on deploying pulsar-proxy, see the `pulsar-proxy documentation`_. | ||
|
|
||
| .. _pulsar-proxy documentation: https://github.com/galaxyproject/pulsar-proxy | ||
|
|
||
| Caching (Experimental) | ||
| ---------------------- | ||
|
|
||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.