Skip to content

Commit 22716c1

Browse files
Move showcase steps to the .score.json file
1 parent 7f0af8c commit 22716c1

5 files changed

Lines changed: 38 additions & 39 deletions

File tree

integration/showcases/simple_lifecycle/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ score_pkg_bundle(
88
"@score_lifecycle_health//examples/cpp_supervised_app",
99
"@score_lifecycle_health//examples/rust_supervised_app",
1010
"@score_lifecycle_health//examples/control_application:control_daemon",
11-
":lifecycle_demo.sh"
11+
":lifecycle_signal.sh"
1212
],
1313
config_data = [
1414
"//showcases/simple_lifecycle:simple_lifecycle.score.json",

integration/showcases/simple_lifecycle/configs/lm_demo.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
"schedulingPolicy": "SCHED_OTHER",
6060
"schedulingPriority": "1",
6161
"identifier": "demo_app_startup_config_0",
62-
"enterTimeoutValue": 2000,
63-
"exitTimeoutValue": 2000,
62+
"enterTimeoutValue": 1000,
63+
"exitTimeoutValue": 1000,
6464
"terminationBehavior": "ProcessIsNotSelfTerminating",
6565
"executionDependency": [],
6666
"processGroupStateDependency": [
@@ -109,8 +109,8 @@
109109
"schedulingPolicy": "SCHED_OTHER",
110110
"schedulingPriority": "1",
111111
"identifier": "demo_app_startup_config_1",
112-
"enterTimeoutValue": 2000,
113-
"exitTimeoutValue": 2000,
112+
"enterTimeoutValue": 1000,
113+
"exitTimeoutValue": 1000,
114114
"terminationBehavior": "ProcessIsNotSelfTerminating",
115115
"executionDependency": [],
116116
"processGroupStateDependency": [

integration/showcases/simple_lifecycle/lifecycle_demo.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /bin/sh
2+
# This script sends a signal to a process by name. It uses `slay` on QNX and `pkill` on other systems.
3+
# Usage: lifecycle_signal.sh <process_name> <signal>
4+
# Example: lifecycle_signal.sh my_process SIGTERM
5+
6+
running_on_qnx() {
7+
[ -x "$(command -v slay)" ]
8+
}
9+
10+
process_name=$1
11+
signal=$2
12+
13+
if running_on_qnx
14+
then
15+
slay -s $signal -f $process_name
16+
else
17+
pkill -$signal -f $process_name
18+
fi
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
{
22
"name": "Simple Health and lifecycle management example",
3-
"description": "Example runs launch_manager which is spawning two applications and monitors if they are healthy. When some application is malfunctioning, launch_manager will switch to a Recovery state and terminate both applications. Examples takes ~15s",
3+
"description": "Example runs two applications and monitors if they are healthy. When some application is malfunctioning, this will be recorded. Examples takes ~15s",
44
"apps": [
55
{
6-
"path": "/showcases/bin/lifecycle_demo.sh",
7-
"dir": "/",
6+
"path": "/showcases/bin/launch_manager",
7+
"dir": "/showcases/data/simple_lifecycle",
88
"args": [],
99
"env": {}
10+
},
11+
{
12+
"path": "/showcases/bin/lifecycle_signal.sh",
13+
"args": ["cpp_supervised_app", "SIGUSR1"],
14+
"env": {},
15+
"delay": 2
16+
},
17+
{
18+
"path": "/showcases/bin/lifecycle_signal.sh",
19+
"args": ["launch_manager", "SIGTERM"],
20+
"env": {},
21+
"delay": 6
1022
}
1123
]
1224
}

0 commit comments

Comments
 (0)