Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds initial implementation for LocalWorker and supporting classes
This is the initial draft of LocalWorker. It does not yet execute code, but is a step closer to being able to do so. LocalWorker should be able to: * Register worker and notify server of properties * Handle disconnects and attempt to reconnect to server * Receive jobs from server and push them to RunningActionsManager * Run keep alives * Respond to server with result of what RunningActionManager posts
- Loading branch information
Showing
19 changed files
with
1,166 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Copyright 2022 Nathan (Blaise) Bruer. All rights reserved. | ||
|
||
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") | ||
|
||
rust_library( | ||
name = "local_worker", | ||
srcs = ["local_worker.rs"], | ||
deps = [ | ||
"//cas/store", | ||
"//config", | ||
"//proto", | ||
"//third_party:futures", | ||
"//third_party:tokio", | ||
"//third_party:tokio_stream", | ||
"//third_party:tonic", | ||
"//util:common", | ||
"//util:error", | ||
":running_actions_manager", | ||
":worker_api_client_wrapper", | ||
":worker_utils", | ||
], | ||
visibility = ["//cas:__pkg__"], | ||
) | ||
|
||
rust_library( | ||
name = "running_actions_manager", | ||
srcs = ["running_actions_manager.rs"], | ||
deps = [ | ||
"//cas/scheduler:action_messages", | ||
"//cas/store", | ||
"//cas/store:ac_utils", | ||
"//proto", | ||
"//third_party:fast_async_mutex", | ||
"//util:common", | ||
"//util:error", | ||
], | ||
proc_macro_deps = ["//third_party:async_trait"], | ||
) | ||
|
||
|
||
rust_library( | ||
name = "worker_utils", | ||
srcs = ["worker_utils.rs"], | ||
deps = [ | ||
"//config", | ||
"//proto", | ||
"//third_party:futures", | ||
"//third_party:shlex", | ||
"//third_party:tokio", | ||
"//third_party:tonic", | ||
"//util:common", | ||
"//util:error", | ||
], | ||
) | ||
|
||
rust_library( | ||
name = "worker_api_client_wrapper", | ||
srcs = ["worker_api_client_wrapper.rs"], | ||
deps = [ | ||
"//proto", | ||
"//third_party:tonic", | ||
], | ||
proc_macro_deps = ["//third_party:async_trait"], | ||
) | ||
|
||
rust_library( | ||
name = "local_worker_test_utils", | ||
srcs = ["local_worker_test_utils.rs"], | ||
testonly = True, | ||
deps = [ | ||
"//config", | ||
"//proto", | ||
"//third_party:fast_async_mutex", | ||
"//third_party:hyper", | ||
"//third_party:tokio", | ||
"//third_party:tonic", | ||
"//util:common", | ||
"//util:error", | ||
":local_worker", | ||
":running_actions_manager", | ||
":worker_api_client_wrapper", | ||
], | ||
proc_macro_deps = ["//third_party:async_trait"], | ||
) | ||
|
||
rust_test( | ||
name = "local_worker_test", | ||
srcs = ["tests/local_worker_test.rs"], | ||
deps = [ | ||
"//cas/scheduler:action_messages", | ||
"//cas/scheduler:platform_property_manager", | ||
"//config", | ||
"//proto", | ||
"//third_party:env_logger", | ||
"//third_party:pretty_assertions", | ||
"//third_party:prost", | ||
"//third_party:tokio", | ||
"//third_party:tonic", | ||
"//util:common", | ||
"//util:error", | ||
":local_worker_test_utils", | ||
], | ||
proc_macro_deps = ["//third_party:async_trait", "//third_party:ctor"], | ||
) |
Oops, something went wrong.