Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://issues.redhat.com/browse/ACM-17505--Add Apps, device lifecycle hooks, and resource monitoring #7532

Open
wants to merge 1 commit into
base: 2.13_stage
Choose a base branch
from

Conversation

amolnar-rh
Copy link
Collaborator

@amolnar-rh amolnar-rh commented Feb 21, 2025

Issue: https://issues.redhat.com/browse/ACM-17505

To preview, select the file in this folder with the same name as the branch name from this PR.

Copy link

openshift-ci bot commented Feb 21, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amolnar-rh

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

|===

By default, actions are performed every time the hook is triggered.
However, for the `afterUpdating` hook, you can use the `If` parameter to add conditions that must be true for an action to be performed.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why is it just afterUpdating hook? Can't you use the If parameter for all hooks?

If the path is to a directory, it must end with a forward slash (`/`).
If you specify a path to a file, the file must have changed to satisfy the condition.
If you specify a path to a directory, a file in that directory or any of its subdirectories must have changed to satisfy the condition.
|`On` |A list of file operations, such as `created`, `updated`, and `removed`, to limit the type of changes to the specified path as condition for the action to be performed.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a bit hard to understand, I'd like some clarification so that I can rephrase it. Currently, my understanding is that you can create a rule based on the changes to this path. For example, if the file is removed, then execute a command. However, if it's updated, then the condition is not met, so the command is not executed. Is that it?

<1> Embed the compose file in a `scratch` container.
<2> Add the `appType=compose` label.

. Build and push the container to your OCI registry.
Copy link
Collaborator Author

@amolnar-rh amolnar-rh Feb 24, 2025

Choose a reason for hiding this comment

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

Please provide a command for this step

Deploy an application package to a device from an OCI registry by using the CLI.
Complete the following steps:

* Specify the application package that you want to deploy in the `spec.applications` field in the `Device` resource:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the same step as the one in creating an application. Deploying has a bit more detail. Where do we want to have this step?

<2> A reference to an application package in an OCI registry.
<3> Optional. A list of key-value pairs that are passed to the deployment tool as environment variables or command line flags.

*Note:* For each application in the `applications` section of the device specification, you can find the corresponding device status information.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do I verify? Could you please provide an example output?

Comment on lines +89 to +136
////
Check if this is this relevant
* To deploy an unpackaged application from a Git repository, specify it in the device's `spec.applications[]` as follows:
+
[source,yaml]
----
apiVersion: flightctl.io/v1alpha1
kind: Device
metadata:
name: some_device_name
spec:
[...]
applications:
- name: wordpress
git:
url: https://github.com/flightctl/flightctl-demos.git
revision: v1.0
path: /wordpress
envVars:
WORDPRESS_DB_HOST: "mysql"
WORDPRESS_DB_USER: "user"
WORDPRESS_DB_PASSWORD: "password"
[...]
----

* To deploy an unpackaged application inline with the device specification, specify it in the device's `spec.applications[]` as follows:
+
[source,yaml]
----
apiVersion: flightctl.io/v1alpha1
kind: Device
metadata:
name: some_device_name
spec:
[...]
applications:
- name: wordpress
inline:
podman-compose.yaml: |
version: “3.7"
services:
wordpress:
image: “wordpress:latest”
[...]
envVars:
WORDPRESS_DB_HOST: "mysql"
WORDPRESS_DB_USER: "user"
WORDPRESS_DB_PASSWORD: "password"
[...]
----
////
Copy link
Collaborator Author

@amolnar-rh amolnar-rh Feb 24, 2025

Choose a reason for hiding this comment

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

Are these still relevant? I can't find them in the upstream docs anymore

include::edge_mgr_device_lifecycle_hooks.adoc[leveloffset=+2]
include::edge_mgr_monitor_device_resources.adoc[leveloffset=+2]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we want to include Accessing Devices Remotely? Seems to be experimental

@amolnar-rh amolnar-rh force-pushed the FC-manage-apps branch 2 times, most recently from 741e33c to 7c023d1 Compare February 24, 2025 16:08
@amolnar-rh amolnar-rh changed the title [WIP] https://issues.redhat.com/browse/ACM-17505--Add Apps, device lifecycle hooks, and resource monitoring https://issues.redhat.com/browse/ACM-17505--Add Apps, device lifecycle hooks, and resource monitoring Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants