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

IPC mechanism in AppScope library for Cli #1108

Closed
michalbiesek opened this issue Sep 16, 2022 · 3 comments · Fixed by #1219
Closed

IPC mechanism in AppScope library for Cli #1108

michalbiesek opened this issue Sep 16, 2022 · 3 comments · Fixed by #1219
Assignees
Labels

Comments

@michalbiesek
Copy link
Contributor

The need for a mechanism for the connection between cli and AppScope process:

  • we have a way to set our data in the loaded process but we don't have any reliable way to get data from scoped/loaded process
  • For example scenario: there is a need for proper support detach and reattach to ask the application about the state are you scoped?/ are you loaded?
  • the general mechanism can be utilized in more scenarios: ask about the configuration/ set the configuration
  • initial approach is to utilize message-queue API (mq_open...)
  • should be nonblock no library side
@michalbiesek michalbiesek self-assigned this Nov 21, 2022
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Nov 21, 2022
- server: process with AppScope library in it
- client: `scope` with new command inspect

Closes: criblio#1108
michalbiesek added a commit that referenced this issue Nov 23, 2022
- handle IPC mechanism communication between scoped application and
  CLI

TODO:
- cli
- unit test
- integration test
- IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 23, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - cli
    - unit test
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 23, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - cli
    - unit test
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 23, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - cli
    - unit test
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 23, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - unit test
    - CLI
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 24, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - CLI
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 24, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - CLI
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 24, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - CLI
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 25, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - CLI
    - integration test
    - IPC namespace switch

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 25, 2022
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - CLI
    - integration test

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 25, 2022
- handle IPC mechanism communication between scoped application and
  CLI

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 25, 2022
- handle IPC mechanism communication between scoped application and
  CLI

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 25, 2022
- handle IPC mechanism communication between scoped application and
  CLI

Closes: #1108
michalbiesek added a commit that referenced this issue Nov 25, 2022
- handle IPC mechanism communication between scoped application and
  CLI

Closes: #1108
michalbiesek added a commit that referenced this issue Jan 3, 2023
- framing mechanism
- process configuration
@michalbiesek michalbiesek linked a pull request Jan 3, 2023 that will close this issue
@michalbiesek
Copy link
Contributor Author

Pull Request #1219 introduced the IPC mechanism.
Currently, 3 messages are supported:

  • get Scope status - allows retrieval of information from the scoped process status (Active,Latent, Setup) in other words we can distinguish process after detaching from scoped process. Used by cli via scope ps

  • get Scope configuration - allows retrieval of runtime configuration used in the scoped process. Used by cli via scope inspect <PID>

  • set Scope configuration - allows retrieval of runtime configuration used in the scoped process. Used by cli via scope update <PID> --config <configFilePath>

michalbiesek added a commit that referenced this issue Jan 3, 2023
- Modify handling cfg structure
@michalbiesek
Copy link
Contributor Author

michalbiesek commented Jan 3, 2023

Open questions:

  • Bug in the current implementation of REQ_SET_CFG? In the following part of code we do not free the memory pointed by g_staticfg we overwrite it.
                case REQ_SET_CFG:
                    if (req->cfg) {
                        // Apply the config
                        doConfig(req->cfg);
                        g_staticfg = req->cfg;
                    } else {
                        DBG(NULL);
                    }
  • Unify types in CLI and library regarding configuration: ScopeConfig and jsonConfigurationObject. E.g. in CLI the enable metric property is type of boolean:
    Done in 3b1de89

michalbiesek added a commit that referenced this issue Jan 4, 2023
- Modify handling cfg structure
michalbiesek added a commit that referenced this issue Jan 4, 2023
- change message queue parameters
- change message queues to be non-block on client side as well
- add mandatory fields validation
- add unit tests
michalbiesek added a commit that referenced this issue Jan 4, 2023
- change message queue parameters
- change message queues to be non-block on client side as well
- add mandatory fields validation
- add unit tests
michalbiesek added a commit that referenced this issue Jan 5, 2023
- change message queue parameters
- change message queues to be non-block on client side as well
- add mandatory fields validation
- add unit tests
@michalbiesek michalbiesek mentioned this issue Jan 10, 2023
7 tasks
@jrcheli
Copy link
Contributor

jrcheli commented Jan 11, 2023

@abetones: this is adding two new new cli commands (subcommands?) in v1.3.0. "scope inspect" and "scope update". We think that the cli-reference will need to be updated accordingly.

jrcheli added a commit that referenced this issue Jan 11, 2023
@jrcheli jrcheli moved this from In Progress to Done in AppScope 1.3.0 (Spring) Feature Release Jan 23, 2023
michalbiesek added a commit that referenced this issue Jan 31, 2023
- Replace `cJSON_free` with proper destroy method
  of CJSON object -> `CJSON_Delete`
- Avoid double free in case of structure already
  added to root object - there is no need to
  priv structure anymore
- Add missing `scope_free` for `cJSON_PrintUnformatted` method

Ref: #1108
michalbiesek added a commit that referenced this issue Jan 31, 2023
jrcheli added a commit that referenced this issue Jan 31, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
    - handle IPC mechanism communication between scoped application and
      CLI

    TODO:
    - cli
    - unit test
    - integration test
    - IPC namespace switch

Closes: criblio#1108
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
michalbiesek added a commit to michalbiesek/appscope that referenced this issue Feb 19, 2023
- Replace `cJSON_free` with proper destroy method
  of CJSON object -> `CJSON_Delete`
- Avoid double free in case of structure already
  added to root object - there is no need to
  priv structure anymore
- Add missing `scope_free` for `cJSON_PrintUnformatted` method

Ref: criblio#1108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants