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

Add operations for FreezeUnit and ThawUnit #489

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

irishair
Copy link
Contributor

We are trying to use bluechi for multi-node container ochestration in our automotive HPC.
In our system, we have additional requirements for suspend and resume of units.
From systemd 246, it supports "systemctl freeze/thaw" and D-Bus APIs for those based on cgroup v2.
So we added a new feature that supports freeze and thaw units on multi-node to bluechi, and we would like to submit this patch.

This PR contains following changes.

  • Add FreezeUnit/ThawUnit operations to agent and manager
  • Add freeze/thaw commands to client
  • Add FreezeUnit/ThawUnit interfaces to DBus-API

Example test results

# bluechictl freeze ak7_master_sub v2x-client.service
Unit v2x-client.service freeze operation done


# systemctl status v2x-client.service
● v2x-client.service - systemd service for v2x client container
Loaded: loaded (/etc/containers/systemd/v2x-client.container; generated)
Active: active (running) (frozen) since Wed 2023-08-21 14:26:34 KST; 2min 37s ago
Main PID: 3451 (conmon)
  Tasks: 21 (limit: 7782)
Memory: 25.8M
    CPU: 6.107s
CGroup: /system.slice/v2x-client.service
         ├─libpod-payload-7ea31bcb6eb869693e09d7ca49b57cfbb3cbf51adfdaa0c54cc008c5068119a4
         │ ├─3454 /bin/bash /usr/local/akitos/communications/v2xservice/bin/v2x_client.sh start_sync
         │ └─3496 /usr/lib/v2x_agent/v2x_agent --config=/tmp/v2xservice/conf/v2x_config.json
         └─runtime
           └─3451 /usr/bin/conmon --api-version 1 -c 7ea31bcb6eb869693e09d7ca49b57cfbb3cbf51adfdaa0c54cc008c5068119a4 -u 7ea31bcb6eb869693e09d7ca49b57cfbb3cbf51adfdaa0c54cc008c5068119a4 -r /usr/bin/crun>


# bluechictl thaw ak7_master_sub v2x-client.service
Unit v2x-client.service thaw operation done

@pypingou
Copy link
Member

hi @irishair

First of all, many thanks for this PR and your interest in the project!

I just wanted to flag that we're currently in the process of changing the license of the project from GPLv2+ to LGPLv2.1+: (cf #462) as well as contributing it to the Eclipse Foundation for it to become part of the Eclipse SDV umbrella.
So I wanted to double-check that you are fine with your contribution being under either of these licenses.

Thanks in advance! :)

@rhatdan
Copy link
Contributor

rhatdan commented Aug 22, 2023

Need fixed for bluechi-ctl as well.

@pypingou
Copy link
Member

Need fixed for bluechi-ctl as well.

as in, could you also document these features in https://github.com/containers/bluechi/blob/main/doc/man/bluechictl.1.md ?

@irishair
Copy link
Contributor Author

Need fixed for bluechi-ctl as well.

as in, could you also document these features in https://github.com/containers/bluechi/blob/main/doc/man/bluechictl.1.md ?

I updated bluechictl.1.md.
bluechictl commands for freeze and thaw are already applied.
Thanks for your comments :)

@irishair
Copy link
Contributor Author

hi @irishair

First of all, many thanks for this PR and your interest in the project!

I just wanted to flag that we're currently in the process of changing the license of the project from GPLv2+ to LGPLv2.1+: (cf #462) as well as contributing it to the Eclipse Foundation for it to become part of the Eclipse SDV umbrella. So I wanted to double-check that you are fine with your contribution being under either of these licenses.

Thanks in advance! :)

Yes, we are fine with license change.
Thanks for letting me know.

Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

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

LGTM, great work!

@irishair Could you fetch the latest changes from main? Then the 2 failing integration tests should pass as well and we could merge.

It would be great to have integration tests for these new features, but that can be done in a separate PR - I'll create an issue for it.
Update: Created #495

- Add FreezeUnit/ThawUnit operations to agent and manager
- Add freeze/thaw commands to client
- Add FreezeUnit/ThawUnit interfaces to DBus-API

Signed-off-by: minsoo.kim <[email protected]>
@irishair
Copy link
Contributor Author

LGTM, great work!

@irishair Could you fetch the latest changes from main? Then the 2 failing integration tests should pass as well and we could merge.

It would be great to have integration tests for these new features, but that can be done in a separate PR - I'll create an issue for it.

fetched latest changes, and I'll follow up on the issue for integration test.

Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

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

LGTM

@dougsland
Copy link
Contributor

dougsland commented Aug 23, 2023

LGTM @irishair should we consider a RFE for bluechi status to show the service as running (frozen) ?

# ./bluechictl freeze control chronyd.service
Unit chronyd.service freeze operation done
[root@control client]# ./bluechictl status control chronyd.service
UNIT		| LOADED	| ACTIVE	| SUBSTATE	| ENABLED	|
--------------------------------------------------------------------------------
chronyd.service	| loaded	| active	| running	| enabled	|
● chronyd.service - NTP client/server
     Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; preset: enabled)
     Active: active (running) (frozen) since Wed 2023-08-23 23:38:10 UTC; 11min ago

@dougsland
Copy link
Contributor

We got LGTM from @engelmi @mwperina and me, merging. The bluechictl status can be handle in different PR.

@dougsland dougsland merged commit 732a12b into eclipse-bluechi:main Aug 23, 2023
@irishair
Copy link
Contributor Author

LGTM @irishair should we consider a RFE for bluechi status to show the service as running (frozen) ?

# ./bluechictl freeze control chronyd.service
Unit chronyd.service freeze operation done
[root@control client]# ./bluechictl status control chronyd.service
UNIT		| LOADED	| ACTIVE	| SUBSTATE	| ENABLED	|
--------------------------------------------------------------------------------
chronyd.service	| loaded	| active	| running	| enabled	|
● chronyd.service - NTP client/server
     Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; preset: enabled)
     Active: active (running) (frozen) since Wed 2023-08-23 23:38:10 UTC; 11min ago

I'll apply this to bluechictl status as a different PR.
Thanks for notifying.

@engelmi
Copy link
Member

engelmi commented Aug 24, 2023

Good idea @dougsland!
I created issue #499 to keep track of this

I'll apply this to bluechictl status as a different PR.
Thanks for notifying.

@irishair If you submit a PR, you can reference #499.
nvm, just saw your PR #497

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.

6 participants