Skip to content

Commit d5793f4

Browse files
committed
docs: update README.md
This commit updates the README file to include detailed steps for installing and using criu-coordinator. Signed-off-by: Kouame Behouba Manasse <[email protected]>
1 parent e732b88 commit d5793f4

File tree

1 file changed

+93
-6
lines changed

1 file changed

+93
-6
lines changed

README.md

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,116 @@ CRIU Coordinator
33

44
_criu-coordinator_ enables checkpoint coordination among multiple processes, containers, or Kubernetes Pods.
55

6-
Usage Example
6+
7+
Installation
8+
------------
9+
10+
To install _criu-coordinator_, follow these steps:
11+
12+
1. Clone the repository
13+
```console
14+
git clone https://github.com/checkpoint-restore/criu-coordinator.git
15+
cd criu-coordinator
16+
```
17+
18+
2. Build the project
19+
```console
20+
make
21+
```
22+
23+
3. Install the binary
24+
```console
25+
make install
26+
```
27+
28+
Usage
729
-------------
830

31+
__criu-coordinator__ operates in a client-server model. The server manages the coordination of checkpoints, while clients are invoked as CRIU action scripts that communicate with the server during checkpoint and restore operations.
32+
933
1. Start coordinator server
1034

1135
```console
1236
criu-coordinator server --address 127.0.0.1 --port 8080
1337
```
1438

15-
2. Create directory for CRIU image files and copy `criu-coordinator.json`
39+
2. Create a configuration
1640

17-
```console
18-
mkdir /tmp/test
19-
cp example-config/criu-coordinator.json /tmp/test/
41+
Create a global configuration file at /etc/criu/criu-coordinator.json. For example:
42+
43+
```json
44+
{
45+
"address": "127.0.0.1",
46+
"port": "8080",
47+
"dependencies": {
48+
"A": ["B"],
49+
"B": ["A"]
50+
}
51+
}
2052
```
53+
A and B could be process names, process IDs, or container IDs. The dependencies define which processes must be checkpointed together.
2154

22-
3. Configure CRIU to use criu-coordinator
55+
56+
Alternatively, for simple processes, you can create a per process configuration file `criu-coordinator.json` and place it in the directory where CRIU images will be stored. For example:
57+
58+
For process A:
59+
```json
60+
{
61+
"id": "A",
62+
"dependencies": ["B"],
63+
"address": "127.0.0.1",
64+
"port": "8080",
65+
"log-file": "coordinator.log"
66+
}
67+
68+
```
69+
70+
For process B:
71+
```json
72+
{
73+
"id": "B",
74+
"dependencies": ["A"],
75+
"address": "127.0.0.1",
76+
"port": "8080",
77+
"log-file": "coordinator.log"
78+
}
79+
```
80+
81+
3. Configure CRIU to use criu-coordinator as the action script
2382

2483
```console
2584
mkdir -p /etc/criu/
2685
echo action-script="$(which criu-coordinator)" | sudo tee /etc/criu/default.conf
2786
```
2887

88+
4. Coordinated Checkpoint/Restore
89+
90+
You can now perform coordinated checkpoint and restore operations. For example, to checkpoint process A and B:
91+
92+
In terminal 1 (for process A):
93+
94+
```console
95+
sudo criu dump -t <PID_A> -D /tmp/images-a -j
96+
```
97+
98+
In terminal 2 (for process B):
99+
100+
```console
101+
sudo criu dump -t <PID_B> -D /tmp/images-b -j
102+
```
103+
104+
To restore the processes, use the following commands:
105+
106+
In terminal 1 (for process A):
107+
```console
108+
sudo criu restore -D /tmp/images-a
109+
```
110+
111+
In terminal 2 (for process B):
112+
```console
113+
sudo criu restore -D /tmp/images-b
114+
```
115+
29116
License
30117
-------
31118

0 commit comments

Comments
 (0)