openedx / xqueue-watcher

GNU Affero General Public License v3.0
17 stars 39 forks source link

Md/issue 2326 #111

Closed Ardiea closed 6 months ago

Ardiea commented 6 months ago

Added a watcher configuration option to override the name of the queue to allow us to pull from multiple xqueue instances that have queues with the same name.

For example:

{
  "Watcher-MITx-6.0001r": {
    "AUTH": [
      "xqwatcher",
      "REDACTED"
    ],
    "CONNECTIONS": 5,
    "HANDLERS": [
      {
        "CODEJAIL": {
          "bin_path": "/home/xqwatcher/xqwatcher/grader_venvs/mit-600x/bin/python",
          "lang": "python3",
          "name": "mit-600x",
          "user": "xqwatcher"
        },
        "HANDLER": "xqueue_watcher.jailedgrader.JailedGrader",
        "KWARGS": {
          "grader_root": "../xqwatcher/graders/mit-600x-Watcher-MITx-6.0001r/graders/python3graders/"
        }
      }
    ],
    "NAME_OVERRIDE": "Watcher-MITx-6.0001r",
    "SERVER": "http://xqueue.service.mitx-qa.consul:8040"
  },
  "Watcher-MITx-staging-6.0001r": {
    "AUTH": [
      "xqwatcher",
      "REDACTED"
    ],
    "CONNECTIONS": 5,
    "HANDLERS": [
      {
        "CODEJAIL": {
          "bin_path": "/home/xqwatcher/xqwatcher/grader_venvs/mit-600x/bin/python",
          "lang": "python3",
          "name": "mit-600x",
          "user": "xqwatcher"
        },
        "HANDLER": "xqueue_watcher.jailedgrader.JailedGrader",
        "KWARGS": {
          "grader_root": "../xqwatcher/graders/mit-600x-Watcher-MITx-6.0001r/graders/python3graders/"
        }
      }
    ],
    "NAME_OVERRIDE": "Watcher-MITx-6.0001r",
    "SERVER": "http://xqueue.service.mitx-staging-qa.consul:8040"
  },

Note how both elements of the root dict have different names, however NAME_OVERRIDE is the same for both configurations. One SERVER directive points to the staging environment and the other points to the normal environment. Both configurations will pull from the queue named Watcher-MITx-6.0001r for each environment. Previously, the configuration for the staging environment would have pulled from a queue named Watcher-MITx-staging-6.0001r which does not exist.

openedx-webhooks commented 6 months ago

Thanks for the pull request, @Ardiea! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

openedx-webhooks commented 6 months ago

@Ardiea Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.