Add event loop application starter
New application starter reads a configuration file with the list of
applications and their properties (arguments, binary name, etc.) and
manages starting and restarting them. The status of applications are
reported on an event loop channel and they can be controlled with a
separate starter_cmd tool.
Change-Id: I7691840be38dc28887e48efcdff7926590710eb7
diff --git a/aos/starter/BUILD b/aos/starter/BUILD
index 4d9f17d..91061e3 100644
--- a/aos/starter/BUILD
+++ b/aos/starter/BUILD
@@ -1,3 +1,5 @@
+load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+
# This target is everything which should get deployed to the robot.
filegroup(
name = "starter",
@@ -25,3 +27,80 @@
"//third_party/libevent",
],
)
+
+cc_library(
+ name = "starterd_lib",
+ srcs = ["starterd_lib.cc"],
+ hdrs = ["starterd_lib.h"],
+ deps = [
+ ":starter_fbs",
+ ":starter_rpc_fbs",
+ "//aos:configuration",
+ "//aos:macros",
+ "//aos/events:shm_event_loop",
+ "@com_github_google_glog//:glog",
+ ],
+)
+
+cc_test(
+ name = "starter_test",
+ srcs = ["starter_test.cc"],
+ data = [
+ "//aos/events:ping",
+ "//aos/events:pingpong_config",
+ "//aos/events:pong",
+ ],
+ deps = [
+ ":starter_rpc_lib",
+ ":starterd_lib",
+ "//aos/events:ping_fbs",
+ "//aos/events:pong_fbs",
+ "//aos/testing:googletest",
+ "//aos/testing:tmpdir",
+ ],
+)
+
+cc_binary(
+ name = "starterd",
+ srcs = ["starterd.cc"],
+ deps = [
+ ":starterd_lib",
+ "//aos:init",
+ ],
+)
+
+cc_library(
+ name = "starter_rpc_lib",
+ srcs = ["starter_rpc_lib.cc"],
+ hdrs = ["starter_rpc_lib.h"],
+ deps = [
+ ":starter_fbs",
+ ":starter_rpc_fbs",
+ "//aos:configuration",
+ "//aos:init",
+ "//aos/events:shm_event_loop",
+ ],
+)
+
+cc_binary(
+ name = "starter_cmd",
+ srcs = ["starter_cmd.cc"],
+ deps = [
+ ":starter_rpc_lib",
+ "@com_github_google_glog//:glog",
+ ],
+)
+
+flatbuffer_cc_library(
+ name = "starter_fbs",
+ srcs = ["starter.fbs"],
+ gen_reflections = True,
+ visibility = ["//visibility:public"],
+)
+
+flatbuffer_cc_library(
+ name = "starter_rpc_fbs",
+ srcs = ["starter_rpc.fbs"],
+ gen_reflections = True,
+ visibility = ["//visibility:public"],
+)