-
Notifications
You must be signed in to change notification settings - Fork 596
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
config: add --action-env cli option #2136
Conversation
CI is broken because of it, but this is a case where you could extend the unit tests to make sure this use case is also tested. Every time strings are parsed a unit test is probably a useful addition. Especially error paths can be tested during unit tests. There is also some command line option and configuration file testing which can be enhanced to ensure that the new options are tested. Overall I think this sounds useful.
Not sure about this argument. How is the container and pod name relevant on the CRIU level which only deals with PIDs? Maybe you can elaborate a bit more how this can be useful. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## criu-dev #2136 +/- ##
=========================================
Coverage 70.36% 70.36%
=========================================
Files 133 133
Lines 33894 33946 +52
=========================================
+ Hits 23848 23887 +39
- Misses 10046 10059 +13
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
f82a553
to
4f0aa7f
Compare
Thanks Adrian! I've updated the unit tests with a new test for the
When a distributed application that consist of multiple containers is running across different nodes, each container could have dependency on one or more others containers. In order to synchronise and coordinate the checkpointing/restoring of multiple containers we can use action-scripts. However, the information currently provided to an action script is insufficient to identify the container that is being checkpointed/restored. The |
Your changes are partially not covered by tests. Adding something to https://github.com/checkpoint-restore/criu/blob/criu-dev/test/others/config-file/run.sh would help. |
19fe7ff
to
14d6e32
Compare
I've updated the pull request with a test that covers the action-script functionality. |
In some use cases, action scripts might require user-specified environment variables to be passed. For example, when creating a checkpoint of a Pod, we would like to be able to pass the container name and pod name to the action script. To enable this functionality, this patch adds a new CLI option `--action-env` that takes as input a string in the following format "<NAME>=<VALUE>". This option can be used multiple times. Example: criu dump --action-script /foo/bar/script.sh \ --action-env "FOO1=BAR1" \ --action-env "FOO2=BAR2" ... Signed-off-by: Radostin Stoyanov <[email protected]>
Signed-off-by: Radostin Stoyanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Very good test coverage and the code looks correct regarding memory management.
A friendly reminder that this PR had no activity for 30 days. |
Can we execute criu with all these variables and then action scripts will inherit them? |
Yes, these variables don't affect how criu works. We are currently working on a tool called For example, a configuration file that would enable this functionality looks something like the following:
where |
@rst0git Do I understand it right that you don't need this change any more? |
No, we do need it. |
Could you answer this question? How do you run criu? Why can't you set this variables for the criu process? |
@avagin I'm sorry, I misunderstood your question. Our goal is enable coordination between multiple |
Is it a per-container configuration file? Is an action script a shell script? If the answer is yest, can it sources a file with env variables? |
Yes
Good question. The |
I'm closing this pull request for now as we have modified criu-coordinator to load the connection parameters from a configuration file. I've moved the commit adding a test for the |
In some use cases, action scripts might require user-specified environment variables to be passed. For example, when creating a checkpoint of a Pod, we would like to be able to pass the container name and pod name to the action script. To enable this functionality, this pull request adds a new CLI option
--action-env
that takes as input a string in the following format<NAME>=<VALUE>
. This option can be used multiple times.Example: