mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-28 09:42:21 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85b3a67215 | ||
|
|
fc0deb5b9a | ||
|
|
e0df9739bf | ||
|
|
bf50d1811c | ||
|
|
a5192a16e8 | ||
|
|
3881c06578 | ||
|
|
cfda17d529 | ||
|
|
1c576659de | ||
|
|
cbd5fa008a |
17
.github/workflows/main.yaml
vendored
17
.github/workflows/main.yaml
vendored
@@ -266,7 +266,7 @@ jobs:
|
||||
|
||||
gather-artifacts:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: [build-kernel, build-qemu, build-qemu-virtiofsd, build-image, build-firecracker, build-kata-components, build-nemu]
|
||||
needs: [build-experimental-kernel, build-kernel, build-qemu, build-qemu-virtiofsd, build-image, build-firecracker, build-kata-components, build-nemu, build-clh]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: get-artifacts
|
||||
@@ -291,6 +291,7 @@ jobs:
|
||||
with:
|
||||
name: release-candidate
|
||||
- name: build-and-push-kata-deploy-ci
|
||||
id: build-and-push-kata-deploy-ci
|
||||
run: |
|
||||
tag=$(echo $GITHUB_REF | cut -d/ -f3-)
|
||||
git clone https://github.com/kata-containers/packaging
|
||||
@@ -302,14 +303,15 @@ jobs:
|
||||
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:$pkg_sha ./packaging/kata-deploy
|
||||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||
docker push katadocker/kata-deploy-ci:$pkg_sha
|
||||
echo ::set-env name=PKG_SHA::$pkg_sha
|
||||
|
||||
echo "##[set-output name=PKG_SHA;]${pkg_sha}"
|
||||
echo ::set-env name=TAG::$tag
|
||||
- name: test-kata-deploy-ci-in-aks
|
||||
uses: ./packaging/kata-deploy/action
|
||||
with:
|
||||
packaging-sha: env.PKG_SHA
|
||||
packaging-sha: ${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}}
|
||||
env:
|
||||
PKG_SHA: ${{ env.PKG_SHA }}
|
||||
PKG_SHA: ${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}}
|
||||
AZ_APPID: ${{ secrets.AZ_APPID }}
|
||||
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||
@@ -317,8 +319,9 @@ jobs:
|
||||
- name: push-tarball
|
||||
run: |
|
||||
# tag the container image we created and push to DockerHub
|
||||
docker tag katadocker/kata-deploy-ci:${{ env.PKG_SHA }} katadocker/kata-deploy:${{ env.TAG }}
|
||||
docker push katadocker/kata-deploy:${{ env.TAG }}
|
||||
tag=$(echo $GITHUB_REF | cut -d/ -f3-)
|
||||
docker tag katadocker/kata-deploy-ci:${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}} katadocker/kata-deploy:${tag}
|
||||
docker push katadocker/kata-deploy:${tag}
|
||||
|
||||
upload-static-tarball:
|
||||
needs: kata-deploy
|
||||
@@ -339,4 +342,4 @@ jobs:
|
||||
mv release-candidate/kata-static.tar.xz release-candidate/kata-static-$tag-x86_64.tar.xz
|
||||
git clone https://github.com/kata-containers/runtime.git
|
||||
cd runtime
|
||||
GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a ../release-candidate/kata-static-$tag-x86_64.tar.xz "${tag}"
|
||||
GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a ../release-candidate/kata-static-${tag}-x86_64.tar.xz "${tag}"
|
||||
|
||||
7
Makefile
Normal file
7
Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# Copyright (c) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
test:
|
||||
bash ci/go-test.sh
|
||||
11
ci/go-test.sh
Executable file
11
ci/go-test.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
cidir=$(dirname "$0")
|
||||
source "${cidir}/lib.sh"
|
||||
|
||||
run_go_test
|
||||
@@ -33,3 +33,9 @@ run_rust_test()
|
||||
clone_tests_repo
|
||||
bash "$tests_repo_dir/.ci/rust-test.sh"
|
||||
}
|
||||
|
||||
run_go_test()
|
||||
{
|
||||
clone_tests_repo
|
||||
bash "$tests_repo_dir/.ci/go-test.sh"
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ edition = "2018"
|
||||
oci = { path = "oci" }
|
||||
rustjail = { path = "rustjail" }
|
||||
protocols = { path = "protocols" }
|
||||
netlink = { path = "netlink" }
|
||||
lazy_static = "1.3.0"
|
||||
error-chain = "0.12.1"
|
||||
grpcio = { git="https://github.com/alipay/grpc-rs", branch="rust_agent" }
|
||||
|
||||
19
src/agent/netlink/Cargo.toml
Normal file
19
src/agent/netlink/Cargo.toml
Normal file
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "netlink"
|
||||
version = "0.1.0"
|
||||
authors = ["Yang Bo <yb203166@antfin.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2.58"
|
||||
nix = "0.14.1"
|
||||
protobuf = "2.6.1"
|
||||
rustjail = { path = "../rustjail" }
|
||||
protocols = { path = "../protocols" }
|
||||
slog = { version = "2.5.2", features = ["dynamic-keys", "max_level_trace", "release_max_level_info"] }
|
||||
slog-json = "2.3.0"
|
||||
slog-async = "2.3.0"
|
||||
slog-scope = "4.1.2"
|
||||
scan_fmt = "0.2.3"
|
||||
@@ -6,8 +6,24 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_unsafe)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate nix;
|
||||
extern crate protobuf;
|
||||
extern crate protocols;
|
||||
extern crate rustjail;
|
||||
|
||||
#[macro_use]
|
||||
extern crate slog;
|
||||
extern crate slog_async;
|
||||
extern crate slog_json;
|
||||
extern crate slog_scope;
|
||||
|
||||
#[macro_use]
|
||||
extern crate scan_fmt;
|
||||
|
||||
use libc;
|
||||
use nix::errno::Errno;
|
||||
use protobuf::RepeatedField;
|
||||
use protocols::types::{IPAddress, IPFamily, Interface, Route};
|
||||
@@ -2834,7 +2850,7 @@ impl From<IPAddress> for RtIPAddr {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::netlink::{nlmsghdr, NLMSG_ALIGNTO, RTA_ALIGNTO, RTM_BASE};
|
||||
use crate::{nlmsghdr, NLMSG_ALIGNTO, RTA_ALIGNTO, RTM_BASE};
|
||||
use libc;
|
||||
use std::mem;
|
||||
#[test]
|
||||
@@ -33,10 +33,10 @@ use crate::device::{add_devices, rescan_pci_bus};
|
||||
use crate::linux_abi::*;
|
||||
use crate::mount::{add_storages, remove_mounts, STORAGEHANDLERLIST};
|
||||
use crate::namespace::{NSTYPEIPC, NSTYPEPID, NSTYPEUTS};
|
||||
use crate::netlink::{RtnlHandle, NETLINK_ROUTE};
|
||||
use crate::random;
|
||||
use crate::sandbox::Sandbox;
|
||||
use crate::version::{AGENT_VERSION, API_VERSION};
|
||||
use netlink::{RtnlHandle, NETLINK_ROUTE};
|
||||
|
||||
use libc::{self, c_ushort, pid_t, winsize, TIOCSWINSZ};
|
||||
use serde_json;
|
||||
|
||||
@@ -24,6 +24,8 @@ extern crate oci;
|
||||
extern crate slog;
|
||||
extern crate slog_async;
|
||||
extern crate slog_json;
|
||||
#[macro_use]
|
||||
extern crate netlink;
|
||||
|
||||
use futures::*;
|
||||
use nix::sys::wait::{self, WaitStatus};
|
||||
@@ -48,7 +50,6 @@ mod linux_abi;
|
||||
mod logging;
|
||||
mod mount;
|
||||
mod namespace;
|
||||
pub mod netlink;
|
||||
mod network;
|
||||
pub mod random;
|
||||
mod sandbox;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
use crate::linux_abi::*;
|
||||
use crate::mount::{get_mount_fs_type, remove_mounts, TYPEROOTFS};
|
||||
use crate::namespace::Namespace;
|
||||
use crate::netlink::{RtnlHandle, NETLINK_ROUTE};
|
||||
use crate::network::Network;
|
||||
use libc::pid_t;
|
||||
use netlink::{RtnlHandle, NETLINK_ROUTE};
|
||||
use protocols::agent::OnlineCPUMemRequest;
|
||||
use regex::Regex;
|
||||
use rustjail::cgroups;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
use crate::device::online_device;
|
||||
use crate::linux_abi::*;
|
||||
use crate::netlink::{RtnlHandle, NETLINK_UEVENT};
|
||||
use crate::sandbox::Sandbox;
|
||||
use crate::GLOBAL_DEVICE_WATCHER;
|
||||
use netlink::{RtnlHandle, NETLINK_UEVENT};
|
||||
use slog::Logger;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
|
||||
Reference in New Issue
Block a user