Commit Graph

134 Commits

Author SHA1 Message Date
lifupan
a7041c27dc agent: switch from grpc to ttrpc as agent protocol
switch from grpc to ttrpc
Fixes: #148

Signed-off-by: lifupan <lifupan@gmail.com>
2020-04-22 22:12:18 +08:00
Archana Shinde
c95d09a34d
Merge pull request #181 from chavafg/1.11.0-rc0-branch-bump
# Kata Containers 1.11.0-rc0
2020-04-17 14:55:51 -07:00
Salvador Fuentes
63d9a8696f release: Kata Containers 1.11.0-rc0
- Fix potentianl crash
- sandbox: fix the issue of missing setting hostname
- unify the rustjail's log to contain container id and exec id
- Refactor the way of creating container process

ba3c732 grpc: fix the issue of potential crashes
32431d7 rpc: fix the issue of kill container process
986e666 sandbox: fix the issue of missing setting hostname
7d9bdf7 grpc: Fix the issue passing wrong exec_id to exec process
9220fb8 rustjail: unify the rustjail's log to contain container id and exec id
c1b6838 rustjail: refactoring the way of creating container process
e56b10f rustjail: remove the unused imported crates
ded27f4 oci: add Default and Clone to oci spec objects
7df8ede rustjail: replace protocol spec with oci spec

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-17 17:51:05 +00:00
Yang Bo
c0dc7676e0
Merge pull request #179 from lifupan/fix_potentianl_crash
Fix potentianl crash
2020-04-07 19:58:52 +08:00
fupan.lfp
ba3c732f86 grpc: fix the issue of potential crashes
It's better to check whether the sandbox's get_container
result instead of unwrap it directly, otherwise it would
crash the agent if the conainer id is invalid.

Fixes: #178

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-04-02 18:58:24 +08:00
fupan.lfp
32431d701c rpc: fix the issue of kill container process
When kill a process, if the exec id is empty, then
it means to kill all processes in the container, if
the exec id isn't empty, then it will only kill the
specific exec process.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-04-02 17:58:46 +08:00
Yang Bo
6d61ab439c
Merge pull request #176 from lifupan/fix_hostname
sandbox: fix the issue of missing setting hostname
2020-04-01 10:00:31 +08:00
fupan.lfp
986e666b0b sandbox: fix the issue of missing setting hostname
When setup the persisten uts namespace, it's should
set the hostname for this ns.

Fixes: #175

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-31 17:22:24 +08:00
fupan.lfp
7d9bdf7b01 grpc: Fix the issue passing wrong exec_id to exec process
This issue was brought accidently by PR #174, fix this issue.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-31 17:19:40 +08:00
James O. D. Hunt
c948d8a802
Merge pull request #174 from lifupan/unify_log
unify the rustjail's log to contain container id and exec id
2020-03-30 10:02:39 +01:00
fupan.lfp
9220fb8e0c rustjail: unify the rustjail's log to contain container id and exec id
Add the container id and exec id to start container's log
which would make it clearly to check the log.

Fixes: #173

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-27 20:10:50 +08:00
Yang Bo
1e15465012
Merge pull request #167 from lifupan/refactor
Refactor the way of creating container process
2020-03-24 11:18:42 +08:00
fupan.lfp
c1b6838e25 rustjail: refactoring the way of creating container process
In the previous implementation, create a container process
by forking the parent process as the container process,
and then at the forked child process do much more setting,
such as rootfs mounting, drop capabilities and so on, at
last exec the container entry cmd to switch into container
process.

But since the parent is a muti thread process, which would
cause a dead lock in the forked child. For example, if one
of the parent process's thread do some malloc operation, which
would take a mutex lock, and at the same time, the parent forked
a child process, since the mutex lock status would be inherited
by the child process but there's no chance to release the lock
in the child since the child process only has a single thread
which would meet a dead lock if it would do some malloc operation.

Thus, the new implementation would do exec directly after forked
and then do the setting in the exec process. Of course, this requred
a data communication between parent and child since the child cannot
depends on the shared memory by fork way.

Fixes: #166
Fixes: #133

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-23 17:12:10 +08:00
fupan.lfp
e56b10f835 rustjail: remove the unused imported crates
remove the unused imported crates

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-20 17:04:05 +08:00
fupan.lfp
ded27f48d5 oci: add Default and Clone to oci spec objects
Add the clone and default feature to oci
spec objects.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-20 17:03:54 +08:00
fupan.lfp
7df8edef1b rustjail: replace protocol spec with oci spec
transform the rpc protocol spec to
oci spec.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-20 16:26:32 +08:00
James O. D. Hunt
8280208443
Merge pull request #154 from awprice/issue-152
agent: add configurable container pipe size cmdline option
2020-03-18 08:36:23 +00:00
GabyCT
7087b5f43c
Merge pull request #165 from bergwolf/1.11.0-alpha1-branch-bump
# Kata Containers 1.11.0-alpha1
2020-03-17 13:10:53 -06:00
James O. D. Hunt
fe0a3a0c7c
Merge pull request #156 from lifupan/master
add a workspace and run all the tests in the workspace
2020-03-17 11:10:27 +00:00
Peng Tao
fbf1d015e7 release: Kata Containers 1.11.0-alpha1
- actions: Add verbose information
- systemd-service: build rust-agent systemd services
- grpc: fix the issue of crash agent when didn't find the process

cd233c0 actions: Add verbose information
f0eaeac path-absolutize: version update
3136712 systemd-service: build rust-agent systemd services
289d617 grpc: fix the issue of crash agent when didn't find the process

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-03-16 12:38:41 +00:00
fupan.lfp
245183cb28 cargo: add a workspace and run all the tests in the workspace
Add a worksapce and run all of the tests in
under this workspace.

Fixes:#155

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-16 16:34:59 +08:00
GabyCT
22afde1850
Merge pull request #158 from jcvenegas/fix-157
actions: Add verbose information
2020-03-04 15:15:42 -06:00
Jose Carlos Venegas Munoz
cd233c047a actions: Add verbose information
Add a logs to debug actions easily

Fixes: #157

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-04 16:02:06 +00:00
Alex Price
204edf0e51 agent: add configurable container pipe size cmdline option
Adds a cmdline option to configure the stdout/stderr pipe sizes.
Uses `F_SETPIPE_SZ` to resize the write side of the pipe after
creation.

Example Cmdline option: `agent.container_pipe_size=2097152`

fixes #152

Signed-off-by: Alex Price <aprice@atlassian.com>
2020-03-04 15:31:59 +11:00
GabyCT
35c33bba47
Merge pull request #145 from Pennyzct/build_service_for_rust_agent
systemd-service: build rust-agent systemd services
2020-03-03 13:17:27 -06:00
Penny Zheng
f0eaeac3be path-absolutize: version update
The latest tag version v1.2.0 fixes the error of inapporiately using
mutable static.

Fixes: #144

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-03 09:24:13 +08:00
Penny Zheng
3136712d8e systemd-service: build rust-agent systemd services
I add another sub-command `build-service` in Makefile to
generate rust-agent-related systemd service files, which
are necessary for building guest rootfs image.
The whole design is following the one in go-agent.

Fixes: #144

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-03 09:24:02 +08:00
James O. D. Hunt
7965445adf
Merge pull request #138 from lifupan/master
grpc: fix the issue of crash agent when didn't find the process
2020-02-25 10:53:00 +00:00
Salvador Fuentes
9d7bbdc5a6
Merge pull request #143 from amshinde/1.11.0-alpha0-branch-bump
# Kata Containers 1.11.0-alpha0
2020-02-19 17:24:45 -06:00
Archana Shinde
83b1712fa9 release: Kata Containers 1.11.0-alpha0
- should ignore  invalid a key-value pair as an env
- Revert: "Makefile: Fix rust agent build using "--release"."
- Makefile: Fix rust agent build using "--release".
- vsock: support log_vport and debug_console_vport
- Agent: Separate logging into a single crate
- agent: fix the issue of crash agent without spec
- fix the issue of missing restore process's cwd
- Running rust-agent on AArch64
- ci: Remove run_rust_test functions as not being used
- add oci compatibility test case
- agent: Add unit tests for sandbox.rs
- version: Add VERSION file
- ci: Add minimal makefile to use central go test script
- netlink: pull out netlink as library crate.
- Fixup workflow 103

40b5a56 agent: ignore invalid a key-value pair as an env
269daa9 Revert: "Makefile: Fix rust agent build using "--release"."
a3e46a3 Makefile: Fix rust agent build using "--release".
3c1252e vsock: support log_vport and debug_console_vport
c373f84 agent: separate logging into a single crate
2be8661 agent: fix the issue of missing restore process's cwd
6c7453d agent: fix the issue of crash agent without spec
4edf537 ci: Remove run_rust_test functions as not being used
d222533 agent: add oci compatibility test case
7dfc4e0 linker: `no such file` linking error on AArch64
44b2caa AArch64: missing symbols on target `aarch64-unknown-linux-musl`
9621a7f ABI: only support arm 64-bit platform
8d60612 version: Add VERSION file
a5192a1 netlink: pull out netlink as library crate.
3881c06 ci: Add minimal makefile to use central go test script
1c57665 workflows: make sure we build the experimental kernel, CLH
cbd5fa0 workflows: fix step output usage
92301a6 agent: Add unit tests for sandbox.rs

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-02-18 19:36:52 +00:00
fupan.lfp
289d61730c grpc: fix the issue of crash agent when didn't find the process
It's better to catch the  error of couldn't find the process
in tty_win_resize service, other wise, an invalid process id
could crash the agent.

Fixes: #137

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-02-11 10:04:19 +08:00
Yang Bo
e2c9426ebf Merge pull request #134 from liubin/master
should ignore  invalid a key-value pair as an env
2020-02-10 11:14:36 +08:00
Fupan Li
31a97031f8
Merge pull request #136 from yyyeerbo/wip
Revert: "Makefile: Fix rust agent build using "--release"."
2020-02-10 09:17:11 +08:00
Kant
40b5a56688 agent: ignore invalid a key-value pair as an env
Fixes #135

Signed-off-by: Kant <lb203159@antfin.com>
2020-02-08 13:51:28 +08:00
Yang Bo
269daa94ef Revert: "Makefile: Fix rust agent build using "--release"."
This reverts commit a3e46a369f.

There is still problem with static link, built binary will
segmentfault on clearlinux. So revert this patch for now.

Depends-on: github.com/kata-containers/tests#2293

Fixes: #69

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-08 12:56:34 +08:00
Yang Bo
afc7b4d523
Merge pull request #129 from yyyeerbo/wip
Makefile: Fix rust agent build using "--release".
2020-02-07 15:31:58 +08:00
Yang Bo
a3e46a369f Makefile: Fix rust agent build using "--release".
Based on @ericho's work on the bug

Depends-on: github.com/kata-containers/tests#2277

Fixes: #69

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-07 11:38:03 +08:00
Fupan Li
356222fbba
Merge pull request #132 from yyyeerbo/wip2
vsock: support log_vport and debug_console_vport
2020-02-07 10:06:42 +08:00
Fupan Li
7d667a92ee
Merge pull request #130 from Tim-Zhang/separate-logging
Agent: Separate logging into a single crate
2020-02-04 22:29:50 +08:00
Yang Bo
3c1252ea79 vsock: support log_vport and debug_console_vport
Fixes: #61, #64

Signed-off-by: Yang Bo <bo@hyper.sh>
2020-02-04 20:32:07 +08:00
Tim Zhang
c373f846f5 agent: separate logging into a single crate
Since the codes in logging.rs is weakly related to the project,
separating it from the project will reduce coupling and make it reusable.

Fixes: #131

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-02-03 20:40:26 +08:00
James O. D. Hunt
b5e741ba8b
Merge pull request #125 from lifupan/fix_agent_crash
agent: fix the issue of crash agent without spec
2020-01-20 11:29:16 +00:00
James O. D. Hunt
174f9abee8
Merge pull request #127 from lifupan/fix_cwd
fix the issue of missing restore process's cwd
2020-01-20 11:28:11 +00:00
fupan.lfp
2be8661ffa agent: fix the issue of missing restore process's cwd
It should restore to it's previous cwd after it
create container in which it would change it's
cwd to container's bundle path.

Fixes: #126

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-01-20 11:00:48 +08:00
fupan.lfp
6c7453db78 agent: fix the issue of crash agent without spec
To check is the oci spec passed in, other wise,
it would crash the agent unwrap it directly.

Fixes: #124

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-01-18 18:26:01 +08:00
Yang Bo
1b1e066083
Merge pull request #108 from Pennyzct/build_bug_fix
Running rust-agent on AArch64
2020-01-15 21:43:31 +08:00
Salvador Fuentes
7ce9c40c76
Merge pull request #122 from GabyCT/topic/removetest
ci: Remove run_rust_test functions as not being used
2020-01-15 07:21:43 -06:00
Gabriela Cervantes
4edf5379ca ci: Remove run_rust_test functions as not being used
This PR removes a function that is never used as the script that is
referring is also non existing at the test repository.

Fixes #113

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-01-14 14:23:14 -06:00
Fupan Li
8fbc673e68
Merge pull request #119 from quanweiZhou/add-test-case
add oci compatibility test case
2020-01-09 14:54:11 +08:00
Yang Bo
c4f15f1280
Merge pull request #91 from ericho/master
agent: Add unit tests for sandbox.rs
2020-01-09 12:51:41 +08:00