1
0
mirror of https://github.com/containers/youki synced 2024-09-28 15:01:29 +02:00
Commit Graph

44 Commits

Author SHA1 Message Date
Furisto
4b39d096ee Set supplementary gids 2021-09-01 00:17:08 +02:00
yihuaf
65c7d52236 enable oom_score_adj test 2021-08-31 07:45:45 +02:00
utam0k
c6065e67b1
distinguish channels more clearly between each process (#244)
* seperate the channel for each process communication.

* separate messages for intermediate and init ready.

* stop sending a pid from init to intermediate as they are not needed.
2021-08-30 16:20:07 -07:00
yihuaf
ff582b7f7f
Fix graceful shutdown when intermediate or init process errors or panic (#238)
* Fix graceful shutdown when intermediate or init process error out
* Only set hostname when enter into new uts ns
* enable linux_ns_path_type test
2021-08-28 01:48:13 -07:00
yihuaf
ebf4708f46
Fix user namespace for integration tests (#233)
* Fix entering into user namespace correctly

1. Allow entering user namespace when calling process is root.
Previously, only when calling process is non-root, will the rootless
condition be triggered.
2. Move the creation to the NotifyListener into main process. Once the
container init process enter into user namespace, we can't bind to a
unix domain socket where the parent directory is owned by root.

* Now we pass 2 more namespace tests
2021-08-27 11:55:03 -07:00
yihuaf
45d129f75d move id mapping code out of channel 2021-08-23 22:59:08 +02:00
yihuaf
0f9490c68b Implement double fork 2021-08-23 17:37:03 +02:00
yihuaf
774a5f5e61 Fix arg0 and argv for hook 2021-08-14 07:01:37 +02:00
yihuaf
b3219fd0bf refactor hook->hooks 2021-08-14 06:53:31 +02:00
yihuaf
31e9f2b886 adds create runtime hook 2021-08-14 06:53:31 +02:00
yihuaf
23b6eb6658 Implement the requirement to pass state into hook
The OCI spec needs the container state to pipe in through stdin
2021-08-14 06:53:31 +02:00
Furisto
1231479b0e Move cgroup code to own crate 2021-08-12 11:31:26 +02:00
utam0k
c1bc815513 fix conflicts. 2021-08-11 22:34:33 +09:00
utam0k
780f75ce94
Merge pull request #183 from saschagrunert/more-types
Make optional types optional
2021-08-11 18:56:02 +09:00
utam0k
e0d6a02d4c fix conflicts. 2021-08-10 22:06:18 +09:00
Sascha Grunert
fdf89fc9f8
Make optional types optional
This adds a few missing types and synchronizes them with the
implementation in containrs. Optional types are now not required any
more which means that all necessary code paths in youki needs to be
adapted as well.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-08-10 09:27:18 +02:00
utam0k
d99aafbf58 delete the original FileDescriptor.
I was going to develop it a bit more, but there was no point in being
particularly original, I deleted it.
2021-08-09 15:05:31 +09:00
utam0k
465fb1cee0 reduce the number of clones by introducing lifetime to namespaces. 2021-08-09 14:54:24 +09:00
utam0k
787a5505c2 reduce the number of clones by introducing lifetime to rootless. 2021-08-08 17:37:13 +09:00
utam0k
327e94d45e pass only the bare necessities in ContainerInitArgs. 2021-08-08 16:17:57 +09:00
utam0k
515e7bc727 fix conflicts. 2021-08-04 15:59:08 +09:00
yihuaf
ff7aeb1c34 Move container_init related function into new file 2021-08-02 02:34:31 +02:00
yihuaf
c87a29d080 Implemented preserve_fds 2021-08-02 02:23:56 +02:00
utam0k
5088b3632e fix the warnings found by cargo clippy. 2021-08-01 19:17:24 +09:00
utam0k
0e76835962 fix cargo clippy. 2021-07-31 17:18:37 +09:00
yihuaf
e0e9815a43 Move ContainerInitArgs closer to where it is used 2021-07-30 19:33:00 +02:00
yihuaf
682c1dd6cf remove a warning where container_dir is unused. 2021-07-30 19:33:00 +02:00
yihuaf
494646c064 parent f4027f583182b2d9ec30818cb381dcc2ba9bf10a
author yihuaf <yihuaf@unkies.org> 1627609965 +0200
committer yihuaf <yihuaf@unkies.org> 1627665696 +0200

Group the args of container_init into a struct
2021-07-30 19:33:00 +02:00
yihuaf
bd54128413 Refactor how the closure used for clone to create the new process. 2021-07-30 19:16:06 +02:00
Sascha Grunert
ade1c172a1
Generalize OCI spec root
We now generalize and document the OCI `Spec` root structure. This means
that some fields have been added and other are now optional.

All corresponding usages of the new spec format have been changed and
tests have been adapted.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-07-30 14:08:49 +02:00
Yashodhan Joshi
44c682ec09 Converted linux in spec from Option<Linux> to Linux
As Linux has Deafult trait, all occurrences of spec.linux would always unwrap it,
and not having linux present is a fetal error in youki, there is no need to keep it
in an Option wrapper.
2021-07-24 19:02:55 +05:30
Furisto
a075e8b566 Move commands into dedicated module 2021-07-22 15:20:41 +02:00
yihuaf
6b2054b978 do not pivot root again for exec 2021-07-22 04:47:58 +00:00
yihuaf
e497179119 minor fixes 2021-07-22 04:46:02 +00:00
yihuaf
68e30596ea final clean up 2021-07-22 04:46:02 +00:00
yihuaf
27bbccd240 fix the notify listener 2021-07-22 04:44:59 +00:00
yihuaf
33ab221467 add error context 2021-07-22 04:44:59 +00:00
yihuaf
de3bb1ff5a implement container creation using clone 2021-07-22 04:44:59 +00:00
Furisto
84bc49c877 Add comments 2021-07-17 16:18:10 +02:00
Furisto
0f36e355ec Implement exec command 2021-07-15 22:44:34 +02:00
Furisto
1643dd2e93 Renaming 2021-07-05 20:59:23 +02:00
Furisto
9be94d9475 Remove tests 2021-07-05 19:50:34 +02:00
Furisto
53c9b73bcc Split container builder into dedicated init and tenant builders
The current monolithic builder provides options that should only be called
during init and not when creating a tenant and vice versa. This puts the
burden on the user of the builder to know which methods are safe to call.
Now the ContainerBuilder can be used to specify options that are common to
both scenarios and afterwards as_init/as_tenant can be called to provide
scenario specific options. This also simplifies the whole "if init then else"
branching logic during container build.
2021-07-04 23:04:30 +02:00
Furisto
a387a43ffc Modularize create code 2021-07-03 00:45:38 +02:00