Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions score/launch_manager/docs/user_guide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ component_properties (object)
* **Allowed Values:**
* ``"Running"``: The process has started and reached its running state.
* ``"Terminated"``: The process has started, reached its running state, and then terminated successfully.
* **file_state** (object, optional)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it valid to configure both process_state and file_state at the same time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it now that only one ready condition can be set.

* **Description:** Specifies a ready condition based on the existence state of a file at a given path.
* **Properties:**

@NicolasFussberger NicolasFussberger Aug 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we do not need a dedicated timeout here and we will use the existing ready_timeout parameter.
We need to refactor the usage of ready_timeout so that it actually tracks the time until ready condition is fulfilled and not until Running state is reached

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same parameter shall be used, I think later this we might have the decouple this from the process and make the component care about this.

* **file_path** (string, required)
* **Description:** Specifies the absolute path to the file being watched.
* **state** (string, optional)
* **Description:** Specifies the required existence state of the file.
* **Allowed Values:**
* ``"Exists"``: The component is ready when the file at ``file_path`` exists.
* ``"Deleted"``: The component is ready when the file at ``file_path`` is deleted.

@NicolasFussberger NicolasFussberger Aug 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any files which cannot be watched via inotify and thus we need to poll for their existence with some to-be-configured interval?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed only containers would be problematic here, and I think for now since we do not support containers anyways I don't think we should support this yet. I think in the future we could have an optional polling_rate var that when set would switch to using polling but don't think it makes sense to pay so much of a slow down to support a very specific scenario.

* **Default:** ``"Exists"``

.. _lm_conf_deployment_config_object_:

Expand Down
15 changes: 13 additions & 2 deletions score/launch_manager/src/daemon/src/configuration/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <string>
#include <string_view>
#include <sys/types.h>
#include <variant>
#include <vector>

namespace score::mw::launch_manager::configuration
Expand All @@ -37,6 +38,12 @@ enum class ProcessState : uint8_t
Terminated = 1
};

enum class FileExistenceState : uint8_t
{
Exists = 0,
Deleted,
};

struct ComponentAliveSupervision
{
uint32_t reporting_cycle_ms{};
Expand All @@ -52,11 +59,15 @@ struct ApplicationProfile
std::optional<ComponentAliveSupervision> alive_supervision;
};

struct ReadyCondition
struct FileState
{
ProcessState process_state{ProcessState::Running};
std::string file_path;
FileExistenceState state{FileExistenceState::Exists};
};


using ReadyCondition = std::variant<ProcessState, FileState>;

struct ComponentProperties
{
std::string binary_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@
"Terminated"
],
"description": "Specifies the required state of the component's POSIX process. 'Running': the process has started and reached its running state. 'Terminated': the process has started, reached its running state, and then terminated successfully."
},
"file_state": {
"type": "object",
"description": "Specifies a ready condition based on the existence state of a file at a given path.",
"properties": {
"file_path": {
"type": "string",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to specify a regex here to validate the basic format of the path?
For example that it is an absolute path that starts with "/".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a validation

"description": "Specifies the absolute path to the file being watched."
},
"state": {
"type": "string",
"enum": [
"Exists",
"Deleted"
],
"pattern": "^/.*",
"description": "Specifies the required existence state of the file. 'Exists': the file must be present at 'file_path'. 'Deleted': the file must be absent from 'file_path'. Defaults to 'Exists' if not specified."
}
},
"required": [
"file_path"
],
"additionalProperties": false
}
},
"required": [],
Expand Down Expand Up @@ -488,4 +511,4 @@
"initial_run_target"
],
"additionalProperties": false
}
}
Loading
Loading