Skip to content

Commit bfcae08

Browse files
committed
Add Kyron integration
- add kyron after splitting from orchestration - fix examples and FITs
1 parent f3644b6 commit bfcae08

File tree

7 files changed

+89
-53
lines changed

7 files changed

+89
-53
lines changed

.github/workflows/build_and_test_on_every_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ jobs:
5353
done < ci/showcase_targets_run.txt
5454
- name: Feature Integration Tests
5555
run: |
56-
bazel run --config bl-x86_64-linux //feature_integration_tests/python_test_cases:fit
56+
bazel test --config bl-x86_64-linux //feature_integration_tests/python_test_cases:fit

feature_integration_tests/rust_test_scenarios/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ rust_binary(
2121
"manual",
2222
],
2323
deps = [
24-
"@score_orchestrator//src/kyron:libkyron",
25-
"@score_orchestrator//src/kyron-foundation:libkyron_foundation",
24+
"@score_kyron//src/kyron:libkyron",
25+
"@score_kyron//src/kyron-foundation:libkyron_foundation",
2626
"@score_orchestrator//src/orchestration:liborchestration",
2727
"@score_persistency//src/rust/rust_kvs:rust_kvs",
2828
"@score_test_scenarios//test_scenarios_rust:test_scenarios_rust",

feature_showcase/rust/BUILD

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ rust_binary(
1717
name = "kyron_example",
1818
srcs = glob(["kyron/**/*.rs"]),
1919
deps = [
20-
"@score_orchestrator//src/kyron:libkyron",
21-
"@score_orchestrator//src/kyron-foundation:libkyron_foundation",
22-
"@score_crates//:tracing",
20+
"@score_kyron//src/kyron:libkyron",
21+
"@score_kyron//src/kyron-foundation:libkyron_foundation",
22+
"@score_crates//:tracing_subscriber",
2323
],
2424
visibility = ["//visibility:public"],
2525
)
@@ -28,11 +28,10 @@ rust_binary(
2828
name = "orch_per_example",
2929
srcs = glob(["orchestration_persistency/**/*.rs"]),
3030
deps = [
31-
"@score_orchestrator//src/kyron:libkyron",
32-
"@score_orchestrator//src/kyron-foundation:libkyron_foundation",
31+
"@score_kyron//src/kyron:libkyron",
32+
"@score_kyron//src/kyron-foundation:libkyron_foundation",
3333
"@score_orchestrator//src/orchestration:liborchestration",
34-
"@score_orchestrator//src/logging_tracing:liblogging_tracing",
35-
"@score_crates//:tracing",
34+
"@score_kyron//src/logging_tracing:liblogging_tracing",
3635
"@score_persistency//src/rust/rust_kvs:rust_kvs",
3736
],
3837
visibility = ["//visibility:public"],

feature_showcase/rust/kyron/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ use kyron_foundation::prelude::*;
2323
/// For more visit https://github.com/eclipse-score/orchestrator
2424
#[kyron::main]
2525
async fn main() {
26-
tracing_subscriber::fmt().with_target(false).with_max_level(Level::INFO).init();
26+
tracing_subscriber::fmt()
27+
.with_target(false)
28+
.with_max_level(Level::INFO)
29+
.init();
2730

2831
let (sender, mut receiver) = create_channel_default::<u32>();
2932

feature_showcase/rust/orchestration_persistency/main.rs

Lines changed: 65 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ use std::time::Duration;
1515

1616
use kyron::runtime::*;
1717
use kyron_foundation::prelude::*;
18-
use logging_tracing::TracingLibraryBuilder;
18+
use logging_tracing::LogAndTraceBuilder;
1919
use orchestration::{
20-
actions::{invoke::Invoke, sequence::SequenceBuilder, sync::SyncBuilder, trigger::TriggerBuilder},
20+
actions::{
21+
invoke::Invoke, sequence::SequenceBuilder, sync::SyncBuilder, trigger::TriggerBuilder,
22+
},
2123
api::{design::Design, Orchestration},
2224
common::DesignConfig,
2325
prelude::InvokeResult,
@@ -34,7 +36,6 @@ use rust_kvs::prelude::*;
3436
// which starts the object detection component. Persistency is demonstrated using a key-value store during shutdown.
3537
// The orchestration is run using the Kyron async runtime, and the program chains are executed concurrently.
3638

37-
3839
const CAMERA_IMG_READY: &str = "CameraImageReadyEvent";
3940
const CAMERA_IMG_PROCESSED: &str = "CameraImageProcessedEvent";
4041

@@ -56,8 +57,8 @@ async fn on_shutdown() -> InvokeResult {
5657
// Instance ID for KVS object instances.
5758
let instance_id = InstanceId(0);
5859
let builder = KvsBuilder::new(instance_id)
59-
.dir("./")
60-
.kvs_load(KvsLoad::Optional);
60+
.dir("./")
61+
.kvs_load(KvsLoad::Optional);
6162
let kvs = builder.build().unwrap();
6263

6364
kvs.set_value("number", 123.0).unwrap();
@@ -74,41 +75,61 @@ fn camera_processing_component_design() -> Result<Design, CommonErrors> {
7475
// Register events and invoke actions in design so it knows how to build task chains
7576
design.register_event(CAMERA_IMG_READY.into())?;
7677
design.register_event(CAMERA_IMG_PROCESSED.into())?;
77-
let on_camera_image_ready_tag = design.register_invoke_async("on_camera_image_ready".into(), on_camera_image_ready)?;
78+
let on_camera_image_ready_tag =
79+
design.register_invoke_async("on_camera_image_ready".into(), on_camera_image_ready)?;
7880

7981
// Create a program describing task chain
80-
design.add_program("CameraProcessingProgram", move |design_instance, builder| {
81-
builder.with_run_action(
82-
SequenceBuilder::new()
83-
.with_step(SyncBuilder::from_design(CAMERA_IMG_READY, design_instance))
84-
.with_step(Invoke::from_tag(&on_camera_image_ready_tag, design_instance.config()))
85-
.with_step(TriggerBuilder::from_design(CAMERA_IMG_PROCESSED, design_instance))
86-
.build(),
87-
);
88-
Ok(())
89-
});
82+
design.add_program(
83+
"CameraProcessingProgram",
84+
move |design_instance, builder| {
85+
builder.with_run_action(
86+
SequenceBuilder::new()
87+
.with_step(SyncBuilder::from_design(CAMERA_IMG_READY, design_instance))
88+
.with_step(Invoke::from_tag(
89+
&on_camera_image_ready_tag,
90+
design_instance.config(),
91+
))
92+
.with_step(TriggerBuilder::from_design(
93+
CAMERA_IMG_PROCESSED,
94+
design_instance,
95+
))
96+
.build(),
97+
);
98+
Ok(())
99+
},
100+
);
90101

91102
Ok(design)
92103
}
93104

94105
fn detect_object_component_design() -> Result<Design, CommonErrors> {
95106
let mut design = Design::new("DetectObjectDesign".into(), DesignConfig::default());
96107

97-
// Register events and invoke actions in design so it knows how to build task chains
108+
// Register events and invoke actions in design so it knows how to build task chains
98109
design.register_event(CAMERA_IMG_PROCESSED.into())?;
99-
let detect_objects_tag = design.register_invoke_async("detect_objects".into(), detect_objects)?;
110+
let detect_objects_tag =
111+
design.register_invoke_async("detect_objects".into(), detect_objects)?;
100112
let on_shutdown_tag = design.register_invoke_async("on_shutdown".into(), on_shutdown)?;
101113

102114
// Create a program describing task chain
103115
design.add_program("DetectObjectProgram", move |design_instance, builder| {
104-
builder.with_run_action(
105-
SequenceBuilder::new()
106-
.with_step(SyncBuilder::from_design(CAMERA_IMG_PROCESSED, design_instance))
107-
.with_step(Invoke::from_tag(&detect_objects_tag, design_instance.config()))
108-
.build(),
109-
).with_stop_action(
110-
Invoke::from_tag(&on_shutdown_tag, design_instance.config()), Duration::from_secs(2)
111-
);
116+
builder
117+
.with_run_action(
118+
SequenceBuilder::new()
119+
.with_step(SyncBuilder::from_design(
120+
CAMERA_IMG_PROCESSED,
121+
design_instance,
122+
))
123+
.with_step(Invoke::from_tag(
124+
&detect_objects_tag,
125+
design_instance.config(),
126+
))
127+
.build(),
128+
)
129+
.with_stop_action(
130+
Invoke::from_tag(&on_shutdown_tag, design_instance.config()),
131+
Duration::from_secs(2),
132+
);
112133
Ok(())
113134
});
114135

@@ -117,18 +138,30 @@ fn detect_object_component_design() -> Result<Design, CommonErrors> {
117138

118139
fn main() {
119140
// Setup any logging framework you want to use.
120-
let mut logger = TracingLibraryBuilder::new().global_log_level(Level::INFO).enable_logging(true).build();
121-
122-
logger.init_log_trace();
141+
let logger = LogAndTraceBuilder::new()
142+
.global_log_level(logging_tracing::Level::INFO)
143+
.enable_logging(true)
144+
.build();
145+
// logger.init_log_trace();
123146

124147
// Create runtime
125-
let (builder, _engine_id) = kyron::runtime::RuntimeBuilder::new().with_engine(ExecutionEngineBuilder::new().task_queue_size(256).workers(2));
148+
let (builder, _engine_id) = kyron::runtime::RuntimeBuilder::new().with_engine(
149+
ExecutionEngineBuilder::new()
150+
.task_queue_size(256)
151+
.workers(2),
152+
);
126153
let mut runtime = builder.build().unwrap();
127154

128155
// Build Orchestration
129156
let mut orch = Orchestration::new()
130-
.add_design(camera_processing_component_design().expect("Failed to create camera_processing_component_design"))
131-
.add_design(detect_object_component_design().expect("Failed to create detect_object_component_design"))
157+
.add_design(
158+
camera_processing_component_design()
159+
.expect("Failed to create camera_processing_component_design"),
160+
)
161+
.add_design(
162+
detect_object_component_design()
163+
.expect("Failed to create detect_object_component_design"),
164+
)
132165
.design_done();
133166

134167
// Specify deployment information, ie. which event is local, which timer etc

integration_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare -A BUILD_TARGET_GROUPS=(
1717
[score_baselibs]="@score_baselibs//score/..."
1818
[score_communication]="@score_communication//score/mw/com:com"
1919
[score_persistency]="@score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
20-
#[score_logging]="@score_logging//src/..."
20+
[score_kyron]="@score_kyron//src/..."
2121
[score_orchestrator]="@score_orchestrator//src/..."
2222
[score_test_scenarios]="@score_test_scenarios//..."
2323
[score_feo]="-- @score_feo//... -@score_feo//:docs -@score_feo//:ide_support -@score_feo//:needs_json"

score_modules.MODULE.bazel

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@ single_version_override(
3030
)
3131

3232
bazel_dep(name = "score_orchestrator")
33-
single_version_override(
33+
git_override(
3434
module_name = "score_orchestrator",
35-
version = "0.0.3",
35+
remote = "https://github.com/eclipse-score/orchestrator.git",
36+
commit = "df64cda1e129aa259d8be7bbb8af50f852748301",
37+
)
38+
39+
bazel_dep(name = "score_kyron")
40+
git_override(
41+
module_name = "score_kyron",
42+
remote = "https://github.com/eclipse-score/kyron.git",
43+
commit = "b835cbb7d5e724b6c2b892997b6319766aff84b2",
3644
)
3745

3846
bazel_dep(name = "score_tooling")
@@ -76,10 +84,3 @@ single_version_override(
7684
module_name = "score_feo",
7785
version = "1.0.2",
7886
)
79-
80-
bazel_dep(name = "score_kyron")
81-
git_override(
82-
module_name = "score_kyron",
83-
remote = "https://github.com/eclipse-score/kyron.git",
84-
commit = "c5837ac6612a5ebf91cd016775f2d3ee85ed6892",
85-
)

0 commit comments

Comments
 (0)