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
Adds basic PoC of new worker type #1222
Closed
Closed
Conversation
This file contains 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
|
WARNING!!! This PR is not attached to an issue. In most cases this is not advisable. Please see our PR docs for more information about how to attach this PR to an issue. |
f11cf41
to
a25d292
Compare
The use of non-JSON serializable `args` and `kwargs` is now deprecated. closes #8505
This adds a new `pulpcore.plugin.tasking.dispatch` interface which will replace the `pulpcore.plugin.tasking.enqueue_with_reservation` interface. This also deprecates the `pulpcore.plugin.tasking.enqueue_with_reservation` and causes it to emit warnings if used. Additionally the `pulpcore.plugin.viewsets.OperationPostponedResponse` has been ported to support both the `dispatch` and `enqueue_with_reservation` interfaces. closes #8496
1dc2e7f
to
50ed95f
Compare
bmbouter
commented
Apr 2, 2021
| name=f"{func.__module__}.{func.__name__}", | ||
| args=args_as_json, | ||
| kwargs=kwargs_as_json, | ||
| parent_task=None, # TODO implement me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs resolution.
This PR is very unpolished, but here is the state of things: Done to a working point: * Fallback support allowing this code to work with RQ style workers * Introduction of the ` USE_NEW_WORKER_TYPE` setting * The `puplcore-worker` entrypoint * The heartbeating of workers into the status API the same as before * Finding the next safe task * Correctly using advisory locks to synchronize exclusive access to resources, and tested locks are released upon worker exit. * transitioning of task states from running, completed, and failed * calling into the task code itself Not done: * The distributed worker cleanup. Right now the workers do not watch each other. * worker forking * general docs * changelogs * setting the Task.parent_task when a task is dispatched from within a task. The "recording of task reserved resources" to be shown to users in TaskSerializer is a huge mess. This PR basically avoids that entirely by introducing `Task.new_reserved_resources_record`. The hope is that once this worker style is the only type Pulp uses we can delete the 4-ish models providing the "ReservedResource..." models. However! The TaskSerializer currently is *not* integrated with `Task.new_reserved_resources_record`. Also I used the not-recommended `hashtext` postgresql function to transform the string to 64-bit data for the advisory locks. It works well, but it's not safe in the long-term because it's an internal to postgresql. It was fast and easy for this PoC though. The blake2 implementation I have on the ticket wasn't working so I moved on for now.
50ed95f
to
42d45c3
Compare
|
This is superseeded by #1261 |
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.
This PR is very unpolished, but here is the state of things:
Done to a working point:
USE_NEW_WORKER_TYPEsettingpuplcore-workerentrypointresources, and tested locks are released upon worker exit.
Not done:
each other.
task.
The "recording of task reserved resources" to be shown to users in
TaskSerializer is a huge mess. This PR basically avoids that entirely by
introducing
Task.new_reserved_resources_record. The hope is that oncethis worker style is the only type Pulp uses we can delete the 4-ish
models providing the "ReservedResource..." models.
However! The TaskSerializer currently is not integrated with
Task.new_reserved_resources_record.Also I used the not-recommended
hashtextpostgresql function totransform the string to 64-bit data for the advisory locks. It works
well, but it's not safe in the long-term because it's an internal to
postgresql. It was fast and easy for this PoC though. The blake2
implementation I have on the ticket wasn't working so I moved on for
now.