This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Executors: enable dequeueing and heartbeating for multiple queues#52016
Merged
Conversation
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff f05f3ed...4c88db8.
|
4 tasks
Piszmog
approved these changes
May 16, 2023
Piszmog
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Feels too straight forward 👀
Could you also run a main dry run? I would like to ensure the E2E tests pass
- Closes https://github.com/sourcegraph/sourcegraph/issues/50616 - Coupled with https://github.com/sourcegraph/sourcegraph/pull/52016 (this is a child branch) This PR: - Adds an env var `EXECUTOR_QUEUE_NAMES` to the config of an executor, which supports a comma-separated string of queue names to listen to - Validates that one and only one of `EXECUTOR_QUEUE_NAME` and `EXECUTOR_QUEUE_NAMES` is configured - Sets the value on the `apiWorkerOptions` and `queueOptions` The actual client implementation is found in the parent PR. ## TODO - [x] Update docs - [ ] Update Terraform modules: see https://github.com/sourcegraph/sourcegraph/issues/52250 ## Test plan - [x] Unit tests - [ ] Demo (will be added to parent PR) <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
d49aef5 to
3afaebf
Compare
sanderginn
commented
May 22, 2023
sanderginn
referenced
this pull request
May 26, 2023
- Closes https://github.com/sourcegraph/sourcegraph/issues/50616 - Coupled with https://github.com/sourcegraph/sourcegraph/pull/52016 (this is a child branch) This PR: - Adds an env var `EXECUTOR_QUEUE_NAMES` to the config of an executor, which supports a comma-separated string of queue names to listen to - Validates that one and only one of `EXECUTOR_QUEUE_NAME` and `EXECUTOR_QUEUE_NAMES` is configured - Sets the value on the `apiWorkerOptions` and `queueOptions` The actual client implementation is found in the parent PR. - [x] Update docs - [ ] Update Terraform modules: see https://github.com/sourcegraph/sourcegraph/issues/52250 - [x] Unit tests - [ ] Demo (will be added to parent PR) <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
2 tasks
sanderginn
referenced
this pull request
May 31, 2023
…e queues (#52525) - Fixes https://github.com/sourcegraph/sourcegraph/issues/51658 Hierarchy: - This merges into https://github.com/sourcegraph/sourcegraph/pull/52381 - Which merges into https://github.com/sourcegraph/sourcegraph/pull/52016 - Which merges into main ## Test plan - [x] Unit tests - [ ] Demo: all the way in the parent PR <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
…nd UI changes (#52381) - Fixes https://github.com/sourcegraph/sourcegraph/issues/51656 - depends on https://github.com/sourcegraph/sourcegraph/issues/51658, which will be next Opening a draft PR to get some early reviews in. This is not fully complete yet, because the heartbeat depends on the client and `Record` interface to implement the necessary changes in order for heartbeats to be submitted successfully. ## TODO - [ ] UI changes need some polishing - [x] Update `heartbeat` signature to take the refactored string IDs after client implementation - [x] More unit tests ## Test plan - [x] Local testing - [x] Unit tests - [ ] Demo (parent PR) <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
Collaborator
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 4b412e2 and 42be886 or learn more. Open explanation
|
Contributor
Piszmog
approved these changes
Jun 1, 2023
Piszmog
left a comment
Contributor
There was a problem hiding this comment.
Looks great! This is awesome!
Just one minor question on terraform.
Contributor
Author
|
Completed testing, added demos. All that is left is a changelog entry! |
ErikaRS
pushed a commit
that referenced
this pull request
Jun 22, 2023
…2016) - Closes https://github.com/sourcegraph/sourcegraph/issues/50614 Depends on the following issues: - https://github.com/sourcegraph/sourcegraph/issues/50616 - Merged in https://github.com/sourcegraph/sourcegraph/pull/52020 - https://github.com/sourcegraph/sourcegraph/issues/51656 - Merged in https://github.com/sourcegraph/sourcegraph/pull/52381 - https://github.com/sourcegraph/sourcegraph/issues/51658 - Merged in https://github.com/sourcegraph/sourcegraph/pull/52525 Due to the dependency on the work listed above, all PRs were ultimately merged into this branch, so the client side implementation got a little bit messy to review, for which I apologize. The initial intent of this PR, closing #50614, was reviewed before the merges occurred. ## Demos ### Scenario 1: old Sourcegraph version, new executor version #### batches, single queue https://github.com/sourcegraph/sourcegraph/assets/2979513/6d325326-d4f5-4e6f-a5e0-0918dbde07bf #### codeintel, single queue https://github.com/sourcegraph/sourcegraph/assets/2979513/ff3a87db-ef07-4221-a159-73b93a6ae55b ### Scenario 2: new Sourcegraph version, old executor version #### batches, single queue https://github.com/sourcegraph/sourcegraph/assets/2979513/c66a9b9f-b745-4abc-bf87-9077dd5f2959 #### codeintel, single queue https://github.com/sourcegraph/sourcegraph/assets/2979513/785d7f34-630f-4c2a-abb6-82ca3b896813 ### Scenario 3: new Sourcegraph version, new executor version #### batches, single queue https://github.com/sourcegraph/sourcegraph/assets/2979513/69c5c06b-ea1c-47f7-9196-e3f108794493 #### codeintel, single queue https://github.com/sourcegraph/sourcegraph/assets/2979513/4e791d98-06cd-4fa7-93dd-81be0a73c744 #### batches + codeintel in parallel, multi queue https://github.com/sourcegraph/sourcegraph/assets/2979513/004608dd-f98c-4305-aeb3-a01444c12224 ## Initial PR description (enable client to dequeue from multiple queues) This PR updates the client's `Dequeue` method to dequeue from multiple queues. It's backwards compatible with single-queue configurations. The field `Job.Queue` is only set when dequeuing from the general `/dequeue` endpoint, so the job `MarkXxx` methods default to single-queue behaviour if the job does not specify a queue name. Unrelated to the linked issue, the multi-handler will log and return no content early in the event of an empty queue list in a dequeue request (although this should never occur). ## Test plan - [x] Unit tests - [x] Local testing - [x] Dogfood testing - [x] Demo <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Depends on the following issues:
Due to the dependency on the work listed above, all PRs were ultimately merged into this branch, so the client side implementation got a little bit messy to review, for which I apologize. The initial intent of this PR, closing #50614, was reviewed before the merges occurred.
Demos
Scenario 1: old Sourcegraph version, new executor version
batches, single queue
1.old.SG.new.exec.BC.singlequeue.mov
codeintel, single queue
2.old.SG.new.exec.CI.singlequeue.mov
Scenario 2: new Sourcegraph version, old executor version
batches, single queue
3.new.SG.old.executor.BC.singlequeue.mov
codeintel, single queue
4.new.SG.old.executor.CI.singlequeue.mov
Scenario 3: new Sourcegraph version, new executor version
batches, single queue
5.new.SG.new.executor.BC.singlequeue.mov
codeintel, single queue
6.new.SG.new.executor.CI.singlequeue.mov
batches + codeintel in parallel, multi queue
7.multiqueue.processing.both.queues.mov
Initial PR description (enable client to dequeue from multiple queues)
This PR updates the client's
Dequeuemethod to dequeue from multiple queues. It's backwards compatible with single-queue configurations. The fieldJob.Queueis only set when dequeuing from the general/dequeueendpoint, so the jobMarkXxxmethods default to single-queue behaviour if the job does not specify a queue name.Unrelated to the linked issue, the multi-handler will log and return no content early in the event of an empty queue list in a dequeue request (although this should never occur).
Test plan