mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-04-07 20:43:07 +00:00
Compare commits
18 Commits
mahuber/st
...
pin-action
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8916f5f301 | ||
|
|
b3ae6ef99c | ||
|
|
79fab93041 | ||
|
|
e40abcf72d | ||
|
|
0fd4559f7e | ||
|
|
7385938c57 | ||
|
|
38e04bb6d8 | ||
|
|
feaec78ad0 | ||
|
|
461907918d | ||
|
|
9e1f595160 | ||
|
|
f7d9024249 | ||
|
|
46a7b9e75d | ||
|
|
3d60196735 | ||
|
|
0444d70704 | ||
|
|
78c61459f8 | ||
|
|
cb7c790dc7 | ||
|
|
2a024f55d0 | ||
|
|
8944058a5b |
13
.dockerignore
Normal file
13
.dockerignore
Normal file
@@ -0,0 +1,13 @@
|
||||
# Context for tools/packaging/kata-deploy/Dockerfile (build from repo root: -f tools/packaging/kata-deploy/Dockerfile .)
|
||||
#
|
||||
# The Dockerfile only needs: Cargo.toml, Cargo.lock, src/, tools/packaging/kata-deploy/,
|
||||
# and versions.yaml. Exclude heavy or irrelevant trees to keep context small.
|
||||
.git
|
||||
.github
|
||||
target
|
||||
kata-artifacts
|
||||
docs
|
||||
tests
|
||||
utils
|
||||
tools/packaging/kata-deploy/local-build
|
||||
tools/packaging/kata-deploy/binary/target
|
||||
@@ -14,7 +14,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f # v1.0.6
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
name: nydus-snapshotter-version-sync
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- reopened
|
||||
- synchronize
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
nydus-snapshotter-version-check:
|
||||
name: nydus-snapshotter-version-check
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Ensure nydus-snapshotter-version is in sync inside our repo
|
||||
run: |
|
||||
dockerfile_version=$(grep "ARG NYDUS_SNAPSHOTTER_VERSION" tools/packaging/kata-deploy/Dockerfile | cut -f2 -d'=')
|
||||
versions_version=$(yq ".externals.nydus-snapshotter.version | explode(.)" versions.yaml)
|
||||
if [[ "${dockerfile_version}" != "${versions_version}" ]]; then
|
||||
echo "nydus-snapshotter version must be the same in the following places: "
|
||||
echo "- versions.yaml: ${versions_version}"
|
||||
echo "- tools/packaging/kata-deploy/Dockerfile: ${dockerfile_version}"
|
||||
exit 1
|
||||
fi
|
||||
478
Cargo.lock
generated
478
Cargo.lock
generated
@@ -94,6 +94,12 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "allocator-api2"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
||||
|
||||
[[package]]
|
||||
name = "android_system_properties"
|
||||
version = "0.1.5"
|
||||
@@ -409,6 +415,28 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-stream"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
|
||||
dependencies = [
|
||||
"async-stream-impl",
|
||||
"futures-core",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-stream-impl"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-task"
|
||||
version = "4.7.1"
|
||||
@@ -511,6 +539,17 @@ dependencies = [
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backon"
|
||||
version = "1.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef"
|
||||
dependencies = [
|
||||
"fastrand 2.3.0",
|
||||
"gloo-timers",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.76"
|
||||
@@ -1272,6 +1311,16 @@ dependencies = [
|
||||
"darling_macro 0.20.11",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0"
|
||||
dependencies = [
|
||||
"darling_core 0.21.3",
|
||||
"darling_macro 0.21.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_core"
|
||||
version = "0.14.4"
|
||||
@@ -1299,6 +1348,20 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_core"
|
||||
version = "0.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4"
|
||||
dependencies = [
|
||||
"fnv",
|
||||
"ident_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.14.4"
|
||||
@@ -1321,6 +1384,17 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81"
|
||||
dependencies = [
|
||||
"darling_core 0.21.3",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dashmap"
|
||||
version = "5.5.3"
|
||||
@@ -1600,6 +1674,27 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"
|
||||
dependencies = [
|
||||
"derive_more-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more-impl"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustc_version",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "device_tree"
|
||||
version = "1.1.0"
|
||||
@@ -1726,6 +1821,18 @@ version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
|
||||
|
||||
[[package]]
|
||||
name = "educe"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417"
|
||||
dependencies = [
|
||||
"enum-ordinalize",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.15.0"
|
||||
@@ -1774,6 +1881,26 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-ordinalize"
|
||||
version = "4.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0"
|
||||
dependencies = [
|
||||
"enum-ordinalize-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-ordinalize-derive"
|
||||
version = "4.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enumflags2"
|
||||
version = "0.7.12"
|
||||
@@ -2338,6 +2465,18 @@ version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
||||
|
||||
[[package]]
|
||||
name = "gloo-timers"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "go-flag"
|
||||
version = "0.1.0"
|
||||
@@ -2406,6 +2545,8 @@ version = "0.15.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||
dependencies = [
|
||||
"allocator-api2",
|
||||
"equivalent",
|
||||
"foldhash",
|
||||
]
|
||||
|
||||
@@ -2506,6 +2647,17 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hostname"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.4",
|
||||
"libc",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "0.2.12"
|
||||
@@ -2643,7 +2795,9 @@ dependencies = [
|
||||
"http 1.4.0",
|
||||
"hyper 1.8.1",
|
||||
"hyper-util",
|
||||
"log",
|
||||
"rustls",
|
||||
"rustls-native-certs",
|
||||
"rustls-pki-types",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
@@ -2662,6 +2816,19 @@ dependencies = [
|
||||
"tokio-io-timeout",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-timeout"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
|
||||
dependencies = [
|
||||
"hyper 1.8.1",
|
||||
"hyper-util",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.6.0"
|
||||
@@ -3127,6 +3294,19 @@ dependencies = [
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonpath-rust"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c00ae348f9f8fd2d09f82a98ca381c60df9e0820d8d79fce43e649b4dc3128b"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_derive",
|
||||
"regex",
|
||||
"serde_json",
|
||||
"thiserror 2.0.18",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonptr"
|
||||
version = "0.4.7"
|
||||
@@ -3201,6 +3381,18 @@ dependencies = [
|
||||
"tonic-build 0.8.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "k8s-openapi"
|
||||
version = "0.26.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06d9e5e61dd037cdc51da0d7e2b2be10f497478ea7e120d85dad632adb99882b"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kata-agent"
|
||||
version = "0.1.0"
|
||||
@@ -3285,6 +3477,28 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kata-deploy"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"env_logger",
|
||||
"k8s-openapi",
|
||||
"kube",
|
||||
"libc",
|
||||
"log",
|
||||
"regex",
|
||||
"rstest",
|
||||
"serde_json",
|
||||
"serde_yaml 0.9.34+deprecated",
|
||||
"serial_test 0.10.0",
|
||||
"tempfile",
|
||||
"tokio",
|
||||
"toml_edit 0.22.27",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kata-sys-util"
|
||||
version = "0.1.0"
|
||||
@@ -3307,6 +3521,8 @@ dependencies = [
|
||||
"slog",
|
||||
"slog-scope",
|
||||
"subprocess",
|
||||
"tempfile",
|
||||
"test-utils",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
@@ -3325,6 +3541,7 @@ dependencies = [
|
||||
"num_cpus",
|
||||
"oci-spec 0.8.4",
|
||||
"regex",
|
||||
"rstest",
|
||||
"safe-path 0.1.0",
|
||||
"serde",
|
||||
"serde-enum-str",
|
||||
@@ -3334,6 +3551,8 @@ dependencies = [
|
||||
"slog-scope",
|
||||
"sysctl",
|
||||
"sysinfo",
|
||||
"tempfile",
|
||||
"test-utils",
|
||||
"thiserror 1.0.69",
|
||||
"toml",
|
||||
]
|
||||
@@ -3358,6 +3577,115 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kube"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48e7bb0b6a46502cc20e4575b6ff401af45cfea150b34ba272a3410b78aa014e"
|
||||
dependencies = [
|
||||
"k8s-openapi",
|
||||
"kube-client",
|
||||
"kube-core",
|
||||
"kube-derive",
|
||||
"kube-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kube-client"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4987d57a184d2b5294fdad3d7fc7f278899469d21a4da39a8f6ca16426567a36"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bytes 1.11.1",
|
||||
"chrono",
|
||||
"either",
|
||||
"futures",
|
||||
"home",
|
||||
"http 1.4.0",
|
||||
"http-body 1.0.1",
|
||||
"http-body-util",
|
||||
"hyper 1.8.1",
|
||||
"hyper-rustls",
|
||||
"hyper-timeout 0.5.2",
|
||||
"hyper-util",
|
||||
"jsonpath-rust",
|
||||
"k8s-openapi",
|
||||
"kube-core",
|
||||
"pem",
|
||||
"rustls",
|
||||
"secrecy",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_yaml 0.9.34+deprecated",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower 0.5.3",
|
||||
"tower-http",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kube-core"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "914bbb770e7bb721a06e3538c0edd2babed46447d128f7c21caa68747060ee73"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"derive_more",
|
||||
"form_urlencoded",
|
||||
"http 1.4.0",
|
||||
"json-patch 4.1.0",
|
||||
"k8s-openapi",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde-value",
|
||||
"serde_json",
|
||||
"thiserror 2.0.18",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kube-derive"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03dee8252be137772a6ab3508b81cd797dee62ee771112a2453bc85cbbe150d2"
|
||||
dependencies = [
|
||||
"darling 0.21.3",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kube-runtime"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6aea4de4b562c5cc89ab10300bb63474ae1fa57ff5a19275f2e26401a323e3fd"
|
||||
dependencies = [
|
||||
"ahash 0.8.12",
|
||||
"async-broadcast 0.7.2",
|
||||
"async-stream",
|
||||
"backon",
|
||||
"educe",
|
||||
"futures",
|
||||
"hashbrown 0.15.5",
|
||||
"hostname",
|
||||
"json-patch 4.1.0",
|
||||
"k8s-openapi",
|
||||
"kube-client",
|
||||
"parking_lot",
|
||||
"pin-project",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kvm-bindings"
|
||||
version = "0.14.0"
|
||||
@@ -3539,6 +3867,7 @@ dependencies = [
|
||||
"slog-json",
|
||||
"slog-scope",
|
||||
"slog-term",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3584,11 +3913,16 @@ version = "0.2.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
"lazy_static",
|
||||
"maplit",
|
||||
"nix 0.30.1",
|
||||
"once_cell",
|
||||
"page_size",
|
||||
"slog",
|
||||
"slog-async",
|
||||
"slog-scope",
|
||||
"slog-term",
|
||||
"test-utils",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@@ -4493,6 +4827,15 @@ dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ordered-float"
|
||||
version = "2.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ordered-multimap"
|
||||
version = "0.4.3"
|
||||
@@ -4602,6 +4945,16 @@ dependencies = [
|
||||
"quote",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pem"
|
||||
version = "3.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"serde_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.2"
|
||||
@@ -4621,6 +4974,49 @@ dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pest"
|
||||
version = "2.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"ucd-trie",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pest_derive"
|
||||
version = "2.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_generator",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pest_generator"
|
||||
version = "2.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_meta",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pest_meta"
|
||||
version = "2.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"sha2 0.10.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.5.1"
|
||||
@@ -5974,7 +6370,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"log",
|
||||
"once_cell",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"subtle",
|
||||
@@ -6073,6 +6471,7 @@ name = "safe-path"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6119,10 +6518,23 @@ checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc"
|
||||
dependencies = [
|
||||
"dyn-clone",
|
||||
"ref-cast",
|
||||
"schemars_derive",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schemars_derive"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde_derive_internals",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scientific"
|
||||
version = "0.5.3"
|
||||
@@ -6164,6 +6576,15 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "secrecy"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a"
|
||||
dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "3.7.0"
|
||||
@@ -6243,6 +6664,16 @@ version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8a059d895f1a31dd928f40abbea4e7177e3d8ff3aa4152fdb7a396ae1ef63a3"
|
||||
|
||||
[[package]]
|
||||
name = "serde-value"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c"
|
||||
dependencies = [
|
||||
"ordered-float 2.10.1",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_core"
|
||||
version = "1.0.228"
|
||||
@@ -6263,6 +6694,17 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive_internals"
|
||||
version = "0.29.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_ignored"
|
||||
version = "0.1.14"
|
||||
@@ -6496,6 +6938,8 @@ dependencies = [
|
||||
"kata-sys-util",
|
||||
"kata-types",
|
||||
"nix 0.26.4",
|
||||
"tempfile",
|
||||
"test-utils",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@@ -7015,7 +7459,7 @@ dependencies = [
|
||||
"byteorder",
|
||||
"integer-encoding",
|
||||
"log",
|
||||
"ordered-float",
|
||||
"ordered-float 1.1.1",
|
||||
"threadpool",
|
||||
]
|
||||
|
||||
@@ -7163,6 +7607,7 @@ dependencies = [
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"pin-project-lite",
|
||||
"slab",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@@ -7227,6 +7672,18 @@ dependencies = [
|
||||
"winnow 0.5.40",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.22.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
||||
dependencies = [
|
||||
"indexmap 2.13.0",
|
||||
"toml_datetime 0.6.11",
|
||||
"toml_write",
|
||||
"winnow 0.7.15",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.25.4+spec-1.1.0"
|
||||
@@ -7248,6 +7705,12 @@ dependencies = [
|
||||
"winnow 0.7.15",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_write"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
|
||||
|
||||
[[package]]
|
||||
name = "tonic"
|
||||
version = "0.9.2"
|
||||
@@ -7264,7 +7727,7 @@ dependencies = [
|
||||
"http 0.2.12",
|
||||
"http-body 0.4.6",
|
||||
"hyper 0.14.32",
|
||||
"hyper-timeout",
|
||||
"hyper-timeout 0.4.1",
|
||||
"percent-encoding",
|
||||
"pin-project",
|
||||
"prost 0.11.9",
|
||||
@@ -7333,8 +7796,10 @@ dependencies = [
|
||||
"pin-project-lite",
|
||||
"sync_wrapper 1.0.2",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7343,16 +7808,19 @@ version = "0.6.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bitflags 2.11.0",
|
||||
"bytes 1.11.1",
|
||||
"futures-util",
|
||||
"http 1.4.0",
|
||||
"http-body 1.0.1",
|
||||
"iri-string",
|
||||
"mime",
|
||||
"pin-project-lite",
|
||||
"tower 0.5.3",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7525,6 +7993,12 @@ version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
|
||||
|
||||
[[package]]
|
||||
name = "ucd-trie"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
|
||||
|
||||
[[package]]
|
||||
name = "uds_windows"
|
||||
version = "1.2.0"
|
||||
|
||||
18
Cargo.toml
18
Cargo.toml
@@ -6,6 +6,17 @@ rust-version = "1.88"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
# libs
|
||||
"src/libs/kata-sys-util",
|
||||
"src/libs/kata-types",
|
||||
"src/libs/logging",
|
||||
"src/libs/mem-agent",
|
||||
"src/libs/protocols",
|
||||
"src/libs/runtime-spec",
|
||||
"src/libs/safe-path",
|
||||
"src/libs/shim-interface",
|
||||
"src/libs/test-utils",
|
||||
|
||||
# kata-agent
|
||||
"src/agent",
|
||||
"src/agent/rustjail",
|
||||
@@ -31,6 +42,9 @@ members = [
|
||||
# genpolicy
|
||||
"src/tools/genpolicy",
|
||||
|
||||
# kata-deploy (Kubernetes installer binary)
|
||||
"tools/packaging/kata-deploy/binary",
|
||||
|
||||
# runtime-rs
|
||||
"src/runtime-rs",
|
||||
"src/runtime-rs/crates/agent",
|
||||
@@ -48,10 +62,6 @@ resolver = "2"
|
||||
# TODO: Add all excluded crates to root workspace
|
||||
exclude = [
|
||||
"src/tools",
|
||||
"src/libs",
|
||||
|
||||
# kata-deploy binary is standalone and has its own Cargo.toml for now
|
||||
"tools/packaging/kata-deploy/binary",
|
||||
|
||||
# We are cloning and building rust packages under
|
||||
# "tools/packaging/kata-deploy/local-build/build" folder, which may mislead
|
||||
|
||||
@@ -227,7 +227,7 @@ Kata's non-TEE and TEE GPU workload deployment scenarios for your Kubernetes
|
||||
nodes. We provide guidance based on the upstream Kata CI procedures for the
|
||||
NVIDIA GPU CI validation jobs. Note that, this setup:
|
||||
|
||||
- uses the guest image pull method to pull container image layers
|
||||
- uses the nydus snapshotter to pull container image layers in the guest
|
||||
- uses the genpolicy tool to attach Kata agent security policies to the pod
|
||||
manifest
|
||||
- has dedicated (composite) attestation tests, a CUDA vectorAdd test, and a
|
||||
@@ -250,6 +250,17 @@ Service NRAS
|
||||
- container image signature verification and encrypted container images
|
||||
- ephemeral container data and image layer storage
|
||||
|
||||
For the use of these features, we refer to separate documentation in the
|
||||
kata-containers and confidential-containers documentation resources.
|
||||
For example, see a
|
||||
[list of features](https://confidentialcontainers.org/docs/features/) along
|
||||
with their documentation in the confidential-containers documentation.
|
||||
|
||||
> **Note:**
|
||||
>
|
||||
> Image signature verification for signed multi-arch images is currently not
|
||||
> supported.
|
||||
|
||||
### Requirements
|
||||
|
||||
The requirements for the TEE scenario are:
|
||||
@@ -272,8 +283,8 @@ selecting proper hardware and on properly configuring its firmware and OS.
|
||||
#### Containerd and Kubernetes
|
||||
|
||||
First, set up your Kubernetes cluster. For instance, in Kata CI, our NVIDIA
|
||||
jobs use a single-node vanilla Kubernetes cluster with a 2.1 containerd
|
||||
version and Kata's current supported Kubernetes version. This cluster is
|
||||
jobs use a single-node vanilla Kubernetes cluster with containerd v2.2
|
||||
and Kata's current supported Kubernetes version. This cluster is
|
||||
being set up using the `deploy_k8s` function from the script file
|
||||
`tests/integration/kubernetes/gha-run.sh`. If you intend to run this script,
|
||||
follow these steps, and make sure you have `yq` and `helm` installed. Note
|
||||
@@ -284,7 +295,7 @@ You can execute the function as follows:
|
||||
$ export GH_TOKEN="<your-gh-pat>"
|
||||
$ export KUBERNETES="vanilla"
|
||||
$ export CONTAINER_ENGINE="containerd"
|
||||
$ export CONTAINER_ENGINE_VERSION="v2.1"
|
||||
$ export CONTAINER_ENGINE_VERSION="v2.2"
|
||||
$ source tests/gha-run-k8s-common.sh
|
||||
$ deploy_k8s
|
||||
```
|
||||
@@ -300,6 +311,13 @@ $ deploy_k8s
|
||||
> `create_container_timeout` of 1200s, which is the equivalent value on shim
|
||||
> side, controlling the time the shim allows for a container to remain in
|
||||
> *container creating* state.
|
||||
> If you need a timeout of more than 1200s, you will also need to adjust the
|
||||
> agent's `image_pull_timeout`, which in turn sets the confidential data
|
||||
> hub's image pull API timeout in seconds. For this, add the
|
||||
> `agent.image_pull_timeout=<seconds>` kernel parameter to your shim
|
||||
> configuration's `kernel_params` field, or pass the parameter explicitly
|
||||
> via the `io.katacontainers.config.hypervisor.kernel_params: "..."` pod
|
||||
> annotation. The default value for this timeout is 1200s.
|
||||
|
||||
> **Note:**
|
||||
>
|
||||
@@ -356,7 +374,7 @@ $ helm install --wait --generate-name \
|
||||
|
||||
Install the latest Kata Containers helm chart, similar to
|
||||
[existing documentation](https://github.com/kata-containers/kata-containers/blob/main/tools/packaging/kata-deploy/helm-chart/README.md)
|
||||
(minimum version: `3.24.0`).
|
||||
(minimum version: `3.29.0`).
|
||||
|
||||
```bash
|
||||
$ export VERSION=$(curl -sSL https://api.github.com/repos/kata-containers/kata-containers/releases/latest | jq .tag_name | tr -d '"')
|
||||
@@ -371,6 +389,13 @@ $ helm install kata-deploy \
|
||||
"${CHART}" --version "${VERSION}"
|
||||
```
|
||||
|
||||
> **Note:**
|
||||
>
|
||||
> For node lifecycle management, see the
|
||||
> [lifecycle-manager](https://github.com/kata-containers/lifecycle-manager)
|
||||
> repository which enables Argo Workflows-based lifecycle management for your
|
||||
> node's Kata deployments.
|
||||
|
||||
#### Trustee's KBS for remote attestation
|
||||
|
||||
For our Kata CI runners we use Trustee's KBS for composite attestation for
|
||||
@@ -566,21 +591,21 @@ With GPU passthrough being supported by the
|
||||
you can use the tool to create a Kata agent security policy. Our CI deploys
|
||||
all sample pod manifests with a Kata agent security policy.
|
||||
|
||||
Note that, using containerd 2.1 in upstream's CI, we use the following
|
||||
modification to the genpolicy default settings:
|
||||
Note that, in Kata CI, we use snippets such as the following to modify the
|
||||
genpolicy default settings:
|
||||
```bash
|
||||
[
|
||||
{
|
||||
"op": "replace",
|
||||
"path": "/kata_config/oci_version",
|
||||
"value": "1.2.1"
|
||||
"value": "1.3.0"
|
||||
}
|
||||
]
|
||||
```
|
||||
This modification is applied via the genpolicy drop-in configuration file
|
||||
`src\tools\genpolicy\drop-in-examples\20-oci-1.2.1-drop-in.json`.
|
||||
When using a newer containerd version, such as containerd 2.2, the OCI
|
||||
version field needs to be adjusted to "1.3.0", for instance.
|
||||
`src/tools/genpolicy/drop-in-examples/20-oci-1.3.0-drop-in.json`.
|
||||
When using a newer (or older) containerd version, the OCI version field
|
||||
may need to be adjusted accordingly.
|
||||
|
||||
#### Deploy pods using your own containers and manifests
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"kata-sys-util",
|
||||
"kata-types",
|
||||
"logging",
|
||||
"mem-agent",
|
||||
"protocols",
|
||||
"runtime-spec",
|
||||
"safe-path",
|
||||
"shim-interface",
|
||||
"test-utils",
|
||||
]
|
||||
resolver = "2"
|
||||
@@ -11,6 +11,17 @@ ifeq ($(USERID), 0)
|
||||
override EXTRA_TEST_FLAGS = --ignored
|
||||
endif
|
||||
|
||||
LIBS := \
|
||||
-p kata-sys-util \
|
||||
-p kata-types \
|
||||
-p logging \
|
||||
-p mem-agent \
|
||||
-p protocols \
|
||||
-p runtime-spec \
|
||||
-p safe-path \
|
||||
-p shim-interface \
|
||||
-p test-utils
|
||||
|
||||
default: build
|
||||
|
||||
build:
|
||||
@@ -23,13 +34,13 @@ check: clippy format
|
||||
|
||||
clippy:
|
||||
@echo "INFO: cargo clippy..."
|
||||
cargo clippy --all-targets --all-features --release \
|
||||
cargo clippy $(LIBS) --all-features --release \
|
||||
-- \
|
||||
-D warnings
|
||||
|
||||
format:
|
||||
@echo "INFO: cargo fmt..."
|
||||
cargo fmt -- --check
|
||||
cargo fmt $(LIBS) -- --check
|
||||
|
||||
clean:
|
||||
cargo clean
|
||||
@@ -38,8 +49,8 @@ clean:
|
||||
# See the `test_logger_levels()` test for further information.
|
||||
test:
|
||||
@echo "INFO: testing libraries for development build"
|
||||
cargo test --all $(EXTRA_RUSTFEATURES) -- --nocapture $(EXTRA_TEST_FLAGS)
|
||||
cargo test $(LIBS) $(EXTRA_RUSTFEATURES) -- --nocapture $(EXTRA_TEST_FLAGS)
|
||||
@echo "INFO: testing libraries for release build"
|
||||
cargo test --release --all $(EXTRA_RUSTFEATURES) -- --nocapture $(EXTRA_TEST_FLAGS)
|
||||
cargo test --release $(LIBS) $(EXTRA_RUSTFEATURES) -- --nocapture $(EXTRA_TEST_FLAGS)
|
||||
|
||||
.PHONY: install vendor
|
||||
|
||||
@@ -495,6 +495,9 @@ ifneq (,$(QEMUCMD))
|
||||
KERNELPARAMS_NV += "pci=nocrs"
|
||||
KERNELPARAMS_NV += "pci=assign-busses"
|
||||
|
||||
KERNELPARAMS_CONFIDENTIAL_NV = $(KERNELPARAMS_NV)
|
||||
KERNELPARAMS_CONFIDENTIAL_NV += "nvrc.smi.srs=1"
|
||||
|
||||
# Setting this to false can lead to cgroup leakages in the host
|
||||
# Best practice for production is to set this to true
|
||||
DEFSANDBOXCGROUPONLY_NV = true
|
||||
@@ -667,6 +670,7 @@ USER_VARS += DEFAULTMEMORY_NV
|
||||
USER_VARS += DEFAULTVFIOPORT_NV
|
||||
USER_VARS += DEFAULTPCIEROOTPORT_NV
|
||||
USER_VARS += KERNELPARAMS_NV
|
||||
USER_VARS += KERNELPARAMS_CONFIDENTIAL_NV
|
||||
USER_VARS += KERNELVERITYPARAMS_NV
|
||||
USER_VARS += KERNELVERITYPARAMS_CONFIDENTIAL_NV
|
||||
USER_VARS += DEFAULTTIMEOUT_NV
|
||||
|
||||
@@ -90,7 +90,7 @@ snp_guest_policy = 196608
|
||||
# may stop the virtual machine from booting.
|
||||
# To see the list of default parameters, enable hypervisor debug, create a
|
||||
# container and look for 'default-kernel-parameters' log entries.
|
||||
kernel_params = "@KERNELPARAMS_NV@"
|
||||
kernel_params = "@KERNELPARAMS_CONFIDENTIAL_NV@"
|
||||
|
||||
# Optional dm-verity parameters (comma-separated key=value list):
|
||||
# root_hash=...,salt=...,data_blocks=...,data_block_size=...,hash_block_size=...
|
||||
|
||||
@@ -67,7 +67,7 @@ valid_hypervisor_paths = @QEMUTDXEXPERIMENTALVALIDHYPERVISORPATHS@
|
||||
# may stop the virtual machine from booting.
|
||||
# To see the list of default parameters, enable hypervisor debug, create a
|
||||
# container and look for 'default-kernel-parameters' log entries.
|
||||
kernel_params = "@KERNELPARAMS_NV@"
|
||||
kernel_params = "@KERNELPARAMS_CONFIDENTIAL_NV@"
|
||||
|
||||
# Optional dm-verity parameters (comma-separated key=value list):
|
||||
# root_hash=...,salt=...,data_blocks=...,data_block_size=...,hash_block_size=...
|
||||
|
||||
@@ -45,7 +45,7 @@ kbs_set_allow_all_resources() {
|
||||
|
||||
kbs_set_default_policy() {
|
||||
kbs_set_resources_policy \
|
||||
"${COCO_KBS_DIR}/src/policy_engine/opa/default_policy.rego"
|
||||
"${COCO_KBS_DIR}/sample_policies/default.rego"
|
||||
}
|
||||
|
||||
# Set "deny all" policy to resources.
|
||||
|
||||
@@ -69,11 +69,11 @@ EOF"
|
||||
|
||||
## Cases for target container
|
||||
### First container
|
||||
container_name=$(kubectl exec $pod_name -c $first_container_name -- $env_command | grep CONTAINER_NAME)
|
||||
container_name=$(kubectl exec $pod_name -c $first_container_name -- $env_command | grep CONTAINER_NAME | tr -d '\r')
|
||||
[ "$container_name" == "CONTAINER_NAME=$first_container_name" ]
|
||||
|
||||
### Second container
|
||||
container_name=$(kubectl exec $pod_name -c $second_container_name -- $env_command | grep CONTAINER_NAME)
|
||||
container_name=$(kubectl exec $pod_name -c $second_container_name -- $env_command | grep CONTAINER_NAME | tr -d '\r')
|
||||
[ "$container_name" == "CONTAINER_NAME=$second_container_name" ]
|
||||
|
||||
}
|
||||
|
||||
@@ -29,14 +29,6 @@ setup() {
|
||||
|
||||
envsubst < "${pod_yaml_in}" > "${pod_yaml}"
|
||||
|
||||
if [ "${TEE}" = "true" ]; then
|
||||
kernel_params_annotation="io.katacontainers.config.hypervisor.kernel_params"
|
||||
kernel_params_value="nvrc.smi.srs=1"
|
||||
set_metadata_annotation "${pod_yaml}" \
|
||||
"${kernel_params_annotation}" \
|
||||
"${kernel_params_value}"
|
||||
fi
|
||||
|
||||
policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")"
|
||||
add_requests_to_policy_settings "${policy_settings_dir}" "ReadStreamRequest"
|
||||
|
||||
|
||||
@@ -35,15 +35,16 @@ setup() {
|
||||
kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name
|
||||
|
||||
# Check PID from first container
|
||||
# Strip \r — containers with tty: true return \r\n line endings
|
||||
first_pid_container=$(kubectl exec $pod_name -c $first_container_name \
|
||||
-- $ps_command | grep "/pause")
|
||||
-- $ps_command | grep "/pause" | tr -d '\r')
|
||||
# Verify that is not empty
|
||||
check_first_pid=$(echo $first_pid_container | wc -l)
|
||||
[ "$check_first_pid" == "1" ]
|
||||
|
||||
# Check PID from second container
|
||||
second_pid_container=$(kubectl exec $pod_name -c $second_container_name \
|
||||
-- $ps_command | grep "/pause")
|
||||
-- $ps_command | grep "/pause" | tr -d '\r')
|
||||
# Verify that is not empty
|
||||
check_second_pid=$(echo $second_pid_container | wc -l)
|
||||
[ "$check_second_pid" == "1" ]
|
||||
|
||||
@@ -68,12 +68,12 @@ install_userspace_components() {
|
||||
libnvidia-decode libnvidia-fbc1 libnvidia-encode \
|
||||
libnvidia-nscq libnvidia-compute nvidia-settings
|
||||
|
||||
# Needed for confidential-data-hub runtime dependencies
|
||||
# Needed for confidential-data-hub and NVAT runtime dependencies
|
||||
eval "${APT_INSTALL}" cryptsetup-bin dmsetup \
|
||||
libargon2-1 e2fsprogs
|
||||
libargon2-1 e2fsprogs libxml2
|
||||
|
||||
apt-mark hold cryptsetup-bin dmsetup libargon2-1 \
|
||||
e2fsprogs
|
||||
e2fsprogs libxml2
|
||||
}
|
||||
|
||||
setup_apt_repositories() {
|
||||
|
||||
@@ -224,6 +224,26 @@ chisseled_gpudirect() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
chisseled_nvat() {
|
||||
if [[ "${type}" != "confidential" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "nvidia: chisseling NVAT"
|
||||
|
||||
local libdir="lib/${machine_arch}-linux-gnu"
|
||||
|
||||
# NVAT shared library (bundled via coco-guest-components tarball)
|
||||
cp -a "${stage_one}"/usr/local/lib/libnvat.so* "${libdir}"/.
|
||||
|
||||
# NVAT runtime dependencies (per ldd on attestation-agent)
|
||||
cp -a "${stage_one}/${libdir}"/libxml2.so.2* "${libdir}"/.
|
||||
cp -a "${stage_one}/${libdir}"/libstdc++.so.6* "${libdir}"/.
|
||||
cp -a "${stage_one}/${libdir}"/liblzma.so.5* "${libdir}"/.
|
||||
cp -a "${stage_one}/${libdir}"/libicuuc.so.* "${libdir}"/.
|
||||
cp -a "${stage_one}/${libdir}"/libicudata.so.* "${libdir}"/.
|
||||
}
|
||||
|
||||
setup_nvrc_init_symlinks() {
|
||||
local nvrc="NVRC-${machine_arch}-unknown-linux-musl"
|
||||
# make sure NVRC is the init process for the initrd and image case
|
||||
@@ -358,7 +378,7 @@ coco_guest_components() {
|
||||
local -r pause_dir="pause_bundle"
|
||||
|
||||
mkdir -p "${coco_bin_dir}"
|
||||
cp -a "${stage_one}/${coco_bin_dir}"/attestation-agent "${coco_bin_dir}/."
|
||||
cp -a "${stage_one}/${coco_bin_dir}"/attestation-agent-nv "${coco_bin_dir}/attestation-agent"
|
||||
cp -a "${stage_one}/${coco_bin_dir}"/api-server-rest "${coco_bin_dir}/."
|
||||
cp -a "${stage_one}/${coco_bin_dir}"/confidential-data-hub "${coco_bin_dir}/."
|
||||
|
||||
@@ -418,6 +438,7 @@ setup_nvidia_gpu_rootfs_stage_two() {
|
||||
done
|
||||
|
||||
coco_guest_components
|
||||
chisseled_nvat
|
||||
fi
|
||||
|
||||
compress_rootfs
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
FROM golang:1.24-alpine AS nydus-binary-downloader
|
||||
|
||||
# Keep the version here aligned with "ndyus-snapshotter.version"
|
||||
# in versions.yaml
|
||||
ARG NYDUS_SNAPSHOTTER_VERSION=v0.15.13
|
||||
ARG NYDUS_SNAPSHOTTER_REPO=https://github.com/containerd/nydus-snapshotter
|
||||
COPY versions.yaml /tmp/versions.yaml
|
||||
|
||||
RUN \
|
||||
set -e && \
|
||||
apk add --no-cache curl yq-go && \
|
||||
NYDUS_SNAPSHOTTER_VERSION="$(yq eval -e '.externals.nydus-snapshotter.version | explode(.)' /tmp/versions.yaml)" && \
|
||||
NYDUS_SNAPSHOTTER_REPO="$(yq eval -e '.externals.nydus-snapshotter.url | explode(.)' /tmp/versions.yaml)" && \
|
||||
mkdir -p /opt/nydus-snapshotter && \
|
||||
ARCH="$(uname -m)" && \
|
||||
if [ "${ARCH}" = "x86_64" ]; then ARCH=amd64 ; fi && \
|
||||
if [ "${ARCH}" = "aarch64" ]; then ARCH=arm64; fi && \
|
||||
apk add --no-cache curl && \
|
||||
curl -fOL --progress-bar "${NYDUS_SNAPSHOTTER_REPO}/releases/download/${NYDUS_SNAPSHOTTER_VERSION}/nydus-snapshotter-${NYDUS_SNAPSHOTTER_VERSION}-linux-${ARCH}.tar.gz" && \
|
||||
tar xvzpf "nydus-snapshotter-${NYDUS_SNAPSHOTTER_VERSION}-linux-${ARCH}.tar.gz" -C /opt/nydus-snapshotter && \
|
||||
rm "nydus-snapshotter-${NYDUS_SNAPSHOTTER_VERSION}-linux-${ARCH}.tar.gz"
|
||||
@@ -49,10 +49,13 @@ RUN \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/ && \
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_TOOLCHAIN}
|
||||
|
||||
WORKDIR /kata-deploy
|
||||
# Build from the repository root so kata-deploy uses the root Cargo workspace:
|
||||
# docker build -f tools/packaging/kata-deploy/Dockerfile .
|
||||
WORKDIR /kata
|
||||
|
||||
# Copy standalone binary project
|
||||
COPY binary /kata-deploy
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY src ./src
|
||||
COPY tools/packaging/kata-deploy/binary ./tools/packaging/kata-deploy/binary
|
||||
|
||||
# Install target and run tests based on architecture
|
||||
# - AMD64/arm64: use musl for fully static binaries
|
||||
@@ -93,23 +96,23 @@ RUN \
|
||||
RUN \
|
||||
rust_target="$(cat /tmp/rust_target)"; \
|
||||
echo "Running binary tests with target ${rust_target}..." && \
|
||||
RUSTFLAGS="-D warnings" cargo test --target "${rust_target}" -- --test-threads=1 && \
|
||||
RUSTFLAGS="-D warnings" cargo test -p kata-deploy --target "${rust_target}" -- --test-threads=1 && \
|
||||
echo "All tests passed!"
|
||||
|
||||
RUN \
|
||||
rust_target="$(cat /tmp/rust_target)"; \
|
||||
echo "Building kata-deploy binary for ${rust_target}..." && \
|
||||
RUSTFLAGS="-D warnings" cargo build --release --target "${rust_target}" && \
|
||||
RUSTFLAGS="-D warnings" cargo build --release -p kata-deploy --target "${rust_target}" && \
|
||||
mkdir -p /kata-deploy/bin && \
|
||||
cp "/kata-deploy/target/${rust_target}/release/kata-deploy" /kata-deploy/bin/kata-deploy && \
|
||||
cp "/kata/target/${rust_target}/release/kata-deploy" /kata-deploy/bin/kata-deploy && \
|
||||
echo "Cleaning up build artifacts to save disk space..." && \
|
||||
rm -rf /kata-deploy/target && \
|
||||
rm -rf /kata/target && \
|
||||
cargo clean
|
||||
|
||||
#### Extract kata artifacts
|
||||
FROM alpine:3.22 AS artifact-extractor
|
||||
|
||||
ARG KATA_ARTIFACTS=kata-static.tar.zst
|
||||
ARG KATA_ARTIFACTS=tools/packaging/kata-deploy/kata-static.tar.zst
|
||||
ARG DESTINATION=/opt/kata-artifacts
|
||||
|
||||
COPY ${KATA_ARTIFACTS} /tmp/
|
||||
@@ -222,11 +225,11 @@ COPY --from=runtime-assembler /output/lib/ /lib/
|
||||
COPY --from=runtime-assembler /output/lib64/ /lib64/
|
||||
|
||||
# Copy nydus snapshotter
|
||||
COPY nydus-snapshotter ${DESTINATION}/nydus-snapshotter
|
||||
COPY tools/packaging/kata-deploy/nydus-snapshotter ${DESTINATION}/nydus-snapshotter
|
||||
COPY --from=nydus-binary-downloader /opt/nydus-snapshotter/bin/containerd-nydus-grpc ${DESTINATION}/nydus-snapshotter/
|
||||
COPY --from=nydus-binary-downloader /opt/nydus-snapshotter/bin/nydus-overlayfs ${DESTINATION}/nydus-snapshotter/
|
||||
|
||||
# Copy runtimeclasses and node-feature-rules
|
||||
COPY node-feature-rules ${DESTINATION}/node-feature-rules
|
||||
COPY tools/packaging/kata-deploy/node-feature-rules ${DESTINATION}/node-feature-rules
|
||||
|
||||
ENTRYPOINT ["/usr/bin/kata-deploy"]
|
||||
|
||||
@@ -1,58 +1,38 @@
|
||||
[package]
|
||||
name = "kata-deploy"
|
||||
version = "0.1.0"
|
||||
authors.workspace = true
|
||||
edition = "2021"
|
||||
license.workspace = true
|
||||
rust-version = "1.90.0"
|
||||
authors = ["The Kata Containers community <kata-dev@lists.katacontainers.io>"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
[[bin]]
|
||||
name = "kata-deploy"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
# Error handling
|
||||
anyhow = "1.0"
|
||||
|
||||
# Logging
|
||||
log = "0.4"
|
||||
anyhow.workspace = true
|
||||
clap.workspace = true
|
||||
env_logger = "0.10"
|
||||
|
||||
# Command line parsing
|
||||
clap = { version = "4.5", features = ["derive"] }
|
||||
|
||||
# TOML parsing and manipulation
|
||||
toml_edit = "0.22"
|
||||
|
||||
# YAML parsing and manipulation
|
||||
serde_yaml = "0.9"
|
||||
|
||||
# Kubernetes API client
|
||||
kube = { version = "2.0", features = ["runtime", "derive"] }
|
||||
k8s-openapi = { version = "0.26", default-features = false, features = [
|
||||
"v1_33",
|
||||
] }
|
||||
|
||||
# System operations (using nsenter command instead of syscalls)
|
||||
libc = "0.2"
|
||||
|
||||
# JSON serialization
|
||||
serde_json = "1.0"
|
||||
|
||||
# File operations
|
||||
walkdir = "2"
|
||||
|
||||
# String manipulation
|
||||
regex = "1.10"
|
||||
|
||||
# Async runtime (required by kube-rs and for async main)
|
||||
tokio = { version = "1.38", features = [
|
||||
kube = { version = "2.0", features = ["runtime", "derive"] }
|
||||
libc.workspace = true
|
||||
log.workspace = true
|
||||
regex.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_yaml = "0.9"
|
||||
tokio = { workspace = true, features = [
|
||||
"rt-multi-thread",
|
||||
"macros",
|
||||
"signal",
|
||||
"time",
|
||||
] }
|
||||
toml_edit = "0.22"
|
||||
walkdir = "2"
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.8"
|
||||
rstest = "0.18"
|
||||
rstest.workspace = true
|
||||
serial_test.workspace = true
|
||||
tempfile.workspace = true
|
||||
|
||||
@@ -757,18 +757,15 @@ fn get_arch_var_or_base(base_name: &str, arch: &str) -> Option<String> {
|
||||
mod tests {
|
||||
//! Tests for configuration parsing and validation.
|
||||
//!
|
||||
//! IMPORTANT: All tests in this crate MUST be run serially (--test-threads=1)
|
||||
//! because they manipulate shared environment variables. Running tests in parallel
|
||||
//! will cause race conditions and test failures.
|
||||
//!
|
||||
//! Use: cargo test --bin kata-deploy -- --test-threads=1
|
||||
//! Tests that touch environment variables use `serial_test::serial` so they do not run
|
||||
//! in parallel within this process. For extra isolation you can still use
|
||||
//! `cargo test -p kata-deploy config::tests -- --test-threads=1`.
|
||||
|
||||
use super::*;
|
||||
use rstest::rstest;
|
||||
use serial_test::serial;
|
||||
|
||||
// NOTE: These tests modify environment variables which are process-global.
|
||||
// Run with: cargo test config::tests -- --test-threads=1
|
||||
// to ensure proper test isolation.
|
||||
// NOTE: Env-var tests use #[serial] (see above) for safe parallel execution with other modules.
|
||||
|
||||
/// Helper to clean up common environment variables used in tests
|
||||
fn cleanup_env_vars() {
|
||||
@@ -867,6 +864,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_get_arch() {
|
||||
let arch = get_arch().unwrap();
|
||||
@@ -874,6 +872,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_get_arch_var() {
|
||||
std::env::set_var("SHIMS_X86_64", "test1 test2");
|
||||
@@ -887,10 +886,12 @@ mod tests {
|
||||
#[rstest]
|
||||
#[case(false, "config.toml.d")]
|
||||
#[case(true, "config-v3.toml.d")]
|
||||
#[serial]
|
||||
fn test_k3s_rke2_drop_in_dir_name(#[case] use_v3: bool, #[case] expected: &str) {
|
||||
assert_eq!(k3s_rke2_drop_in_dir_name(use_v3), expected);
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_k3s_rke2_rendered_config_path() {
|
||||
assert_eq!(k3s_rke2_rendered_config_path(), "/etc/containerd/config.toml");
|
||||
@@ -905,6 +906,7 @@ mod tests {
|
||||
#[case("version = 2\n", false, false)]
|
||||
#[case("imports = [\"/path/config-v3.toml.d/*.toml\"]", true, true)]
|
||||
#[case("imports = [\"/path/config.toml.d/*.toml\"]", true, false)]
|
||||
#[serial]
|
||||
fn test_k3s_rke2_rendered_has_import(
|
||||
#[case] content: &str,
|
||||
#[case] use_v3: bool,
|
||||
@@ -913,6 +915,7 @@ mod tests {
|
||||
assert_eq!(k3s_rke2_rendered_has_import(content, use_v3), expected);
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_multi_install_suffix_not_set() {
|
||||
setup_minimal_env();
|
||||
@@ -929,6 +932,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_multi_install_suffix_with_value() {
|
||||
setup_minimal_env();
|
||||
@@ -950,6 +954,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_multi_install_suffix_different_values() {
|
||||
let suffixes = ["staging", "prod", "v2", "test123"];
|
||||
@@ -970,6 +975,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_multi_install_prefix_and_suffix() {
|
||||
setup_minimal_env();
|
||||
@@ -988,6 +994,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_empty_shims_no_custom_runtimes() {
|
||||
setup_minimal_env();
|
||||
@@ -1013,6 +1020,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_default_shim_not_in_shims() {
|
||||
setup_minimal_env();
|
||||
@@ -1025,6 +1033,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_hypervisor_annotation_invalid_shim() {
|
||||
setup_minimal_env();
|
||||
@@ -1041,6 +1050,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_agent_https_proxy_invalid_shim() {
|
||||
setup_minimal_env();
|
||||
@@ -1057,6 +1067,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_snapshotter_mapping_invalid_shim() {
|
||||
setup_minimal_env();
|
||||
@@ -1067,6 +1078,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_pull_type_mapping_invalid_shim() {
|
||||
setup_minimal_env();
|
||||
@@ -1077,6 +1089,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_force_guest_pull_invalid_shim() {
|
||||
setup_minimal_env();
|
||||
@@ -1087,6 +1100,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_validate_success() {
|
||||
setup_minimal_env();
|
||||
@@ -1106,6 +1120,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_missing_node_name_fails() {
|
||||
cleanup_env_vars();
|
||||
@@ -1116,6 +1131,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_empty_node_name_fails() {
|
||||
setup_minimal_env();
|
||||
@@ -1125,6 +1141,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_empty_default_shim_fails() {
|
||||
setup_minimal_env();
|
||||
@@ -1137,6 +1154,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_whitespace_only_default_shim_fails() {
|
||||
setup_minimal_env();
|
||||
@@ -1147,6 +1165,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_whitespace_only_shims_fails() {
|
||||
setup_minimal_env();
|
||||
@@ -1156,6 +1175,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_agent_no_proxy_invalid_shim() {
|
||||
setup_minimal_env();
|
||||
@@ -1166,6 +1186,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_multi_install_suffix_empty_treated_as_none() {
|
||||
setup_minimal_env();
|
||||
@@ -1177,6 +1198,7 @@ mod tests {
|
||||
cleanup_env_vars();
|
||||
}
|
||||
|
||||
#[serial]
|
||||
#[test]
|
||||
fn test_arch_specific_all_variables() {
|
||||
// Test ALL architecture-specific variables work without base variables
|
||||
|
||||
@@ -11,25 +11,48 @@ set -o nounset
|
||||
set -o pipefail
|
||||
set -o errtrace
|
||||
|
||||
KATA_DEPLOY_DIR="`dirname ${0}`/../../kata-deploy"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../.." && pwd)"
|
||||
KATA_DEPLOY_DIR="${REPO_ROOT}/tools/packaging/kata-deploy"
|
||||
STAGED_ARTIFACT="${KATA_DEPLOY_DIR}/kata-static.tar.zst"
|
||||
KATA_DEPLOY_ARTIFACT="${1:-"kata-static.tar.zst"}"
|
||||
REGISTRY="${2:-"quay.io/kata-containers/kata-deploy"}"
|
||||
TAG="${3:-}"
|
||||
|
||||
echo "Copying ${KATA_DEPLOY_ARTIFACT} to ${KATA_DEPLOY_DIR}"
|
||||
cp ${KATA_DEPLOY_ARTIFACT} ${KATA_DEPLOY_DIR}
|
||||
# Only remove a staged copy we created (skip when source is already the staged path).
|
||||
REMOVE_STAGED_ON_EXIT=false
|
||||
cleanup() {
|
||||
if [ "${REMOVE_STAGED_ON_EXIT}" = true ]; then
|
||||
rm -f "${STAGED_ARTIFACT}"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
pushd ${KATA_DEPLOY_DIR}
|
||||
src_rp="$(realpath -e "${KATA_DEPLOY_ARTIFACT}" 2>/dev/null || true)"
|
||||
dest_rp="$(realpath -e "${STAGED_ARTIFACT}" 2>/dev/null || true)"
|
||||
if [ -n "${src_rp}" ] && [ -n "${dest_rp}" ] && [ "${src_rp}" = "${dest_rp}" ]; then
|
||||
echo "Artifact already at staged path ${STAGED_ARTIFACT}; skipping copy"
|
||||
else
|
||||
echo "Copying ${KATA_DEPLOY_ARTIFACT} to ${STAGED_ARTIFACT}"
|
||||
cp "${KATA_DEPLOY_ARTIFACT}" "${STAGED_ARTIFACT}"
|
||||
REMOVE_STAGED_ON_EXIT=true
|
||||
fi
|
||||
|
||||
pushd "${REPO_ROOT}"
|
||||
|
||||
arch=$(uname -m)
|
||||
[ "$arch" = "x86_64" ] && arch="amd64"
|
||||
[ "$arch" = "aarch64" ] && arch="arm64"
|
||||
# Disable provenance and SBOM so each tag is a single image manifest. quay.io rejects
|
||||
# pushing multi-arch manifest lists that include attestation manifests ("manifest invalid").
|
||||
PLATFORM="linux/${arch}"
|
||||
IMAGE_TAG="${REGISTRY}:kata-containers-$(git rev-parse HEAD)-${arch}"
|
||||
IMAGE_TAG="${REGISTRY}:kata-containers-$(git -C "${REPO_ROOT}" rev-parse HEAD)-${arch}"
|
||||
|
||||
DOCKERFILE="${REPO_ROOT}/tools/packaging/kata-deploy/Dockerfile"
|
||||
|
||||
echo "Building the image"
|
||||
docker buildx build --platform "${PLATFORM}" --provenance false --sbom false \
|
||||
-f "${DOCKERFILE}" \
|
||||
--tag "${IMAGE_TAG}" --push .
|
||||
|
||||
if [ -n "${TAG}" ]; then
|
||||
@@ -37,6 +60,7 @@ if [ -n "${TAG}" ]; then
|
||||
|
||||
echo "Building the ${ADDITIONAL_TAG} image"
|
||||
docker buildx build --platform "${PLATFORM}" --provenance false --sbom false \
|
||||
-f "${DOCKERFILE}" \
|
||||
--tag "${ADDITIONAL_TAG}" --push .
|
||||
fi
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ ENV PATH="/opt/cargo/bin/:${PATH}"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN mkdir ${RUSTUP_HOME} ${CARGO_HOME} && chmod -R a+rwX ${RUSTUP_HOME} ${CARGO_HOME}
|
||||
RUN mkdir ${RUSTUP_HOME} ${CARGO_HOME}
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get --no-install-recommends install -y \
|
||||
@@ -38,6 +38,18 @@ RUN apt-get update && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/ && \
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${RUST_TOOLCHAIN}
|
||||
|
||||
ARG NVAT_VERSION
|
||||
RUN if [ "$(uname -m)" = "x86_64" ] && [ -n "${NVAT_VERSION}" ]; then \
|
||||
apt-get update && apt-get --no-install-recommends install -y \
|
||||
build-essential libxml2-dev zlib1g-dev && \
|
||||
tmpdir=$(mktemp -d) && pushd "$tmpdir" && \
|
||||
git clone https://github.com/NVIDIA/attestation-sdk && \
|
||||
pushd attestation-sdk && git fetch --depth=1 origin "${NVAT_VERSION}" && \
|
||||
git checkout FETCH_HEAD && pushd nv-attestation-sdk-cpp && cmake . && make install && \
|
||||
mkdir -p /usr/include && ln -sf /usr/local/include/nvat.h /usr/include/nvat.h && ldconfig && \
|
||||
popd && popd && popd && rm -rf "$tmpdir" && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/; fi
|
||||
|
||||
ENV LIBC="gnu"
|
||||
RUN ARCH=$(uname -m); \
|
||||
rust_arch=""; \
|
||||
@@ -50,3 +62,5 @@ RUN ARCH=$(uname -m); \
|
||||
esac; \
|
||||
echo "RUST_ARCH=${rust_arch}" > /etc/profile.d/rust.sh; \
|
||||
rustup target add "${rust_arch}-unknown-linux-${LIBC}"
|
||||
|
||||
RUN chmod -R a+rwX ${RUSTUP_HOME} ${CARGO_HOME}
|
||||
|
||||
@@ -35,6 +35,22 @@ build_coco_guest_components_from_source() {
|
||||
DESTDIR="${DESTDIR}/usr/local/bin" TEE_PLATFORM=${TEE_PLATFORM} make install
|
||||
|
||||
install -D -m0644 "confidential-data-hub/hub/src/image/ocicrypt_config.json" "${DESTDIR}/etc/ocicrypt_config.json"
|
||||
|
||||
if [ -n "${NV_ATTESTER:-}" ]; then
|
||||
echo "build attestation-agent-nv with nvidia-attester support"
|
||||
|
||||
rm "target/${RUST_ARCH}-unknown-linux-${LIBC}/release/attestation-agent"
|
||||
|
||||
ATTESTER="${NV_ATTESTER}" NVAT_USE_SYSTEM_LIB=1 RUSTFLAGS="-L /usr/local/lib" \
|
||||
DESTDIR="${DESTDIR}/usr/local/bin" TEE_PLATFORM=${TEE_PLATFORM} make build
|
||||
strip "target/${RUST_ARCH}-unknown-linux-${LIBC}/release/attestation-agent"
|
||||
install -D -m0755 "target/${RUST_ARCH}-unknown-linux-${LIBC}/release/attestation-agent" \
|
||||
"${DESTDIR}/usr/local/bin/attestation-agent-nv"
|
||||
|
||||
mkdir -p "${DESTDIR}/usr/local/lib"
|
||||
cp -a /usr/local/lib/libnvat.so* "${DESTDIR}/usr/local/lib/"
|
||||
fi
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,16 @@ package_output_dir="${package_output_dir:-}"
|
||||
[ -n "${coco_guest_components_version}" ] || die "Failed to get coco-guest-components version or commit"
|
||||
[ -n "${coco_guest_components_toolchain}" ] || die "Failed to get the rust toolchain to build coco-guest-components"
|
||||
|
||||
nvat_version="${nvat_version:-}"
|
||||
[ -n "${nvat_version}" ] || nvat_version=$(get_from_kata_deps ".externals.nvidia.nvat.version" 2>/dev/null || true)
|
||||
|
||||
container_image="${COCO_GUEST_COMPONENTS_CONTAINER_BUILDER:-$(get_coco_guest_components_image_name)}"
|
||||
[ "${CROSS_BUILD}" == "true" ] && container_image="${container_image}-cross-build"
|
||||
|
||||
docker pull ${container_image} || \
|
||||
(docker $BUILDX build $PLATFORM \
|
||||
--build-arg RUST_TOOLCHAIN="${coco_guest_components_toolchain}" \
|
||||
--build-arg NVAT_VERSION="${nvat_version}" \
|
||||
-t "${container_image}" "${script_dir}" && \
|
||||
# No-op unless PUSH_TO_REGISTRY is exported as "yes"
|
||||
push_to_registry "${container_image}")
|
||||
@@ -44,7 +48,8 @@ RESOURCE_PROVIDER="kbs,sev"
|
||||
# snp-attester and tdx-attester crates require packages only available on x86
|
||||
# se-attester crate requires packages only available on s390x
|
||||
case "$(uname -m)" in
|
||||
x86_64) ATTESTER="snp-attester,tdx-attester,nvidia-attester" ;;
|
||||
x86_64) ATTESTER="snp-attester,tdx-attester"
|
||||
NV_ATTESTER="snp-attester,tdx-attester,nvidia-attester" ;;
|
||||
s390x) ATTESTER="se-attester" ;;
|
||||
aarch64) ATTESTER="cca-attester" ;;
|
||||
*) ATTESTER="none" ;;
|
||||
@@ -56,6 +61,7 @@ docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
||||
--env TEE_PLATFORM=${TEE_PLATFORM:+"all"} \
|
||||
--env RESOURCE_PROVIDER=${RESOURCE_PROVIDER:-} \
|
||||
--env ATTESTER=${ATTESTER:-} \
|
||||
--env NV_ATTESTER=${NV_ATTESTER:-} \
|
||||
--env coco_guest_components_repo="${coco_guest_components_repo}" \
|
||||
--env coco_guest_components_version="${coco_guest_components_version}" \
|
||||
--user "$(id -u)":"$(id -g)" \
|
||||
|
||||
@@ -269,6 +269,10 @@ externals:
|
||||
ctk:
|
||||
version: "1.18.1-1"
|
||||
url: "https://github.com/NVIDIA/nvidia-container-toolkit"
|
||||
nvat:
|
||||
desc: "NVIDIA Attestation SDK"
|
||||
version: "2026.03.02"
|
||||
url: "https://github.com/NVIDIA/attestation-sdk"
|
||||
|
||||
busybox:
|
||||
desc: "The Swiss Army Knife of Embedded Linux"
|
||||
@@ -288,18 +292,18 @@ externals:
|
||||
coco-guest-components:
|
||||
description: "Provides attested key unwrapping for image decryption"
|
||||
url: "https://github.com/confidential-containers/guest-components/"
|
||||
version: "ab95914ac84c32a43102463cc0ae330710af47be"
|
||||
version: "30b552e7841b10e656fa28cf643ed25b9d45e33f"
|
||||
toolchain: "1.90.0"
|
||||
|
||||
coco-trustee:
|
||||
description: "Provides attestation and secret delivery components"
|
||||
url: "https://github.com/confidential-containers/trustee"
|
||||
version: "f5cb8fc1b51b652fc24e2d6b8742cf417805352e"
|
||||
version: "22788122660d6e9be3e4bf52704282de5fcc0a2a"
|
||||
# image / ita_image and image_tag / ita_image_tag must be in sync
|
||||
image: "ghcr.io/confidential-containers/staged-images/kbs"
|
||||
image_tag: "f5cb8fc1b51b652fc24e2d6b8742cf417805352e"
|
||||
image_tag: "22788122660d6e9be3e4bf52704282de5fcc0a2a"
|
||||
ita_image: "ghcr.io/confidential-containers/staged-images/kbs-ita-as"
|
||||
ita_image_tag: "f5cb8fc1b51b652fc24e2d6b8742cf417805352e-x86_64"
|
||||
ita_image_tag: "22788122660d6e9be3e4bf52704282de5fcc0a2a-x86_64"
|
||||
toolchain: "1.90.0"
|
||||
|
||||
containerd:
|
||||
@@ -383,8 +387,6 @@ externals:
|
||||
url: "https://github.com/dragonflyoss/image-service"
|
||||
version: "v2.2.3"
|
||||
|
||||
# Keep the version here aligned with the NYDUS_SNAPSHOTTER_VERSION
|
||||
# on tools/packaging/kata-deploy/Dockerfile
|
||||
nydus-snapshotter:
|
||||
description: "Snapshotter for Nydus image acceleration service"
|
||||
url: "https://github.com/containerd/nydus-snapshotter"
|
||||
|
||||
Reference in New Issue
Block a user