Commit Graph

26 Commits

Author SHA1 Message Date
Eric Ernst
460117a1a6 Merge pull request #1510 from littlejawa/issue_1003
build: remove unused variables from Makefile
2021-03-29 14:54:09 -07:00
Peng Tao
fc0f93aef9 actions: enable unit tests in PR check
Right now we only run UTs for agent. We need to run it for *ALL*
components.

Fixes: #1538
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-03-24 20:12:14 +08:00
Julien Ropé
3a77e4eb8c build: remove unused variables from Makefile
Some variable are initialized in the Makefile, but never used.
Removing them to clean up the Makefile.

Fixes: #1003

Signed-off-by: Julien Ropé <jrope@redhat.com>
2021-03-16 08:51:16 +01:00
Carlos Venegas
7ae349c511 agent: makefile: Add codecov target
Add target to run codecov report locally.

Useful to identify what are the missing lines
to be covered by unit test.

Fixes: #1487

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-03-04 16:32:52 +00:00
Carlos Venegas
a494c4de23 makefile: agent: Add self documented help
Add comments that allow self document variables and targets

Fixes: #1436

Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
2021-02-19 15:30:42 +00:00
Jakob Naucke
a1cedc567a agent: Build for glibc on s390x
Since there is no Rust target for musl on s390x, builds on s390x should
use glibc. This commit makes glibc the default on s390x as per the agent
Makefile.

Fixes: #1262

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-04 09:51:23 +01:00
Peng Tao
6e9ca45732 agent: generate proto files properly
Need to generate all protos.

Depends-on: github.com/kata-containers/tests#3006
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-25 11:27:00 +08:00
bin liu
df4ce9fab7 ci: add cargo clippy for agent
To run `cargo clippy`, this commit includes changes:

- add a new Makefile target to run `cargo clippy`
- move `make`/`make check` to last step to let a fast retrun if `fmt`/`clippy` failed

Fixes: #951

Signed-off-by: bin liu <bin@hyper.sh>
2020-10-21 15:14:17 +08:00
Jianyong Wu
c781a80820 agent: fix aarch64 build
aarch64 needs libgcc to resolve some non-builtin symbols.

Fixes: #909
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-10 18:29:23 +08:00
Christophe de Dinechin
0e898c6bc4 rust-agent: Treat warnings as error
Avoid the accumulation of warnings we had, as reported in #750.

Fixes: #750

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-10-07 17:30:21 +02:00
Pradipta Kr. Banerjee
02c1a59f6d agent: Set LIBC=gnu for ppc64le arch by default
Fixes: #812

Signed-off-by: Pradipta Kr. Banerjee <pradipta.banerjee@gmail.com>
2020-09-29 09:36:45 +00:00
Christophe de Dinechin
615ffb93e5 agent: Generate version file with more adequate information in it.
The version.rs file is now generated to contain up-to-date information
from the makefile, including git commit and the full binary path.

The makefile has also been modified to make it easier to add changes
in generated files based on makefile variables.

Fixes: #740

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-09-17 16:41:00 +02:00
James O. D. Hunt
f13ca94e10 agent: Fix setting of version
Fix the bug where the version string generated by the `Makefile` was not
being passed to the agent, resulting in a "unknown" version.

Fixes: #725.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-09-17 16:41:00 +02:00
James O. D. Hunt
c823b4cd99 agent: Make build remove generated files on clean
Ensure that `make clean` removes generated files.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-09-17 16:41:00 +02:00
Tim Zhang
32b86a8d8b agent: Add target optimize for Makefile
Run `make optimize` will strip the binary.

Fixes: #626

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-08-27 18:44:27 +08:00
Abhishek Dasgupta
f404f4d959 Modified Makefile to pick up correct architecture name for ppc64le.
Makefile is determining the architecture by running uname command
which gives ppc64le as output. But rust toolchain target is available
with the name powerpc64le for ppc64le arch. So this change took care of that.

Signed-off-by: Abhishek Dasgupta <abdasgupta@in.ibm.com>
2020-07-09 06:05:33 -04:00
Fabiano Fidêncio
cdbba6ac4b agent: Make LIBC configurable
Currently the default LIBC used to build the agent is "musl". However,
"musl" is not preset in a big portion of the distros *and* "gnu" libc
just works as expected.

Knowing that, let's add the option to the one building the project to
simply do `make LIBC=gnu` instead of expected the person to go through
the Makefile and replace musl by gnu there.

Fixes: #369

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-07-09 03:30:34 -04:00
James O. D. Hunt
f2a19966b2 agent: Rename check rule to test
Changed the name of the rule that runs the tests to "test" for
consistency, but retained `check` for backwards compatibility
for now.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-06-25 11:18:23 +01:00
bin liu
a3eb0c970e Agent: centrally manage proto files
In Kata 1.x, agent interface is defined in agent repo and vendored by runtime. But in Kata 2.0, agent and runtime will use ttrpc as protocol, and agent is using rust language, so runtime can't vendor agent again, have to compile from agent's protobuf files.

This PR will hold proto files under src/agent, and compile it to rust/go sources for agent/runtime. Typing `make generate-protocols` under root of this repo or `src/agent` can see how to use it.

Signed-off-by: bin liu <bin@hyper.sh>
2020-05-27 21:05:36 +08:00
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
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
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
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
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
Yang Bo
9df1d0e002 rust-agent: Set BUILDTYPE to debug.
Since build with --release produces corrupted binary in ci, we removed
--release. However, the make install target cannot find the binary,
set BUILDTYPE to debug

Fixes: #67

Signed-off-by: Yang Bo <bo@hyper.sh>
2019-11-01 17:17:38 +08:00
Yang Bo
f8ced638d2 rust-agent: Land rust agent into kata-containers
Fixes: #56

Signed-off-by: Yang Bo <bo@hyper.sh>
2019-10-31 10:46:45 +08:00