Commit Graph

2492 Commits

Author SHA1 Message Date
Jose Carlos Venegas Munoz
9b2fc09982
Merge pull request #58 from egernst/master-workflow
Master workflow
2019-12-02 11:01:25 -06:00
Graham Whaley
1c27897ba2
Merge pull request #2300 from tedyu/map-ignored-mounts
vc: Use map to represent ignoredMounts
2019-12-02 16:41:48 +00:00
Eric Ernst
c384359209
Merge pull request #2278 from egernst/fc-comment
Fc comment
2019-12-02 07:53:27 -08:00
Liu Jiang
154c68eb93 agent: group Linux ABI constants into dedicated file
Group Linux ABI related constants into dedicated file for maintenance.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:33 +08:00
Liu Jiang
000bb8592d agent: refine device.rs for better maintenance
1) pass reference instead of value when possible.
2) simplify code.
3) rename get_device_pci_address() as get_pci_device_address() to keep
   consistency get_pci_device_name().
4) refine get_device_name() for maintenance.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:29 +08:00
Liu Jiang
94311e4997 agent: fix wrong return value of set_sandbox_storage()
Function set_sandbox_storage() is designed to return true when the
reference count drops from 1 to 0. But current implementation always
return true no matter the reference count is, which may cause removing
an in use mountpoint.

Fixes: #88

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:28 +08:00
Liu Jiang
b1748323f0 agent: refine namespace.rs/sandbox.rs for better maintenance
Refine namespace.rs for better maintenance:
1) avoid unnecessary clone
2) make NamespaceType::get() return &str instead of String
3) minor syntax changes
4) remove unused enable_grpc_trace

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 22:19:27 +08:00
James O. D. Hunt
67f203f1b8 compatoci: Add a SetLogger call
Add a standard `SetLogger()` call to allow the `compatoci` package to be
provided a base logger which it can then customise.

Fixes: #2305.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-12-02 10:10:37 +00:00
James O. D. Hunt
fc9114dbdc
Merge pull request #2298 from tedyu/mkdir-all-ret
vc: Check return value from os.MkdirAll in virtiofsdArgs
2019-12-02 09:43:21 +00:00
Peng Tao
0a5315b1c6
Merge pull request #2283 from tedyu/rm-pause-resume
vc: Drop Sandbox#Pause and Sandbox#Resume
2019-12-02 13:19:15 +08:00
Peng Tao
450a646afd
Merge pull request #2290 from tedyu/get-container
vc: Use map built-in accessor to find container in Sandbox#GetContainer
2019-12-02 10:29:44 +08:00
Peng Tao
e49569a286
Merge pull request #2287 from devimc/topic/make/FixSuspiciousLine
Makefile: fix suspicious line
2019-12-02 10:29:20 +08:00
Liu Jiang
a4adacaa10 agent: refine uevent.rs for better maintenance
Refine uevent.rs for better maintenance:
1) use dedicated function to handle uevents.
2) use dedicated function to handle blk add events.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-12-02 10:05:44 +08:00
Ted Yu
bec46bb59b vc: Use map to represent ignoredMounts
We can use map from Source to Mount as ignoredMounts representation.
Inner loop in kataAgent#removeIgnoredOCIMount is removed.

Fixes #2299

Signed-off-by: Ted Yu yuzhihong@gmail.com
2019-11-30 12:36:27 -08:00
Ted Yu
628799a42f vc: Check return value from os.MkdirAll in virtiofsdArgs
Fixes #2297

Signed-off-by: Ted Yu yuzhihong@gmail.com
2019-11-30 08:43:23 -08:00
Liu Jiang
8868eaeb4c agent: clean up clippy warnings about '`static'
warning: Constants have by default a `'static` lifetime
  --> src/grpc.rs:59:24
   |
59 | const CONTAINER_BASE: &'static str = "/run/kata-containers";
   |                       -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-11-30 18:54:23 +08:00
Liu Jiang
eb6258b751 agent: improve logger implemetation
Improve loger implementation by:
1) avoid unnecessary clone() operations.
2) change Arc<Mutex<slog::Level>> to Mutex<slog::Level>. We should use
atomic<usize> instead of Mutex<slog::Level> for better performance here.
But with slog_async::Async drainer in the pipeline, RuntimeLevelFilter
drainer will only get from a single-thread context, so keep it as is.
3) minor syntax cleanups.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2019-11-30 18:33:07 +08:00
Julio Montes
9dd3f13a92 Makefile: Move the .git-commit: rule block to below the all: rule
the first rule defined becomes the default and the default rule should be all.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-29 15:39:43 +00:00
Julio Montes
7bcce3da63 Makefile: do not use tabs in if/else blocks
tabs should only appear in rules, not in ifeq/ifneq blocks
(since otherwise make can get very confused on error).

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-29 15:38:53 +00:00
Ted Yu
38224e8b7b vc: Use map built-in accessor to find container in Sandbox#GetContainer
Fixes #2289

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2019-11-29 07:17:15 -08:00
Ted Yu
544730b4b1 vc: Drop Sandbox#Pause and Sandbox#Resume
Fixes #2276

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2019-11-29 05:58:06 -08:00
Julio Montes
d4be097b71 Makefile: fix suspicious line
Emacs (the good and infalible text editor) detects a suspicious line in
Makefile, this line contains both space and tab (something that could be
introduced by a less sophisticated text editor) that is not correct
for a Makefile.

fixes #2286

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-29 13:49:35 +00:00
James O. D. Hunt
b6c8b9d9f4
Merge pull request #97 from lifupan/fox_parse_cmdline
config: fix the issue of parse cmdline options
2019-11-29 08:16:47 +00:00
lifupan
4c051ed717 config: fix the issue of parse cmdline options
It's should use string.eq() to match option's
key words exactly instead of using string.starts_with()
for single key options and for "key=value" options it's
bettet to match "key=" instead of "key" with string.starts_with()
which would match wrongly such as passed options "agent.log_vsock"
which would match "agent.log" with string.starts_with()
and trigger parsing issues.

Fixes: #96

Signed-off-by: lifupan <lifupan@gmail.com>
2019-11-29 09:21:20 +08:00
Johan Kuijpers
e8cc87b378 clh: basic/unit tests for clh driver
- added clh unit tests
- removed some inconsistencies in the cli builder to enable unit tests
- suppressed version check for in startSandbox to enable unit tests
- added clh related constants and methods to virtcontainer test
- small corrections after review applied

Fixes: #2205

Signed-off-by: Johan Kuijpers <johan.kuijpers@ericsson.com>
2019-11-28 10:27:37 +01:00
Eric Ernst
06971246ea fc: update comments for startSandbox
The comment didn't reflect what the function does. Updated accordingly.

Fixes: #2277

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-11-26 15:25:51 -08:00
Archana Shinde
c5a3fa76be actions: Add job for building nemu
Add job for nemu to support generating tarballs for 1.9 stable
branch.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-11-26 13:16:22 -08:00
Archana Shinde
e005c37274 actions: Add job for building cloud-hypervisor
This will build and store the tarball for cloud-hypervisor.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-11-26 13:16:22 -08:00
Archana Shinde
29c2ff8476 release: Move bash from the actions to separate bash file
Try to move all the common bash logic from the actions toml file
to separate scripts and call these scripts instead.
Note the repo itself is now checked out to get access to
these scripts.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-11-26 13:16:22 -08:00
Archana Shinde
383e70344f actions: Add job to upload tarball to release page
Once kata-deploy completes successfully, this job will upload
kata static tarball to the release page using GIT_UPLOAD_TOKEN
secret.

Signed-off-by: Jose Carlos Venegas Munoz<jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-11-26 11:43:28 -08:00
Archana Shinde
d054556f60
Merge pull request #2251 from devimc/topic/k8s/fixWrongNumberCPUs
k8s: fix wrong number cpus after killing a container
2019-11-26 10:12:36 -08:00
Archana Shinde
cc3506403b
Merge pull request #2220 from tedyu/new-mount-map
vc: Utilize map for newMounts to speed up replaceOCIMountSource
2019-11-26 09:10:25 -08:00
Penny Zheng
837a0ee0ae cache-factory: set bridge info when creating vm
For now, we will encounter `failed to get available address from
bridges` error when launching kata containers from cache factory.
Although we've already passed bridges info to clients from cache factory
server, we still missed the setting part when creating vm.

Fixes: #2272

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-11-26 00:42:39 -08:00
Penny Zheng
3d8ffe4120 cache-factory: fix nil pointer runtime panic
For now, when we're using cache factory to launch kata containers,
we would encounter nil pointer runtime panic.

Fixes: #2272

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-11-26 00:42:12 -08:00
Johan Kuijpers
3ef8f6cf1b clh: fixes erroneous killing of virtiofsd
remove type in kill statement for virtiofsd

Fixes: #2270

Signed-off-by: Johan Kuijpers <johan.kuijpers@ericsson.com>
2019-11-26 09:12:13 +01:00
Johan Kuijpers
6af127f7f9 clh: improve driver logging for failed hypervisor
added logging of stdout and stderr for failed hypervisor

Fixes: #2271

Signed-off-by: Johan Kuijpers <johan.kuijpers@ericsson.com>
2019-11-26 09:08:11 +01:00
Eric Ernst
c58e6f973c kernel: update to 4.19.86
Fixes: #2193
Depends-on: github.com/kata-containers/packaging#807

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-11-25 14:10:11 -08:00
Eric Ernst
fd5549aa5f workflows: add release workflow
Many changes introduced by Archana Shinde.

This workflow will:
 1. get a list of artifacts from the packaging repo
 2. In parallel, build each of the applicable artifacts
 3. Consolidate the build artifacts from <2>
 4. Test the artifacts in a docker image on AKS
 5. Push the verified docker image to dockerhub

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-11-25 14:00:15 -08:00
Eric Ernst
552e9407b8
Merge pull request #2245 from tedyu/block-index-update
vc: Sandbox#getAndSetSandboxBlockIndex shouldn't alter BlockIndex in case of error
2019-11-25 13:19:06 -08:00
Archana Shinde
545d61cbe8
Merge pull request #2253 from devimc/topic/virtcontainers/GetPatchedOCI
virtcontainers: rename GetOCISpec to GetPatchedOCISpec
2019-11-25 11:29:58 -08:00
GabyCT
d937c067f2
Merge pull request #2265 from jodh-intel/unbreak-tracing-test
tracing: Unbreak tracing test
2019-11-25 13:16:01 -06:00
Julio Montes
b7731e97dd virtcontainers: don't consider non-running container resources
Don't hot add again non-running container resources to avoid having extra
and useless resources

fixes #2186

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-25 18:42:34 +00:00
Julio Montes
43f051313e virtcontainers: update resources after adding container to sandbox
Status of container should know prior to calculate the number of CPU
and memory

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-25 18:42:34 +00:00
Julio Montes
613fd0fb60 virtcontainers: rename GetOCISpec to GetPatchedOCISpec
GetOCISpec returns a patched version of the original OCI spec, it was modified
to support:
* capabilities
* Ephemeral storage
* k8s empty dir

In order to avoid consusions and make api clear, rename GetOCISpec
to GetPatchedOCISpec and ContainerConfig.Spec to ContainerConfig.CustomSpec

fixes #2252

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-11-25 17:22:23 +00:00
James O. D. Hunt
330cc72ef3 tracing: Unbreak tracing test
Force Jaeger to log when it reports traces to ensure the tracing test
[1] works as expected.

Fixes: #2264.

[1] - https://github.com/kata-containers/tests/blob/master/tracing/tracing-test.sh

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-11-25 16:48:41 +00:00
Julio Montes
dd15db3250
Merge pull request #2261 from teawater/fc_log_debug
fc.go: Set firecracker log level to debug if hypervisor.enable_debug …
2019-11-25 10:32:26 -06:00
Peng Tao
35d4cac999
Merge pull request #2257 from devimc/topic/virtcontainers/honourDontSaveSpec
virtcontainers: honour ContainerConfig struct comment and don't save OCI spec
2019-11-25 20:41:35 +08:00
Graham Whaley
6727c68005
Merge pull request #2255 from devimc/topic/virtcontainers/useMapSearch
virtcontainers: improve algorithm to find containers
2019-11-25 09:29:51 +00:00
Hui Zhu
191ee63750 fc.go: Set fc log level to debug if hypervisor.enable_debug is true
Set firecracker log level to debug if hypervisor.enable_debug is true.

Fixes: #2260

Signed-off-by: Hui Zhu <teawater@antfin.com>
2019-11-25 17:08:00 +08:00
Johan Kuijpers
7b8e15f3a7
Merge pull request #3 from kata-containers/master
Merge #3 of kata-containers/runtime
2019-11-25 09:37:27 +01:00