mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-03-15 09:12:29 +00:00
Compare commits
472 Commits
burgerdev/
...
sprt-patch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bacc72540 | ||
|
|
947862f804 | ||
|
|
94b6a1d43e | ||
|
|
4ad8c31b5a | ||
|
|
edbb4b633c | ||
|
|
d5cb9764fd | ||
|
|
141070b388 | ||
|
|
af919686ab | ||
|
|
16e91bfb21 | ||
|
|
c7d5f207f1 | ||
|
|
40dac78412 | ||
|
|
bfa7f2486d | ||
|
|
aa7e46b5ed | ||
|
|
8221361915 | ||
|
|
88c333f2a6 | ||
|
|
8412af919d | ||
|
|
06ed957a45 | ||
|
|
10f8ec0c20 | ||
|
|
3507b2038e | ||
|
|
bdb0afc4e0 | ||
|
|
f891f340bc | ||
|
|
0c6fcde198 | ||
|
|
363701d767 | ||
|
|
2ad81c4797 | ||
|
|
2f73e34e33 | ||
|
|
8ce714cf97 | ||
|
|
b0b0038689 | ||
|
|
d46474cfc0 | ||
|
|
ba7a5953c8 | ||
|
|
395f237fc2 | ||
|
|
dfd269eb87 | ||
|
|
fb43d3419f | ||
|
|
8b06f3d95d | ||
|
|
5acb6d8e13 | ||
|
|
ff973a95c8 | ||
|
|
b00013c717 | ||
|
|
37bd5e3c9d | ||
|
|
e782d1ad50 | ||
|
|
1bc89d09ae | ||
|
|
496e255ea2 | ||
|
|
5ae891ab46 | ||
|
|
a570fdc0fd | ||
|
|
8dcd91cf5f | ||
|
|
06a3bbdd44 | ||
|
|
a1f90fe350 | ||
|
|
4c386b51d9 | ||
|
|
4002a91452 | ||
|
|
afbec780a9 | ||
|
|
a3a45429f6 | ||
|
|
b42ef09ffb | ||
|
|
2a43bf37ed | ||
|
|
a54d95966b | ||
|
|
5208ee4ec0 | ||
|
|
8e1b33cc14 | ||
|
|
2abf6965ff | ||
|
|
bb6fb8ff39 | ||
|
|
91739d4425 | ||
|
|
364d3cded0 | ||
|
|
62b12953c7 | ||
|
|
4e4f9c44ae | ||
|
|
d954932876 | ||
|
|
07645cf58b | ||
|
|
b3a551d438 | ||
|
|
5a4ddb8c71 | ||
|
|
7b203d1b43 | ||
|
|
7afdfc7388 | ||
|
|
889ba0d5db | ||
|
|
ec81ea95df | ||
|
|
4d760e64ae | ||
|
|
476c827fca | ||
|
|
dbb1eb959c | ||
|
|
8c4bad68a8 | ||
|
|
3418cedacc | ||
|
|
544f688104 | ||
|
|
3ac6579ca6 | ||
|
|
aa9e3fc3d5 | ||
|
|
287db1865f | ||
|
|
59b4e3d3f8 | ||
|
|
7061f64db5 | ||
|
|
2260f66339 | ||
|
|
08272ab673 | ||
|
|
8dc6b24e7d | ||
|
|
650863039b | ||
|
|
5ed76b3c91 | ||
|
|
6ab59453ff | ||
|
|
ba792945ef | ||
|
|
6e451e3da0 | ||
|
|
f994bacf6c | ||
|
|
6f17125ea4 | ||
|
|
000c9cce23 | ||
|
|
d6a1881b8b | ||
|
|
445af6c09b | ||
|
|
4359c7b15d | ||
|
|
2e0ce2f39f | ||
|
|
1e2c86c068 | ||
|
|
e1269afe8a | ||
|
|
5e46f814dd | ||
|
|
0d58bad0fd | ||
|
|
6ff78373cf | ||
|
|
300f7e686e | ||
|
|
2693daf503 | ||
|
|
56c6512781 | ||
|
|
eeecd6d72b | ||
|
|
4b7c1db064 | ||
|
|
34ecb11b35 | ||
|
|
e36f788570 | ||
|
|
a9fc501c08 | ||
|
|
c7a478662f | ||
|
|
5c21b1faf3 | ||
|
|
285aaad13e | ||
|
|
507a0e09f3 | ||
|
|
bbc006ab7c | ||
|
|
43f6a70897 | ||
|
|
a3669d499a | ||
|
|
20c60b21bd | ||
|
|
7b2a7ca4d8 | ||
|
|
a21a94a2e8 | ||
|
|
6f45a7f937 | ||
|
|
ca11a7387d | ||
|
|
575381cb7e | ||
|
|
4b308817bc | ||
|
|
693a1461d2 | ||
|
|
756f3a73df | ||
|
|
c8fdb0e971 | ||
|
|
369124b180 | ||
|
|
369aed0203 | ||
|
|
c94e65e982 | ||
|
|
63515242c5 | ||
|
|
c4e352f7ff | ||
|
|
ef0f8723cf | ||
|
|
8943f0d9b2 | ||
|
|
d9bc7e2b76 | ||
|
|
3743eb4cea | ||
|
|
32453a576f | ||
|
|
f3293ed404 | ||
|
|
077aaa6480 | ||
|
|
433e59de1f | ||
|
|
282e20bc37 | ||
|
|
d1f52728cc | ||
|
|
0b40ad066a | ||
|
|
2e033d0079 | ||
|
|
c28ffac060 | ||
|
|
f6d352d088 | ||
|
|
98446e7338 | ||
|
|
3ce7693a2d | ||
|
|
46cbb2fb98 | ||
|
|
c961f70b7e | ||
|
|
fe5ee803a8 | ||
|
|
9d3d3c9b0f | ||
|
|
0008ecd18b | ||
|
|
711e7b8014 | ||
|
|
566e1abb09 | ||
|
|
9e33888f06 | ||
|
|
bde6eb7c3a | ||
|
|
5d76811c8a | ||
|
|
319237e447 | ||
|
|
e9653eae6e | ||
|
|
0a9e730f54 | ||
|
|
1be3785fa0 | ||
|
|
7c58ec7daa | ||
|
|
79f51ab237 | ||
|
|
0bdc462bed | ||
|
|
362c177b3d | ||
|
|
62c936b916 | ||
|
|
9eca015d73 | ||
|
|
dedd833cdd | ||
|
|
ecb22cb3e3 | ||
|
|
38a28b273a | ||
|
|
e9f69ce321 | ||
|
|
c2b0650491 | ||
|
|
e24e564eb7 | ||
|
|
bfc54d904a | ||
|
|
3e67f92e34 | ||
|
|
a9ec8ef21f | ||
|
|
bcd0c0085c | ||
|
|
5cb1332348 | ||
|
|
e878d4a90a | ||
|
|
2cea32cc23 | ||
|
|
5c14d2956a | ||
|
|
a27009012c | ||
|
|
4e793d635e | ||
|
|
f254eeb0e9 | ||
|
|
72a0f5daec | ||
|
|
02ace265d9 | ||
|
|
16c2dd7c96 | ||
|
|
5dd36c6c0f | ||
|
|
0f5511962c | ||
|
|
429133cedb | ||
|
|
90c99541da | ||
|
|
e73daa2f14 | ||
|
|
28ab972b3f | ||
|
|
313c7313f0 | ||
|
|
f36377070a | ||
|
|
2f5319675a | ||
|
|
5ca403b5d9 | ||
|
|
425e93a9b8 | ||
|
|
50ffa0fbfd | ||
|
|
2221b76b67 | ||
|
|
a658db8746 | ||
|
|
04948c616e | ||
|
|
e6f12d8f86 | ||
|
|
54e8081222 | ||
|
|
346ebd0ff9 | ||
|
|
bf90ccaf75 | ||
|
|
b7143488d9 | ||
|
|
12c5e0f33f | ||
|
|
7565c881e6 | ||
|
|
a300b6b9a9 | ||
|
|
524bf66cbc | ||
|
|
01c7949bfd | ||
|
|
91c3804959 | ||
|
|
eec6c8b0c4 | ||
|
|
0fb40eda12 | ||
|
|
d90e785901 | ||
|
|
49fbd6e7af | ||
|
|
ca244c7265 | ||
|
|
e2992b51ad | ||
|
|
8854e69e28 | ||
|
|
96108006f2 | ||
|
|
d056fb20fe | ||
|
|
bc1170ba0c | ||
|
|
71ddbac56d | ||
|
|
a47c0cdf66 | ||
|
|
9992e1c416 | ||
|
|
95585d818f | ||
|
|
bc75f6a158 | ||
|
|
e31a06d51d | ||
|
|
4265beb081 | ||
|
|
4a92fc1129 | ||
|
|
d48c542a52 | ||
|
|
e0caeb32fc | ||
|
|
73e31ea19a | ||
|
|
ac74ef4505 | ||
|
|
3443ddf24d | ||
|
|
e9a5de35e8 | ||
|
|
df852b77b5 | ||
|
|
489b677927 | ||
|
|
8abfef358a | ||
|
|
dce6f13da8 | ||
|
|
e3e406ff26 | ||
|
|
cc73b14e26 | ||
|
|
b5352af1ee | ||
|
|
2d8c3206c7 | ||
|
|
5d124523f8 | ||
|
|
252d4486f1 | ||
|
|
af41f5018f | ||
|
|
a427537914 | ||
|
|
10de56a749 | ||
|
|
86fe419774 | ||
|
|
fab828586b | ||
|
|
fa6e4981a1 | ||
|
|
dc64d256bf | ||
|
|
16dd1de0ab | ||
|
|
b9ff5ffc21 | ||
|
|
7f86b967d1 | ||
|
|
62ed86d1aa | ||
|
|
334340aa18 | ||
|
|
ad7e60030a | ||
|
|
60ba121a0d | ||
|
|
d741544fa6 | ||
|
|
679cdeadc8 | ||
|
|
66a3d4b4a2 | ||
|
|
710c117a24 | ||
|
|
e3aa973995 | ||
|
|
9c0fcd30c5 | ||
|
|
924051c652 | ||
|
|
8fb4332d42 | ||
|
|
84bcf34c75 | ||
|
|
60790907ef | ||
|
|
4dc21aa966 | ||
|
|
7874505249 | ||
|
|
e3d6cb8547 | ||
|
|
7062a769b7 | ||
|
|
12a9ad56b4 | ||
|
|
ebdfbd3120 | ||
|
|
04dedda6ed | ||
|
|
d073af4e64 | ||
|
|
2844a6f938 | ||
|
|
6e5fe96ed1 | ||
|
|
c80ddd3fd9 | ||
|
|
2dd172c5b6 | ||
|
|
3c3823f2e4 | ||
|
|
59273e8b2d | ||
|
|
7de6455742 | ||
|
|
34925ae740 | ||
|
|
60beb5236d | ||
|
|
a011d2132f | ||
|
|
760b465bb0 | ||
|
|
11655ef029 | ||
|
|
f6e93c2094 | ||
|
|
b10e5a2250 | ||
|
|
efeba0b8ed | ||
|
|
a9ba18d48c | ||
|
|
5d59341f7f | ||
|
|
a989686cf6 | ||
|
|
58259aa5f4 | ||
|
|
1737777d28 | ||
|
|
1d26d07110 | ||
|
|
1060a94b08 | ||
|
|
37764d18d4 | ||
|
|
e502fa2feb | ||
|
|
3f25b88f89 | ||
|
|
22bc29cb4a | ||
|
|
106c6cea59 | ||
|
|
16be168062 | ||
|
|
5715408d61 | ||
|
|
6a2d813196 | ||
|
|
85779a6f1a | ||
|
|
c1ee0985ed | ||
|
|
ceab55a871 | ||
|
|
b640fe5a6a | ||
|
|
c0030c271c | ||
|
|
cbcc7af6f3 | ||
|
|
87356269d8 | ||
|
|
2d28f3d267 | ||
|
|
5ae34ab240 | ||
|
|
8eeea7d1fc | ||
|
|
3e53f2814a | ||
|
|
4644a02871 | ||
|
|
66dc24566f | ||
|
|
c480737ebd | ||
|
|
efbc69a2ec | ||
|
|
1f68f15995 | ||
|
|
f39517a18a | ||
|
|
9b0b7fc795 | ||
|
|
bdd98ec623 | ||
|
|
d16026f7b9 | ||
|
|
1dcc67c241 | ||
|
|
49ca96561b | ||
|
|
e235fc1efb | ||
|
|
203f7090a6 | ||
|
|
6d6202bbe3 | ||
|
|
150c90e32a | ||
|
|
9cc1c76ade | ||
|
|
8330dd059f | ||
|
|
f6ff9cf717 | ||
|
|
754f07cff2 | ||
|
|
3a0416c99f | ||
|
|
65fdb18c96 | ||
|
|
08d2ba1969 | ||
|
|
617af4cb3b | ||
|
|
9a7aadaaca | ||
|
|
63f6dcdeb9 | ||
|
|
687d0bf94a | ||
|
|
fd1b8ceed1 | ||
|
|
b4545da15d | ||
|
|
f79e453313 | ||
|
|
e396a460bc | ||
|
|
23d2dfaedc | ||
|
|
8cbb1a4357 | ||
|
|
381da9e603 | ||
|
|
0ccf429a3d | ||
|
|
5f7525f099 | ||
|
|
3391c6f1c5 | ||
|
|
91913f9e82 | ||
|
|
1a0fbbfa32 | ||
|
|
41dcfb4a9f | ||
|
|
cb5f143b1b | ||
|
|
081823b388 | ||
|
|
f8d7ff40b4 | ||
|
|
ad240a39e6 | ||
|
|
9cc97ad35c | ||
|
|
1329ce355e | ||
|
|
c32fc409ec | ||
|
|
60d87b7785 | ||
|
|
e430727cb6 | ||
|
|
5cc028a8b1 | ||
|
|
faf5aed965 | ||
|
|
b7d2973ce5 | ||
|
|
c4b4a3d8bb | ||
|
|
2ec70bc8e2 | ||
|
|
c980b6e191 | ||
|
|
30aff429df | ||
|
|
014ab2fce6 | ||
|
|
dd1752ac1c | ||
|
|
29ab8df881 | ||
|
|
0ac8f1f70e | ||
|
|
a0ae1b6608 | ||
|
|
412a384aad | ||
|
|
0daafecef2 | ||
|
|
f0db4032f2 | ||
|
|
208cec429a | ||
|
|
1f978ecc31 | ||
|
|
b23d094928 | ||
|
|
0f19465b3a | ||
|
|
e05197e81c | ||
|
|
683d673f4f | ||
|
|
38242d3a61 | ||
|
|
283fd45045 | ||
|
|
730b0f1769 | ||
|
|
585d0be342 | ||
|
|
b748688e69 | ||
|
|
c4af9be411 | ||
|
|
bce8efca67 | ||
|
|
e20f6b2f9d | ||
|
|
3503bcdb50 | ||
|
|
a03dc3129d | ||
|
|
93ec470928 | ||
|
|
903e608c23 | ||
|
|
c92bb1aa88 | ||
|
|
28bd0cf405 | ||
|
|
3a4e1917d2 | ||
|
|
3a5e2060aa | ||
|
|
55ee8abf0b | ||
|
|
0fa7d5b293 | ||
|
|
dcb62a7f91 | ||
|
|
8be41a4e80 | ||
|
|
65a9fe0063 | ||
|
|
43cdde4c5d | ||
|
|
9891b111d1 | ||
|
|
d147e2491b | ||
|
|
479cce8406 | ||
|
|
ea74024b93 | ||
|
|
aadad0c9b6 | ||
|
|
cfd0ebe85f | ||
|
|
c7f4c9a3bb | ||
|
|
2f50c85b12 | ||
|
|
5635410dd3 | ||
|
|
1a6f1fc3ac | ||
|
|
9379a18c8a | ||
|
|
c7c811071a | ||
|
|
f3a669ee2d | ||
|
|
407252a863 | ||
|
|
196d7d674d | ||
|
|
be148c7f72 | ||
|
|
dcbdf56281 | ||
|
|
1d2f2d6350 | ||
|
|
aaf8de3dbf | ||
|
|
9816ffdac7 | ||
|
|
1aa65167d7 | ||
|
|
b50777a174 | ||
|
|
beea0c34c5 | ||
|
|
f9e16431c1 | ||
|
|
f9a6359674 | ||
|
|
6d96875d04 | ||
|
|
69f21692ed | ||
|
|
00bfa3fa02 | ||
|
|
e2156721fd | ||
|
|
1f95d9401b | ||
|
|
cdc0eab8e4 | ||
|
|
ec480dc438 | ||
|
|
37685c41c7 | ||
|
|
163f04a918 | ||
|
|
e3b4d87b6d | ||
|
|
3eb0641431 | ||
|
|
1b1b3af9ab | ||
|
|
af01434226 | ||
|
|
ede773db17 | ||
|
|
05eca5ca25 | ||
|
|
c47bff6d6a | ||
|
|
82f141a02e | ||
|
|
7198c8789e | ||
|
|
9585e608e5 | ||
|
|
8422411d91 | ||
|
|
3fd354b991 | ||
|
|
9e38fd2562 | ||
|
|
f7a36df290 | ||
|
|
d077ed4c1e | ||
|
|
8d30b84abd | ||
|
|
20bef41347 | ||
|
|
96f1d95de5 | ||
|
|
fbb0e7f2f2 | ||
|
|
30778594d0 | ||
|
|
8768e08258 | ||
|
|
254dbd9b45 | ||
|
|
568b13400a | ||
|
|
6188b7f79f | ||
|
|
9a829107ba | ||
|
|
7669f1fbd1 | ||
|
|
97d7575d41 | ||
|
|
00e0db99a3 | ||
|
|
5cccbb9f41 |
9
.github/actionlint.yaml
vendored
9
.github/actionlint.yaml
vendored
@@ -7,8 +7,12 @@
|
|||||||
self-hosted-runner:
|
self-hosted-runner:
|
||||||
# Labels of self-hosted runner that linter should ignore
|
# Labels of self-hosted runner that linter should ignore
|
||||||
labels:
|
labels:
|
||||||
|
- amd64-nvidia-a100
|
||||||
- arm64-k8s
|
- arm64-k8s
|
||||||
- ubuntu-22.04-arm
|
- containerd-v1.7
|
||||||
|
- containerd-v2.0
|
||||||
|
- containerd-v2.1
|
||||||
|
- containerd-v2.2
|
||||||
- garm-ubuntu-2004
|
- garm-ubuntu-2004
|
||||||
- garm-ubuntu-2004-smaller
|
- garm-ubuntu-2004-smaller
|
||||||
- garm-ubuntu-2204
|
- garm-ubuntu-2204
|
||||||
@@ -16,6 +20,7 @@ self-hosted-runner:
|
|||||||
- garm-ubuntu-2304-smaller
|
- garm-ubuntu-2304-smaller
|
||||||
- garm-ubuntu-2204-smaller
|
- garm-ubuntu-2204-smaller
|
||||||
- k8s-ppc64le
|
- k8s-ppc64le
|
||||||
|
- ubuntu-24.04-ppc64le
|
||||||
- metrics
|
- metrics
|
||||||
- ppc64le
|
- ppc64le
|
||||||
- riscv-builder
|
- riscv-builder
|
||||||
@@ -23,3 +28,5 @@ self-hosted-runner:
|
|||||||
- s390x
|
- s390x
|
||||||
- s390x-large
|
- s390x-large
|
||||||
- tdx
|
- tdx
|
||||||
|
- ubuntu-22.04-arm
|
||||||
|
- ubuntu-24.04-s390x
|
||||||
|
|||||||
3
.github/dependabot.yml
vendored
3
.github/dependabot.yml
vendored
@@ -66,6 +66,9 @@ updates:
|
|||||||
rustix:
|
rustix:
|
||||||
patterns:
|
patterns:
|
||||||
- rustix
|
- rustix
|
||||||
|
slab:
|
||||||
|
patterns:
|
||||||
|
- slab
|
||||||
time:
|
time:
|
||||||
patterns:
|
patterns:
|
||||||
- time
|
- time
|
||||||
|
|||||||
3
.github/workflows/PR-wip-checks.yaml
vendored
3
.github/workflows/PR-wip-checks.yaml
vendored
@@ -9,8 +9,7 @@ on:
|
|||||||
- labeled
|
- labeled
|
||||||
- unlabeled
|
- unlabeled
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
|||||||
11
.github/workflows/actionlint.yaml
vendored
11
.github/workflows/actionlint.yaml
vendored
@@ -3,16 +3,8 @@ name: Lint GHA workflows
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- edited
|
|
||||||
- reopened
|
|
||||||
- synchronize
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/**'
|
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -20,6 +12,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-actionlint:
|
run-actionlint:
|
||||||
|
name: run-actionlint
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|||||||
15
.github/workflows/basic-ci-amd64.yaml
vendored
15
.github/workflows/basic-ci-amd64.yaml
vendored
@@ -13,11 +13,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-containerd-sandboxapi:
|
run-containerd-sandboxapi:
|
||||||
|
name: run-containerd-sandboxapi
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# the all the tests are not flaky, otherwise we'll fail
|
# the all the tests are not flaky, otherwise we'll fail
|
||||||
@@ -66,6 +66,7 @@ jobs:
|
|||||||
run: bash tests/integration/cri-containerd/gha-run.sh run
|
run: bash tests/integration/cri-containerd/gha-run.sh run
|
||||||
|
|
||||||
run-containerd-stability:
|
run-containerd-stability:
|
||||||
|
name: run-containerd-stability
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -108,6 +109,7 @@ jobs:
|
|||||||
run: bash tests/stability/gha-run.sh run
|
run: bash tests/stability/gha-run.sh run
|
||||||
|
|
||||||
run-nydus:
|
run-nydus:
|
||||||
|
name: run-nydus
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# the all the tests are not flaky, otherwise we'll fail
|
# the all the tests are not flaky, otherwise we'll fail
|
||||||
@@ -153,6 +155,7 @@ jobs:
|
|||||||
run: bash tests/integration/nydus/gha-run.sh run
|
run: bash tests/integration/nydus/gha-run.sh run
|
||||||
|
|
||||||
run-runk:
|
run-runk:
|
||||||
|
name: run-runk
|
||||||
# Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether
|
# Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether
|
||||||
if: false
|
if: false
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -188,6 +191,7 @@ jobs:
|
|||||||
run: bash tests/integration/runk/gha-run.sh run
|
run: bash tests/integration/runk/gha-run.sh run
|
||||||
|
|
||||||
run-tracing:
|
run-tracing:
|
||||||
|
name: run-tracing
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -232,6 +236,7 @@ jobs:
|
|||||||
run: bash tests/functional/tracing/gha-run.sh run
|
run: bash tests/functional/tracing/gha-run.sh run
|
||||||
|
|
||||||
run-vfio:
|
run-vfio:
|
||||||
|
name: run-vfio
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -275,6 +280,7 @@ jobs:
|
|||||||
run: bash tests/functional/vfio/gha-run.sh run
|
run: bash tests/functional/vfio/gha-run.sh run
|
||||||
|
|
||||||
run-docker-tests:
|
run-docker-tests:
|
||||||
|
name: run-docker-tests
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# all the tests are not flaky, otherwise we'll fail them
|
# all the tests are not flaky, otherwise we'll fail them
|
||||||
@@ -282,10 +288,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
vmm:
|
vmm:
|
||||||
- clh
|
|
||||||
- qemu
|
- qemu
|
||||||
- dragonball
|
|
||||||
- cloud-hypervisor
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
env:
|
env:
|
||||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||||
@@ -321,6 +324,7 @@ jobs:
|
|||||||
run: bash tests/integration/docker/gha-run.sh run
|
run: bash tests/integration/docker/gha-run.sh run
|
||||||
|
|
||||||
run-nerdctl-tests:
|
run-nerdctl-tests:
|
||||||
|
name: run-nerdctl-tests
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# all the tests are not flaky, otherwise we'll fail them
|
# all the tests are not flaky, otherwise we'll fail them
|
||||||
@@ -380,6 +384,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
run-kata-agent-apis:
|
run-kata-agent-apis:
|
||||||
|
name: run-kata-agent-apis
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|||||||
6
.github/workflows/basic-ci-s390x.yaml
vendored
6
.github/workflows/basic-ci-s390x.yaml
vendored
@@ -13,11 +13,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-containerd-sandboxapi:
|
run-containerd-sandboxapi:
|
||||||
|
name: run-containerd-sandboxapi
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# the all the tests are not flaky, otherwise we'll fail
|
# the all the tests are not flaky, otherwise we'll fail
|
||||||
@@ -66,6 +66,7 @@ jobs:
|
|||||||
run: bash tests/integration/cri-containerd/gha-run.sh run
|
run: bash tests/integration/cri-containerd/gha-run.sh run
|
||||||
|
|
||||||
run-containerd-stability:
|
run-containerd-stability:
|
||||||
|
name: run-containerd-stability
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -107,6 +108,7 @@ jobs:
|
|||||||
run: bash tests/stability/gha-run.sh run
|
run: bash tests/stability/gha-run.sh run
|
||||||
|
|
||||||
run-docker-tests:
|
run-docker-tests:
|
||||||
|
name: run-docker-tests
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# all the tests are not flaky, otherwise we'll fail them
|
# all the tests are not flaky, otherwise we'll fail them
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
name: Build checks preview riscv64
|
name: Build checks preview riscv64
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
|
name: check
|
||||||
runs-on: ${{ inputs.instance }}
|
runs-on: ${{ inputs.instance }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -124,9 +124,11 @@ jobs:
|
|||||||
echo "GITHUB_RUNNER_CI_NON_VIRT=true" >> "$GITHUB_ENV"
|
echo "GITHUB_RUNNER_CI_NON_VIRT=true" >> "$GITHUB_ENV"
|
||||||
- name: Running `${{ matrix.command }}` for ${{ matrix.component.name }}
|
- name: Running `${{ matrix.command }}` for ${{ matrix.component.name }}
|
||||||
run: |
|
run: |
|
||||||
cd ${{ matrix.component.path }}
|
cd "${COMPONENT_PATH}"
|
||||||
${{ matrix.command }}
|
${COMMAND}
|
||||||
env:
|
env:
|
||||||
|
COMMAND: ${{ matrix.command }}
|
||||||
|
COMPONENT_PATH: ${{ matrix.component.path }}
|
||||||
RUST_BACKTRACE: "1"
|
RUST_BACKTRACE: "1"
|
||||||
RUST_LIB_BACKTRACE: "0"
|
RUST_LIB_BACKTRACE: "0"
|
||||||
SKIP_GO_VERSION_CHECK: "1"
|
SKIP_GO_VERSION_CHECK: "1"
|
||||||
|
|||||||
17
.github/workflows/build-checks.yaml
vendored
17
.github/workflows/build-checks.yaml
vendored
@@ -5,12 +5,13 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
name: Build checks
|
name: Build checks
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
|
name: check
|
||||||
runs-on: ${{ inputs.instance }}
|
runs-on: ${{ inputs.instance }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -42,6 +43,11 @@ jobs:
|
|||||||
path: src/runtime-rs
|
path: src/runtime-rs
|
||||||
needs:
|
needs:
|
||||||
- rust
|
- rust
|
||||||
|
- name: libs
|
||||||
|
path: src/libs
|
||||||
|
needs:
|
||||||
|
- rust
|
||||||
|
- protobuf-compiler
|
||||||
- name: agent-ctl
|
- name: agent-ctl
|
||||||
path: src/tools/agent-ctl
|
path: src/tools/agent-ctl
|
||||||
needs:
|
needs:
|
||||||
@@ -52,6 +58,7 @@ jobs:
|
|||||||
path: src/tools/kata-ctl
|
path: src/tools/kata-ctl
|
||||||
needs:
|
needs:
|
||||||
- rust
|
- rust
|
||||||
|
- protobuf-compiler
|
||||||
- name: trace-forwarder
|
- name: trace-forwarder
|
||||||
path: src/tools/trace-forwarder
|
path: src/tools/trace-forwarder
|
||||||
needs:
|
needs:
|
||||||
@@ -122,9 +129,11 @@ jobs:
|
|||||||
echo "GITHUB_RUNNER_CI_NON_VIRT=true" >> "$GITHUB_ENV"
|
echo "GITHUB_RUNNER_CI_NON_VIRT=true" >> "$GITHUB_ENV"
|
||||||
- name: Running `${{ matrix.command }}` for ${{ matrix.component.name }}
|
- name: Running `${{ matrix.command }}` for ${{ matrix.component.name }}
|
||||||
run: |
|
run: |
|
||||||
cd ${{ matrix.component.path }}
|
cd "${COMPONENT_PATH}"
|
||||||
${{ matrix.command }}
|
eval "${COMMAND}"
|
||||||
env:
|
env:
|
||||||
|
COMMAND: ${{ matrix.command }}
|
||||||
|
COMPONENT_PATH: ${{ matrix.component.path }}
|
||||||
RUST_BACKTRACE: "1"
|
RUST_BACKTRACE: "1"
|
||||||
RUST_LIB_BACKTRACE: "0"
|
RUST_LIB_BACKTRACE: "0"
|
||||||
SKIP_GO_VERSION_CHECK: "1"
|
SKIP_GO_VERSION_CHECK: "1"
|
||||||
|
|||||||
@@ -23,12 +23,14 @@ on:
|
|||||||
secrets:
|
secrets:
|
||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: false
|
required: false
|
||||||
|
KBUILD_SIGN_PIN:
|
||||||
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-asset:
|
build-asset:
|
||||||
|
name: build-asset
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -108,12 +110,15 @@ jobs:
|
|||||||
ARTEFACT_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
ARTEFACT_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ contains(matrix.asset, 'nvidia') && secrets.KBUILD_SIGN_PIN || '' }}
|
||||||
|
|
||||||
- name: Parse OCI image name and digest
|
- name: Parse OCI image name and digest
|
||||||
id: parse-oci-segments
|
id: parse-oci-segments
|
||||||
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
||||||
|
env:
|
||||||
|
KATA_ASSET: ${{ matrix.asset }}
|
||||||
run: |
|
run: |
|
||||||
oci_image="$(<"build/${{ matrix.asset }}-oci-image")"
|
oci_image="$(<"build/${KATA_ASSET}-oci-image")"
|
||||||
echo "oci-name=${oci_image%@*}" >> "$GITHUB_OUTPUT"
|
echo "oci-name=${oci_image%@*}" >> "$GITHUB_OUTPUT"
|
||||||
echo "oci-digest=${oci_image#*@}" >> "$GITHUB_OUTPUT"
|
echo "oci-digest=${oci_image#*@}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
@@ -141,7 +146,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-amd64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-amd64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
@@ -150,11 +155,12 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-amd64-${{ matrix.asset }}-headers${{ inputs.tarball-suffix }}
|
name: kata-artifacts-amd64-${{ matrix.asset }}-headers${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}-headers.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}-headers.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-asset-rootfs:
|
build-asset-rootfs:
|
||||||
|
name: build-asset-rootfs
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-asset
|
needs: build-asset
|
||||||
permissions:
|
permissions:
|
||||||
@@ -215,17 +221,19 @@ jobs:
|
|||||||
ARTEFACT_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
ARTEFACT_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ contains(matrix.asset, 'nvidia') && secrets.KBUILD_SIGN_PIN || '' }}
|
||||||
|
|
||||||
- name: store-artifact ${{ matrix.asset }}
|
- name: store-artifact ${{ matrix.asset }}
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-amd64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-amd64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
||||||
remove-rootfs-binary-artifacts:
|
remove-rootfs-binary-artifacts:
|
||||||
|
name: remove-rootfs-binary-artifacts
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-asset-rootfs
|
needs: build-asset-rootfs
|
||||||
strategy:
|
strategy:
|
||||||
@@ -243,6 +251,7 @@ jobs:
|
|||||||
|
|
||||||
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
||||||
remove-rootfs-binary-artifacts-for-release:
|
remove-rootfs-binary-artifacts-for-release:
|
||||||
|
name: remove-rootfs-binary-artifacts-for-release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-asset-rootfs
|
needs: build-asset-rootfs
|
||||||
strategy:
|
strategy:
|
||||||
@@ -256,6 +265,7 @@ jobs:
|
|||||||
name: kata-artifacts-amd64-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-amd64-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
||||||
|
|
||||||
build-asset-shim-v2:
|
build-asset-shim-v2:
|
||||||
|
name: build-asset-shim-v2
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts, remove-rootfs-binary-artifacts-for-release]
|
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts, remove-rootfs-binary-artifacts-for-release]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -312,11 +322,12 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-amd64-shim-v2${{ inputs.tarball-suffix }}
|
name: kata-artifacts-amd64-shim-v2${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-shim-v2.tar.xz
|
path: kata-build/kata-static-shim-v2.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
create-kata-tarball:
|
create-kata-tarball:
|
||||||
|
name: create-kata-tarball
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [build-asset, build-asset-rootfs, build-asset-shim-v2]
|
needs: [build-asset, build-asset-rootfs, build-asset-shim-v2]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -349,6 +360,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||||
path: kata-static.tar.xz
|
path: kata-static.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-asset:
|
build-asset:
|
||||||
|
name: build-asset
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -45,6 +45,7 @@ jobs:
|
|||||||
- kernel
|
- kernel
|
||||||
- kernel-dragonball-experimental
|
- kernel-dragonball-experimental
|
||||||
- kernel-nvidia-gpu
|
- kernel-nvidia-gpu
|
||||||
|
- kernel-cca-confidential
|
||||||
- nydus
|
- nydus
|
||||||
- ovmf
|
- ovmf
|
||||||
- qemu
|
- qemu
|
||||||
@@ -92,8 +93,10 @@ jobs:
|
|||||||
- name: Parse OCI image name and digest
|
- name: Parse OCI image name and digest
|
||||||
id: parse-oci-segments
|
id: parse-oci-segments
|
||||||
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
||||||
|
env:
|
||||||
|
KATA_ASSET: ${{ matrix.asset }}
|
||||||
run: |
|
run: |
|
||||||
oci_image="$(<"build/${{ matrix.asset }}-oci-image")"
|
oci_image="$(<"build/${KATA_ASSET}-oci-image")"
|
||||||
echo "oci-name=${oci_image%@*}" >> "$GITHUB_OUTPUT"
|
echo "oci-name=${oci_image%@*}" >> "$GITHUB_OUTPUT"
|
||||||
echo "oci-digest=${oci_image#*@}" >> "$GITHUB_OUTPUT"
|
echo "oci-digest=${oci_image#*@}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
@@ -121,7 +124,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
@@ -130,11 +133,12 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-arm64-${{ matrix.asset }}-headers${{ inputs.tarball-suffix }}
|
name: kata-artifacts-arm64-${{ matrix.asset }}-headers${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}-headers.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}-headers.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-asset-rootfs:
|
build-asset-rootfs:
|
||||||
|
name: build-asset-rootfs
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
needs: build-asset
|
needs: build-asset
|
||||||
permissions:
|
permissions:
|
||||||
@@ -195,12 +199,13 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
||||||
remove-rootfs-binary-artifacts:
|
remove-rootfs-binary-artifacts:
|
||||||
|
name: remove-rootfs-binary-artifacts
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
needs: build-asset-rootfs
|
needs: build-asset-rootfs
|
||||||
strategy:
|
strategy:
|
||||||
@@ -215,6 +220,7 @@ jobs:
|
|||||||
|
|
||||||
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
||||||
remove-rootfs-binary-artifacts-for-release:
|
remove-rootfs-binary-artifacts-for-release:
|
||||||
|
name: remove-rootfs-binary-artifacts-for-release
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
needs: build-asset-rootfs
|
needs: build-asset-rootfs
|
||||||
strategy:
|
strategy:
|
||||||
@@ -228,6 +234,7 @@ jobs:
|
|||||||
name: kata-artifacts-arm64-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-arm64-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
||||||
|
|
||||||
build-asset-shim-v2:
|
build-asset-shim-v2:
|
||||||
|
name: build-asset-shim-v2
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts, remove-rootfs-binary-artifacts-for-release]
|
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts, remove-rootfs-binary-artifacts-for-release]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -282,11 +289,12 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-arm64-shim-v2${{ inputs.tarball-suffix }}
|
name: kata-artifacts-arm64-shim-v2${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-shim-v2.tar.xz
|
path: kata-build/kata-static-shim-v2.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
create-kata-tarball:
|
create-kata-tarball:
|
||||||
|
name: create-kata-tarball
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
needs: [build-asset, build-asset-rootfs, build-asset-shim-v2]
|
needs: [build-asset, build-asset-rootfs, build-asset-shim-v2]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -319,6 +327,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-static-tarball-arm64${{ inputs.tarball-suffix }}
|
name: kata-static-tarball-arm64${{ inputs.tarball-suffix }}
|
||||||
path: kata-static.tar.xz
|
path: kata-static.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -24,15 +24,15 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-asset:
|
build-asset:
|
||||||
|
name: build-asset
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
runs-on: ppc64le
|
runs-on: ubuntu-24.04-ppc64le
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
asset:
|
asset:
|
||||||
@@ -83,12 +83,13 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-ppc64le-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-ppc64le-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-asset-rootfs:
|
build-asset-rootfs:
|
||||||
runs-on: ppc64le
|
name: build-asset-rootfs
|
||||||
|
runs-on: ubuntu-24.04-ppc64le
|
||||||
needs: build-asset
|
needs: build-asset
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -148,12 +149,13 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-ppc64le-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-ppc64le-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
||||||
remove-rootfs-binary-artifacts:
|
remove-rootfs-binary-artifacts:
|
||||||
|
name: remove-rootfs-binary-artifacts
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-asset-rootfs
|
needs: build-asset-rootfs
|
||||||
strategy:
|
strategy:
|
||||||
@@ -167,7 +169,8 @@ jobs:
|
|||||||
name: kata-artifacts-ppc64le-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-ppc64le-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
||||||
|
|
||||||
build-asset-shim-v2:
|
build-asset-shim-v2:
|
||||||
runs-on: ppc64le
|
name: build-asset-shim-v2
|
||||||
|
runs-on: ubuntu-24.04-ppc64le
|
||||||
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts]
|
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -221,12 +224,13 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-ppc64le-shim-v2${{ inputs.tarball-suffix }}
|
name: kata-artifacts-ppc64le-shim-v2${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-shim-v2.tar.xz
|
path: kata-build/kata-static-shim-v2.tar.zst
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
create-kata-tarball:
|
create-kata-tarball:
|
||||||
runs-on: ppc64le
|
name: create-kata-tarball
|
||||||
|
runs-on: ubuntu-24.04-ppc64le
|
||||||
needs: [build-asset, build-asset-rootfs, build-asset-shim-v2]
|
needs: [build-asset, build-asset-rootfs, build-asset-shim-v2]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -262,6 +266,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-static-tarball-ppc64le${{ inputs.tarball-suffix }}
|
name: kata-static-tarball-ppc64le${{ inputs.tarball-suffix }}
|
||||||
path: kata-static.tar.xz
|
path: kata-static.tar.zst
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-asset:
|
build-asset:
|
||||||
|
name: build-asset
|
||||||
runs-on: riscv-builder
|
runs-on: riscv-builder
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -81,6 +81,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-riscv64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-riscv64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-asset:
|
build-asset:
|
||||||
runs-on: s390x
|
name: build-asset
|
||||||
|
runs-on: ubuntu-24.04-s390x
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@@ -91,8 +91,10 @@ jobs:
|
|||||||
- name: Parse OCI image name and digest
|
- name: Parse OCI image name and digest
|
||||||
id: parse-oci-segments
|
id: parse-oci-segments
|
||||||
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
||||||
|
env:
|
||||||
|
ASSET: ${{ matrix.asset }}
|
||||||
run: |
|
run: |
|
||||||
oci_image="$(<"build/${{ matrix.asset }}-oci-image")"
|
oci_image="$(<"build/${ASSET}-oci-image")"
|
||||||
echo "oci-name=${oci_image%@*}" >> "$GITHUB_OUTPUT"
|
echo "oci-name=${oci_image%@*}" >> "$GITHUB_OUTPUT"
|
||||||
echo "oci-digest=${oci_image#*@}" >> "$GITHUB_OUTPUT"
|
echo "oci-digest=${oci_image#*@}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
@@ -115,11 +117,12 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-s390x-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-s390x-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-asset-rootfs:
|
build-asset-rootfs:
|
||||||
|
name: build-asset-rootfs
|
||||||
runs-on: s390x
|
runs-on: s390x
|
||||||
needs: build-asset
|
needs: build-asset
|
||||||
permissions:
|
permissions:
|
||||||
@@ -182,11 +185,12 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-s390x-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-s390x-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-asset-boot-image-se:
|
build-asset-boot-image-se:
|
||||||
|
name: build-asset-boot-image-se
|
||||||
runs-on: s390x
|
runs-on: s390x
|
||||||
needs: [build-asset, build-asset-rootfs]
|
needs: [build-asset, build-asset-rootfs]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -230,12 +234,13 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-s390x${{ inputs.tarball-suffix }}
|
name: kata-artifacts-s390x${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-boot-image-se.tar.xz
|
path: kata-build/kata-static-boot-image-se.tar.zst
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
# We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs
|
||||||
remove-rootfs-binary-artifacts:
|
remove-rootfs-binary-artifacts:
|
||||||
|
name: remove-rootfs-binary-artifacts
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [build-asset-rootfs, build-asset-boot-image-se]
|
needs: [build-asset-rootfs, build-asset-boot-image-se]
|
||||||
strategy:
|
strategy:
|
||||||
@@ -251,7 +256,8 @@ jobs:
|
|||||||
name: kata-artifacts-s390x-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
name: kata-artifacts-s390x-${{ matrix.asset}}${{ inputs.tarball-suffix }}
|
||||||
|
|
||||||
build-asset-shim-v2:
|
build-asset-shim-v2:
|
||||||
runs-on: s390x
|
name: build-asset-shim-v2
|
||||||
|
runs-on: ubuntu-24.04-s390x
|
||||||
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts]
|
needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -307,12 +313,13 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-artifacts-s390x-shim-v2${{ inputs.tarball-suffix }}
|
name: kata-artifacts-s390x-shim-v2${{ inputs.tarball-suffix }}
|
||||||
path: kata-build/kata-static-shim-v2.tar.xz
|
path: kata-build/kata-static-shim-v2.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
create-kata-tarball:
|
create-kata-tarball:
|
||||||
runs-on: s390x
|
name: create-kata-tarball
|
||||||
|
runs-on: ubuntu-24.04-s390x
|
||||||
needs:
|
needs:
|
||||||
- build-asset
|
- build-asset
|
||||||
- build-asset-rootfs
|
- build-asset-rootfs
|
||||||
@@ -348,6 +355,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: kata-static-tarball-s390x${{ inputs.tarball-suffix }}
|
name: kata-static-tarball-s390x${{ inputs.tarball-suffix }}
|
||||||
path: kata-static.tar.xz
|
path: kata-static.tar.zst
|
||||||
retention-days: 15
|
retention-days: 15
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
4
.github/workflows/cargo-deny-runner.yaml
vendored
4
.github/workflows/cargo-deny-runner.yaml
vendored
@@ -11,11 +11,11 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cargo-deny-runner:
|
cargo-deny-runner:
|
||||||
|
name: cargo-deny-runner
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
4
.github/workflows/ci-coco-stability.yaml
vendored
4
.github/workflows/ci-coco-stability.yaml
vendored
@@ -9,8 +9,7 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
kata-containers-ci-on-push:
|
kata-containers-ci-on-push:
|
||||||
@@ -31,3 +30,4 @@ jobs:
|
|||||||
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
|
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
|
||||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|||||||
5
.github/workflows/ci-devel.yaml
vendored
5
.github/workflows/ci-devel.yaml
vendored
@@ -2,8 +2,7 @@ name: Kata Containers CI (manually triggered)
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
kata-containers-ci-on-push:
|
kata-containers-ci-on-push:
|
||||||
@@ -27,6 +26,8 @@ jobs:
|
|||||||
CI_HKD_PATH: ${{ secrets.CI_HKD_PATH }}
|
CI_HKD_PATH: ${{ secrets.CI_HKD_PATH }}
|
||||||
ITA_KEY: ${{ secrets.ITA_KEY }}
|
ITA_KEY: ${{ secrets.ITA_KEY }}
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|
||||||
build-checks:
|
build-checks:
|
||||||
uses: ./.github/workflows/build-checks.yaml
|
uses: ./.github/workflows/build-checks.yaml
|
||||||
|
|||||||
7
.github/workflows/ci-nightly-s390x.yaml
vendored
7
.github/workflows/ci-nightly-s390x.yaml
vendored
@@ -4,11 +4,11 @@ on:
|
|||||||
|
|
||||||
name: Nightly CI for s390x
|
name: Nightly CI for s390x
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-internal-test-result:
|
check-internal-test-result:
|
||||||
|
name: check-internal-test-result
|
||||||
runs-on: s390x
|
runs-on: s390x
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -16,7 +16,8 @@ jobs:
|
|||||||
test_title:
|
test_title:
|
||||||
- kata-vfio-ap-e2e-tests
|
- kata-vfio-ap-e2e-tests
|
||||||
- cc-vfio-ap-e2e-tests
|
- cc-vfio-ap-e2e-tests
|
||||||
- cc-se-e2e-tests
|
- cc-se-e2e-tests-go
|
||||||
|
- cc-se-e2e-tests-rs
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch a test result for {{ matrix.test_title }}
|
- name: Fetch a test result for {{ matrix.test_title }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
5
.github/workflows/ci-nightly.yaml
vendored
5
.github/workflows/ci-nightly.yaml
vendored
@@ -7,8 +7,7 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
kata-containers-ci-on-push:
|
kata-containers-ci-on-push:
|
||||||
@@ -31,3 +30,5 @@ jobs:
|
|||||||
CI_HKD_PATH: ${{ secrets.CI_HKD_PATH }}
|
CI_HKD_PATH: ${{ secrets.CI_HKD_PATH }}
|
||||||
ITA_KEY: ${{ secrets.ITA_KEY }}
|
ITA_KEY: ${{ secrets.ITA_KEY }}
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|||||||
8
.github/workflows/ci-on-push.yaml
vendored
8
.github/workflows/ci-on-push.yaml
vendored
@@ -1,9 +1,8 @@
|
|||||||
name: Kata Containers CI
|
name: Kata Containers CI
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target: # zizmor: ignore[dangerous-triggers] See #11332.
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
- 'stable-*'
|
|
||||||
types:
|
types:
|
||||||
# Adding 'labeled' to the list of activity types that trigger this event
|
# Adding 'labeled' to the list of activity types that trigger this event
|
||||||
# (default: opened, synchronize, reopened) so that we can run this
|
# (default: opened, synchronize, reopened) so that we can run this
|
||||||
@@ -14,8 +13,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- labeled
|
- labeled
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -52,3 +50,5 @@ jobs:
|
|||||||
CI_HKD_PATH: ${{ secrets.CI_HKD_PATH }}
|
CI_HKD_PATH: ${{ secrets.CI_HKD_PATH }}
|
||||||
ITA_KEY: ${{ secrets.ITA_KEY }}
|
ITA_KEY: ${{ secrets.ITA_KEY }}
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|||||||
8
.github/workflows/ci-weekly.yaml
vendored
8
.github/workflows/ci-weekly.yaml
vendored
@@ -27,9 +27,10 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
KBUILD_SIGN_PIN:
|
||||||
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-amd64:
|
build-kata-static-tarball-amd64:
|
||||||
@@ -43,6 +44,8 @@ jobs:
|
|||||||
tarball-suffix: -${{ inputs.tag }}
|
tarball-suffix: -${{ inputs.tag }}
|
||||||
commit-hash: ${{ inputs.commit-hash }}
|
commit-hash: ${{ inputs.commit-hash }}
|
||||||
target-branch: ${{ inputs.target-branch }}
|
target-branch: ${{ inputs.target-branch }}
|
||||||
|
secrets:
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|
||||||
publish-kata-deploy-payload-amd64:
|
publish-kata-deploy-payload-amd64:
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
@@ -63,6 +66,7 @@ jobs:
|
|||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
|
||||||
build-and-publish-tee-confidential-unencrypted-image:
|
build-and-publish-tee-confidential-unencrypted-image:
|
||||||
|
name: build-and-publish-tee-confidential-unencrypted-image
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|||||||
50
.github/workflows/ci.yaml
vendored
50
.github/workflows/ci.yaml
vendored
@@ -35,10 +35,12 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
NGC_API_KEY:
|
||||||
|
required: true
|
||||||
|
KBUILD_SIGN_PIN:
|
||||||
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-amd64:
|
build-kata-static-tarball-amd64:
|
||||||
@@ -52,6 +54,8 @@ jobs:
|
|||||||
tarball-suffix: -${{ inputs.tag }}
|
tarball-suffix: -${{ inputs.tag }}
|
||||||
commit-hash: ${{ inputs.commit-hash }}
|
commit-hash: ${{ inputs.commit-hash }}
|
||||||
target-branch: ${{ inputs.target-branch }}
|
target-branch: ${{ inputs.target-branch }}
|
||||||
|
secrets:
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|
||||||
publish-kata-deploy-payload-amd64:
|
publish-kata-deploy-payload-amd64:
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
@@ -155,7 +159,7 @@ jobs:
|
|||||||
tag: ${{ inputs.tag }}-s390x
|
tag: ${{ inputs.tag }}-s390x
|
||||||
commit-hash: ${{ inputs.commit-hash }}
|
commit-hash: ${{ inputs.commit-hash }}
|
||||||
target-branch: ${{ inputs.target-branch }}
|
target-branch: ${{ inputs.target-branch }}
|
||||||
runner: s390x
|
runner: ubuntu-24.04-s390x
|
||||||
arch: s390x
|
arch: s390x
|
||||||
secrets:
|
secrets:
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
@@ -179,6 +183,7 @@ jobs:
|
|||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
|
||||||
build-and-publish-tee-confidential-unencrypted-image:
|
build-and-publish-tee-confidential-unencrypted-image:
|
||||||
|
name: build-and-publish-tee-confidential-unencrypted-image
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@@ -220,6 +225,7 @@ jobs:
|
|||||||
file: tests/integration/kubernetes/runtimeclass_workloads/confidential/unencrypted/Dockerfile
|
file: tests/integration/kubernetes/runtimeclass_workloads/confidential/unencrypted/Dockerfile
|
||||||
|
|
||||||
publish-csi-driver-amd64:
|
publish-csi-driver-amd64:
|
||||||
|
name: publish-csi-driver-amd64
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -286,6 +292,10 @@ jobs:
|
|||||||
if: ${{ inputs.skip-test != 'yes' }}
|
if: ${{ inputs.skip-test != 'yes' }}
|
||||||
needs: publish-kata-deploy-payload-amd64
|
needs: publish-kata-deploy-payload-amd64
|
||||||
uses: ./.github/workflows/run-k8s-tests-on-aks.yaml
|
uses: ./.github/workflows/run-k8s-tests-on-aks.yaml
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
with:
|
with:
|
||||||
tarball-suffix: -${{ inputs.tag }}
|
tarball-suffix: -${{ inputs.tag }}
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -323,6 +333,21 @@ jobs:
|
|||||||
pr-number: ${{ inputs.pr-number }}
|
pr-number: ${{ inputs.pr-number }}
|
||||||
target-branch: ${{ inputs.target-branch }}
|
target-branch: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
|
run-k8s-tests-on-nvidia-gpu:
|
||||||
|
if: ${{ inputs.skip-test != 'yes' }}
|
||||||
|
needs: publish-kata-deploy-payload-amd64
|
||||||
|
uses: ./.github/workflows/run-k8s-tests-on-nvidia-gpu.yaml
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
||||||
|
tag: ${{ inputs.tag }}-amd64
|
||||||
|
commit-hash: ${{ inputs.commit-hash }}
|
||||||
|
pr-number: ${{ inputs.pr-number }}
|
||||||
|
target-branch: ${{ inputs.target-branch }}
|
||||||
|
secrets:
|
||||||
|
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
|
||||||
|
|
||||||
|
|
||||||
run-kata-coco-tests:
|
run-kata-coco-tests:
|
||||||
if: ${{ inputs.skip-test != 'yes' }}
|
if: ${{ inputs.skip-test != 'yes' }}
|
||||||
needs:
|
needs:
|
||||||
@@ -330,6 +355,9 @@ jobs:
|
|||||||
- build-and-publish-tee-confidential-unencrypted-image
|
- build-and-publish-tee-confidential-unencrypted-image
|
||||||
- publish-csi-driver-amd64
|
- publish-csi-driver-amd64
|
||||||
uses: ./.github/workflows/run-kata-coco-tests.yaml
|
uses: ./.github/workflows/run-kata-coco-tests.yaml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
with:
|
with:
|
||||||
tarball-suffix: -${{ inputs.tag }}
|
tarball-suffix: -${{ inputs.tag }}
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -383,20 +411,6 @@ jobs:
|
|||||||
pr-number: ${{ inputs.pr-number }}
|
pr-number: ${{ inputs.pr-number }}
|
||||||
target-branch: ${{ inputs.target-branch }}
|
target-branch: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
run-metrics-tests:
|
|
||||||
# Skip metrics tests whilst runner is broken
|
|
||||||
if: false
|
|
||||||
# if: ${{ inputs.skip-test != 'yes' }}
|
|
||||||
needs: build-kata-static-tarball-amd64
|
|
||||||
uses: ./.github/workflows/run-metrics.yaml
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
|
||||||
tag: ${{ inputs.tag }}-amd64
|
|
||||||
commit-hash: ${{ inputs.commit-hash }}
|
|
||||||
pr-number: ${{ inputs.pr-number }}
|
|
||||||
target-branch: ${{ inputs.target-branch }}
|
|
||||||
|
|
||||||
run-basic-amd64-tests:
|
run-basic-amd64-tests:
|
||||||
if: ${{ inputs.skip-test != 'yes' }}
|
if: ${{ inputs.skip-test != 'yes' }}
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
|
|||||||
7
.github/workflows/cleanup-resources.yaml
vendored
7
.github/workflows/cleanup-resources.yaml
vendored
@@ -4,13 +4,14 @@ on:
|
|||||||
- cron: "0 0 * * *"
|
- cron: "0 0 * * *"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cleanup-resources:
|
cleanup-resources:
|
||||||
|
name: cleanup-resources
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
environment: ci
|
environment: ci
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
|||||||
4
.github/workflows/codeql.yml
vendored
4
.github/workflows/codeql.yml
vendored
@@ -19,8 +19,8 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '45 0 * * 1'
|
- cron: '45 0 * * 1'
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
|
|||||||
5
.github/workflows/commit-message-check.yaml
vendored
5
.github/workflows/commit-message-check.yaml
vendored
@@ -6,8 +6,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -42,7 +41,7 @@ jobs:
|
|||||||
filter_out_pattern: '^Revert "|^Reapply "'
|
filter_out_pattern: '^Revert "|^Reapply "'
|
||||||
|
|
||||||
- name: DCO Check
|
- name: DCO Check
|
||||||
uses: tim-actions/dco@2fd0504dc0d27b33f542867c300c60840c6dcb20 # master (2020-04-28)
|
uses: tim-actions/dco@f2279e6e62d5a7d9115b0cb8e837b777b1b02e21 # v1.1.0
|
||||||
with:
|
with:
|
||||||
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
||||||
|
|
||||||
|
|||||||
25
.github/workflows/darwin-tests.yaml
vendored
25
.github/workflows/darwin-tests.yaml
vendored
@@ -6,8 +6,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -16,15 +15,29 @@ concurrency:
|
|||||||
name: Darwin tests
|
name: Darwin tests
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: test
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Protoc
|
||||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
run: |
|
||||||
with:
|
f=$(mktemp)
|
||||||
go-version: 1.23.10
|
curl -sSLo "$f" https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protoc-28.2-osx-aarch_64.zip
|
||||||
|
mkdir -p "$HOME/.local"
|
||||||
|
unzip -d "$HOME/.local" "$f"
|
||||||
|
echo "$HOME/.local/bin" >> "${GITHUB_PATH}"
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install golang
|
||||||
|
run: |
|
||||||
|
./tests/install_go.sh -f -p
|
||||||
|
echo "/usr/local/go/bin" >> "${GITHUB_PATH}"
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
run: ./tests/install_rust.sh
|
||||||
|
|
||||||
- name: Build utils
|
- name: Build utils
|
||||||
run: ./ci/darwin-test.sh
|
run: ./ci/darwin-test.sh
|
||||||
|
|||||||
24
.github/workflows/docs-url-alive-check.yaml
vendored
24
.github/workflows/docs-url-alive-check.yaml
vendored
@@ -1,36 +1,34 @@
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 23 * * 0'
|
- cron: '0 23 * * 0'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
name: Docs URL Alive Check
|
name: Docs URL Alive Check
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
name: test
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
# don't run this action on forks
|
# don't run this action on forks
|
||||||
if: github.repository_owner == 'kata-containers'
|
if: github.repository_owner == 'kata-containers'
|
||||||
env:
|
env:
|
||||||
target_branch: ${{ github.base_ref }}
|
target_branch: ${{ github.base_ref }}
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
||||||
with:
|
|
||||||
go-version: 1.23.10
|
|
||||||
env:
|
|
||||||
GOPATH: ${{ github.workspace }}/kata-containers
|
|
||||||
- name: Set env
|
- name: Set env
|
||||||
run: |
|
run: |
|
||||||
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
|
echo "GOPATH=${GITHUB_WORKSPACE}" >> "$GITHUB_ENV"
|
||||||
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
path: ./src/github.com/${{ github.repository }}
|
|
||||||
# docs url alive check
|
- name: Install golang
|
||||||
|
run: |
|
||||||
|
./tests/install_go.sh -f -p
|
||||||
|
echo "/usr/local/go/bin" >> "${GITHUB_PATH}"
|
||||||
|
|
||||||
- name: Docs URL Alive Check
|
- name: Docs URL Alive Check
|
||||||
run: |
|
run: |
|
||||||
cd "${GOPATH}/src/github.com/${{ github.repository }}" && make docs-url-alive-check
|
make docs-url-alive-check
|
||||||
|
|||||||
4
.github/workflows/gatekeeper-skipper.yaml
vendored
4
.github/workflows/gatekeeper-skipper.yaml
vendored
@@ -31,11 +31,11 @@ on:
|
|||||||
skip_static:
|
skip_static:
|
||||||
value: ${{ jobs.skipper.outputs.skip_static }}
|
value: ${{ jobs.skipper.outputs.skip_static }}
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
skipper:
|
skipper:
|
||||||
|
name: skipper
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
outputs:
|
outputs:
|
||||||
skip_build: ${{ steps.skipper.outputs.skip_build }}
|
skip_build: ${{ steps.skipper.outputs.skip_build }}
|
||||||
|
|||||||
6
.github/workflows/gatekeeper.yaml
vendored
6
.github/workflows/gatekeeper.yaml
vendored
@@ -5,15 +5,14 @@ name: Gatekeeper
|
|||||||
# reporting the status.
|
# reporting the status.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target: # zizmor: ignore[dangerous-triggers] See #11332.
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
- reopened
|
- reopened
|
||||||
- labeled
|
- labeled
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -21,6 +20,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
gatekeeper:
|
gatekeeper:
|
||||||
|
name: gatekeeper
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
|
|||||||
15
.github/workflows/govulncheck.yaml
vendored
15
.github/workflows/govulncheck.yaml
vendored
@@ -3,23 +3,23 @@ on:
|
|||||||
|
|
||||||
name: Govulncheck
|
name: Govulncheck
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
govulncheck:
|
govulncheck:
|
||||||
|
name: govulncheck
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- binary: "kata-runtime"
|
- binary: "kata-runtime"
|
||||||
make_target: "runtime"
|
make_target: "runtime"
|
||||||
- binary: "containerd-shim-kata-v2"
|
- binary: "containerd-shim-kata-v2"
|
||||||
make_target: "containerd-shim-v2"
|
make_target: "containerd-shim-v2"
|
||||||
- binary: "kata-monitor"
|
- binary: "kata-monitor"
|
||||||
make_target: "monitor"
|
make_target: "monitor"
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
@@ -40,11 +40,14 @@ jobs:
|
|||||||
- name: Build runtime binaries
|
- name: Build runtime binaries
|
||||||
run: |
|
run: |
|
||||||
cd src/runtime
|
cd src/runtime
|
||||||
make ${{ matrix.make_target }}
|
make "${MAKE_TARGET}"
|
||||||
env:
|
env:
|
||||||
|
MAKE_TARGET: ${{ matrix.make_target }}
|
||||||
SKIP_GO_VERSION_CHECK: "1"
|
SKIP_GO_VERSION_CHECK: "1"
|
||||||
|
|
||||||
- name: Run govulncheck on ${{ matrix.binary }}
|
- name: Run govulncheck on ${{ matrix.binary }}
|
||||||
|
env:
|
||||||
|
BINARY: ${{ matrix.binary }}
|
||||||
run: |
|
run: |
|
||||||
cd src/runtime
|
cd src/runtime
|
||||||
bash ../../tests/govulncheck-runner.sh "./${{ matrix.binary }}"
|
bash ../../tests/govulncheck-runner.sh "./${BINARY}"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
name: kata-runtime-classes-sync
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
@@ -6,8 +8,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -15,6 +16,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
kata-deploy-runtime-classes-check:
|
kata-deploy-runtime-classes-check:
|
||||||
|
name: kata-deploy-runtime-classes-check
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|||||||
35
.github/workflows/nydus-snapshotter-version-in-sync.yaml
vendored
Normal file
35
.github/workflows/nydus-snapshotter-version-in-sync.yaml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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
|
||||||
2
.github/workflows/osv-scanner.yaml
vendored
2
.github/workflows/osv-scanner.yaml
vendored
@@ -15,6 +15,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
scan-scheduled:
|
scan-scheduled:
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
5
.github/workflows/payload-after-push.yaml
vendored
5
.github/workflows/payload-after-push.yaml
vendored
@@ -5,8 +5,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -25,6 +24,7 @@ jobs:
|
|||||||
target-branch: ${{ github.ref_name }}
|
target-branch: ${{ github.ref_name }}
|
||||||
secrets:
|
secrets:
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|
||||||
build-assets-arm64:
|
build-assets-arm64:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -136,6 +136,7 @@ jobs:
|
|||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
|
||||||
publish-manifest:
|
publish-manifest:
|
||||||
|
name: publish-manifest
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
kata-payload:
|
kata-payload:
|
||||||
|
name: kata-payload
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@@ -85,6 +85,6 @@ jobs:
|
|||||||
TAG: ${{ inputs.tag }}
|
TAG: ${{ inputs.tag }}
|
||||||
run: |
|
run: |
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)/kata-static.tar.xz" \
|
"$(pwd)/kata-static.tar.zst" \
|
||||||
"${REGISTRY}/${REPO}" \
|
"${REGISTRY}/${REPO}" \
|
||||||
"${TAG}"
|
"${TAG}"
|
||||||
|
|||||||
11
.github/workflows/release-amd64.yaml
vendored
11
.github/workflows/release-amd64.yaml
vendored
@@ -8,9 +8,10 @@ on:
|
|||||||
secrets:
|
secrets:
|
||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
KBUILD_SIGN_PIN:
|
||||||
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-amd64:
|
build-kata-static-tarball-amd64:
|
||||||
@@ -20,6 +21,7 @@ jobs:
|
|||||||
stage: release
|
stage: release
|
||||||
secrets:
|
secrets:
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@@ -27,6 +29,7 @@ jobs:
|
|||||||
attestations: write
|
attestations: write
|
||||||
|
|
||||||
kata-deploy:
|
kata-deploy:
|
||||||
|
name: kata-deploy
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -71,9 +74,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
for tag in "${tags[@]}"; do
|
for tag in "${tags[@]}"; do
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "ghcr.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "quay.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
done
|
done
|
||||||
|
|||||||
8
.github/workflows/release-arm64.yaml
vendored
8
.github/workflows/release-arm64.yaml
vendored
@@ -9,8 +9,7 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-arm64:
|
build-kata-static-tarball-arm64:
|
||||||
@@ -27,6 +26,7 @@ jobs:
|
|||||||
attestations: write
|
attestations: write
|
||||||
|
|
||||||
kata-deploy:
|
kata-deploy:
|
||||||
|
name: kata-deploy
|
||||||
needs: build-kata-static-tarball-arm64
|
needs: build-kata-static-tarball-arm64
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -71,9 +71,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
for tag in "${tags[@]}"; do
|
for tag in "${tags[@]}"; do
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "ghcr.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "quay.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
done
|
done
|
||||||
|
|||||||
8
.github/workflows/release-ppc64le.yaml
vendored
8
.github/workflows/release-ppc64le.yaml
vendored
@@ -9,8 +9,7 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-ppc64le:
|
build-kata-static-tarball-ppc64le:
|
||||||
@@ -27,6 +26,7 @@ jobs:
|
|||||||
attestations: write
|
attestations: write
|
||||||
|
|
||||||
kata-deploy:
|
kata-deploy:
|
||||||
|
name: kata-deploy
|
||||||
needs: build-kata-static-tarball-ppc64le
|
needs: build-kata-static-tarball-ppc64le
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -71,9 +71,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
for tag in "${tags[@]}"; do
|
for tag in "${tags[@]}"; do
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "ghcr.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "quay.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
done
|
done
|
||||||
|
|||||||
8
.github/workflows/release-s390x.yaml
vendored
8
.github/workflows/release-s390x.yaml
vendored
@@ -11,8 +11,7 @@ on:
|
|||||||
QUAY_DEPLOYER_PASSWORD:
|
QUAY_DEPLOYER_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-s390x:
|
build-kata-static-tarball-s390x:
|
||||||
@@ -31,6 +30,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
kata-deploy:
|
kata-deploy:
|
||||||
|
name: kata-deploy
|
||||||
needs: build-kata-static-tarball-s390x
|
needs: build-kata-static-tarball-s390x
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -75,9 +75,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
for tag in "${tags[@]}"; do
|
for tag in "${tags[@]}"; do
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "ghcr.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
"$(pwd)"/kata-static.tar.zst "quay.io/kata-containers/kata-deploy" \
|
||||||
"${tag}-${TARGET_ARCH}"
|
"${tag}-${TARGET_ARCH}"
|
||||||
done
|
done
|
||||||
|
|||||||
21
.github/workflows/release.yaml
vendored
21
.github/workflows/release.yaml
vendored
@@ -2,11 +2,11 @@ name: Release Kata Containers
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch
|
workflow_dispatch
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
name: release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # needed for the `gh release create` command
|
contents: write # needed for the `gh release create` command
|
||||||
@@ -35,6 +35,7 @@ jobs:
|
|||||||
target-arch: amd64
|
target-arch: amd64
|
||||||
secrets:
|
secrets:
|
||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
KBUILD_SIGN_PIN: ${{ secrets.KBUILD_SIGN_PIN }}
|
||||||
|
|
||||||
build-and-push-assets-arm64:
|
build-and-push-assets-arm64:
|
||||||
needs: release
|
needs: release
|
||||||
@@ -77,6 +78,7 @@ jobs:
|
|||||||
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
|
||||||
publish-multi-arch-images:
|
publish-multi-arch-images:
|
||||||
|
name: publish-multi-arch-images
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [build-and-push-assets-amd64, build-and-push-assets-arm64, build-and-push-assets-s390x, build-and-push-assets-ppc64le]
|
needs: [build-and-push-assets-amd64, build-and-push-assets-arm64, build-and-push-assets-s390x, build-and-push-assets-ppc64le]
|
||||||
permissions:
|
permissions:
|
||||||
@@ -114,6 +116,7 @@ jobs:
|
|||||||
KATA_DEPLOY_REGISTRIES: "quay.io/kata-containers/kata-deploy ghcr.io/kata-containers/kata-deploy"
|
KATA_DEPLOY_REGISTRIES: "quay.io/kata-containers/kata-deploy ghcr.io/kata-containers/kata-deploy"
|
||||||
|
|
||||||
upload-multi-arch-static-tarball:
|
upload-multi-arch-static-tarball:
|
||||||
|
name: upload-multi-arch-static-tarball
|
||||||
needs: [build-and-push-assets-amd64, build-and-push-assets-arm64, build-and-push-assets-s390x, build-and-push-assets-ppc64le]
|
needs: [build-and-push-assets-amd64, build-and-push-assets-arm64, build-and-push-assets-s390x, build-and-push-assets-ppc64le]
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # needed for the `gh release` commands
|
contents: write # needed for the `gh release` commands
|
||||||
@@ -126,7 +129,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Set KATA_STATIC_TARBALL env var
|
- name: Set KATA_STATIC_TARBALL env var
|
||||||
run: |
|
run: |
|
||||||
tarball=$(pwd)/kata-static.tar.xz
|
tarball=$(pwd)/kata-static.tar.zst
|
||||||
echo "KATA_STATIC_TARBALL=${tarball}" >> "$GITHUB_ENV"
|
echo "KATA_STATIC_TARBALL=${tarball}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Download amd64 artifacts
|
- name: Download amd64 artifacts
|
||||||
@@ -178,6 +181,7 @@ jobs:
|
|||||||
ARCHITECTURE: ppc64le
|
ARCHITECTURE: ppc64le
|
||||||
|
|
||||||
upload-versions-yaml:
|
upload-versions-yaml:
|
||||||
|
name: upload-versions-yaml
|
||||||
needs: release
|
needs: release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
@@ -195,6 +199,7 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
upload-cargo-vendored-tarball:
|
upload-cargo-vendored-tarball:
|
||||||
|
name: upload-cargo-vendored-tarball
|
||||||
needs: release
|
needs: release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
@@ -212,6 +217,7 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
upload-libseccomp-tarball:
|
upload-libseccomp-tarball:
|
||||||
|
name: upload-libseccomp-tarball
|
||||||
needs: release
|
needs: release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
@@ -229,6 +235,7 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
upload-helm-chart-tarball:
|
upload-helm-chart-tarball:
|
||||||
|
name: upload-helm-chart-tarball
|
||||||
needs: release
|
needs: release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
@@ -253,10 +260,11 @@ jobs:
|
|||||||
- name: Login to the OCI registries
|
- name: Login to the OCI registries
|
||||||
env:
|
env:
|
||||||
QUAY_DEPLOYER_USERNAME: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
QUAY_DEPLOYER_USERNAME: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||||
GITHUB_ACTOR: ${{ github.actor }}
|
QUAY_DEPLOYER_PASSWORD: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.QUAY_DEPLOYER_PASSWORD }}" | helm registry login quay.io --username "${QUAY_DEPLOYER_USERNAME}" --password-stdin
|
echo "${QUAY_DEPLOYER_PASSWORD}" | helm registry login quay.io --username "${QUAY_DEPLOYER_USERNAME}" --password-stdin
|
||||||
echo "${{ github.token }}" | helm registry login ghcr.io --username "${GITHUB_ACTOR}" --password-stdin
|
echo "${GITHUB_TOKEN}" | helm registry login ghcr.io --username "${GITHUB_ACTOR}" --password-stdin
|
||||||
|
|
||||||
- name: Push helm chart to the OCI registries
|
- name: Push helm chart to the OCI registries
|
||||||
run: |
|
run: |
|
||||||
@@ -265,6 +273,7 @@ jobs:
|
|||||||
helm push "kata-deploy-${release_version}.tgz" oci://ghcr.io/kata-containers/kata-deploy-charts
|
helm push "kata-deploy-${release_version}.tgz" oci://ghcr.io/kata-containers/kata-deploy-charts
|
||||||
|
|
||||||
publish-release:
|
publish-release:
|
||||||
|
name: publish-release
|
||||||
needs: [ build-and-push-assets-amd64, build-and-push-assets-arm64, build-and-push-assets-s390x, build-and-push-assets-ppc64le, publish-multi-arch-images, upload-multi-arch-static-tarball, upload-versions-yaml, upload-cargo-vendored-tarball, upload-libseccomp-tarball ]
|
needs: [ build-and-push-assets-amd64, build-and-push-assets-arm64, build-and-push-assets-s390x, build-and-push-assets-ppc64le, publish-multi-arch-images, upload-multi-arch-static-tarball, upload-versions-yaml, upload-cargo-vendored-tarball, upload-libseccomp-tarball ]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
164
.github/workflows/run-containerd-multi-snapshotter-stability-test.yaml
vendored
Normal file
164
.github/workflows/run-containerd-multi-snapshotter-stability-test.yaml
vendored
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
name: CI | Run containerd multi-snapshotter stability test
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 */1 * * *" #run every hour
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
# This job relies on k8s pre-installed using kubeadm
|
||||||
|
jobs:
|
||||||
|
run-containerd-multi-snapshotter-stability-tests:
|
||||||
|
name: run-containerd-multi-snapshotter-stability-tests
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
containerd:
|
||||||
|
- v1.7
|
||||||
|
- v2.0
|
||||||
|
- v2.1
|
||||||
|
- v2.2
|
||||||
|
env:
|
||||||
|
# I don't want those to be inside double quotes, so I'm deliberately ignoring the double quotes here.
|
||||||
|
IMAGES_LIST: quay.io/mongodb/mongodb-community-server@sha256:8b73733842da21b6bbb6df4d7b2449229bb3135d2ec8c6880314d88205772a11 ghcr.io/edgelesssys/redis@sha256:ecb0a964c259a166a1eb62f0eb19621d42bd1cce0bc9bb0c71c828911d4ba93d
|
||||||
|
runs-on: containerd-${{ matrix.containerd }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Rotate the journal
|
||||||
|
run: sudo journalctl --rotate --vacuum-time 1s
|
||||||
|
|
||||||
|
- name: Pull the kata-deploy image to be used
|
||||||
|
run: sudo ctr -n k8s.io image pull quay.io/kata-containers/kata-deploy-ci:kata-containers-latest
|
||||||
|
|
||||||
|
- name: Deploy Kata Containers
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata
|
||||||
|
env:
|
||||||
|
KATA_HYPERVISOR: qemu-coco-dev
|
||||||
|
KUBERNETES: vanilla
|
||||||
|
SNAPSHOTTER: nydus
|
||||||
|
USE_EXPERIMENTAL_SETUP_SNAPSHOTTER: true
|
||||||
|
|
||||||
|
# This is needed as we may hit the createContainerTimeout
|
||||||
|
- name: Adjust Kata Containers' create_container_timeout
|
||||||
|
run: |
|
||||||
|
sudo sed -i -e 's/^\(create_container_timeout\).*=.*$/\1 = 600/g' /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
grep "create_container_timeout.*=" /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
|
||||||
|
# This is needed in order to have enough tmpfs space inside the guest to pull the image
|
||||||
|
- name: Adjust Kata Containers' default_memory
|
||||||
|
run: |
|
||||||
|
sudo sed -i -e 's/^\(default_memory\).*=.*$/\1 = 4096/g' /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
grep "default_memory.*=" /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
|
||||||
|
- name: Run a few containers using overlayfs
|
||||||
|
run: |
|
||||||
|
# I don't want those to be inside double quotes, so I'm deliberately ignoring the double quotes here
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
for img in ${IMAGES_LIST}; do
|
||||||
|
echo "overlayfs | Using on image: ${img}"
|
||||||
|
pod="$(echo ${img} | tr ':.@/' '-' | awk '{print substr($0,1,56)}')"
|
||||||
|
kubectl run "${pod}" \
|
||||||
|
-it --rm \
|
||||||
|
--restart=Never \
|
||||||
|
--image="${img}" \
|
||||||
|
--image-pull-policy=Always \
|
||||||
|
--pod-running-timeout=10m \
|
||||||
|
-- uname -r
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Run a the same few containers using a different snapshotter
|
||||||
|
run: |
|
||||||
|
# I don't want those to be inside double quotes, so I'm deliberately ignoring the double quotes here
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
for img in ${IMAGES_LIST}; do
|
||||||
|
echo "nydus | Using on image: ${img}"
|
||||||
|
pod="kata-$(echo ${img} | tr ':.@/' '-' | awk '{print substr($0,1,56)}')"
|
||||||
|
kubectl run "${pod}" \
|
||||||
|
-it --rm \
|
||||||
|
--restart=Never \
|
||||||
|
--image="${img}" \
|
||||||
|
--image-pull-policy=Always \
|
||||||
|
--pod-running-timeout=10m \
|
||||||
|
--overrides='{
|
||||||
|
"spec": {
|
||||||
|
"runtimeClassName": "kata-qemu-coco-dev"
|
||||||
|
}
|
||||||
|
}' \
|
||||||
|
-- uname -r
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Uninstall Kata Containers
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh cleanup
|
||||||
|
env:
|
||||||
|
KATA_HYPERVISOR: qemu-coco-dev
|
||||||
|
KUBERNETES: vanilla
|
||||||
|
SNAPSHOTTER: nydus
|
||||||
|
USE_EXPERIMENTAL_SETUP_SNAPSHOTTER: true
|
||||||
|
|
||||||
|
- name: Run a few containers using overlayfs
|
||||||
|
run: |
|
||||||
|
# I don't want those to be inside double quotes, so I'm deliberately ignoring the double quotes here
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
for img in ${IMAGES_LIST}; do
|
||||||
|
echo "overlayfs | Using on image: ${img}"
|
||||||
|
pod="$(echo ${img} | tr ':.@/' '-' | awk '{print substr($0,1,56)}')"
|
||||||
|
kubectl run "${pod}" \
|
||||||
|
-it --rm \
|
||||||
|
--restart=Never \
|
||||||
|
--image=${img} \
|
||||||
|
--image-pull-policy=Always \
|
||||||
|
--pod-running-timeout=10m \
|
||||||
|
-- uname -r
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Deploy Kata Containers
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata
|
||||||
|
env:
|
||||||
|
KATA_HYPERVISOR: qemu-coco-dev
|
||||||
|
KUBERNETES: vanilla
|
||||||
|
SNAPSHOTTER: nydus
|
||||||
|
USE_EXPERIMENTAL_SETUP_SNAPSHOTTER: true
|
||||||
|
|
||||||
|
# This is needed as we may hit the createContainerTimeout
|
||||||
|
- name: Adjust Kata Containers' create_container_timeout
|
||||||
|
run: |
|
||||||
|
sudo sed -i -e 's/^\(create_container_timeout\).*=.*$/\1 = 600/g' /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
grep "create_container_timeout.*=" /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
|
||||||
|
# This is needed in order to have enough tmpfs space inside the guest to pull the image
|
||||||
|
- name: Adjust Kata Containers' default_memory
|
||||||
|
run: |
|
||||||
|
sudo sed -i -e 's/^\(default_memory\).*=.*$/\1 = 4096/g' /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
grep "default_memory.*=" /opt/kata/share/defaults/kata-containers/configuration-qemu-coco-dev.toml
|
||||||
|
|
||||||
|
- name: Run a the same few containers using a different snapshotter
|
||||||
|
run: |
|
||||||
|
# I don't want those to be inside double quotes, so I'm deliberately ignoring the double quotes here
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
for img in ${IMAGES_LIST}; do
|
||||||
|
echo "nydus | Using on image: ${img}"
|
||||||
|
pod="kata-$(echo ${img} | tr ':.@/' '-' | awk '{print substr($0,1,56)}')"
|
||||||
|
kubectl run "${pod}" \
|
||||||
|
-it --rm \
|
||||||
|
--restart=Never \
|
||||||
|
--image="${img}" \
|
||||||
|
--image-pull-policy=Always \
|
||||||
|
--pod-running-timeout=10m \
|
||||||
|
--overrides='{
|
||||||
|
"spec": {
|
||||||
|
"runtimeClassName": "kata-qemu-coco-dev"
|
||||||
|
}
|
||||||
|
}' \
|
||||||
|
-- uname -r
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Uninstall Kata Containers
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh cleanup || true
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
KATA_HYPERVISOR: qemu-coco-dev
|
||||||
|
KUBERNETES: vanilla
|
||||||
|
SNAPSHOTTER: nydus
|
||||||
|
USE_EXPERIMENTAL_SETUP_SNAPSHOTTER: true
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
name: CI | Run cri-containerd tests
|
name: CI | Run cri-containerd tests
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|||||||
15
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
15
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
@@ -34,12 +34,11 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests:
|
run-k8s-tests:
|
||||||
|
name: run-k8s-tests
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -71,6 +70,9 @@ jobs:
|
|||||||
instance-type: normal
|
instance-type: normal
|
||||||
auto-generate-policy: yes
|
auto-generate-policy: yes
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
environment: ci
|
environment: ci
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
@@ -146,6 +148,13 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh run-tests
|
run: bash tests/integration/kubernetes/gha-run.sh run-tests
|
||||||
|
|
||||||
|
- name: Refresh OIDC token in case access token expired
|
||||||
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
|
with:
|
||||||
|
client-id: ${{ secrets.AZ_APPID }}
|
||||||
|
tenant-id: ${{ secrets.AZ_TENANT_ID }}
|
||||||
|
subscription-id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||||
|
|
||||||
- name: Delete AKS cluster
|
- name: Delete AKS cluster
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh delete-cluster
|
run: bash tests/integration/kubernetes/gha-run.sh delete-cluster
|
||||||
|
|||||||
27
.github/workflows/run-k8s-tests-on-amd64.yaml
vendored
27
.github/workflows/run-k8s-tests-on-amd64.yaml
vendored
@@ -22,20 +22,16 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests-amd64:
|
run-k8s-tests-amd64:
|
||||||
|
name: run-k8s-tests-amd64
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
vmm:
|
vmm:
|
||||||
- clh #cloud-hypervisor
|
|
||||||
- dragonball
|
|
||||||
- fc #firecracker
|
|
||||||
- qemu
|
- qemu
|
||||||
- cloud-hypervisor
|
|
||||||
container_runtime:
|
container_runtime:
|
||||||
- containerd
|
- containerd
|
||||||
snapshotter:
|
snapshotter:
|
||||||
@@ -73,6 +69,25 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
|
- name: Remove unnecessary directories to free up space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/local/.ghcup
|
||||||
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
||||||
|
sudo rm -rf /usr/local/lib/android
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf /usr/local/share/boost
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
sudo rm -rf /usr/lib/jvm
|
||||||
|
sudo rm -rf /usr/share/swift
|
||||||
|
sudo rm -rf /usr/local/share/powershell
|
||||||
|
sudo rm -rf /usr/local/julia*
|
||||||
|
sudo rm -rf /opt/az
|
||||||
|
sudo rm -rf /usr/local/share/chromium
|
||||||
|
sudo rm -rf /opt/microsoft
|
||||||
|
sudo rm -rf /opt/google
|
||||||
|
sudo rm -rf /usr/lib/firefox
|
||||||
|
|
||||||
- name: Configure CRI-O
|
- name: Configure CRI-O
|
||||||
if: matrix.container_runtime == 'crio'
|
if: matrix.container_runtime == 'crio'
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh setup-crio
|
run: bash tests/integration/kubernetes/gha-run.sh setup-crio
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests-on-arm64:
|
run-k8s-tests-on-arm64:
|
||||||
|
name: run-k8s-tests-on-arm64
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
90
.github/workflows/run-k8s-tests-on-nvidia-gpu.yaml
vendored
Normal file
90
.github/workflows/run-k8s-tests-on-nvidia-gpu.yaml
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
name: CI | Run NVIDIA GPU kubernetes tests on arm64
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
registry:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
repo:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
tag:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
pr-number:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
commit-hash:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
target-branch:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
secrets:
|
||||||
|
NGC_API_KEY:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-nvidia-gpu-tests-on-amd64:
|
||||||
|
name: run-nvidia-gpu-tests-on-amd64
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
vmm:
|
||||||
|
- qemu-nvidia-gpu
|
||||||
|
k8s:
|
||||||
|
- kubeadm
|
||||||
|
runs-on: amd64-nvidia-a100
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
|
DOCKER_REPO: ${{ inputs.repo }}
|
||||||
|
DOCKER_TAG: ${{ inputs.tag }}
|
||||||
|
GH_PR_NUMBER: ${{ inputs.pr-number }}
|
||||||
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||||
|
KUBERNETES: ${{ matrix.k8s }}
|
||||||
|
USING_NFD: "false"
|
||||||
|
K8S_TEST_HOST_TYPE: all
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.commit-hash }}
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Rebase atop of the latest target branch
|
||||||
|
run: |
|
||||||
|
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
|
||||||
|
env:
|
||||||
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
|
- name: Deploy Kata
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata
|
||||||
|
|
||||||
|
- name: Install `bats`
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
timeout-minutes: 30
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh run-nv-tests
|
||||||
|
env:
|
||||||
|
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
|
||||||
|
- name: Collect artifacts ${{ matrix.vmm }}
|
||||||
|
if: always()
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh collect-artifacts
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Archive artifacts ${{ matrix.vmm }}
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
|
with:
|
||||||
|
name: k8s-tests-${{ matrix.vmm }}-${{ matrix.k8s }}-${{ inputs.tag }}
|
||||||
|
path: /tmp/artifacts
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Delete kata-deploy
|
||||||
|
if: always()
|
||||||
|
timeout-minutes: 5
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh cleanup
|
||||||
@@ -22,11 +22,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests:
|
run-k8s-tests:
|
||||||
|
name: run-k8s-tests
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
8
.github/workflows/run-k8s-tests-on-zvsi.yaml
vendored
8
.github/workflows/run-k8s-tests-on-zvsi.yaml
vendored
@@ -25,11 +25,11 @@ on:
|
|||||||
AUTHENTICATED_IMAGE_PASSWORD:
|
AUTHENTICATED_IMAGE_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests:
|
run-k8s-tests:
|
||||||
|
name: run-k8s-tests
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -106,7 +106,9 @@ jobs:
|
|||||||
# qemu-runtime-rs only works with overlayfs
|
# qemu-runtime-rs only works with overlayfs
|
||||||
# See: https://github.com/kata-containers/kata-containers/issues/10066
|
# See: https://github.com/kata-containers/kata-containers/issues/10066
|
||||||
- name: Configure the ${{ matrix.snapshotter }} snapshotter
|
- name: Configure the ${{ matrix.snapshotter }} snapshotter
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh ${{ matrix.deploy-cmd }}
|
env:
|
||||||
|
DEPLOY_CMD: ${{ matrix.deploy-cmd }}
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh "${DEPLOY_CMD}"
|
||||||
if: ${{ matrix.snapshotter != 'overlayfs' }}
|
if: ${{ matrix.snapshotter != 'overlayfs' }}
|
||||||
|
|
||||||
- name: Deploy Kata
|
- name: Deploy Kata
|
||||||
|
|||||||
@@ -35,13 +35,12 @@ on:
|
|||||||
AUTHENTICATED_IMAGE_PASSWORD:
|
AUTHENTICATED_IMAGE_PASSWORD:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Generate jobs for testing CoCo on non-TEE environments
|
# Generate jobs for testing CoCo on non-TEE environments
|
||||||
run-stability-k8s-tests-coco-nontee:
|
run-stability-k8s-tests-coco-nontee:
|
||||||
|
name: run-stability-k8s-tests-coco-nontee
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -52,6 +51,9 @@ jobs:
|
|||||||
pull-type:
|
pull-type:
|
||||||
- guest-pull
|
- guest-pull
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
environment: ci
|
environment: ci
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
@@ -91,9 +93,6 @@ jobs:
|
|||||||
- name: Install kata
|
- name: Install kata
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh install-kata-tools kata-artifacts
|
run: bash tests/integration/kubernetes/gha-run.sh install-kata-tools kata-artifacts
|
||||||
|
|
||||||
- name: Download Azure CLI
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh install-azure-cli
|
|
||||||
|
|
||||||
- name: Log into the Azure account
|
- name: Log into the Azure account
|
||||||
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
with:
|
with:
|
||||||
@@ -141,6 +140,13 @@ jobs:
|
|||||||
timeout-minutes: 300
|
timeout-minutes: 300
|
||||||
run: bash tests/stability/gha-stability-run.sh run-tests
|
run: bash tests/stability/gha-stability-run.sh run-tests
|
||||||
|
|
||||||
|
- name: Refresh OIDC token in case access token expired
|
||||||
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
|
with:
|
||||||
|
client-id: ${{ secrets.AZ_APPID }}
|
||||||
|
tenant-id: ${{ secrets.AZ_TENANT_ID }}
|
||||||
|
subscription-id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||||
|
|
||||||
- name: Delete AKS cluster
|
- name: Delete AKS cluster
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh delete-cluster
|
run: bash tests/integration/kubernetes/gha-run.sh delete-cluster
|
||||||
|
|||||||
250
.github/workflows/run-kata-coco-tests.yaml
vendored
250
.github/workflows/run-kata-coco-tests.yaml
vendored
@@ -36,22 +36,20 @@ on:
|
|||||||
ITA_KEY:
|
ITA_KEY:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests-on-tdx:
|
run-k8s-tests-on-tee:
|
||||||
|
name: run-k8s-tests-on-tee
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
vmm:
|
include:
|
||||||
- qemu-tdx
|
- runner: tdx
|
||||||
snapshotter:
|
vmm: qemu-tdx
|
||||||
- nydus
|
- runner: sev-snp
|
||||||
pull-type:
|
vmm: qemu-snp
|
||||||
- guest-pull
|
runs-on: ${{ matrix.runner }}
|
||||||
runs-on: tdx
|
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
DOCKER_REPO: ${{ inputs.repo }}
|
DOCKER_REPO: ${{ inputs.repo }}
|
||||||
@@ -59,15 +57,15 @@ jobs:
|
|||||||
GH_PR_NUMBER: ${{ inputs.pr-number }}
|
GH_PR_NUMBER: ${{ inputs.pr-number }}
|
||||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||||
KUBERNETES: "vanilla"
|
KUBERNETES: "vanilla"
|
||||||
USING_NFD: "true"
|
USING_NFD: "false"
|
||||||
KBS: "true"
|
KBS: "true"
|
||||||
K8S_TEST_HOST_TYPE: "baremetal"
|
K8S_TEST_HOST_TYPE: "baremetal"
|
||||||
KBS_INGRESS: "nodeport"
|
KBS_INGRESS: "nodeport"
|
||||||
SNAPSHOTTER: ${{ matrix.snapshotter }}
|
SNAPSHOTTER: "nydus"
|
||||||
PULL_TYPE: ${{ matrix.pull-type }}
|
PULL_TYPE: "guest-pull"
|
||||||
AUTHENTICATED_IMAGE_USER: ${{ vars.AUTHENTICATED_IMAGE_USER }}
|
AUTHENTICATED_IMAGE_USER: ${{ vars.AUTHENTICATED_IMAGE_USER }}
|
||||||
AUTHENTICATED_IMAGE_PASSWORD: ${{ secrets.AUTHENTICATED_IMAGE_PASSWORD }}
|
AUTHENTICATED_IMAGE_PASSWORD: ${{ secrets.AUTHENTICATED_IMAGE_PASSWORD }}
|
||||||
ITA_KEY: ${{ secrets.ITA_KEY }}
|
GH_ITA_KEY: ${{ secrets.ITA_KEY }}
|
||||||
AUTO_GENERATE_POLICY: "yes"
|
AUTO_GENERATE_POLICY: "yes"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
@@ -82,13 +80,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
- name: Deploy Snapshotter
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-snapshotter
|
|
||||||
|
|
||||||
- name: Deploy Kata
|
- name: Deploy Kata
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-tdx
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata
|
||||||
|
|
||||||
- name: Uninstall previous `kbs-client`
|
- name: Uninstall previous `kbs-client`
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -97,6 +91,8 @@ jobs:
|
|||||||
- name: Deploy CoCo KBS
|
- name: Deploy CoCo KBS
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-coco-kbs
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-coco-kbs
|
||||||
|
env:
|
||||||
|
ITA_KEY: ${{ env.KATA_HYPERVISOR == 'qemu-tdx' && env.GH_ITA_KEY || '' }}
|
||||||
|
|
||||||
- name: Install `kbs-client`
|
- name: Install `kbs-client`
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -110,102 +106,19 @@ jobs:
|
|||||||
timeout-minutes: 100
|
timeout-minutes: 100
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh run-tests
|
run: bash tests/integration/kubernetes/gha-run.sh run-tests
|
||||||
|
|
||||||
|
- name: Report tests
|
||||||
|
if: always()
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh report-tests
|
||||||
|
|
||||||
- name: Delete kata-deploy
|
- name: Delete kata-deploy
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh cleanup-tdx
|
run: bash tests/integration/kubernetes/gha-run.sh cleanup
|
||||||
|
|
||||||
- name: Delete Snapshotter
|
|
||||||
if: always()
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snapshotter
|
|
||||||
|
|
||||||
- name: Delete CoCo KBS
|
- name: Delete CoCo KBS
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh delete-coco-kbs
|
|
||||||
|
|
||||||
- name: Delete CSI driver
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh delete-csi-driver
|
|
||||||
|
|
||||||
run-k8s-tests-sev-snp:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
vmm:
|
|
||||||
- qemu-snp
|
|
||||||
snapshotter:
|
|
||||||
- nydus
|
|
||||||
pull-type:
|
|
||||||
- guest-pull
|
|
||||||
runs-on: sev-snp
|
|
||||||
env:
|
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
|
||||||
DOCKER_REPO: ${{ inputs.repo }}
|
|
||||||
DOCKER_TAG: ${{ inputs.tag }}
|
|
||||||
GH_PR_NUMBER: ${{ inputs.pr-number }}
|
|
||||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
|
||||||
KUBECONFIG: /home/kata/.kube/config
|
|
||||||
KUBERNETES: "vanilla"
|
|
||||||
USING_NFD: "false"
|
|
||||||
KBS: "true"
|
|
||||||
KBS_INGRESS: "nodeport"
|
|
||||||
K8S_TEST_HOST_TYPE: "baremetal"
|
|
||||||
SNAPSHOTTER: ${{ matrix.snapshotter }}
|
|
||||||
PULL_TYPE: ${{ matrix.pull-type }}
|
|
||||||
AUTHENTICATED_IMAGE_USER: ${{ vars.AUTHENTICATED_IMAGE_USER }}
|
|
||||||
AUTHENTICATED_IMAGE_PASSWORD: ${{ secrets.AUTHENTICATED_IMAGE_PASSWORD }}
|
|
||||||
AUTO_GENERATE_POLICY: "yes"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.commit-hash }}
|
|
||||||
fetch-depth: 0
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Rebase atop of the latest target branch
|
|
||||||
run: |
|
run: |
|
||||||
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
|
[[ "${KATA_HYPERVISOR}" == "qemu-tdx" ]] && echo "ITA_KEY=${GH_ITA_KEY}" >> "${GITHUB_ENV}"
|
||||||
env:
|
bash tests/integration/kubernetes/gha-run.sh delete-coco-kbs
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
|
||||||
|
|
||||||
- name: Deploy Snapshotter
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-snapshotter
|
|
||||||
|
|
||||||
- name: Deploy Kata
|
|
||||||
timeout-minutes: 10
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-snp
|
|
||||||
|
|
||||||
- name: Uninstall previous `kbs-client`
|
|
||||||
timeout-minutes: 10
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh uninstall-kbs-client
|
|
||||||
|
|
||||||
- name: Deploy CoCo KBS
|
|
||||||
timeout-minutes: 10
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-coco-kbs
|
|
||||||
|
|
||||||
- name: Install `kbs-client`
|
|
||||||
timeout-minutes: 10
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh install-kbs-client
|
|
||||||
|
|
||||||
- name: Deploy CSI driver
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-csi-driver
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
timeout-minutes: 50
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh run-tests
|
|
||||||
|
|
||||||
- name: Delete kata-deploy
|
|
||||||
if: always()
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snp
|
|
||||||
|
|
||||||
- name: Delete Snapshotter
|
|
||||||
if: always()
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snapshotter
|
|
||||||
|
|
||||||
- name: Delete CoCo KBS
|
|
||||||
if: always()
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh delete-coco-kbs
|
|
||||||
|
|
||||||
- name: Delete CSI driver
|
- name: Delete CSI driver
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
@@ -213,6 +126,7 @@ jobs:
|
|||||||
|
|
||||||
# Generate jobs for testing CoCo on non-TEE environments
|
# Generate jobs for testing CoCo on non-TEE environments
|
||||||
run-k8s-tests-coco-nontee:
|
run-k8s-tests-coco-nontee:
|
||||||
|
name: run-k8s-tests-coco-nontee
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -222,7 +136,12 @@ jobs:
|
|||||||
- nydus
|
- nydus
|
||||||
pull-type:
|
pull-type:
|
||||||
- guest-pull
|
- guest-pull
|
||||||
|
include:
|
||||||
|
- pull-type: experimental-force-guest-pull
|
||||||
|
snapshotter: ""
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
environment: ci
|
environment: ci
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
@@ -245,7 +164,6 @@ jobs:
|
|||||||
# insufficient resources.
|
# insufficient resources.
|
||||||
K8S_TEST_HOST_TYPE: "all"
|
K8S_TEST_HOST_TYPE: "all"
|
||||||
USING_NFD: "false"
|
USING_NFD: "false"
|
||||||
AUTO_GENERATE_POLICY: "yes"
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
with:
|
with:
|
||||||
@@ -268,9 +186,6 @@ jobs:
|
|||||||
- name: Install kata
|
- name: Install kata
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh install-kata-tools kata-artifacts
|
run: bash tests/integration/kubernetes/gha-run.sh install-kata-tools kata-artifacts
|
||||||
|
|
||||||
- name: Download Azure CLI
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh install-azure-cli
|
|
||||||
|
|
||||||
- name: Log into the Azure account
|
- name: Log into the Azure account
|
||||||
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
with:
|
with:
|
||||||
@@ -298,13 +213,13 @@ jobs:
|
|||||||
- name: Download credentials for the Kubernetes CLI to use them
|
- name: Download credentials for the Kubernetes CLI to use them
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh get-cluster-credentials
|
run: bash tests/integration/kubernetes/gha-run.sh get-cluster-credentials
|
||||||
|
|
||||||
- name: Deploy Snapshotter
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-snapshotter
|
|
||||||
|
|
||||||
- name: Deploy Kata
|
- name: Deploy Kata
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-aks
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-aks
|
||||||
|
env:
|
||||||
|
EXPERIMENTAL_FORCE_GUEST_PULL: ${{ env.PULL_TYPE == 'experimental-force-guest-pull' && env.KATA_HYPERVISOR || '' }}
|
||||||
|
USE_EXPERIMENTAL_SETUP_SNAPSHOTTER: ${{ env.SNAPSHOTTER == 'nydus' }}
|
||||||
|
AUTO_GENERATE_POLICY: ${{ env.PULL_TYPE == 'experimental-force-guest-pull' && 'no' || 'yes' }}
|
||||||
|
|
||||||
- name: Deploy CoCo KBS
|
- name: Deploy CoCo KBS
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -326,6 +241,105 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh report-tests
|
run: bash tests/integration/kubernetes/gha-run.sh report-tests
|
||||||
|
|
||||||
|
- name: Refresh OIDC token in case access token expired
|
||||||
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
|
with:
|
||||||
|
client-id: ${{ secrets.AZ_APPID }}
|
||||||
|
tenant-id: ${{ secrets.AZ_TENANT_ID }}
|
||||||
|
subscription-id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||||
|
|
||||||
- name: Delete AKS cluster
|
- name: Delete AKS cluster
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh delete-cluster
|
run: bash tests/integration/kubernetes/gha-run.sh delete-cluster
|
||||||
|
|
||||||
|
# Generate jobs for testing CoCo on non-TEE environments with erofs-snapshotter
|
||||||
|
run-k8s-tests-coco-nontee-with-erofs-snapshotter:
|
||||||
|
name: run-k8s-tests-coco-nontee-with-erofs-snapshotter
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
vmm:
|
||||||
|
- qemu-coco-dev
|
||||||
|
snapshotter:
|
||||||
|
- erofs
|
||||||
|
pull-type:
|
||||||
|
- default
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
environment: ci
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
|
DOCKER_REPO: ${{ inputs.repo }}
|
||||||
|
DOCKER_TAG: ${{ inputs.tag }}
|
||||||
|
GH_PR_NUMBER: ${{ inputs.pr-number }}
|
||||||
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||||
|
# Some tests rely on that variable to run (or not)
|
||||||
|
KBS: "false"
|
||||||
|
# Set the KBS ingress handler (empty string disables handling)
|
||||||
|
KBS_INGRESS: ""
|
||||||
|
KUBERNETES: "vanilla"
|
||||||
|
CONTAINER_ENGINE: "containerd"
|
||||||
|
CONTAINER_ENGINE_VERSION: "v2.2"
|
||||||
|
PULL_TYPE: ${{ matrix.pull-type }}
|
||||||
|
SNAPSHOTTER: ${{ matrix.snapshotter }}
|
||||||
|
USE_EXPERIMENTAL_SETUP_SNAPSHOTTER: "true"
|
||||||
|
K8S_TEST_HOST_TYPE: "all"
|
||||||
|
USING_NFD: "false"
|
||||||
|
# We are skipping the auto generated policy tests for now,
|
||||||
|
# but those should be enabled as soon as we work on that.
|
||||||
|
AUTO_GENERATE_POLICY: "no"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.commit-hash }}
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Rebase atop of the latest target branch
|
||||||
|
run: |
|
||||||
|
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
|
||||||
|
env:
|
||||||
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
|
- name: Remove unnecessary directories to free up space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/local/.ghcup
|
||||||
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
||||||
|
sudo rm -rf /usr/local/lib/android
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf /usr/local/share/boost
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
sudo rm -rf /usr/lib/jvm
|
||||||
|
sudo rm -rf /usr/share/swift
|
||||||
|
sudo rm -rf /usr/local/share/powershell
|
||||||
|
sudo rm -rf /usr/local/julia*
|
||||||
|
sudo rm -rf /opt/az
|
||||||
|
sudo rm -rf /usr/local/share/chromium
|
||||||
|
sudo rm -rf /opt/microsoft
|
||||||
|
sudo rm -rf /opt/google
|
||||||
|
sudo rm -rf /usr/lib/firefox
|
||||||
|
|
||||||
|
- name: Deploy kubernetes
|
||||||
|
timeout-minutes: 15
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Install `bats`
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
||||||
|
|
||||||
|
- name: Deploy Kata
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata
|
||||||
|
|
||||||
|
- name: Deploy CSI driver
|
||||||
|
timeout-minutes: 5
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-csi-driver
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
timeout-minutes: 80
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh run-tests
|
||||||
|
|
||||||
|
- name: Report tests
|
||||||
|
if: always()
|
||||||
|
run: bash tests/integration/kubernetes/gha-run.sh report-tests
|
||||||
|
|||||||
@@ -29,12 +29,11 @@ on:
|
|||||||
AZ_SUBSCRIPTION_ID:
|
AZ_SUBSCRIPTION_ID:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-kata-deploy-tests:
|
run-kata-deploy-tests:
|
||||||
|
name: run-kata-deploy-tests
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -50,6 +49,8 @@ jobs:
|
|||||||
vmm: clh
|
vmm: clh
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
environment: ci
|
environment: ci
|
||||||
|
permissions:
|
||||||
|
id-token: write # Used for OIDC access to log into Azure
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
DOCKER_REPO: ${{ inputs.repo }}
|
DOCKER_REPO: ${{ inputs.repo }}
|
||||||
@@ -72,9 +73,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
- name: Download Azure CLI
|
|
||||||
run: bash tests/functional/kata-deploy/gha-run.sh install-azure-cli
|
|
||||||
|
|
||||||
- name: Log into the Azure account
|
- name: Log into the Azure account
|
||||||
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
with:
|
with:
|
||||||
@@ -105,6 +103,13 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: bash tests/functional/kata-deploy/gha-run.sh run-tests
|
run: bash tests/functional/kata-deploy/gha-run.sh run-tests
|
||||||
|
|
||||||
|
- name: Refresh OIDC token in case access token expired
|
||||||
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||||
|
with:
|
||||||
|
client-id: ${{ secrets.AZ_APPID }}
|
||||||
|
tenant-id: ${{ secrets.AZ_TENANT_ID }}
|
||||||
|
subscription-id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||||
|
|
||||||
- name: Delete AKS cluster
|
- name: Delete AKS cluster
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/functional/kata-deploy/gha-run.sh delete-cluster
|
run: bash tests/functional/kata-deploy/gha-run.sh delete-cluster
|
||||||
|
|||||||
23
.github/workflows/run-kata-deploy-tests.yaml
vendored
23
.github/workflows/run-kata-deploy-tests.yaml
vendored
@@ -22,11 +22,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-kata-deploy-tests:
|
run-kata-deploy-tests:
|
||||||
|
name: run-kata-deploy-tests
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -59,6 +59,25 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
|
- name: Remove unnecessary directories to free up space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/local/.ghcup
|
||||||
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
||||||
|
sudo rm -rf /usr/local/lib/android
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf /usr/local/share/boost
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
sudo rm -rf /usr/lib/jvm
|
||||||
|
sudo rm -rf /usr/share/swift
|
||||||
|
sudo rm -rf /usr/local/share/powershell
|
||||||
|
sudo rm -rf /usr/local/julia*
|
||||||
|
sudo rm -rf /opt/az
|
||||||
|
sudo rm -rf /usr/local/share/chromium
|
||||||
|
sudo rm -rf /opt/microsoft
|
||||||
|
sudo rm -rf /opt/google
|
||||||
|
sudo rm -rf /usr/lib/firefox
|
||||||
|
|
||||||
- name: Deploy ${{ matrix.k8s }}
|
- name: Deploy ${{ matrix.k8s }}
|
||||||
run: bash tests/functional/kata-deploy/gha-run.sh deploy-k8s
|
run: bash tests/functional/kata-deploy/gha-run.sh deploy-k8s
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-monitor:
|
run-monitor:
|
||||||
|
name: run-monitor
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
4
.github/workflows/run-metrics.yaml
vendored
4
.github/workflows/run-metrics.yaml
vendored
@@ -22,11 +22,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-metrics:
|
run-metrics:
|
||||||
|
name: run-metrics
|
||||||
strategy:
|
strategy:
|
||||||
# We can set this to true whenever we're 100% sure that
|
# We can set this to true whenever we're 100% sure that
|
||||||
# the all the tests are not flaky, otherwise we'll fail
|
# the all the tests are not flaky, otherwise we'll fail
|
||||||
|
|||||||
4
.github/workflows/run-runk-tests.yaml
vendored
4
.github/workflows/run-runk-tests.yaml
vendored
@@ -13,11 +13,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-runk:
|
run-runk:
|
||||||
|
name: run-runk
|
||||||
# Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether
|
# Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether
|
||||||
if: false
|
if: false
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|||||||
6
.github/workflows/shellcheck.yaml
vendored
6
.github/workflows/shellcheck.yaml
vendored
@@ -10,8 +10,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -19,6 +18,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
shellcheck:
|
shellcheck:
|
||||||
|
name: shellcheck
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
@@ -27,6 +27,6 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca # master (2024-06-20)
|
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
|
||||||
with:
|
with:
|
||||||
ignore_paths: "**/vendor/**"
|
ignore_paths: "**/vendor/**"
|
||||||
|
|||||||
6
.github/workflows/shellcheck_required.yaml
vendored
6
.github/workflows/shellcheck_required.yaml
vendored
@@ -11,8 +11,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -20,6 +19,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
shellcheck-required:
|
shellcheck-required:
|
||||||
|
name: shellcheck-required
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca # master (2024-06-20)
|
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
|
||||||
with:
|
with:
|
||||||
severity: error
|
severity: error
|
||||||
ignore_paths: "**/vendor/**"
|
ignore_paths: "**/vendor/**"
|
||||||
|
|||||||
4
.github/workflows/stale.yaml
vendored
4
.github/workflows/stale.yaml
vendored
@@ -4,11 +4,11 @@ on:
|
|||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
|
name: stale
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
|
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ on:
|
|||||||
- reopened
|
- reopened
|
||||||
- labeled # a workflow runs only when the 'ok-to-test' label is added
|
- labeled # a workflow runs only when the 'ok-to-test' label is added
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -30,8 +29,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
instance:
|
instance:
|
||||||
- "ubuntu-22.04-arm"
|
- "ubuntu-22.04-arm"
|
||||||
- "s390x"
|
- "ubuntu-24.04-s390x"
|
||||||
- "ppc64le"
|
- "ubuntu-24.04-ppc64le"
|
||||||
uses: ./.github/workflows/build-checks.yaml
|
uses: ./.github/workflows/build-checks.yaml
|
||||||
with:
|
with:
|
||||||
instance: ${{ matrix.instance }}
|
instance: ${{ matrix.instance }}
|
||||||
|
|||||||
58
.github/workflows/static-checks.yaml
vendored
58
.github/workflows/static-checks.yaml
vendored
@@ -7,8 +7,7 @@ on:
|
|||||||
- synchronize
|
- synchronize
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -23,6 +22,7 @@ jobs:
|
|||||||
target-branch: ${{ github.event.pull_request.base.ref }}
|
target-branch: ${{ github.event.pull_request.base.ref }}
|
||||||
|
|
||||||
check-kernel-config-version:
|
check-kernel-config-version:
|
||||||
|
name: check-kernel-config-version
|
||||||
needs: skipper
|
needs: skipper
|
||||||
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -55,6 +55,7 @@ jobs:
|
|||||||
instance: ubuntu-22.04
|
instance: ubuntu-22.04
|
||||||
|
|
||||||
build-checks-depending-on-kvm:
|
build-checks-depending-on-kvm:
|
||||||
|
name: build-checks-depending-on-kvm
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: skipper
|
needs: skipper
|
||||||
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
||||||
@@ -89,13 +90,16 @@ jobs:
|
|||||||
- name: Running `${{ matrix.command }}` for ${{ matrix.component }}
|
- name: Running `${{ matrix.command }}` for ${{ matrix.component }}
|
||||||
run: |
|
run: |
|
||||||
export PATH="$PATH:${HOME}/.cargo/bin"
|
export PATH="$PATH:${HOME}/.cargo/bin"
|
||||||
cd ${{ matrix.component-path }}
|
cd "${COMPONENT_PATH}"
|
||||||
${{ matrix.command }}
|
eval "${COMMAND}"
|
||||||
env:
|
env:
|
||||||
|
COMMAND: ${{ matrix.command }}
|
||||||
|
COMPONENT_PATH: ${{ matrix.component-path }}
|
||||||
RUST_BACKTRACE: "1"
|
RUST_BACKTRACE: "1"
|
||||||
RUST_LIB_BACKTRACE: "0"
|
RUST_LIB_BACKTRACE: "0"
|
||||||
|
|
||||||
static-checks:
|
static-checks:
|
||||||
|
name: static-checks
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: skipper
|
needs: skipper
|
||||||
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
||||||
@@ -118,13 +122,13 @@ jobs:
|
|||||||
path: ./src/github.com/${{ github.repository }}
|
path: ./src/github.com/${{ github.repository }}
|
||||||
- name: Install yq
|
- name: Install yq
|
||||||
run: |
|
run: |
|
||||||
cd "${GOPATH}/src/github.com/${{ github.repository }}"
|
cd "${GOPATH}/src/github.com/${GITHUB_REPOSITORY}"
|
||||||
./ci/install_yq.sh
|
./ci/install_yq.sh
|
||||||
env:
|
env:
|
||||||
INSTALL_IN_GOPATH: false
|
INSTALL_IN_GOPATH: false
|
||||||
- name: Install golang
|
- name: Install golang
|
||||||
run: |
|
run: |
|
||||||
cd "${GOPATH}/src/github.com/${{ github.repository }}"
|
cd "${GOPATH}/src/github.com/${GITHUB_REPOSITORY}"
|
||||||
./tests/install_go.sh -f -p
|
./tests/install_go.sh -f -p
|
||||||
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
@@ -132,7 +136,7 @@ jobs:
|
|||||||
sudo apt-get update && sudo apt-get -y install moreutils hunspell hunspell-en-gb hunspell-en-us pandoc
|
sudo apt-get update && sudo apt-get -y install moreutils hunspell hunspell-en-gb hunspell-en-us pandoc
|
||||||
- name: Install open-policy-agent
|
- name: Install open-policy-agent
|
||||||
run: |
|
run: |
|
||||||
cd "${GOPATH}/src/github.com/${{ github.repository }}"
|
cd "${GOPATH}/src/github.com/${GITHUB_REPOSITORY}"
|
||||||
./tests/install_opa.sh
|
./tests/install_opa.sh
|
||||||
- name: Install regorus
|
- name: Install regorus
|
||||||
env:
|
env:
|
||||||
@@ -140,13 +144,49 @@ jobs:
|
|||||||
ARTEFACT_REGISTRY_USERNAME: "${{ github.actor }}"
|
ARTEFACT_REGISTRY_USERNAME: "${{ github.actor }}"
|
||||||
ARTEFACT_REGISTRY_PASSWORD: "${{ secrets.GITHUB_TOKEN }}"
|
ARTEFACT_REGISTRY_PASSWORD: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
run: |
|
run: |
|
||||||
"${GOPATH}/src/github.com/${{ github.repository }}/tests/install_regorus.sh"
|
"${GOPATH}/src/github.com/${GITHUB_REPOSITORY}/tests/install_regorus.sh"
|
||||||
- name: Run check
|
- name: Run check
|
||||||
|
env:
|
||||||
|
CMD: ${{ matrix.cmd }}
|
||||||
run: |
|
run: |
|
||||||
export PATH="${PATH}:${GOPATH}/bin"
|
export PATH="${PATH}:${GOPATH}/bin"
|
||||||
cd "${GOPATH}/src/github.com/${{ github.repository }}" && ${{ matrix.cmd }}
|
cd "${GOPATH}/src/github.com/${GITHUB_REPOSITORY}" && ${CMD}
|
||||||
|
|
||||||
govulncheck:
|
govulncheck:
|
||||||
needs: skipper
|
needs: skipper
|
||||||
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
||||||
uses: ./.github/workflows/govulncheck.yaml
|
uses: ./.github/workflows/govulncheck.yaml
|
||||||
|
|
||||||
|
codegen:
|
||||||
|
name: codegen
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: skipper
|
||||||
|
if: ${{ needs.skipper.outputs.skip_static != 'yes' }}
|
||||||
|
permissions:
|
||||||
|
contents: read # for checkout
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
- name: generate
|
||||||
|
run: make -C src/agent generate-protocols
|
||||||
|
- name: check for diff
|
||||||
|
run: |
|
||||||
|
diff=$(git diff)
|
||||||
|
if [[ -z "${diff}" ]]; then
|
||||||
|
echo "No diff detected."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat << EOF >> "${GITHUB_STEP_SUMMARY}"
|
||||||
|
Run \`make -C src/agent generate-protocols\` to update protobuf bindings.
|
||||||
|
|
||||||
|
\`\`\`diff
|
||||||
|
${diff}
|
||||||
|
\`\`\`
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "::error::Golang protobuf bindings need to be regenerated (see Github step summary for diff)."
|
||||||
|
exit 1
|
||||||
|
|||||||
16
.github/workflows/zizmor.yaml
vendored
16
.github/workflows/zizmor.yaml
vendored
@@ -1,12 +1,9 @@
|
|||||||
name: GHA security analysis
|
name: GHA security analysis
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
@@ -14,10 +11,8 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
zizmor:
|
zizmor:
|
||||||
|
name: zizmor
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
@@ -26,4 +21,9 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Run zizmor
|
- name: Run zizmor
|
||||||
uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1
|
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
|
||||||
|
with:
|
||||||
|
advanced-security: false
|
||||||
|
annotations: true
|
||||||
|
persona: auditor
|
||||||
|
version: v1.13.0
|
||||||
|
|||||||
3
.github/zizmor.yml
vendored
Normal file
3
.github/zizmor.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
rules:
|
||||||
|
undocumented-permissions:
|
||||||
|
disable: true
|
||||||
2
Makefile
2
Makefile
@@ -42,7 +42,7 @@ generate-protocols:
|
|||||||
|
|
||||||
# Some static checks rely on generated source files of components.
|
# Some static checks rely on generated source files of components.
|
||||||
static-checks: static-checks-build
|
static-checks: static-checks-build
|
||||||
bash tests/static-checks.sh github.com/kata-containers/kata-containers
|
bash tests/static-checks.sh
|
||||||
|
|
||||||
docs-url-alive-check:
|
docs-url-alive-check:
|
||||||
bash ci/docs-url-alive-check.sh
|
bash ci/docs-url-alive-check.sh
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
foo
|
||||||
|
|
||||||
<img src="https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/kata/SVG/kata-1.svg" width="900">
|
<img src="https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/kata/SVG/kata-1.svg" width="900">
|
||||||
|
|
||||||
[](https://github.com/kata-containers/kata-containers/actions/workflows/payload-after-push.yaml) [](https://github.com/kata-containers/kata-containers/actions/workflows/ci-nightly.yaml)
|
[](https://github.com/kata-containers/kata-containers/actions/workflows/payload-after-push.yaml) [](https://github.com/kata-containers/kata-containers/actions/workflows/ci-nightly.yaml)
|
||||||
|
|||||||
12
ci/README.md
12
ci/README.md
@@ -306,7 +306,7 @@ tarball to the newly created VM that will be used for debugging purposes.
|
|||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Those artifacts are only available (for 15 days) when all jobs are finished.
|
> Those artifacts are only available (for 15 days) when all jobs are finished.
|
||||||
|
|
||||||
Once you have the `kata-static.tar.xz` in your VM, you can login to the VM with
|
Once you have the `kata-static.tar.zst` in your VM, you can login to the VM with
|
||||||
`kcli ssh debug-nerdctl-pr8070`, go ahead and then clone your development branch
|
`kcli ssh debug-nerdctl-pr8070`, go ahead and then clone your development branch
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -323,15 +323,15 @@ $ git config --global user.name "Your Name"
|
|||||||
$ git rebase upstream/main
|
$ git rebase upstream/main
|
||||||
```
|
```
|
||||||
|
|
||||||
Now copy the `kata-static.tar.xz` into your `kata-containers/kata-artifacts` directory
|
Now copy the `kata-static.tar.zst` into your `kata-containers/kata-artifacts` directory
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ mkdir kata-artifacts
|
$ mkdir kata-artifacts
|
||||||
$ cp ../kata-static.tar.xz kata-artifacts/
|
$ cp ../kata-static.tar.zst kata-artifacts/
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> If you downloaded the .zip from GitHub you need to uncompress first to see `kata-static.tar.xz`
|
> If you downloaded the .zip from GitHub you need to uncompress first to see `kata-static.tar.zst`
|
||||||
|
|
||||||
And finally run the tests following what's in the yaml file for the test you're
|
And finally run the tests following what's in the yaml file for the test you're
|
||||||
debugging.
|
debugging.
|
||||||
@@ -363,11 +363,11 @@ and have fun debugging and hacking!
|
|||||||
|
|
||||||
Steps for debugging the Kubernetes tests are very similar to the ones for
|
Steps for debugging the Kubernetes tests are very similar to the ones for
|
||||||
debugging non-Kubernetes tests, with the caveat that what you'll need, this
|
debugging non-Kubernetes tests, with the caveat that what you'll need, this
|
||||||
time, is not the `kata-static.tar.xz` tarball, but rather a payload to be used
|
time, is not the `kata-static.tar.zst` tarball, but rather a payload to be used
|
||||||
with kata-deploy.
|
with kata-deploy.
|
||||||
|
|
||||||
In order to generate your own kata-deploy image you can generate your own
|
In order to generate your own kata-deploy image you can generate your own
|
||||||
`kata-static.tar.xz` and then take advantage of the following script. Be aware
|
`kata-static.tar.zst` and then take advantage of the following script. Be aware
|
||||||
that the image generated and uploaded must be accessible by the VM where you'll
|
that the image generated and uploaded must be accessible by the VM where you'll
|
||||||
be performing your tests.
|
be performing your tests.
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ set -e
|
|||||||
|
|
||||||
cidir=$(dirname "$0")
|
cidir=$(dirname "$0")
|
||||||
runtimedir=${cidir}/../src/runtime
|
runtimedir=${cidir}/../src/runtime
|
||||||
|
genpolicydir=${cidir}/../src/tools/genpolicy
|
||||||
|
|
||||||
build_working_packages() {
|
build_working_packages() {
|
||||||
# working packages:
|
# working packages:
|
||||||
@@ -40,3 +41,11 @@ build_working_packages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_working_packages
|
build_working_packages
|
||||||
|
|
||||||
|
build_genpolicy() {
|
||||||
|
echo "building genpolicy"
|
||||||
|
pushd "${genpolicydir}" &>/dev/null
|
||||||
|
make TRIPLE=aarch64-apple-darwin build
|
||||||
|
}
|
||||||
|
|
||||||
|
build_genpolicy
|
||||||
|
|||||||
@@ -43,19 +43,18 @@ WORKAROUND_9206_CRIO=${WORKAROUND_9206_CRIO:-no}
|
|||||||
# Leverage kata-deploy to install Kata Containers in the cluster.
|
# Leverage kata-deploy to install Kata Containers in the cluster.
|
||||||
#
|
#
|
||||||
apply_kata_deploy() {
|
apply_kata_deploy() {
|
||||||
local deploy_file="tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml"
|
if ! command -v helm &>/dev/null; then
|
||||||
pushd "${katacontainers_repo_dir}" || die
|
echo "Helm not installed, installing..."
|
||||||
sed -ri "s#(\s+image:) .*#\1 ${KATA_DEPLOY_IMAGE}#" "${deploy_file}"
|
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
|
fi
|
||||||
|
|
||||||
info "Applying kata-deploy"
|
|
||||||
oc apply -f tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml
|
|
||||||
oc label --overwrite ns kube-system pod-security.kubernetes.io/enforce=privileged pod-security.kubernetes.io/warn=baseline pod-security.kubernetes.io/audit=baseline
|
oc label --overwrite ns kube-system pod-security.kubernetes.io/enforce=privileged pod-security.kubernetes.io/warn=baseline pod-security.kubernetes.io/audit=baseline
|
||||||
oc apply -f "${deploy_file}"
|
local version chart
|
||||||
oc -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod
|
version=$(curl -sSL https://api.github.com/repos/kata-containers/kata-containers/releases/latest | jq .tag_name | tr -d '"')
|
||||||
|
chart="oci://ghcr.io/kata-containers/kata-deploy-charts/kata-deploy"
|
||||||
|
|
||||||
info "Adding the kata runtime classes"
|
echo "Installing kata using helm ${chart} ${version}"
|
||||||
oc apply -f tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml
|
helm install kata-deploy --wait --namespace kube-system --set "image.reference=${KATA_DEPLOY_IMAGE%%:*},image.tag=${KATA_DEPLOY_IMAGE##*:}" "${chart}" --version "${version}"
|
||||||
popd || die
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -174,13 +173,13 @@ wait_for_app_pods_message() {
|
|||||||
local namespace="$5"
|
local namespace="$5"
|
||||||
[[ -z "${pod_count}" ]] && pod_count=1
|
[[ -z "${pod_count}" ]] && pod_count=1
|
||||||
[[ -z "${timeout}" ]] && timeout=60
|
[[ -z "${timeout}" ]] && timeout=60
|
||||||
[[ -n "${namespace}" ]] && namespace=" -n ${namespace} "
|
[[ -n "${namespace}" ]] && namespace=("-n" "${namespace}")
|
||||||
local pod
|
local pod
|
||||||
local pods
|
local pods
|
||||||
local i
|
local i
|
||||||
SECONDS=0
|
SECONDS=0
|
||||||
while :; do
|
while :; do
|
||||||
mapfile -t pods < <(oc get pods -l app="${app}" --no-headers=true "${namespace}" | awk '{print $1}')
|
mapfile -t pods < <(oc get pods -l app="${app}" --no-headers=true "${namespace[@]}" | awk '{print $1}')
|
||||||
[[ "${#pods}" -ge "${pod_count}" ]] && break
|
[[ "${#pods}" -ge "${pod_count}" ]] && break
|
||||||
if [[ "${SECONDS}" -gt "${timeout}" ]]; then
|
if [[ "${SECONDS}" -gt "${timeout}" ]]; then
|
||||||
printf "Unable to find ${pod_count} pods for '-l app=\"${app}\"' in ${SECONDS}s (%s)" "${pods[@]}"
|
printf "Unable to find ${pod_count} pods for '-l app=\"${app}\"' in ${SECONDS}s (%s)" "${pods[@]}"
|
||||||
@@ -190,7 +189,7 @@ wait_for_app_pods_message() {
|
|||||||
local log
|
local log
|
||||||
for pod in "${pods[@]}"; do
|
for pod in "${pods[@]}"; do
|
||||||
while :; do
|
while :; do
|
||||||
log=$(oc logs "${namespace}" "${pod}")
|
log=$(oc logs "${namespace[@]}" "${pod}")
|
||||||
echo "${log}" | grep "${message}" -q && echo "Found $(echo "${log}" | grep "${message}") in ${pod}'s log (${SECONDS})" && break;
|
echo "${log}" | grep "${message}" -q && echo "Found $(echo "${log}" | grep "${message}") in ${pod}'s log (${SECONDS})" && break;
|
||||||
if [[ "${SECONDS}" -gt "${timeout}" ]]; then
|
if [[ "${SECONDS}" -gt "${timeout}" ]]; then
|
||||||
echo -n "Message '${message}' not present in '${pod}' pod of the '-l app=\"${app}\"' "
|
echo -n "Message '${message}' not present in '${pod}' pod of the '-l app=\"${app}\"' "
|
||||||
|
|||||||
@@ -12,6 +12,33 @@
|
|||||||
|
|
||||||
SCRIPT_DIR=$(dirname "$0")
|
SCRIPT_DIR=$(dirname "$0")
|
||||||
|
|
||||||
|
##################
|
||||||
|
# Helper functions
|
||||||
|
##################
|
||||||
|
|
||||||
|
# Sparse "git clone" supporting old git version
|
||||||
|
# $1 - origin
|
||||||
|
# $2 - revision
|
||||||
|
# $3- - sparse checkout paths
|
||||||
|
# Note: uses pushd to change into the clonned directory!
|
||||||
|
git_sparse_clone() {
|
||||||
|
local origin="$1"
|
||||||
|
local revision="$2"
|
||||||
|
shift 2
|
||||||
|
local sparse_paths=("$@")
|
||||||
|
|
||||||
|
local repo
|
||||||
|
repo=$(basename -s .git "${origin}")
|
||||||
|
|
||||||
|
git init "${repo}"
|
||||||
|
pushd "${repo}" || exit 1
|
||||||
|
git remote add origin "${origin}"
|
||||||
|
git fetch --depth 1 origin "${revision}"
|
||||||
|
git sparse-checkout init --cone
|
||||||
|
git sparse-checkout set "${sparse_paths[@]}"
|
||||||
|
git checkout FETCH_HEAD
|
||||||
|
}
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Disable security to allow e2e
|
# Disable security to allow e2e
|
||||||
###############################
|
###############################
|
||||||
@@ -116,33 +143,40 @@ az network vnet subnet update \
|
|||||||
for NODE_NAME in $(kubectl get nodes -o jsonpath='{.items[*].metadata.name}'); do [[ "${NODE_NAME}" =~ 'worker' ]] && kubectl label node "${NODE_NAME}" node.kubernetes.io/worker=; done
|
for NODE_NAME in $(kubectl get nodes -o jsonpath='{.items[*].metadata.name}'); do [[ "${NODE_NAME}" =~ 'worker' ]] && kubectl label node "${NODE_NAME}" node.kubernetes.io/worker=; done
|
||||||
|
|
||||||
# CAA artifacts
|
# CAA artifacts
|
||||||
CAA_IMAGE="quay.io/confidential-containers/cloud-api-adaptor"
|
if [[ -z "${CAA_TAG}" ]]; then
|
||||||
TAGS="$(curl https://quay.io/api/v1/repository/confidential-containers/cloud-api-adaptor/tag/?onlyActiveTags=true)"
|
if [[ -n "${CAA_IMAGE}" ]]; then
|
||||||
DIGEST=$(echo "${TAGS}" | jq -r '.tags[] | select(.name | contains("latest-amd64")) | .manifest_digest')
|
echo "CAA_IMAGE (${CAA_IMAGE}) is set but CAA_TAG isn't, which is not supported. Please specify both or none"
|
||||||
CAA_TAG="$(echo "${TAGS}" | jq -r '.tags[] | select(.manifest_digest | contains("'"${DIGEST}"'")) | .name' | grep -v "latest")"
|
exit 1
|
||||||
|
fi
|
||||||
|
TAGS="$(curl https://quay.io/api/v1/repository/confidential-containers/cloud-api-adaptor/tag/?onlyActiveTags=true)"
|
||||||
|
DIGEST=$(echo "${TAGS}" | jq -r '.tags[] | select(.name | contains("latest-amd64")) | .manifest_digest')
|
||||||
|
CAA_TAG="$(echo "${TAGS}" | jq -r '.tags[] | select(.manifest_digest | contains("'"${DIGEST}"'")) | .name' | grep -v "latest")"
|
||||||
|
fi
|
||||||
|
if [[ -z "${CAA_IMAGE}" ]]; then
|
||||||
|
CAA_IMAGE="quay.io/confidential-containers/cloud-api-adaptor"
|
||||||
|
fi
|
||||||
|
|
||||||
# Get latest PP image
|
# Get latest PP image
|
||||||
SUCCESS_TIME=$(curl -s \
|
if [[ -z "${PP_IMAGE_ID}" ]]; then
|
||||||
-H "Accept: application/vnd.github+json" \
|
SUCCESS_TIME=$(curl -s \
|
||||||
"https://api.github.com/repos/confidential-containers/cloud-api-adaptor/actions/workflows/azure-nightly-build.yml/runs?status=success" \
|
-H "Accept: application/vnd.github+json" \
|
||||||
| jq -r '.workflow_runs[0].updated_at')
|
"https://api.github.com/repos/confidential-containers/cloud-api-adaptor/actions/workflows/azure-nightly-build.yml/runs?status=success" \
|
||||||
PP_IMAGE_ID="/CommunityGalleries/cocopodvm-d0e4f35f-5530-4b9c-8596-112487cdea85/Images/podvm_image0/Versions/$(date -u -jf "%Y-%m-%dT%H:%M:%SZ" "${SUCCESS_TIME}" "+%Y.%m.%d" 2>/dev/null || date -d "${SUCCESS_TIME}" +%Y.%m.%d)"
|
| jq -r '.workflow_runs[0].updated_at')
|
||||||
|
PP_IMAGE_ID="/CommunityGalleries/cocopodvm-d0e4f35f-5530-4b9c-8596-112487cdea85/Images/podvm_image0/Versions/$(date -u -jf "%Y-%m-%dT%H:%M:%SZ" "${SUCCESS_TIME}" "+%Y.%m.%d" 2>/dev/null || date -d "${SUCCESS_TIME}" +%Y.%m.%d)"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "AZURE_REGION: \"${AZURE_REGION}\""
|
echo "AZURE_REGION=\"${AZURE_REGION}\""
|
||||||
echo "PP_REGION: \"${PP_REGION}\""
|
echo "PP_REGION=\"${PP_REGION}\""
|
||||||
echo "AZURE_RESOURCE_GROUP: \"${AZURE_RESOURCE_GROUP}\""
|
echo "AZURE_RESOURCE_GROUP=\"${AZURE_RESOURCE_GROUP}\""
|
||||||
echo "PP_RESOURCE_GROUP: \"${PP_RESOURCE_GROUP}\""
|
echo "PP_RESOURCE_GROUP=\"${PP_RESOURCE_GROUP}\""
|
||||||
echo "PP_SUBNET_ID: \"${PP_SUBNET_ID}\""
|
echo "PP_SUBNET_ID=\"${PP_SUBNET_ID}\""
|
||||||
echo "CAA_TAG: \"${CAA_TAG}\""
|
echo "CAA_IMAGE=\"${CAA_IMAGE}\""
|
||||||
echo "PP_IMAGE_ID: \"${PP_IMAGE_ID}\""
|
echo "CAA_TAG=\"${CAA_TAG}\""
|
||||||
|
echo "PP_IMAGE_ID=\"${PP_IMAGE_ID}\""
|
||||||
|
|
||||||
# Clone and configure caa
|
# Clone and configure caa
|
||||||
git clone --depth 1 --no-checkout https://github.com/confidential-containers/cloud-api-adaptor.git
|
git_sparse_clone "https://github.com/confidential-containers/cloud-api-adaptor.git" "${CAA_GIT_SHA:-main}" "src/cloud-api-adaptor/install/"
|
||||||
pushd cloud-api-adaptor
|
echo "CAA_GIT_SHA=\"$(git rev-parse HEAD)\""
|
||||||
git sparse-checkout init --cone
|
|
||||||
git sparse-checkout set src/cloud-api-adaptor/install/
|
|
||||||
git checkout
|
|
||||||
echo "CAA_GIT_SHA: \"$(git rev-parse HEAD)\""
|
|
||||||
pushd src/cloud-api-adaptor
|
pushd src/cloud-api-adaptor
|
||||||
cat <<EOF > install/overlays/azure/workload-identity.yaml
|
cat <<EOF > install/overlays/azure/workload-identity.yaml
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -208,12 +242,8 @@ echo "AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}" >> install/overlays/azure/serv
|
|||||||
echo "AZURE_TENANT_ID=${AZURE_TENANT_ID}" >> install/overlays/azure/service-principal.env
|
echo "AZURE_TENANT_ID=${AZURE_TENANT_ID}" >> install/overlays/azure/service-principal.env
|
||||||
|
|
||||||
# Deploy Operator
|
# Deploy Operator
|
||||||
git clone --depth 1 --no-checkout https://github.com/confidential-containers/operator
|
git_sparse_clone "https://github.com/confidential-containers/operator" "${OPERATOR_SHA:-main}" "config/"
|
||||||
pushd operator
|
echo "OPERATOR_SHA=\"$(git rev-parse HEAD)\""
|
||||||
git sparse-checkout init --cone
|
|
||||||
git sparse-checkout set "config/"
|
|
||||||
git checkout
|
|
||||||
echo "OPERATOR_SHA: \"$(git rev-parse HEAD)\""
|
|
||||||
oc apply -k "config/release"
|
oc apply -k "config/release"
|
||||||
oc apply -k "config/samples/ccruntime/peer-pods"
|
oc apply -k "config/samples/ccruntime/peer-pods"
|
||||||
popd
|
popd
|
||||||
@@ -227,7 +257,7 @@ popd
|
|||||||
SECONDS=0
|
SECONDS=0
|
||||||
( while [[ "${SECONDS}" -lt 360 ]]; do
|
( while [[ "${SECONDS}" -lt 360 ]]; do
|
||||||
kubectl get runtimeclass | grep -q kata-remote && exit 0
|
kubectl get runtimeclass | grep -q kata-remote && exit 0
|
||||||
done; exit 1 ) || { echo "kata-remote runtimeclass not initialized in 60s"; kubectl -n confidential-containers-system get all; echo; echo CAA; kubectl -n confidential-containers-system logs daemonset.apps/cloud-api-adaptor-daemonset; echo pre-install; kubectl -n confidential-containers-system logs daemonset.apps/cc-operator-pre-install-daemon; echo install; kubectl -n confidential-containers-system logs daemonset.apps/cc-operator-daemon-install; exit 1; }
|
done; exit 1 ) || { echo "kata-remote runtimeclass not initialized in 60s"; kubectl -n confidential-containers-system get all; echo; echo "kubectl -n confidential-containers-system describe all"; kubectl -n confidential-containers-system describe all; echo; echo CAA; kubectl -n confidential-containers-system logs daemonset.apps/cloud-api-adaptor-daemonset; echo pre-install; kubectl -n confidential-containers-system logs daemonset.apps/cc-operator-pre-install-daemon; echo install; kubectl -n confidential-containers-system logs daemonset.apps/cc-operator-daemon-install; exit 1; }
|
||||||
|
|
||||||
|
|
||||||
################
|
################
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ You can build and install the guest kernel image as shown [here](../tools/packag
|
|||||||
# Install a hypervisor
|
# Install a hypervisor
|
||||||
|
|
||||||
When setting up Kata using a [packaged installation method](install/README.md#installing-on-a-linux-system), the
|
When setting up Kata using a [packaged installation method](install/README.md#installing-on-a-linux-system), the
|
||||||
`QEMU` VMM is installed automatically. Cloud-Hypervisor, Firecracker and StratoVirt VMMs are available from the [release tarballs](https://github.com/kata-containers/kata-containers/releases), as well as through [`kata-deploy`](../tools/packaging/kata-deploy/README.md).
|
`QEMU` VMM is installed automatically. Cloud-Hypervisor, Firecracker and StratoVirt VMMs are available from the [release tarballs](https://github.com/kata-containers/kata-containers/releases), as well as through [`kata-deploy`](../tools/packaging/kata-deploy/helm-chart/README.md).
|
||||||
You may choose to manually build your VMM/hypervisor.
|
You may choose to manually build your VMM/hypervisor.
|
||||||
|
|
||||||
## Build a custom QEMU
|
## Build a custom QEMU
|
||||||
|
|||||||
@@ -166,19 +166,26 @@ moment.
|
|||||||
See [this issue](https://github.com/kata-containers/runtime/issues/2812) for more details.
|
See [this issue](https://github.com/kata-containers/runtime/issues/2812) for more details.
|
||||||
[Another issue](https://github.com/kata-containers/kata-containers/issues/1728) focuses on the case of `emptyDir`.
|
[Another issue](https://github.com/kata-containers/kata-containers/issues/1728) focuses on the case of `emptyDir`.
|
||||||
|
|
||||||
|
### Kubernetes [hostPath][k8s-hostpath] volumes
|
||||||
|
|
||||||
|
When the source path of a hostPath volume is under `/dev`, and the path
|
||||||
|
either corresponds to a host device or is not accessible by the Kata
|
||||||
|
shim, the Kata agent bind mounts the source path directly from the
|
||||||
|
*guest* filesystem into the container.
|
||||||
|
|
||||||
|
[k8s-hostpath]: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
|
||||||
|
|
||||||
## Host resource sharing
|
## Host resource sharing
|
||||||
|
|
||||||
### Privileged containers
|
### Privileged containers
|
||||||
|
|
||||||
Privileged support in Kata is essentially different from `runc` containers.
|
Privileged support in Kata is essentially different from `runc` containers.
|
||||||
The container runs with elevated capabilities within the guest and is granted
|
The container runs with elevated capabilities within the guest.
|
||||||
access to guest devices instead of the host devices.
|
|
||||||
This is also true with using `securityContext privileged=true` with Kubernetes.
|
This is also true with using `securityContext privileged=true` with Kubernetes.
|
||||||
|
|
||||||
The container may also be granted full access to a subset of host devices
|
Importantly, the default behavior to pass the host devices to a
|
||||||
(https://github.com/kata-containers/runtime/issues/1568).
|
privileged container is not supported in Kata Containers and needs to be
|
||||||
|
disabled, see [Privileged Kata Containers](how-to/privileged.md).
|
||||||
See [Privileged Kata Containers](how-to/privileged.md) for how to configure some of this behavior.
|
|
||||||
|
|
||||||
# Appendices
|
# Appendices
|
||||||
|
|
||||||
|
|||||||
@@ -48,3 +48,4 @@
|
|||||||
- [How to use the Kata Agent Policy](how-to-use-the-kata-agent-policy.md)
|
- [How to use the Kata Agent Policy](how-to-use-the-kata-agent-policy.md)
|
||||||
- [How to pull images in the guest](how-to-pull-images-in-guest-with-kata.md)
|
- [How to pull images in the guest](how-to-pull-images-in-guest-with-kata.md)
|
||||||
- [How to use mem-agent to decrease the memory usage of Kata container](how-to-use-memory-agent.md)
|
- [How to use mem-agent to decrease the memory usage of Kata container](how-to-use-memory-agent.md)
|
||||||
|
- [How to use seccomp with runtime-rs](how-to-use-seccomp-with-runtime-rs.md)
|
||||||
@@ -89,16 +89,16 @@ However, if any of these components are absent, they must be built from the
|
|||||||
$ # Assume that the project is cloned at $GOPATH/src/github.com/kata-containers
|
$ # Assume that the project is cloned at $GOPATH/src/github.com/kata-containers
|
||||||
$ cd $GOPATH/src/github.com/kata-containers/kata-containers
|
$ cd $GOPATH/src/github.com/kata-containers/kata-containers
|
||||||
$ make rootfs-initrd-confidential-tarball
|
$ make rootfs-initrd-confidential-tarball
|
||||||
$ tar -tf build/kata-static-kernel-confidential.tar.xz | grep vmlinuz
|
$ tar --zstd -tf build/kata-static-kernel-confidential.tar.zst | grep vmlinuz
|
||||||
./opt/kata/share/kata-containers/vmlinuz-confidential.container
|
./opt/kata/share/kata-containers/vmlinuz-confidential.container
|
||||||
./opt/kata/share/kata-containers/vmlinuz-6.7-136-confidential
|
./opt/kata/share/kata-containers/vmlinuz-6.7-136-confidential
|
||||||
$ kernel_version=6.7-136
|
$ kernel_version=6.7-136
|
||||||
$ tar -tf build/kata-static-rootfs-initrd-confidential.tar.xz | grep initrd
|
$ tar --zstd -tf build/kata-static-rootfs-initrd-confidential.tar.zst | grep initrd
|
||||||
./opt/kata/share/kata-containers/kata-containers-initrd-confidential.img
|
./opt/kata/share/kata-containers/kata-containers-initrd-confidential.img
|
||||||
./opt/kata/share/kata-containers/kata-ubuntu-20.04-confidential.initrd
|
./opt/kata/share/kata-containers/kata-ubuntu-20.04-confidential.initrd
|
||||||
$ mkdir artifacts
|
$ mkdir artifacts
|
||||||
$ tar -xvf build/kata-static-kernel-confidential.tar.xz -C artifacts ./opt/kata/share/kata-containers/vmlinuz-${kernel_version}-confidential
|
$ tar --zstd -xvf build/kata-static-kernel-confidential.tar.zst -C artifacts ./opt/kata/share/kata-containers/vmlinuz-${kernel_version}-confidential
|
||||||
$ tar -xvf build/kata-static-rootfs-initrd-confidential.tar.xz -C artifacts ./opt/kata/share/kata-containers/kata-ubuntu-20.04-confidential.initrd
|
$ tar --zstd -xvf build/kata-static-rootfs-initrd-confidential.tar.zst -C artifacts ./opt/kata/share/kata-containers/kata-ubuntu-20.04-confidential.initrd
|
||||||
$ ls artifacts/opt/kata/share/kata-containers/
|
$ ls artifacts/opt/kata/share/kata-containers/
|
||||||
kata-ubuntu-20.04-confidential.initrd vmlinuz-${kernel_version}-confidential
|
kata-ubuntu-20.04-confidential.initrd vmlinuz-${kernel_version}-confidential
|
||||||
```
|
```
|
||||||
@@ -190,8 +190,8 @@ can be easily accomplished by issuing the following make target:
|
|||||||
$ cd $GOPATH/src/github.com/kata-containers/kata-containers
|
$ cd $GOPATH/src/github.com/kata-containers/kata-containers
|
||||||
$ mkdir hkd_dir && cp $host_key_document hkd_dir
|
$ mkdir hkd_dir && cp $host_key_document hkd_dir
|
||||||
$ HKD_PATH=hkd_dir SE_KERNEL_PARAMS="agent.log=debug" make boot-image-se-tarball
|
$ HKD_PATH=hkd_dir SE_KERNEL_PARAMS="agent.log=debug" make boot-image-se-tarball
|
||||||
$ ls build/kata-static-boot-image-se.tar.xz
|
$ ls build/kata-static-boot-image-se.tar.zst
|
||||||
build/kata-static-boot-image-se.tar.xz
|
build/kata-static-boot-image-se.tar.zst
|
||||||
```
|
```
|
||||||
|
|
||||||
`SE_KERNEL_PARAMS` could be used to add any extra kernel parameters. If no additional kernel configuration is required, this can be omitted.
|
`SE_KERNEL_PARAMS` could be used to add any extra kernel parameters. If no additional kernel configuration is required, this can be omitted.
|
||||||
@@ -318,7 +318,7 @@ Finally, an operational kata container with IBM Secure Execution is now running.
|
|||||||
|
|
||||||
It is reasonable to expect that the manual steps mentioned above can be easily executed.
|
It is reasonable to expect that the manual steps mentioned above can be easily executed.
|
||||||
Typically, you can use
|
Typically, you can use
|
||||||
[kata-deploy](https://github.com/kata-containers/kata-containers/blob/main/tools/packaging/kata-deploy/README.md)
|
[kata-deploy](https://github.com/kata-containers/kata-containers/blob/main/tools/packaging/kata-deploy/helm-chart/README.md)
|
||||||
to install Kata Containers on a Kubernetes cluster. However, when leveraging IBM Secure Execution,
|
to install Kata Containers on a Kubernetes cluster. However, when leveraging IBM Secure Execution,
|
||||||
you need to employ the confidential container's
|
you need to employ the confidential container's
|
||||||
[operator](https://github.com/confidential-containers/operator).
|
[operator](https://github.com/confidential-containers/operator).
|
||||||
@@ -344,18 +344,18 @@ $ make virtiofsd-tarball
|
|||||||
$ make shim-v2-tarball
|
$ make shim-v2-tarball
|
||||||
$ mkdir kata-artifacts
|
$ mkdir kata-artifacts
|
||||||
$ build_dir=$(readlink -f build)
|
$ build_dir=$(readlink -f build)
|
||||||
$ cp -r $build_dir/*.tar.xz kata-artifacts
|
$ cp -r $build_dir/*.tar.zst kata-artifacts
|
||||||
$ ls -1 kata-artifacts
|
$ ls -1 kata-artifacts
|
||||||
kata-static-agent.tar.xz
|
kata-static-agent.tar.zst
|
||||||
kata-static-boot-image-se.tar.xz
|
kata-static-boot-image-se.tar.zst
|
||||||
kata-static-coco-guest-components.tar.xz
|
kata-static-coco-guest-components.tar.zst
|
||||||
kata-static-kernel-confidential-modules.tar.xz
|
kata-static-kernel-confidential-modules.tar.zst
|
||||||
kata-static-kernel-confidential.tar.xz
|
kata-static-kernel-confidential.tar.zst
|
||||||
kata-static-pause-image.tar.xz
|
kata-static-pause-image.tar.zst
|
||||||
kata-static-qemu.tar.xz
|
kata-static-qemu.tar.zst
|
||||||
kata-static-rootfs-initrd-confidential.tar.xz
|
kata-static-rootfs-initrd-confidential.tar.zst
|
||||||
kata-static-shim-v2.tar.xz
|
kata-static-shim-v2.tar.zst
|
||||||
kata-static-virtiofsd.tar.xz
|
kata-static-virtiofsd.tar.zst
|
||||||
$ ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts
|
$ ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ command before running `kata-deploy-merge-builds.sh`:
|
|||||||
$ make rootfs-image-tarball
|
$ make rootfs-image-tarball
|
||||||
```
|
```
|
||||||
|
|
||||||
At this point, you should have an archive file named `kata-static.tar.xz` at the project root,
|
At this point, you should have an archive file named `kata-static.tar.zst` at the project root,
|
||||||
which will be used to build a payload image. If you are using a local container registry at
|
which will be used to build a payload image. If you are using a local container registry at
|
||||||
`localhost:5000`, proceed with the following:
|
`localhost:5000`, proceed with the following:
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ Build and push a payload image with the name `localhost:5000/build-kata-deploy`
|
|||||||
`latest` using the following:
|
`latest` using the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh kata-static.tar.xz localhost:5000/build-kata-deploy latest
|
$ ./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh kata-static.tar.zst localhost:5000/build-kata-deploy latest
|
||||||
... logs ...
|
... logs ...
|
||||||
Pushing the image localhost:5000/build-kata-deploy:latest to the registry
|
Pushing the image localhost:5000/build-kata-deploy:latest to the registry
|
||||||
The push refers to repository [localhost:5000/build-kata-deploy]
|
The push refers to repository [localhost:5000/build-kata-deploy]
|
||||||
|
|||||||
44
docs/how-to/how-to-use-seccomp-with-runtime-rs.md
Normal file
44
docs/how-to/how-to-use-seccomp-with-runtime-rs.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
## Introduction
|
||||||
|
|
||||||
|
To enhance security, Kata Containers supports using seccomp to restrict the hypervisor's system calls. Previously, this was only supported for a subset of hypervisors in runtime-go. Now, the runtime-rs also supports seccomp. This document describes how to enable/disable the seccomp feature for the corresponding hypervisor in runtime-rs.
|
||||||
|
|
||||||
|
## Pre-requisites
|
||||||
|
|
||||||
|
1. Ensure your system's kernel supports **seccomp**.
|
||||||
|
2. Confirm that each of the following virtual machines can run correctly on your system.
|
||||||
|
|
||||||
|
## Configure seccomp
|
||||||
|
|
||||||
|
With the exception of `qemu`, seccomp is enabled by default for all other supported hypervisors. Their corresponding built-in functionalities are also enabled by default.
|
||||||
|
|
||||||
|
### QEMU
|
||||||
|
|
||||||
|
As with runtime-go, you need to modify the following in your **configuration file**. These parameters will be passed directly to the `qemu` startup command line. For more details on the parameters, you can refer to: [https://www.qemu.org/docs/master/system/qemu-manpage.html](https://www.qemu.org/docs/master/system/qemu-manpage.html)
|
||||||
|
|
||||||
|
``` toml
|
||||||
|
# Qemu seccomp sandbox feature
|
||||||
|
# comma-separated list of seccomp sandbox features to control the syscall access.
|
||||||
|
# For example, `seccompsandbox= "on,obsolete=deny,spawn=deny,resourcecontrol=deny"`
|
||||||
|
# Note: "elevateprivileges=deny" doesn't work with daemonize option, so it's removed from the seccomp sandbox
|
||||||
|
# Another note: enabling this feature may reduce performance, you may enable
|
||||||
|
# /proc/sys/net/core/bpf_jit_enable to reduce the impact. see https://man7.org/linux/man-pages/man8/bpfc.8.html
|
||||||
|
seccompsandbox="on,obsolete=deny,spawn=deny,resourcecontrol=deny"
|
||||||
|
```
|
||||||
|
### Cloud Hypervisor, Firecracker and Dragonball
|
||||||
|
|
||||||
|
The **seccomp** functionality is enabled by default for the following three hypervisors: `cloud hypervisor`, `firecracker`, and `dragonball`.
|
||||||
|
|
||||||
|
The seccomp rules for `cloud hypervisor` and `firecracker` are built directly into their executable files. For `dragonball`, the relevant configuration is currently located at `src/runtime-rs/crates/hypervisor/src/dragonball/seccomp.rs`.
|
||||||
|
|
||||||
|
To disable this functionality for these hypervisors, you can modify the following configuration options in your **configuration file**.
|
||||||
|
|
||||||
|
``` toml
|
||||||
|
# Disable the 'seccomp' feature from Cloud Hypervisor, firecracker or dragonball, default false
|
||||||
|
disable_seccomp = true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Implementation details
|
||||||
|
|
||||||
|
For `qemu`, `cloud hypervisor`, and `firecracker`, their **seccomp** functionality is built into the respective executable files you are using. **runtime-rs** simply provides command-line arguments for their launch based on the configuration file.
|
||||||
|
|
||||||
|
For `dragonball`, a set of allowed system calls is currently provided for the entire **runtime-rs** process, and the process is prevented from using any system calls outside of this whitelist. As mentioned above, this set is located at `src/runtime-rs/crates/hypervisor/src/dragonball/seccomp.rs`.
|
||||||
@@ -32,11 +32,24 @@ Kubernetes users can encode in `base64` format their Policy documents, and add t
|
|||||||
|
|
||||||
### Encode a Policy file
|
### Encode a Policy file
|
||||||
|
|
||||||
For example, the [`allow-all-except-exec-process.rego`](../../src/kata-opa/allow-all-except-exec-process.rego) sample policy file is different from the [default Policy](../../src/kata-opa/allow-all.rego) because it rejects any `ExecProcess` requests. You can encode this policy file:
|
For example, the [`allow-all-except-exec-process.rego`](../../src/kata-opa/allow-all-except-exec-process.rego) sample policy file is different from the [default Policy](../../src/kata-opa/allow-all.rego) because it rejects any `ExecProcess` requests. To encode this policy file, you need to:
|
||||||
|
- Embed the policy inside an init data struct
|
||||||
|
- Compress
|
||||||
|
- Base64 encode
|
||||||
|
For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ base64 -w 0 allow-all-except-exec-process.rego
|
$ STRING="$(< allow-all-except-exec-process.rego)"
|
||||||
cGFja2FnZSBhZ2VudF9wb2xpY3kKCmRlZmF1bHQgQWRkQVJQTmVpZ2hib3JzUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgQWRkU3dhcFJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IENsb3NlU3RkaW5SZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBDb3B5RmlsZVJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IENyZWF0ZUNvbnRhaW5lclJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IENyZWF0ZVNhbmRib3hSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBEZXN0cm95U2FuZGJveFJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IEdldE1ldHJpY3NSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBHZXRPT01FdmVudFJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IEd1ZXN0RGV0YWlsc1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IExpc3RJbnRlcmZhY2VzUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgTGlzdFJvdXRlc1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IE1lbUhvdHBsdWdCeVByb2JlUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgT25saW5lQ1BVTWVtUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUGF1c2VDb250YWluZXJSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBQdWxsSW1hZ2VSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBSZWFkU3RyZWFtUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVtb3ZlQ29udGFpbmVyUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVtb3ZlU3RhbGVWaXJ0aW9mc1NoYXJlTW91bnRzUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVzZWVkUmFuZG9tRGV2UmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVzdW1lQ29udGFpbmVyUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgU2V0R3Vlc3REYXRlVGltZVJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFNldFBvbGljeVJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFNpZ25hbFByb2Nlc3NSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBTdGFydENvbnRhaW5lclJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFN0YXJ0VHJhY2luZ1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFN0YXRzQ29udGFpbmVyUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgU3RvcFRyYWNpbmdSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBUdHlXaW5SZXNpemVSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVDb250YWluZXJSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVFcGhlbWVyYWxNb3VudHNSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVJbnRlcmZhY2VSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVSb3V0ZXNSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBXYWl0UHJvY2Vzc1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFdyaXRlU3RyZWFtUmVxdWVzdCA6PSB0cnVlCgpkZWZhdWx0IEV4ZWNQcm9jZXNzUmVxdWVzdCA6PSBmYWxzZQo=
|
$ cat <<EOF | gzip -c | base64 -w0
|
||||||
|
version = "0.1.0"
|
||||||
|
algorithm = "sha256"
|
||||||
|
|
||||||
|
[data]
|
||||||
|
"policy.rego" = '''
|
||||||
|
$STRING
|
||||||
|
'''
|
||||||
|
EOF
|
||||||
|
H4sIAAAAAAAAA42UTW/TQBCG7/4Vq/QQOCQKQXCo1ENIAkRqiGWnpBJCaGKP7RXrXTM7DnV/PRMiVUh07R582J3H8/XO7AnJa2fVjRrNpm+ms1EEpnSkuarPd76C+bv3oyj6lgPD92jUOKOzbkpYupEA4/E4ulJL13Sky4rVq+y1ms/mb9VWZ+S8K1iM1DgClijRlcBpvLqf3OoMrcfJJkfLutBI12rRQFbhZD6dCRfJ4SeUqOSz/OMSNopyLKA1rBZ5vkjiLyhBj458gr9a9KyubxRTi/9i6W9oQualcR5TzrUNElLZR20waCcExqWzDNoi9WMp2PzoHkLQSi7JdQPUJ+QtMuksWLQQu912fZK+BZHz7QolaRN0c6s9bywjFZBhL5W4lsPEFuvPjhvTlh+6mNwx2MudNdLDZXwnf4SYGFo/3O64NWZTy+SEgAQhT1lECQZKsHan4UgXLGUw+FWTzHjh0woIt661HGxJgh4xT0RoV6/w1IO19XAOKfJFTxmxva6DRQsX/12jIKBLC0Y0Er2DuUutxMM5nak9QaZt2cOwf4En1ww42nN3OK+w14/B4u+a/CWLesHWTYU1Eph+GS/w0470Y/1LcgDNA40/yKOMzw/tE7N+wOx/NwUYj9H5qf4DsX93tO4FAAA=
|
||||||
```
|
```
|
||||||
|
|
||||||
### Attach the Policy to a pod
|
### Attach the Policy to a pod
|
||||||
@@ -49,7 +62,7 @@ kind: Pod
|
|||||||
metadata:
|
metadata:
|
||||||
name: policy-exec-rejected
|
name: policy-exec-rejected
|
||||||
annotations:
|
annotations:
|
||||||
io.katacontainers.config.agent.policy: cGFja2FnZSBhZ2VudF9wb2xpY3kKCmRlZmF1bHQgQWRkQVJQTmVpZ2hib3JzUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgQWRkU3dhcFJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IENsb3NlU3RkaW5SZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBDb3B5RmlsZVJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IENyZWF0ZUNvbnRhaW5lclJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IENyZWF0ZVNhbmRib3hSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBEZXN0cm95U2FuZGJveFJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IEdldE1ldHJpY3NSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBHZXRPT01FdmVudFJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IEd1ZXN0RGV0YWlsc1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IExpc3RJbnRlcmZhY2VzUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgTGlzdFJvdXRlc1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IE1lbUhvdHBsdWdCeVByb2JlUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgT25saW5lQ1BVTWVtUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUGF1c2VDb250YWluZXJSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBQdWxsSW1hZ2VSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBSZWFkU3RyZWFtUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVtb3ZlQ29udGFpbmVyUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVtb3ZlU3RhbGVWaXJ0aW9mc1NoYXJlTW91bnRzUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVzZWVkUmFuZG9tRGV2UmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgUmVzdW1lQ29udGFpbmVyUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgU2V0R3Vlc3REYXRlVGltZVJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFNldFBvbGljeVJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFNpZ25hbFByb2Nlc3NSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBTdGFydENvbnRhaW5lclJlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFN0YXJ0VHJhY2luZ1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFN0YXRzQ29udGFpbmVyUmVxdWVzdCA6PSB0cnVlCmRlZmF1bHQgU3RvcFRyYWNpbmdSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBUdHlXaW5SZXNpemVSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVDb250YWluZXJSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVFcGhlbWVyYWxNb3VudHNSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVJbnRlcmZhY2VSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBVcGRhdGVSb3V0ZXNSZXF1ZXN0IDo9IHRydWUKZGVmYXVsdCBXYWl0UHJvY2Vzc1JlcXVlc3QgOj0gdHJ1ZQpkZWZhdWx0IFdyaXRlU3RyZWFtUmVxdWVzdCA6PSB0cnVlCgpkZWZhdWx0IEV4ZWNQcm9jZXNzUmVxdWVzdCA6PSBmYWxzZQo=
|
io.katacontainers.config.hypervisor.cc_init_data: H4sIAAAAAAAAA42UTW/TQBCG7/4Vq/QQOCQKQXCo1ENIAkRqiGWnpBJCaGKP7RXrXTM7DnV/PRMiVUh07R582J3H8/XO7AnJa2fVjRrNpm+ms1EEpnSkuarPd76C+bv3oyj6lgPD92jUOKOzbkpYupEA4/E4ulJL13Sky4rVq+y1ms/mb9VWZ+S8K1iM1DgClijRlcBpvLqf3OoMrcfJJkfLutBI12rRQFbhZD6dCRfJ4SeUqOSz/OMSNopyLKA1rBZ5vkjiLyhBj458gr9a9KyubxRTi/9i6W9oQualcR5TzrUNElLZR20waCcExqWzDNoi9WMp2PzoHkLQSi7JdQPUJ+QtMuksWLQQu912fZK+BZHz7QolaRN0c6s9bywjFZBhL5W4lsPEFuvPjhvTlh+6mNwx2MudNdLDZXwnf4SYGFo/3O64NWZTy+SEgAQhT1lECQZKsHan4UgXLGUw+FWTzHjh0woIt661HGxJgh4xT0RoV6/w1IO19XAOKfJFTxmxva6DRQsX/12jIKBLC0Y0Er2DuUutxMM5nak9QaZt2cOwf4En1ww42nN3OK+w14/B4u+a/CWLesHWTYU1Eph+GS/w0470Y/1LcgDNA40/yKOMzw/tE7N+wOx/NwUYj9H5qf4DsX93tO4FAAA=
|
||||||
spec:
|
spec:
|
||||||
runtimeClassName: kata
|
runtimeClassName: kata
|
||||||
containers:
|
containers:
|
||||||
@@ -66,7 +79,7 @@ Create the pod:
|
|||||||
$ kubectl apply -f pod1.yaml
|
$ kubectl apply -f pod1.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
While creating the Pod sandbox, the Kata Shim will notice the `io.katacontainers.config.agent.policy` annotation and will send the Policy document to the Kata Agent - by sending a `SetPolicy` request. Note that this request will fail if the default Policy, included in the Guest image, doesn't allow this `SetPolicy` request. If the `SetPolicy` request is rejected by the Guest, the Kata Shim will fail to start the Pod sandbox.
|
While creating the Pod sandbox, the Kata Shim will notice the `io.katacontainers.config.hypervisor.cc_init_data` annotation and will create the init data device on the host and mount it on the guest as a block device. The agent then reads the init data struct from this device and sets the policy if present.
|
||||||
|
|
||||||
# How is the Policy being enforced?
|
# How is the Policy being enforced?
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ Container deployments utilize explicit or implicit file sharing between host fil
|
|||||||
|
|
||||||
As of the 2.0 release of Kata Containers, [virtio-fs](https://virtio-fs.gitlab.io/) is the default filesystem sharing mechanism.
|
As of the 2.0 release of Kata Containers, [virtio-fs](https://virtio-fs.gitlab.io/) is the default filesystem sharing mechanism.
|
||||||
|
|
||||||
virtio-fs support works out of the box for `cloud-hypervisor` and `qemu`, when Kata Containers is deployed using `kata-deploy`. Learn more about `kata-deploy` and how to use `kata-deploy` in Kubernetes [here](../../tools/packaging/kata-deploy/README.md#kubernetes-quick-start).
|
virtio-fs support works out of the box for `cloud-hypervisor` and `qemu`, when Kata Containers is deployed using `kata-deploy`. Learn more about `kata-deploy` and how to use `kata-deploy` in Kubernetes [here](../../tools/packaging/kata-deploy/helm-chart/README.md).
|
||||||
|
|||||||
@@ -1,22 +1,25 @@
|
|||||||
# Privileged Kata Containers
|
# Privileged Kata Containers
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Whilst this functionality is supported, it can decrease the security of Kata Containers if not configured correctly.
|
||||||
|
|
||||||
Kata Containers supports creation of containers that are "privileged" (i.e. have additional capabilities and access
|
Kata Containers supports creation of containers that are "privileged" (i.e. have additional capabilities and access
|
||||||
that is not normally granted).
|
that is not normally granted).
|
||||||
|
|
||||||
## Warnings
|
## Enabling privileged containers without host devices
|
||||||
|
|
||||||
**Warning:** Whilst this functionality is supported, it can decrease the security of Kata Containers if not configured
|
> [!TIP]
|
||||||
correctly.
|
> When Kata Containers is installed through
|
||||||
|
> [kata-deploy](/tools/packaging/kata-deploy/helm-chart/README.md#kata-deploy-helm-chart), this mitigation is configured
|
||||||
|
> out of the box, hence there is no action required in that case.
|
||||||
|
|
||||||
### Host Devices
|
By default, a privileged container attempts to expose all devices from the host. This is generally not supported in Kata
|
||||||
|
Containers as the container is running a different kernel than the host.
|
||||||
|
|
||||||
By default, when privileged is enabled for a container, all the `/dev/*` block devices from the host are mounted
|
Instead, the following sections document how to disable this behavior in different container runtimes. Note that this
|
||||||
into the guest. This will allow the privileged container inside the Kata guest to gain access to mount any block device
|
mitigation does not affect a container's ability to mount *guest* devices.
|
||||||
from the host, a potentially undesirable side-effect that decreases the security of Kata.
|
|
||||||
|
|
||||||
The following sections document how to configure this behavior in different container runtimes.
|
## Containerd
|
||||||
|
|
||||||
#### Containerd
|
|
||||||
|
|
||||||
The Containerd allows configuring the privileged host devices behavior for each runtime in the containerd config. This is
|
The Containerd allows configuring the privileged host devices behavior for each runtime in the containerd config. This is
|
||||||
done with the `privileged_without_host_devices` option. Setting this to `true` will disable hot plugging of the host
|
done with the `privileged_without_host_devices` option. Setting this to `true` will disable hot plugging of the host
|
||||||
@@ -43,7 +46,7 @@ See below example config:
|
|||||||
- [How to use Kata Containers and containerd with Kubernetes](how-to-use-k8s-with-containerd-and-kata.md)
|
- [How to use Kata Containers and containerd with Kubernetes](how-to-use-k8s-with-containerd-and-kata.md)
|
||||||
- [Containerd CRI config documentation](https://github.com/containerd/containerd/blob/main/docs/cri/config.md)
|
- [Containerd CRI config documentation](https://github.com/containerd/containerd/blob/main/docs/cri/config.md)
|
||||||
|
|
||||||
#### CRI-O
|
## CRI-O
|
||||||
|
|
||||||
Similar to containerd, CRI-O allows configuring the privileged host devices
|
Similar to containerd, CRI-O allows configuring the privileged host devices
|
||||||
behavior for each runtime in the CRI config. This is done with the
|
behavior for each runtime in the CRI config. This is done with the
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ architectures:
|
|||||||
|
|
||||||
### Kata Deploy Installation
|
### Kata Deploy Installation
|
||||||
|
|
||||||
Follow the [`kata-deploy`](../../tools/packaging/kata-deploy/README.md).
|
Follow the [`kata-deploy`](../../tools/packaging/kata-deploy/helm-chart/README.md).
|
||||||
### Official packages
|
### Official packages
|
||||||
`ToDo`
|
`ToDo`
|
||||||
### Automatic Installation
|
### Automatic Installation
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ You might need to disable Docker before initializing Kubernetes. Be aware
|
|||||||
that the OpenSSL container image built above will need to be exported from
|
that the OpenSSL container image built above will need to be exported from
|
||||||
Docker and imported into containerd.
|
Docker and imported into containerd.
|
||||||
|
|
||||||
If Kata is installed through [`kata-deploy`](../../tools/packaging/kata-deploy/README.md)
|
If Kata is installed through [`kata-deploy`](../../tools/packaging/kata-deploy/helm-chart/README.md)
|
||||||
there will be multiple `configuration.toml` files associated with different
|
there will be multiple `configuration.toml` files associated with different
|
||||||
hypervisors. Rather than add in the custom Kata kernel, Kata rootfs, and
|
hypervisors. Rather than add in the custom Kata kernel, Kata rootfs, and
|
||||||
kernel modules to each `configuration.toml` as the default, instead use
|
kernel modules to each `configuration.toml` as the default, instead use
|
||||||
|
|||||||
172
src/agent/Cargo.lock
generated
172
src/agent/Cargo.lock
generated
@@ -508,6 +508,15 @@ dependencies = [
|
|||||||
"wyz",
|
"wyz",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-buffer"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-buffer"
|
name = "block-buffer"
|
||||||
version = "0.10.4"
|
version = "0.10.4"
|
||||||
@@ -656,30 +665,6 @@ dependencies = [
|
|||||||
"shlex",
|
"shlex",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cdi"
|
|
||||||
version = "0.1.0"
|
|
||||||
source = "git+https://github.com/cncf-tags/container-device-interface-rs?rev=3b1e83dda5efcc83c7a4f134466ec006b37109c9#3b1e83dda5efcc83c7a4f134466ec006b37109c9"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"clap",
|
|
||||||
"const_format",
|
|
||||||
"jsonschema",
|
|
||||||
"lazy_static",
|
|
||||||
"libc",
|
|
||||||
"nix 0.24.3",
|
|
||||||
"notify",
|
|
||||||
"oci-spec",
|
|
||||||
"once_cell",
|
|
||||||
"path-clean",
|
|
||||||
"regex",
|
|
||||||
"semver",
|
|
||||||
"serde",
|
|
||||||
"serde_derive",
|
|
||||||
"serde_json",
|
|
||||||
"serde_yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@@ -799,6 +784,31 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "container-device-interface"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "653849f0c250f73d9afab4b2a9a6b07adaee1f34c44ffa6f2d2c3f9392002c1a"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"clap",
|
||||||
|
"const_format",
|
||||||
|
"jsonschema",
|
||||||
|
"lazy_static",
|
||||||
|
"libc",
|
||||||
|
"nix 0.24.3",
|
||||||
|
"notify",
|
||||||
|
"oci-spec",
|
||||||
|
"once_cell",
|
||||||
|
"path-clean",
|
||||||
|
"regex",
|
||||||
|
"semver",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"serde_json",
|
||||||
|
"serde_yaml",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation-sys"
|
name = "core-foundation-sys"
|
||||||
version = "0.8.7"
|
version = "0.8.7"
|
||||||
@@ -889,6 +899,16 @@ dependencies = [
|
|||||||
"typenum",
|
"typenum",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crypto-mac"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
"subtle",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling"
|
name = "darling"
|
||||||
version = "0.14.4"
|
version = "0.14.4"
|
||||||
@@ -1033,13 +1053,22 @@ dependencies = [
|
|||||||
"syn 2.0.101",
|
"syn 2.0.101",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "digest"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.10.7"
|
version = "0.10.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer",
|
"block-buffer 0.10.4",
|
||||||
"crypto-common",
|
"crypto-common",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1543,6 +1572,16 @@ version = "0.4.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hmac"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac",
|
||||||
|
"digest 0.9.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "home"
|
name = "home"
|
||||||
version = "0.5.9"
|
version = "0.5.9"
|
||||||
@@ -2011,11 +2050,11 @@ dependencies = [
|
|||||||
"async-trait",
|
"async-trait",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"capctl",
|
"capctl",
|
||||||
"cdi",
|
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cgroups-rs",
|
"cgroups-rs",
|
||||||
"clap",
|
"clap",
|
||||||
"const_format",
|
"const_format",
|
||||||
|
"container-device-interface",
|
||||||
"derivative",
|
"derivative",
|
||||||
"futures",
|
"futures",
|
||||||
"ipnetwork",
|
"ipnetwork",
|
||||||
@@ -2049,7 +2088,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
"sha2",
|
"sha2 0.10.9",
|
||||||
"slog",
|
"slog",
|
||||||
"slog-scope",
|
"slog-scope",
|
||||||
"slog-stdlog",
|
"slog-stdlog",
|
||||||
@@ -2133,7 +2172,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde-enum-str",
|
"serde-enum-str",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2 0.10.9",
|
||||||
"slog",
|
"slog",
|
||||||
"slog-scope",
|
"slog-scope",
|
||||||
"sysinfo",
|
"sysinfo",
|
||||||
@@ -2210,6 +2249,23 @@ version = "0.2.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a7cbbd4ad467251987c6e5b47d53b11a5a05add08f2447a9e2d70aef1e0d138"
|
checksum = "9a7cbbd4ad467251987c6e5b47d53b11a5a05add08f2447a9e2d70aef1e0d138"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libsystemd"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6f4f0b5b062ba67aa075e331de778082c09e66b5ef32970ea5a1e9c37c9555d1"
|
||||||
|
dependencies = [
|
||||||
|
"hmac",
|
||||||
|
"libc",
|
||||||
|
"log",
|
||||||
|
"nix 0.23.2",
|
||||||
|
"once_cell",
|
||||||
|
"serde",
|
||||||
|
"sha2 0.9.9",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"uuid 0.8.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libz-sys"
|
name = "libz-sys"
|
||||||
version = "1.1.22"
|
version = "1.1.22"
|
||||||
@@ -2273,6 +2329,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"slog",
|
"slog",
|
||||||
"slog-async",
|
"slog-async",
|
||||||
|
"slog-journald",
|
||||||
"slog-json",
|
"slog-json",
|
||||||
"slog-scope",
|
"slog-scope",
|
||||||
"slog-term",
|
"slog-term",
|
||||||
@@ -2734,6 +2791,12 @@ version = "1.21.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "opaque-debug"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "opentelemetry"
|
name = "opentelemetry"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
@@ -3498,7 +3561,7 @@ dependencies = [
|
|||||||
"rkyv_derive",
|
"rkyv_derive",
|
||||||
"seahash",
|
"seahash",
|
||||||
"tinyvec",
|
"tinyvec",
|
||||||
"uuid",
|
"uuid 1.16.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3911,7 +3974,20 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest",
|
"digest 0.10.7",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha2"
|
||||||
|
version = "0.9.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.9.0",
|
||||||
|
"cfg-if",
|
||||||
|
"cpufeatures",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"opaque-debug",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3922,7 +3998,7 @@ checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest",
|
"digest 0.10.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3963,12 +4039,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.9"
|
version = "0.4.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
|
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
|
||||||
dependencies = [
|
|
||||||
"autocfg",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slash-formatter"
|
name = "slash-formatter"
|
||||||
@@ -3994,6 +4067,16 @@ dependencies = [
|
|||||||
"thread_local",
|
"thread_local",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "slog-journald"
|
||||||
|
version = "2.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "83e14eb8c2f5d0c8fc9fbac40e6391095e4dc5cb334f7dce99c75cb1919eb39c"
|
||||||
|
dependencies = [
|
||||||
|
"libsystemd",
|
||||||
|
"slog",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slog-json"
|
name = "slog-json"
|
||||||
version = "2.6.1"
|
version = "2.6.1"
|
||||||
@@ -4133,6 +4216,12 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "subtle"
|
||||||
|
version = "2.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.109"
|
version = "1.0.109"
|
||||||
@@ -4694,6 +4783,15 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "uuid"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.16.0"
|
version = "1.16.0"
|
||||||
@@ -4707,7 +4805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8"
|
checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"outref",
|
"outref",
|
||||||
"uuid",
|
"uuid 1.16.0",
|
||||||
"vsimd",
|
"vsimd",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,12 @@ lazy_static = "1.3.0"
|
|||||||
ttrpc = { version = "0.8.4", features = ["async"], default-features = false }
|
ttrpc = { version = "0.8.4", features = ["async"], default-features = false }
|
||||||
protobuf = "3.7.2"
|
protobuf = "3.7.2"
|
||||||
libc = "0.2.94"
|
libc = "0.2.94"
|
||||||
# Notes: nix needs to stay in sync with libs
|
|
||||||
|
# Notes:
|
||||||
|
# - Needs to stay in sync with libs
|
||||||
|
# - Upgrading to 0.27+ will require code changes (see #11842)
|
||||||
nix = "0.26.4"
|
nix = "0.26.4"
|
||||||
|
|
||||||
capctl = "0.2.0"
|
capctl = "0.2.0"
|
||||||
scan_fmt = "0.2.6"
|
scan_fmt = "0.2.6"
|
||||||
scopeguard = "1.0.0"
|
scopeguard = "1.0.0"
|
||||||
@@ -84,7 +88,7 @@ vsock-exporter = { path = "vsock-exporter" }
|
|||||||
mem-agent = { path = "../mem-agent", package = "mem-agent-lib" }
|
mem-agent = { path = "../mem-agent", package = "mem-agent-lib" }
|
||||||
|
|
||||||
kata-sys-util = { path = "../libs/kata-sys-util" }
|
kata-sys-util = { path = "../libs/kata-sys-util" }
|
||||||
kata-types = { path = "../libs/kata-types" }
|
kata-types = { path = "../libs/kata-types", features = ["safe-path"] }
|
||||||
# Note: this crate sets the slog 'max_*' features which allows the log level
|
# Note: this crate sets the slog 'max_*' features which allows the log level
|
||||||
# to be modified at runtime.
|
# to be modified at runtime.
|
||||||
logging = { path = "../libs/logging" }
|
logging = { path = "../libs/logging" }
|
||||||
@@ -163,9 +167,6 @@ clap.workspace = true
|
|||||||
strum.workspace = true
|
strum.workspace = true
|
||||||
strum_macros.workspace = true
|
strum_macros.workspace = true
|
||||||
|
|
||||||
# Agent Policy
|
|
||||||
cdi = { git = "https://github.com/cncf-tags/container-device-interface-rs", rev = "3b1e83dda5efcc83c7a4f134466ec006b37109c9" }
|
|
||||||
|
|
||||||
# Local dependencies
|
# Local dependencies
|
||||||
kata-agent-policy = { workspace = true, optional = true }
|
kata-agent-policy = { workspace = true, optional = true }
|
||||||
mem-agent.workspace = true
|
mem-agent.workspace = true
|
||||||
@@ -185,6 +186,8 @@ base64 = "0.22"
|
|||||||
sha2 = "0.10.8"
|
sha2 = "0.10.8"
|
||||||
async-compression = { version = "0.4.22", features = ["tokio", "gzip"] }
|
async-compression = { version = "0.4.22", features = ["tokio", "gzip"] }
|
||||||
|
|
||||||
|
container-device-interface = "0.1.0"
|
||||||
|
|
||||||
[target.'cfg(target_arch = "s390x")'.dependencies]
|
[target.'cfg(target_arch = "s390x")'.dependencies]
|
||||||
pv_core = { git = "https://github.com/ibm-s390-linux/s390-tools", rev = "4942504a9a2977d49989a5e5b7c1c8e07dc0fa41", package = "s390_pv_core" }
|
pv_core = { git = "https://github.com/ibm-s390-linux/s390-tools", rev = "4942504a9a2977d49989a5e5b7c1c8e07dc0fa41", package = "s390_pv_core" }
|
||||||
|
|
||||||
|
|||||||
@@ -217,4 +217,11 @@ codecov-html: check_tarpaulin
|
|||||||
|
|
||||||
##TARGET generate-protocols: generate/update grpc agent protocols
|
##TARGET generate-protocols: generate/update grpc agent protocols
|
||||||
generate-protocols:
|
generate-protocols:
|
||||||
|
image=$$(docker build -q \
|
||||||
|
--build-arg GO_VERSION=$$(yq '.languages.golang.version' $(CURDIR)/../../versions.yaml) \
|
||||||
|
--build-arg PROTOC_VERSION=$$(yq '.externals.protoc.version' $(CURDIR)/../../versions.yaml | grep -oE "[0-9.]+") \
|
||||||
|
--build-arg PROTOC_GEN_GO_VERSION=$$(yq '.externals.protoc-gen-go.version' $(CURDIR)/../../versions.yaml) \
|
||||||
|
--build-arg TTRPC_VERSION=$$(yq '.externals.ttrpc.version' $(CURDIR)/../../versions.yaml) \
|
||||||
|
$(CURDIR)/../../tools/packaging/static-build/codegen) && \
|
||||||
|
docker run --rm --workdir /kata/src/agent -v $(CURDIR)/../..:/kata --user $(shell id -u) $$image \
|
||||||
../libs/protocols/hack/update-generated-proto.sh all
|
../libs/protocols/hack/update-generated-proto.sh all
|
||||||
|
|||||||
@@ -1037,6 +1037,12 @@ impl BaseContainer for LinuxContainer {
|
|||||||
let child_stderr: std::process::Stdio;
|
let child_stderr: std::process::Stdio;
|
||||||
|
|
||||||
if tty {
|
if tty {
|
||||||
|
// NOTE(#11842): This code will require changes if we upgrade to nix 0.27+:
|
||||||
|
// - `pseudo` will contain OwnedFds instead of RawFds.
|
||||||
|
// - We'll have to use `OwnedFd::into_raw_fd()` which will
|
||||||
|
// transfer the ownership to the caller.
|
||||||
|
// - The duplication strategy will not change.
|
||||||
|
|
||||||
let pseudo = pty::openpty(None, None)?;
|
let pseudo = pty::openpty(None, None)?;
|
||||||
p.term_master = Some(pseudo.master);
|
p.term_master = Some(pseudo.master);
|
||||||
let _ = fcntl::fcntl(pseudo.master, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))
|
let _ = fcntl::fcntl(pseudo.master, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))
|
||||||
@@ -1045,8 +1051,8 @@ impl BaseContainer for LinuxContainer {
|
|||||||
.map_err(|e| warn!(logger, "fcntl pseudo.slave {:?}", e));
|
.map_err(|e| warn!(logger, "fcntl pseudo.slave {:?}", e));
|
||||||
|
|
||||||
child_stdin = unsafe { std::process::Stdio::from_raw_fd(pseudo.slave) };
|
child_stdin = unsafe { std::process::Stdio::from_raw_fd(pseudo.slave) };
|
||||||
child_stdout = unsafe { std::process::Stdio::from_raw_fd(pseudo.slave) };
|
child_stdout = unsafe { std::process::Stdio::from_raw_fd(unistd::dup(pseudo.slave)?) };
|
||||||
child_stderr = unsafe { std::process::Stdio::from_raw_fd(pseudo.slave) };
|
child_stderr = unsafe { std::process::Stdio::from_raw_fd(unistd::dup(pseudo.slave)?) };
|
||||||
|
|
||||||
if let Some(proc_io) = &mut p.proc_io {
|
if let Some(proc_io) = &mut p.proc_io {
|
||||||
// A reference count used to clean up the term master fd.
|
// A reference count used to clean up the term master fd.
|
||||||
@@ -1914,7 +1920,7 @@ mod tests {
|
|||||||
let cgroups_path = format!(
|
let cgroups_path = format!(
|
||||||
"/{}/dummycontainer{}",
|
"/{}/dummycontainer{}",
|
||||||
CGROUP_PARENT,
|
CGROUP_PARENT,
|
||||||
since_the_epoch.as_millis()
|
since_the_epoch.as_micros()
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut spec = SpecBuilder::default()
|
let mut spec = SpecBuilder::default()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
use libc::uid_t;
|
use libc::uid_t;
|
||||||
|
use nix::errno::Errno;
|
||||||
use nix::fcntl::{self, OFlag};
|
use nix::fcntl::{self, OFlag};
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
use nix::mount;
|
use nix::mount;
|
||||||
@@ -336,25 +337,19 @@ fn check_proc_mount(m: &Mount) -> Result<()> {
|
|||||||
|
|
||||||
if mount_dest == PROC_PATH {
|
if mount_dest == PROC_PATH {
|
||||||
// only allow a mount on-top of proc if it's source is "proc"
|
// only allow a mount on-top of proc if it's source is "proc"
|
||||||
unsafe {
|
let mount_source = m.source().as_ref().unwrap().display().to_string();
|
||||||
let mut stats = MaybeUninit::<libc::statfs>::uninit();
|
|
||||||
let mount_source = m.source().as_ref().unwrap().display().to_string();
|
|
||||||
if mount_source
|
|
||||||
.with_nix_path(|path| libc::statfs(path.as_ptr(), stats.as_mut_ptr()))
|
|
||||||
.is_ok()
|
|
||||||
{
|
|
||||||
if stats.assume_init().f_type == PROC_SUPER_MAGIC {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
return Err(anyhow!(format!(
|
let mut stats = MaybeUninit::<libc::statfs>::uninit();
|
||||||
|
let statfs_ret = mount_source
|
||||||
|
.with_nix_path(|path| unsafe { libc::statfs(path.as_ptr(), stats.as_mut_ptr()) })?;
|
||||||
|
|
||||||
|
return match Errno::result(statfs_ret) {
|
||||||
|
Ok(_) if unsafe { stats.assume_init().f_type } == PROC_SUPER_MAGIC => Ok(()),
|
||||||
|
Ok(_) | Err(_) => Err(anyhow!(format!(
|
||||||
"{} cannot be mounted to {} because it is not of type proc",
|
"{} cannot be mounted to {} because it is not of type proc",
|
||||||
&mount_source, &mount_dest
|
&mount_source, &mount_dest
|
||||||
)));
|
))),
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if mount_dest.starts_with(PROC_PATH) {
|
if mount_dest.starts_with(PROC_PATH) {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ use protocols::{
|
|||||||
};
|
};
|
||||||
use safe_path::scoped_join;
|
use safe_path::scoped_join;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::{self, Read};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::{os::unix::fs::symlink, path::PathBuf};
|
use std::{os::unix::fs::symlink, path::PathBuf};
|
||||||
use tokio::sync::OnceCell;
|
use tokio::sync::OnceCell;
|
||||||
@@ -235,8 +237,8 @@ pub async fn unseal_file(path: &str) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let secret_name = entry.file_name();
|
let secret_name = entry.file_name();
|
||||||
let contents = fs::read_to_string(&target_path)?;
|
if content_starts_with_prefix(&target_path, SEALED_SECRET_PREFIX).await? {
|
||||||
if contents.starts_with(SEALED_SECRET_PREFIX) {
|
let contents = fs::read_to_string(&target_path)?;
|
||||||
// Get the directory name of the sealed secret file
|
// Get the directory name of the sealed secret file
|
||||||
let dir_name = target_path
|
let dir_name = target_path
|
||||||
.parent()
|
.parent()
|
||||||
@@ -262,6 +264,17 @@ pub async fn unseal_file(path: &str) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn content_starts_with_prefix(path: &Path, prefix: &str) -> io::Result<bool> {
|
||||||
|
let mut file = File::open(path)?;
|
||||||
|
let mut buffer = vec![0u8; prefix.len()];
|
||||||
|
|
||||||
|
match file.read_exact(&mut buffer) {
|
||||||
|
Ok(()) => Ok(buffer == prefix.as_bytes()),
|
||||||
|
Err(ref e) if e.kind() == io::ErrorKind::UnexpectedEof => Ok(false),
|
||||||
|
Err(e) => Err(e),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn secure_mount(
|
pub async fn secure_mount(
|
||||||
volume_type: &str,
|
volume_type: &str,
|
||||||
options: &std::collections::HashMap<String, String>,
|
options: &std::collections::HashMap<String, String>,
|
||||||
@@ -294,7 +307,7 @@ mod tests {
|
|||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tempfile::tempdir;
|
use tempfile::{tempdir, NamedTempFile};
|
||||||
use test_utils::skip_if_not_root;
|
use test_utils::skip_if_not_root;
|
||||||
use tokio::signal::unix::{signal, SignalKind};
|
use tokio::signal::unix::{signal, SignalKind};
|
||||||
struct TestService;
|
struct TestService;
|
||||||
@@ -416,4 +429,34 @@ mod tests {
|
|||||||
rt.shutdown_background();
|
rt.shutdown_background();
|
||||||
std::thread::sleep(std::time::Duration::from_secs(2));
|
std::thread::sleep(std::time::Duration::from_secs(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_content_starts_with_prefix() {
|
||||||
|
// Normal case: content matches the prefix
|
||||||
|
let mut f = NamedTempFile::new().unwrap();
|
||||||
|
write!(f, "sealed.hello_world").unwrap();
|
||||||
|
assert!(content_starts_with_prefix(f.path(), "sealed.")
|
||||||
|
.await
|
||||||
|
.unwrap());
|
||||||
|
|
||||||
|
// Does not match the prefix
|
||||||
|
let mut f2 = NamedTempFile::new().unwrap();
|
||||||
|
write!(f2, "notsealed.hello_world").unwrap();
|
||||||
|
assert!(!content_starts_with_prefix(f2.path(), "sealed.")
|
||||||
|
.await
|
||||||
|
.unwrap());
|
||||||
|
|
||||||
|
// File length < prefix.len()
|
||||||
|
let mut f3 = NamedTempFile::new().unwrap();
|
||||||
|
write!(f3, "seal").unwrap();
|
||||||
|
assert!(!content_starts_with_prefix(f3.path(), "sealed.")
|
||||||
|
.await
|
||||||
|
.unwrap());
|
||||||
|
|
||||||
|
// Empty file
|
||||||
|
let f4 = NamedTempFile::new().unwrap();
|
||||||
|
assert!(!content_starts_with_prefix(f4.path(), "sealed.")
|
||||||
|
.await
|
||||||
|
.unwrap());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ macro_rules! config_override {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
($builder:ident, $config:ident, $field:ident, $func: ident) => {
|
($builder:ident, $config:ident, $field:ident, $func:ident) => {
|
||||||
if let Some(v) = $builder.$field {
|
if let Some(v) = $builder.$field {
|
||||||
$config.$field = $func(&v)?;
|
$config.$field = $func(&v)?;
|
||||||
}
|
}
|
||||||
@@ -661,8 +661,8 @@ impl AgentConfig {
|
|||||||
self.server_addr = addr;
|
self.server_addr = addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(addr) = env::var(LOG_LEVEL_ENV_VAR) {
|
if let Ok(level) = env::var(LOG_LEVEL_ENV_VAR) {
|
||||||
if let Ok(level) = logrus_to_slog_level(&addr) {
|
if let Ok(level) = logrus_to_slog_level(&level) {
|
||||||
self.log_level = level;
|
self.log_level = level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use anyhow::{anyhow, Context, Result};
|
|||||||
use cdi::annotations::parse_annotations;
|
use cdi::annotations::parse_annotations;
|
||||||
use cdi::cache::{new_cache, with_auto_refresh, CdiOption};
|
use cdi::cache::{new_cache, with_auto_refresh, CdiOption};
|
||||||
use cdi::spec_dirs::with_spec_dirs;
|
use cdi::spec_dirs::with_spec_dirs;
|
||||||
|
use container_device_interface as cdi;
|
||||||
use kata_types::device::DeviceHandlerManager;
|
use kata_types::device::DeviceHandlerManager;
|
||||||
use nix::sys::stat;
|
use nix::sys::stat;
|
||||||
use oci::{LinuxDeviceCgroup, Spec};
|
use oci::{LinuxDeviceCgroup, Spec};
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ use nix::unistd::{self, dup, sync, Pid};
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
|
use std::io::ErrorKind;
|
||||||
use std::os::unix::fs::{self as unixfs, FileTypeExt};
|
use std::os::unix::fs::{self as unixfs, FileTypeExt};
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@@ -465,8 +466,17 @@ fn attestation_binaries_available(logger: &Logger, procs: &GuestComponentsProcs)
|
|||||||
_ => vec![],
|
_ => vec![],
|
||||||
};
|
};
|
||||||
for binary in binaries.iter() {
|
for binary in binaries.iter() {
|
||||||
if !Path::new(binary).exists() {
|
let exists = Path::new(binary)
|
||||||
warn!(logger, "{} not found", binary);
|
.try_exists()
|
||||||
|
.unwrap_or_else(|error| match error.kind() {
|
||||||
|
ErrorKind::NotFound => {
|
||||||
|
warn!(logger, "{} not found", binary);
|
||||||
|
false
|
||||||
|
}
|
||||||
|
_ => panic!("Path existence check failed for '{}': {}", binary, error),
|
||||||
|
});
|
||||||
|
|
||||||
|
if !exists {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,7 +401,11 @@ impl Handle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let RouteAttribute::Oif(index) = attribute {
|
if let RouteAttribute::Oif(index) = attribute {
|
||||||
route.device = self.find_link(LinkFilter::Index(*index)).await?.name();
|
route.device = self
|
||||||
|
.find_link(LinkFilter::Index(*index))
|
||||||
|
.await
|
||||||
|
.context(format!("error looking up device {index}"))?
|
||||||
|
.name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -909,10 +913,15 @@ mod tests {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use netlink_packet_route::address::AddressHeader;
|
use netlink_packet_route::address::AddressHeader;
|
||||||
use netlink_packet_route::link::LinkHeader;
|
use netlink_packet_route::link::LinkHeader;
|
||||||
|
use serial_test::serial;
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use test_utils::skip_if_not_root;
|
use test_utils::skip_if_not_root;
|
||||||
|
|
||||||
|
// Constants for ARP neighbor tests
|
||||||
|
const TEST_DUMMY_INTERFACE: &str = "dummy_for_arp";
|
||||||
|
const TEST_ARP_IP: &str = "192.0.2.127";
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn find_link_by_name() {
|
async fn find_link_by_name() {
|
||||||
let message = Handle::new()
|
let message = Handle::new()
|
||||||
@@ -972,11 +981,15 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial(arp_neighbor_tests)]
|
||||||
async fn list_routes() {
|
async fn list_routes() {
|
||||||
|
clean_env_for_test_add_one_arp_neighbor(TEST_DUMMY_INTERFACE, TEST_ARP_IP);
|
||||||
|
let devices: Vec<Interface> = Handle::new().unwrap().list_interfaces().await.unwrap();
|
||||||
let all = Handle::new()
|
let all = Handle::new()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.list_routes()
|
.list_routes()
|
||||||
.await
|
.await
|
||||||
|
.context(format!("available devices: {:?}", devices))
|
||||||
.expect("Failed to list routes");
|
.expect("Failed to list routes");
|
||||||
|
|
||||||
assert_ne!(all.len(), 0);
|
assert_ne!(all.len(), 0);
|
||||||
@@ -1088,7 +1101,7 @@ mod tests {
|
|||||||
.expect("prepare: failed to delete neigh");
|
.expect("prepare: failed to delete neigh");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_env_for_test_add_one_arp_neighbor(dummy_name: &str, ip: &str) {
|
async fn prepare_env_for_test_add_one_arp_neighbor(dummy_name: &str, ip: &str) {
|
||||||
clean_env_for_test_add_one_arp_neighbor(dummy_name, ip);
|
clean_env_for_test_add_one_arp_neighbor(dummy_name, ip);
|
||||||
// modprobe dummy
|
// modprobe dummy
|
||||||
Command::new("modprobe")
|
Command::new("modprobe")
|
||||||
@@ -1102,9 +1115,9 @@ mod tests {
|
|||||||
.output()
|
.output()
|
||||||
.expect("failed to add dummy interface");
|
.expect("failed to add dummy interface");
|
||||||
|
|
||||||
// ip addr add 192.168.0.2/16 dev dummy
|
// ip addr add 192.0.2.2/24 dev dummy
|
||||||
Command::new("ip")
|
Command::new("ip")
|
||||||
.args(["addr", "add", "192.168.0.2/16", "dev", dummy_name])
|
.args(["addr", "add", "192.0.2.2/24", "dev", dummy_name])
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to add ip for dummy");
|
.expect("failed to add ip for dummy");
|
||||||
|
|
||||||
@@ -1113,24 +1126,26 @@ mod tests {
|
|||||||
.args(["link", "set", dummy_name, "up"])
|
.args(["link", "set", dummy_name, "up"])
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to up dummy");
|
.expect("failed to up dummy");
|
||||||
|
|
||||||
|
// Wait briefly to ensure the IP address addition is fully complete
|
||||||
|
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
#[serial(arp_neighbor_tests)]
|
||||||
async fn test_add_one_arp_neighbor() {
|
async fn test_add_one_arp_neighbor() {
|
||||||
skip_if_not_root!();
|
skip_if_not_root!();
|
||||||
|
|
||||||
let mac = "6a:92:3a:59:70:aa";
|
let mac = "6a:92:3a:59:70:aa";
|
||||||
let to_ip = "169.254.1.1";
|
|
||||||
let dummy_name = "dummy_for_arp";
|
|
||||||
|
|
||||||
prepare_env_for_test_add_one_arp_neighbor(dummy_name, to_ip);
|
prepare_env_for_test_add_one_arp_neighbor(TEST_DUMMY_INTERFACE, TEST_ARP_IP).await;
|
||||||
|
|
||||||
let mut ip_address = IPAddress::new();
|
let mut ip_address = IPAddress::new();
|
||||||
ip_address.set_address(to_ip.to_string());
|
ip_address.set_address(TEST_ARP_IP.to_string());
|
||||||
|
|
||||||
let mut neigh = ARPNeighbor::new();
|
let mut neigh = ARPNeighbor::new();
|
||||||
neigh.set_toIPAddress(ip_address);
|
neigh.set_toIPAddress(ip_address);
|
||||||
neigh.set_device(dummy_name.to_string());
|
neigh.set_device(TEST_DUMMY_INTERFACE.to_string());
|
||||||
neigh.set_lladdr(mac.to_string());
|
neigh.set_lladdr(mac.to_string());
|
||||||
neigh.set_state(0x80);
|
neigh.set_state(0x80);
|
||||||
|
|
||||||
@@ -1141,15 +1156,24 @@ mod tests {
|
|||||||
.expect("Failed to add ARP neighbor");
|
.expect("Failed to add ARP neighbor");
|
||||||
|
|
||||||
// ip neigh show dev dummy ip
|
// ip neigh show dev dummy ip
|
||||||
let stdout = Command::new("ip")
|
let output = Command::new("ip")
|
||||||
.args(["neigh", "show", "dev", dummy_name, to_ip])
|
.args(["neigh", "show", "dev", TEST_DUMMY_INTERFACE, TEST_ARP_IP])
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to show neigh")
|
.expect("failed to show neigh");
|
||||||
.stdout;
|
|
||||||
|
|
||||||
let stdout = std::str::from_utf8(&stdout).expect("failed to convert stdout");
|
let stdout = std::str::from_utf8(&output.stdout).expect("failed to convert stdout");
|
||||||
assert_eq!(stdout.trim(), format!("{} lladdr {} PERMANENT", to_ip, mac));
|
let stderr = std::str::from_utf8(&output.stderr).expect("failed to convert stderr");
|
||||||
|
assert!(
|
||||||
|
output.status.success(),
|
||||||
|
"`ip neigh show` returned exit code {:?}. stderr: {:?}",
|
||||||
|
output.status.code(),
|
||||||
|
stderr
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
stdout.trim(),
|
||||||
|
format!("{} lladdr {} PERMANENT", TEST_ARP_IP, mac)
|
||||||
|
);
|
||||||
|
|
||||||
clean_env_for_test_add_one_arp_neighbor(dummy_name, to_ip);
|
clean_env_for_test_add_one_arp_neighbor(TEST_DUMMY_INTERFACE, TEST_ARP_IP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2417,7 +2417,7 @@ mod tests {
|
|||||||
let cgroups_path = format!(
|
let cgroups_path = format!(
|
||||||
"/{}/dummycontainer{}",
|
"/{}/dummycontainer{}",
|
||||||
CGROUP_PARENT,
|
CGROUP_PARENT,
|
||||||
since_the_epoch.as_millis()
|
since_the_epoch.as_micros()
|
||||||
);
|
);
|
||||||
|
|
||||||
let spec = SpecBuilder::default()
|
let spec = SpecBuilder::default()
|
||||||
|
|||||||
@@ -858,7 +858,7 @@ mod tests {
|
|||||||
let cgroups_path = format!(
|
let cgroups_path = format!(
|
||||||
"/{}/dummycontainer{}",
|
"/{}/dummycontainer{}",
|
||||||
CGROUP_PARENT,
|
CGROUP_PARENT,
|
||||||
since_the_epoch.as_millis()
|
since_the_epoch.as_micros()
|
||||||
);
|
);
|
||||||
|
|
||||||
let spec = SpecBuilder::default()
|
let spec = SpecBuilder::default()
|
||||||
|
|||||||
17
src/dragonball/Cargo.lock
generated
17
src/dragonball/Cargo.lock
generated
@@ -344,20 +344,26 @@ name = "dbs-pci"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
|
"dbs-address-space",
|
||||||
"dbs-allocator",
|
"dbs-allocator",
|
||||||
"dbs-arch",
|
"dbs-arch",
|
||||||
"dbs-boot",
|
"dbs-boot",
|
||||||
"dbs-device",
|
"dbs-device",
|
||||||
"dbs-interrupt",
|
"dbs-interrupt",
|
||||||
|
"dbs-utils",
|
||||||
|
"dbs-virtio-devices",
|
||||||
"downcast-rs",
|
"downcast-rs",
|
||||||
"kvm-bindings",
|
"kvm-bindings",
|
||||||
"kvm-ioctls",
|
"kvm-ioctls",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
|
"serde",
|
||||||
"thiserror 1.0.48",
|
"thiserror 1.0.48",
|
||||||
"vfio-bindings",
|
"vfio-bindings",
|
||||||
"vfio-ioctls",
|
"vfio-ioctls",
|
||||||
|
"virtio-queue",
|
||||||
"vm-memory",
|
"vm-memory",
|
||||||
|
"vmm-sys-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1810,9 +1816,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "seccompiler"
|
name = "seccompiler"
|
||||||
version = "0.2.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e01d1292a1131b22ccea49f30bd106f1238b5ddeec1a98d39268dcc31d540e68"
|
checksum = "a4ae55de56877481d112a559bbc12667635fdaf5e005712fd4e2b2fa50ffc884"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -1922,12 +1928,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.9"
|
version = "0.4.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
|
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
|
||||||
dependencies = [
|
|
||||||
"autocfg",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slog"
|
name = "slog"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ event-manager = "0.2.1"
|
|||||||
kvm-bindings = "0.6.0"
|
kvm-bindings = "0.6.0"
|
||||||
kvm-ioctls = "0.12.0"
|
kvm-ioctls = "0.12.0"
|
||||||
linux-loader = "0.8.0"
|
linux-loader = "0.8.0"
|
||||||
seccompiler = "0.2.0"
|
seccompiler = "0.5.0"
|
||||||
vfio-bindings = "0.3.0"
|
vfio-bindings = "0.3.0"
|
||||||
vfio-ioctls = "0.1.0"
|
vfio-ioctls = "0.1.0"
|
||||||
virtio-bindings = "0.1.0"
|
virtio-bindings = "0.1.0"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
//!
|
//!
|
||||||
//! # Examples
|
//! # Examples
|
||||||
//!
|
//!
|
||||||
//! Creating a dummy deivce which implement DeviceIo trait, and register it to [IoManager] with
|
//! Creating a dummy device which implement DeviceIo trait, and register it to [IoManager] with
|
||||||
//! trapped MMIO/PIO address ranges:
|
//! trapped MMIO/PIO address ranges:
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
@@ -102,7 +102,7 @@ use crate::resources::Resource;
|
|||||||
use crate::{DeviceIo, IoAddress, IoSize, PioAddress};
|
use crate::{DeviceIo, IoAddress, IoSize, PioAddress};
|
||||||
|
|
||||||
/// Error types for `IoManager` related operations.
|
/// Error types for `IoManager` related operations.
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug, PartialEq)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// The inserting device overlaps with a current device.
|
/// The inserting device overlaps with a current device.
|
||||||
#[error("device address conflicts with existing devices")]
|
#[error("device address conflicts with existing devices")]
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
|
use std::sync::atomic::{AtomicU16, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
use std::sync::Mutex;
|
||||||
|
|
||||||
use vmm_sys_util::eventfd::EventFd;
|
use vmm_sys_util::eventfd::EventFd;
|
||||||
|
|
||||||
@@ -121,6 +123,77 @@ mod msi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Vector value used to disable MSI for a queue.
|
||||||
|
pub const VIRTQ_MSI_NO_VECTOR: u16 = 0xffff;
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq, Debug, Copy)]
|
||||||
|
pub enum VirtioInterruptType {
|
||||||
|
Config,
|
||||||
|
Queue(u16),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct VirtioNotifierMsix {
|
||||||
|
pub(crate) config_vector: Arc<AtomicU16>,
|
||||||
|
pub(crate) queues_vectors: Arc<Mutex<Vec<u16>>>,
|
||||||
|
pub(crate) interrupt_source_group: Arc<Box<dyn InterruptSourceGroup>>,
|
||||||
|
pub(crate) interrupt_type: VirtioInterruptType,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl VirtioNotifierMsix {
|
||||||
|
pub fn new(
|
||||||
|
config_vector: Arc<AtomicU16>,
|
||||||
|
queues_vectors: Arc<Mutex<Vec<u16>>>,
|
||||||
|
interrupt_source_group: Arc<Box<dyn InterruptSourceGroup>>,
|
||||||
|
interrupt_type: VirtioInterruptType,
|
||||||
|
) -> Self {
|
||||||
|
VirtioNotifierMsix {
|
||||||
|
config_vector,
|
||||||
|
queues_vectors,
|
||||||
|
interrupt_source_group,
|
||||||
|
interrupt_type,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl InterruptNotifier for VirtioNotifierMsix {
|
||||||
|
fn notify(&self) -> std::result::Result<(), std::io::Error> {
|
||||||
|
let vector = match self.interrupt_type {
|
||||||
|
VirtioInterruptType::Config => self.config_vector.load(Ordering::Acquire),
|
||||||
|
VirtioInterruptType::Queue(queue_index) => {
|
||||||
|
self.queues_vectors.lock().unwrap()[queue_index as usize]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if vector == VIRTQ_MSI_NO_VECTOR {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
self.interrupt_source_group
|
||||||
|
.trigger(vector as InterruptIndex)
|
||||||
|
}
|
||||||
|
fn notifier(&self) -> Option<&EventFd> {
|
||||||
|
let vector = match self.interrupt_type {
|
||||||
|
VirtioInterruptType::Config => self.config_vector.load(Ordering::Acquire),
|
||||||
|
VirtioInterruptType::Queue(queue_index) => {
|
||||||
|
self.queues_vectors.lock().unwrap()[queue_index as usize]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if vector == VIRTQ_MSI_NO_VECTOR {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.interrupt_source_group
|
||||||
|
.notifier(vector as InterruptIndex)
|
||||||
|
}
|
||||||
|
fn as_any(&self) -> &dyn Any {
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clone_boxed(&self) -> Box<dyn InterruptNotifier> {
|
||||||
|
Box::new(self.clone())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Struct to discard interrupts.
|
/// Struct to discard interrupts.
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
pub struct NoopNotifier {}
|
pub struct NoopNotifier {}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ thiserror = "1"
|
|||||||
dbs-allocator = { workspace = true }
|
dbs-allocator = { workspace = true }
|
||||||
dbs-boot = { workspace = true }
|
dbs-boot = { workspace = true }
|
||||||
dbs-device = { workspace = true }
|
dbs-device = { workspace = true }
|
||||||
|
dbs-address-space = { workspace = true }
|
||||||
|
dbs-virtio-devices = { workspace = true }
|
||||||
dbs-interrupt = { workspace = true, features = [
|
dbs-interrupt = { workspace = true, features = [
|
||||||
"kvm-irq",
|
"kvm-irq",
|
||||||
"kvm-legacy-irq",
|
"kvm-legacy-irq",
|
||||||
@@ -23,12 +25,18 @@ dbs-interrupt = { workspace = true, features = [
|
|||||||
] }
|
] }
|
||||||
downcast-rs = "1.2.0"
|
downcast-rs = "1.2.0"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
|
serde = "1.0.27"
|
||||||
|
|
||||||
vm-memory = {workspace = true}
|
vm-memory = {workspace = true}
|
||||||
kvm-ioctls = {workspace = true}
|
kvm-ioctls = {workspace = true}
|
||||||
kvm-bindings = {workspace = true}
|
kvm-bindings = {workspace = true}
|
||||||
vfio-ioctls = {workspace = true}
|
vfio-ioctls = {workspace = true}
|
||||||
vfio-bindings = {workspace = true}
|
vfio-bindings = {workspace = true}
|
||||||
libc = "0.2.39"
|
libc = "0.2.39"
|
||||||
|
vmm-sys-util = {workspace = true}
|
||||||
|
virtio-queue = {workspace = true}
|
||||||
|
dbs-utils = {workspace = true}
|
||||||
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
dbs-arch = { workspace = true }
|
dbs-arch = { workspace = true }
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
//! - PCI configuration: a common framework to emulator PCI configuration space header.
|
//! - PCI configuration: a common framework to emulator PCI configuration space header.
|
||||||
//! - PCI MSI/MSIx: structs to emulate PCI MSI/MSIx capabilities.
|
//! - PCI MSI/MSIx: structs to emulate PCI MSI/MSIx capabilities.
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
use dbs_device::device_manager::IoManagerContext;
|
use dbs_device::device_manager::IoManagerContext;
|
||||||
use dbs_interrupt::KvmIrqManager;
|
use dbs_interrupt::KvmIrqManager;
|
||||||
@@ -58,8 +58,17 @@ pub use msix::{MsixCap, MsixState, MSIX_TABLE_ENTRY_SIZE};
|
|||||||
mod vfio;
|
mod vfio;
|
||||||
pub use vfio::{VfioPciDevice, VfioPciError, VENDOR_NVIDIA};
|
pub use vfio::{VfioPciDevice, VfioPciError, VENDOR_NVIDIA};
|
||||||
|
|
||||||
|
mod virtio_pci;
|
||||||
|
pub use virtio_pci::{VirtioPciDevice, VirtioPciDeviceError, CAPABILITY_BAR_SIZE};
|
||||||
|
|
||||||
|
mod pci_address;
|
||||||
|
use dbs_virtio_devices::VirtioDevice;
|
||||||
|
pub use pci_address::PciAddress;
|
||||||
|
|
||||||
|
mod pci_common_config;
|
||||||
|
|
||||||
/// Error codes related to PCI root/bus/device operations.
|
/// Error codes related to PCI root/bus/device operations.
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error, PartialEq)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// Failed to activate the PCI root/bus/device.
|
/// Failed to activate the PCI root/bus/device.
|
||||||
#[error("failed to activate PCI device, {0:?}")]
|
#[error("failed to activate PCI device, {0:?}")]
|
||||||
@@ -110,6 +119,9 @@ pub enum Error {
|
|||||||
/// PCI ROM BAR address is invalid.
|
/// PCI ROM BAR address is invalid.
|
||||||
#[error("address {0} size {1} too big")]
|
#[error("address {0} size {1} too big")]
|
||||||
RomBarAddressInvalid(u64, u64),
|
RomBarAddressInvalid(u64, u64),
|
||||||
|
/// Invalid parameter
|
||||||
|
#[error("invalid pci device address")]
|
||||||
|
InvalidParameter,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specialized `Result` for PCI related operations.
|
/// Specialized `Result` for PCI related operations.
|
||||||
@@ -130,3 +142,8 @@ pub fn fill_config_data(data: &mut [u8]) {
|
|||||||
*pos = 0xff;
|
*pos = 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// we only support one pci bus
|
||||||
|
pub const PCI_BUS_DEFAULT: u8 = 0;
|
||||||
|
|
||||||
|
type ArcMutexBoxDynVirtioDevice<AS, Q, R> = Arc<Mutex<Box<dyn VirtioDevice<AS, Q, R>>>>;
|
||||||
|
|||||||
100
src/dragonball/dbs_pci/src/pci_address.rs
Normal file
100
src/dragonball/dbs_pci/src/pci_address.rs
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
// Copyright (C) 2024 Alibaba Cloud. All rights reserved.
|
||||||
|
//
|
||||||
|
// Copyright (C) 2025 Ant Group. All rights reserved.
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
|
||||||
|
|
||||||
|
use std::cmp::Ordering;
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
|
use crate::{Error, Result};
|
||||||
|
|
||||||
|
const PCI_MAX_DEV_ID: u8 = 0x1f;
|
||||||
|
const PCI_MAX_FUNC_ID: u8 = 0x7;
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
|
pub struct PciAddress {
|
||||||
|
/// Bus number, in the range [0, 0xff].
|
||||||
|
bus: u8,
|
||||||
|
/// Device id, in the range [0x0, 0x1f].
|
||||||
|
dev: u8,
|
||||||
|
/// Function id, in the range [0x0, 0x7].
|
||||||
|
func: u8,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PartialOrd for PciAddress {
|
||||||
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||||
|
Some(self.cmp(other))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Ord for PciAddress {
|
||||||
|
fn cmp(&self, other: &Self) -> Ordering {
|
||||||
|
// Compare in the order of bus -> dev -> func.
|
||||||
|
self.bus
|
||||||
|
.cmp(&other.bus)
|
||||||
|
.then_with(|| self.dev.cmp(&other.dev))
|
||||||
|
.then_with(|| self.func.cmp(&other.func))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PciAddress {
|
||||||
|
/// Create a new PCI address from bus and device/function id.
|
||||||
|
///
|
||||||
|
/// * `bus`: PCI bus number, in the range \[0x0, 0xff\].
|
||||||
|
/// * `dev`: PCI device id, in the range \[0x0, 0x1f\].
|
||||||
|
/// * `func`: PCI function id, in the range \[0x0, 0x7\].
|
||||||
|
pub fn new(bus: u8, dev: u8, func: u8) -> Result<Self> {
|
||||||
|
if dev > PCI_MAX_DEV_ID || func > PCI_MAX_FUNC_ID {
|
||||||
|
return Err(Error::InvalidParameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(PciAddress { bus, dev, func })
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get PCI device id on the PCI bus, which is in [0x0, 0x1f]
|
||||||
|
pub fn dev_id(&self) -> u8 {
|
||||||
|
self.dev
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get PCI device function id, which is in [0x0, 0x7].
|
||||||
|
pub fn func_id(&self) -> u8 {
|
||||||
|
self.func
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get PCI device bus number, which is in [0x0, 0xff].
|
||||||
|
pub fn bus_id(&self) -> u8 {
|
||||||
|
self.bus
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for PciAddress {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
"PciAddress: {:02x}:{:02x}.{:02x}",
|
||||||
|
self.bus, self.dev, self.func
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_pci_address() {
|
||||||
|
// test invlaid device id
|
||||||
|
assert_eq!(PciAddress::new(0, 32, 0), Err(Error::InvalidParameter));
|
||||||
|
|
||||||
|
// test invalid function id
|
||||||
|
assert_eq!(PciAddress::new(0, 0, 8), Err(Error::InvalidParameter));
|
||||||
|
|
||||||
|
// test pci address
|
||||||
|
let (bus, dev, func) = (3, 5, 4);
|
||||||
|
let address = PciAddress::new(bus, dev, func).unwrap();
|
||||||
|
assert_eq!(address.bus_id(), bus);
|
||||||
|
assert_eq!(address.dev_id(), dev);
|
||||||
|
assert_eq!(address.func_id(), func);
|
||||||
|
}
|
||||||
|
}
|
||||||
507
src/dragonball/dbs_pci/src/pci_common_config.rs
Normal file
507
src/dragonball/dbs_pci/src/pci_common_config.rs
Normal file
@@ -0,0 +1,507 @@
|
|||||||
|
// Copyright 2018 The Chromium OS Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE-BSD-3-Clause file.
|
||||||
|
//
|
||||||
|
// Copyright © 2019 Intel Corporation
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
||||||
|
//
|
||||||
|
// Copyright (C) 2024 Alibaba Cloud. All rights reserved.
|
||||||
|
//
|
||||||
|
// Copyright (C) 2025 Ant Group. All rights reserved.
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0 or BSD-3-Clause
|
||||||
|
|
||||||
|
use std::sync::atomic::{AtomicU16, Ordering};
|
||||||
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
use byteorder::{ByteOrder, LittleEndian};
|
||||||
|
use log::{error, trace, warn};
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use virtio_queue::QueueT;
|
||||||
|
use vm_memory::{GuestAddressSpace, GuestMemoryRegion};
|
||||||
|
|
||||||
|
use crate::ArcMutexBoxDynVirtioDevice;
|
||||||
|
use dbs_virtio_devices::VirtioQueueConfig;
|
||||||
|
|
||||||
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
|
pub struct VirtioPciCommonConfigState {
|
||||||
|
pub driver_status: u8,
|
||||||
|
pub config_generation: u8,
|
||||||
|
pub device_feature_select: u32,
|
||||||
|
pub driver_feature_select: u32,
|
||||||
|
pub queue_select: u16,
|
||||||
|
pub msix_config: u16,
|
||||||
|
pub msix_queues: Vec<u16>,
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The standard layout for the ring is a continuous chunk of memory which looks
|
||||||
|
* like this. We assume num is a power of 2.
|
||||||
|
*
|
||||||
|
* struct vring
|
||||||
|
* {
|
||||||
|
* // The actual descriptors (16 bytes each)
|
||||||
|
* struct vring_desc desc[num];
|
||||||
|
*
|
||||||
|
* // A ring of available descriptor heads with free-running index.
|
||||||
|
* __virtio16 avail_flags;
|
||||||
|
* __virtio16 avail_idx;
|
||||||
|
* __virtio16 available[num];
|
||||||
|
* __virtio16 used_event_idx;
|
||||||
|
*
|
||||||
|
* // Padding to the next align boundary.
|
||||||
|
* char pad[];
|
||||||
|
*
|
||||||
|
* // A ring of used descriptor heads with free-running index.
|
||||||
|
* __virtio16 used_flags;
|
||||||
|
* __virtio16 used_idx;
|
||||||
|
* struct vring_used_elem used[num];
|
||||||
|
* __virtio16 avail_event_idx;
|
||||||
|
* };
|
||||||
|
* struct vring_desc {
|
||||||
|
* __virtio64 addr;
|
||||||
|
* __virtio32 len;
|
||||||
|
* __virtio16 flags;
|
||||||
|
* __virtio16 next;
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* struct vring_avail {
|
||||||
|
* __virtio16 flags;
|
||||||
|
* __virtio16 idx;
|
||||||
|
* __virtio16 ring[];
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* // u32 is used here for ids for padding reasons.
|
||||||
|
* struct vring_used_elem {
|
||||||
|
* // Index of start of used descriptor chain.
|
||||||
|
* __virtio32 id;
|
||||||
|
* // Total length of the descriptor chain which was used (written to)
|
||||||
|
* __virtio32 len;
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* Kernel header used for this reference: include/uapi/linux/virtio_ring.h
|
||||||
|
* Virtio Spec: https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// Contains the data for reading and writing the common configuration structure of a virtio PCI
|
||||||
|
/// device.
|
||||||
|
///
|
||||||
|
/// * Registers:
|
||||||
|
///
|
||||||
|
/// ** About the whole device.
|
||||||
|
/// le32 device_feature_select; // 0x00 // read-write
|
||||||
|
/// le32 device_feature; // 0x04 // read-only for driver
|
||||||
|
/// le32 driver_feature_select; // 0x08 // read-write
|
||||||
|
/// le32 driver_feature; // 0x0C // read-write
|
||||||
|
/// le16 msix_config; // 0x10 // read-write
|
||||||
|
/// le16 num_queues; // 0x12 // read-only for driver
|
||||||
|
/// u8 device_status; // 0x14 // read-write (driver_status)
|
||||||
|
/// u8 config_generation; // 0x15 // read-only for driver
|
||||||
|
///
|
||||||
|
/// ** About a specific virtqueue.
|
||||||
|
/// le16 queue_select; // 0x16 // read-write
|
||||||
|
/// le16 queue_size; // 0x18 // read-write, power of 2, or 0.
|
||||||
|
/// le16 queue_msix_vector; // 0x1A // read-write
|
||||||
|
/// le16 queue_enable; // 0x1C // read-write (Ready)
|
||||||
|
/// le16 queue_notify_off; // 0x1E // read-only for driver
|
||||||
|
/// le64 queue_desc; // 0x20 // read-write
|
||||||
|
/// le64 queue_avail; // 0x28 // read-write
|
||||||
|
/// le64 queue_used; // 0x30 // read-write
|
||||||
|
pub struct VirtioPciCommonConfig {
|
||||||
|
pub driver_status: u8,
|
||||||
|
pub config_generation: u8,
|
||||||
|
pub device_feature_select: u32,
|
||||||
|
pub driver_feature_select: u32,
|
||||||
|
pub queue_select: u16,
|
||||||
|
pub msix_config: Arc<AtomicU16>,
|
||||||
|
pub msix_queues: Arc<Mutex<Vec<u16>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl VirtioPciCommonConfig {
|
||||||
|
pub fn new(state: VirtioPciCommonConfigState) -> Self {
|
||||||
|
VirtioPciCommonConfig {
|
||||||
|
driver_status: state.driver_status,
|
||||||
|
config_generation: state.config_generation,
|
||||||
|
device_feature_select: state.device_feature_select,
|
||||||
|
driver_feature_select: state.driver_feature_select,
|
||||||
|
queue_select: state.queue_select,
|
||||||
|
msix_config: Arc::new(AtomicU16::new(state.msix_config)),
|
||||||
|
msix_queues: Arc::new(Mutex::new(state.msix_queues)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(fupan): use for live upgrade later
|
||||||
|
#[allow(dead_code)]
|
||||||
|
fn state(&self) -> VirtioPciCommonConfigState {
|
||||||
|
VirtioPciCommonConfigState {
|
||||||
|
driver_status: self.driver_status,
|
||||||
|
config_generation: self.config_generation,
|
||||||
|
device_feature_select: self.device_feature_select,
|
||||||
|
driver_feature_select: self.driver_feature_select,
|
||||||
|
queue_select: self.queue_select,
|
||||||
|
msix_config: self.msix_config.load(Ordering::Acquire),
|
||||||
|
msix_queues: self.msix_queues.lock().unwrap().clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_common_config_byte(&self, offset: u64) -> u8 {
|
||||||
|
trace!("read_common_config_byte: offset 0x{:x}", offset);
|
||||||
|
// The driver is only allowed to do aligned, properly sized access.
|
||||||
|
match offset {
|
||||||
|
0x14 => self.driver_status,
|
||||||
|
0x15 => self.config_generation,
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio config byte read: 0x{:x}", offset);
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_common_config_byte(&mut self, offset: u64, value: u8) {
|
||||||
|
trace!(
|
||||||
|
"write_common_config_byte: offset 0x{:x} value 0x{:x}",
|
||||||
|
offset,
|
||||||
|
value
|
||||||
|
);
|
||||||
|
match offset {
|
||||||
|
0x14 => self.driver_status = value,
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio config byte write: 0x{:x}", offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_common_config_word<Q: QueueT + 'static>(
|
||||||
|
&self,
|
||||||
|
offset: u64,
|
||||||
|
queues: &[VirtioQueueConfig<Q>],
|
||||||
|
) -> u16 {
|
||||||
|
trace!("read_common_config_word: offset 0x{:x}", offset);
|
||||||
|
match offset {
|
||||||
|
0x10 => self.msix_config.load(Ordering::Acquire),
|
||||||
|
0x12 => queues.len() as u16, // num_queues
|
||||||
|
0x16 => self.queue_select,
|
||||||
|
0x18 => self.with_queue(queues, |q| q.max_size()).unwrap_or(0),
|
||||||
|
0x1a => self.msix_queues.lock().unwrap()[self.queue_select as usize],
|
||||||
|
0x1c => u16::from(self.with_queue(queues, |q| q.ready()).unwrap_or(false)),
|
||||||
|
0x1e => self.queue_select, // notify_off
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio register word read: 0x{:x}", offset);
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_common_config_word<Q: QueueT + 'static>(
|
||||||
|
&mut self,
|
||||||
|
offset: u64,
|
||||||
|
value: u16,
|
||||||
|
queues: &mut [VirtioQueueConfig<Q>],
|
||||||
|
) {
|
||||||
|
trace!(
|
||||||
|
"write_common_config_word: offset 0x{:x} value 0x{:x}",
|
||||||
|
offset,
|
||||||
|
value
|
||||||
|
);
|
||||||
|
match offset {
|
||||||
|
0x10 => self.msix_config.store(value, Ordering::Release),
|
||||||
|
0x16 => self.queue_select = value,
|
||||||
|
0x18 => self.with_queue_mut(queues, |q| q.set_size(value)),
|
||||||
|
0x1a => self.msix_queues.lock().unwrap()[self.queue_select as usize] = value,
|
||||||
|
0x1c => self.with_queue_mut(queues, |q| {
|
||||||
|
let ready = value == 1;
|
||||||
|
q.set_ready(ready);
|
||||||
|
}),
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio register word write: 0x{:x}", offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_common_config_dword<
|
||||||
|
AS: GuestAddressSpace + 'static,
|
||||||
|
Q: QueueT + 'static,
|
||||||
|
R: 'static + GuestMemoryRegion,
|
||||||
|
>(
|
||||||
|
&self,
|
||||||
|
offset: u64,
|
||||||
|
device: ArcMutexBoxDynVirtioDevice<AS, Q, R>,
|
||||||
|
) -> u32 {
|
||||||
|
trace!("read_common_config_dword: offset 0x{:x}", offset);
|
||||||
|
match offset {
|
||||||
|
0x00 => self.device_feature_select,
|
||||||
|
0x04 => {
|
||||||
|
// Only 64 bits of features (2 pages) are defined for now, so limit
|
||||||
|
// device_feature_select to avoid shifting by 64 or more bits.
|
||||||
|
let locked_device = device.lock().unwrap();
|
||||||
|
if self.device_feature_select < 2 {
|
||||||
|
locked_device.get_avail_features(self.device_feature_select)
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
0x08 => self.driver_feature_select,
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio register dword read: 0x{:x}", offset);
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_common_config_dword<
|
||||||
|
AS: GuestAddressSpace + 'static,
|
||||||
|
Q: QueueT + 'static,
|
||||||
|
R: 'static + GuestMemoryRegion,
|
||||||
|
>(
|
||||||
|
&mut self,
|
||||||
|
offset: u64,
|
||||||
|
value: u32,
|
||||||
|
queues: &mut [VirtioQueueConfig<Q>],
|
||||||
|
device: ArcMutexBoxDynVirtioDevice<AS, Q, R>,
|
||||||
|
) {
|
||||||
|
trace!(
|
||||||
|
"write_common_config_dword: offset 0x{:x} value 0x{:x}",
|
||||||
|
offset,
|
||||||
|
value
|
||||||
|
);
|
||||||
|
|
||||||
|
match offset {
|
||||||
|
0x00 => self.device_feature_select = value,
|
||||||
|
0x08 => self.driver_feature_select = value,
|
||||||
|
0x0c => {
|
||||||
|
if self.driver_feature_select < 2 {
|
||||||
|
let mut locked_device = device.lock().unwrap();
|
||||||
|
locked_device.set_acked_features(self.driver_feature_select, value);
|
||||||
|
} else {
|
||||||
|
warn!(
|
||||||
|
"invalid ack_features (page {}, value 0x{:x})",
|
||||||
|
self.driver_feature_select, value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
0x20 => self.with_queue_mut(queues, |q| q.set_desc_table_address(Some(value), None)),
|
||||||
|
0x24 => self.with_queue_mut(queues, |q| q.set_desc_table_address(None, Some(value))),
|
||||||
|
0x28 => self.with_queue_mut(queues, |q| q.set_avail_ring_address(Some(value), None)),
|
||||||
|
0x2c => self.with_queue_mut(queues, |q| q.set_avail_ring_address(None, Some(value))),
|
||||||
|
0x30 => self.with_queue_mut(queues, |q| q.set_used_ring_address(Some(value), None)),
|
||||||
|
0x34 => self.with_queue_mut(queues, |q| q.set_used_ring_address(None, Some(value))),
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio register dword write: 0x{:x}", offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_common_config_qword(&self, _offset: u64) -> u64 {
|
||||||
|
trace!("read_common_config_qword: offset 0x{:x}", _offset);
|
||||||
|
0 // Assume the guest has no reason to read write-only registers.
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_common_config_qword<Q: QueueT + 'static>(
|
||||||
|
&mut self,
|
||||||
|
offset: u64,
|
||||||
|
value: u64,
|
||||||
|
queues: &mut [VirtioQueueConfig<Q>],
|
||||||
|
) {
|
||||||
|
trace!(
|
||||||
|
"write_common_config_qword: offset 0x{:x}, value 0x{:x}",
|
||||||
|
offset,
|
||||||
|
value
|
||||||
|
);
|
||||||
|
|
||||||
|
let low = Some((value & 0xffff_ffff) as u32);
|
||||||
|
let high = Some((value >> 32) as u32);
|
||||||
|
|
||||||
|
match offset {
|
||||||
|
0x20 => self.with_queue_mut(queues, |q| q.set_desc_table_address(low, high)),
|
||||||
|
0x28 => self.with_queue_mut(queues, |q| q.set_avail_ring_address(low, high)),
|
||||||
|
0x30 => self.with_queue_mut(queues, |q| q.set_used_ring_address(low, high)),
|
||||||
|
_ => {
|
||||||
|
warn!("invalid virtio register qword write: 0x{:x}", offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn with_queue<U, F, Q>(&self, queues: &[VirtioQueueConfig<Q>], f: F) -> Option<U>
|
||||||
|
where
|
||||||
|
F: FnOnce(&Q) -> U,
|
||||||
|
Q: QueueT + 'static,
|
||||||
|
{
|
||||||
|
queues.get(self.queue_select as usize).map(|q| f(&q.queue))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn with_queue_mut<F: FnOnce(&mut Q), Q: QueueT + 'static>(
|
||||||
|
&self,
|
||||||
|
queues: &mut [VirtioQueueConfig<Q>],
|
||||||
|
f: F,
|
||||||
|
) {
|
||||||
|
if let Some(queue) = queues.get_mut(self.queue_select as usize) {
|
||||||
|
f(&mut queue.queue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn read<
|
||||||
|
AS: GuestAddressSpace + 'static,
|
||||||
|
Q: QueueT + 'static,
|
||||||
|
R: 'static + GuestMemoryRegion,
|
||||||
|
>(
|
||||||
|
&self,
|
||||||
|
offset: u64,
|
||||||
|
data: &mut [u8],
|
||||||
|
queues: &[VirtioQueueConfig<Q>],
|
||||||
|
device: ArcMutexBoxDynVirtioDevice<AS, Q, R>,
|
||||||
|
) {
|
||||||
|
assert!(data.len() <= 8);
|
||||||
|
|
||||||
|
match data.len() {
|
||||||
|
1 => {
|
||||||
|
let v = self.read_common_config_byte(offset);
|
||||||
|
data[0] = v;
|
||||||
|
}
|
||||||
|
2 => {
|
||||||
|
let v = self.read_common_config_word(offset, queues);
|
||||||
|
LittleEndian::write_u16(data, v);
|
||||||
|
}
|
||||||
|
4 => {
|
||||||
|
let v = self.read_common_config_dword(offset, device);
|
||||||
|
LittleEndian::write_u32(data, v);
|
||||||
|
}
|
||||||
|
8 => {
|
||||||
|
let v = self.read_common_config_qword(offset);
|
||||||
|
LittleEndian::write_u64(data, v);
|
||||||
|
}
|
||||||
|
_ => error!("invalid data length for virtio read: len {}", data.len()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn write<
|
||||||
|
AS: GuestAddressSpace + 'static,
|
||||||
|
Q: QueueT + 'static,
|
||||||
|
R: 'static + GuestMemoryRegion,
|
||||||
|
>(
|
||||||
|
&mut self,
|
||||||
|
offset: u64,
|
||||||
|
data: &[u8],
|
||||||
|
queues: &mut [VirtioQueueConfig<Q>],
|
||||||
|
device: ArcMutexBoxDynVirtioDevice<AS, Q, R>,
|
||||||
|
) {
|
||||||
|
assert!(data.len() <= 8);
|
||||||
|
|
||||||
|
match data.len() {
|
||||||
|
1 => self.write_common_config_byte(offset, data[0]),
|
||||||
|
2 => self.write_common_config_word(offset, LittleEndian::read_u16(data), queues),
|
||||||
|
4 => {
|
||||||
|
self.write_common_config_dword(offset, LittleEndian::read_u32(data), queues, device)
|
||||||
|
}
|
||||||
|
8 => self.write_common_config_qword(offset, LittleEndian::read_u64(data), queues),
|
||||||
|
_ => error!("invalid data length for virtio write: len {}", data.len()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::super::virtio_pci::tests::{DummyDevice, DUMMY_FEATURES};
|
||||||
|
use super::*;
|
||||||
|
use dbs_virtio_devices::VirtioDevice;
|
||||||
|
use virtio_queue::QueueSync;
|
||||||
|
use vm_memory::{GuestMemoryMmap, GuestRegionMmap};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn write_base_regs() {
|
||||||
|
let regs_state = VirtioPciCommonConfigState {
|
||||||
|
driver_status: 0xaa,
|
||||||
|
config_generation: 0x55,
|
||||||
|
device_feature_select: 0x0,
|
||||||
|
driver_feature_select: 0x0,
|
||||||
|
queue_select: 0xff,
|
||||||
|
msix_config: 0,
|
||||||
|
msix_queues: vec![0; 3],
|
||||||
|
};
|
||||||
|
let mut regs = VirtioPciCommonConfig::new(regs_state);
|
||||||
|
|
||||||
|
let dev: Arc<
|
||||||
|
Mutex<Box<dyn VirtioDevice<Arc<GuestMemoryMmap>, QueueSync, GuestRegionMmap>>>,
|
||||||
|
> = Arc::new(Mutex::new(Box::new(DummyDevice::new())));
|
||||||
|
let mut queues = Vec::new();
|
||||||
|
queues.push(VirtioQueueConfig::create(2, 0).unwrap());
|
||||||
|
queues.push(VirtioQueueConfig::create(2, 1).unwrap());
|
||||||
|
|
||||||
|
// Can set all bits of driver_status.
|
||||||
|
regs.write(0x14, &[0x55], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0x00];
|
||||||
|
regs.read(0x14, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0x55);
|
||||||
|
|
||||||
|
// The config generation register is read only.
|
||||||
|
regs.write(0x15, &[0xaa], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0x00];
|
||||||
|
regs.read(0x15, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0x55);
|
||||||
|
|
||||||
|
// Device features is read-only and passed through from the device.
|
||||||
|
regs.write(0x04, &[0, 0, 0, 0], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0, 0, 0, 0];
|
||||||
|
regs.read(0x04, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(LittleEndian::read_u32(&read_back), DUMMY_FEATURES as u32);
|
||||||
|
|
||||||
|
// Read device features with device_feature_select as 0
|
||||||
|
regs.write(0x00, &[0, 0, 0, 0], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0, 0, 0, 0];
|
||||||
|
regs.read(0x04, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(LittleEndian::read_u32(&read_back), DUMMY_FEATURES as u32);
|
||||||
|
|
||||||
|
// Read device features with device_feature_select as 1
|
||||||
|
regs.write(0x00, &[1, 0, 0, 0], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0, 0, 0, 0];
|
||||||
|
regs.read(0x04, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(
|
||||||
|
LittleEndian::read_u32(&read_back),
|
||||||
|
(DUMMY_FEATURES >> 32) as u32
|
||||||
|
);
|
||||||
|
|
||||||
|
// Feature select registers are read/write.
|
||||||
|
regs.write(0x00, &[1, 2, 3, 4], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0, 0, 0, 0];
|
||||||
|
regs.read(0x00, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(LittleEndian::read_u32(&read_back), 0x0403_0201);
|
||||||
|
regs.write(0x08, &[1, 2, 3, 4], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0, 0, 0, 0];
|
||||||
|
regs.read(0x08, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(LittleEndian::read_u32(&read_back), 0x0403_0201);
|
||||||
|
|
||||||
|
// 'queue_select' can be read and written.
|
||||||
|
regs.write(0x16, &[0xaa, 0x55], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0x00, 0x00];
|
||||||
|
regs.read(0x16, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0xaa);
|
||||||
|
assert_eq!(read_back[1], 0x55);
|
||||||
|
|
||||||
|
// write msix_queues by queue_select 2
|
||||||
|
regs.write(0x16, &[0x02, 0x00], &mut queues, Arc::clone(&dev));
|
||||||
|
regs.write(0x1a, &[0xbb, 0xcc], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0x00, 0x00];
|
||||||
|
regs.read(0x1a, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0xbb);
|
||||||
|
assert_eq!(read_back[1], 0xcc);
|
||||||
|
|
||||||
|
// 'msix_config' can be read and written.
|
||||||
|
regs.write(0x10, &[0xdd, 0xee], &mut queues, Arc::clone(&dev));
|
||||||
|
let mut read_back = vec![0x00, 0x00];
|
||||||
|
regs.read(0x10, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0xdd);
|
||||||
|
assert_eq!(read_back[1], 0xee);
|
||||||
|
|
||||||
|
// 'queue_size' can be read and set.
|
||||||
|
let mut read_back = vec![0x00, 0x00];
|
||||||
|
// queue_select is 2 and queues[2] is None, so queue_size is 0
|
||||||
|
regs.read(0x18, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0x00);
|
||||||
|
assert_eq!(read_back[1], 0x00);
|
||||||
|
// queue_select is 1, so queue_size is 2
|
||||||
|
regs.write(0x16, &[0x01, 0x00], &mut queues, Arc::clone(&dev));
|
||||||
|
regs.read(0x18, &mut read_back, &queues, Arc::clone(&dev));
|
||||||
|
assert_eq!(read_back[0], 0x02);
|
||||||
|
assert_eq!(read_back[1], 0x00);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -888,7 +888,7 @@ pub struct VfioPciDeviceState<C: PciSystemContext> {
|
|||||||
vfio_path: String,
|
vfio_path: String,
|
||||||
interrupt: Interrupt,
|
interrupt: Interrupt,
|
||||||
vfio_dev: Arc<VfioDevice>,
|
vfio_dev: Arc<VfioDevice>,
|
||||||
context: Weak<C>,
|
context: Arc<Mutex<C>>,
|
||||||
configuration: PciConfiguration,
|
configuration: PciConfiguration,
|
||||||
device: Option<Weak<dyn DeviceIo>>,
|
device: Option<Weak<dyn DeviceIo>>,
|
||||||
regions: Vec<Region>,
|
regions: Vec<Region>,
|
||||||
@@ -904,7 +904,7 @@ impl<C: PciSystemContext> VfioPciDeviceState<C> {
|
|||||||
vfio_path: String,
|
vfio_path: String,
|
||||||
vfio_dev: Arc<VfioDevice>,
|
vfio_dev: Arc<VfioDevice>,
|
||||||
bus: Weak<PciBus>,
|
bus: Weak<PciBus>,
|
||||||
context: Weak<C>,
|
context: Arc<Mutex<C>>,
|
||||||
vendor_device_id: u32,
|
vendor_device_id: u32,
|
||||||
clique_id: Option<u8>,
|
clique_id: Option<u8>,
|
||||||
vfio_container: Arc<VfioContainer>,
|
vfio_container: Arc<VfioContainer>,
|
||||||
@@ -1277,11 +1277,7 @@ impl<C: PciSystemContext> VfioPciDeviceState<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn register_regions(&mut self, vm: &Arc<VmFd>) -> Result<()> {
|
fn register_regions(&mut self, vm: &Arc<VmFd>) -> Result<()> {
|
||||||
let ctx = self
|
let ctx = self.context.lock().unwrap().get_device_manager_context();
|
||||||
.context
|
|
||||||
.upgrade()
|
|
||||||
.ok_or(VfioPciError::BusIsDropped)?
|
|
||||||
.get_device_manager_context();
|
|
||||||
let mut tx = ctx.begin_tx();
|
let mut tx = ctx.begin_tx();
|
||||||
|
|
||||||
for region in self.regions.iter_mut() {
|
for region in self.regions.iter_mut() {
|
||||||
@@ -1336,22 +1332,7 @@ impl<C: PciSystemContext> VfioPciDeviceState<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn unregister_regions(&mut self, vm: &Arc<VmFd>) -> Result<()> {
|
fn unregister_regions(&mut self, vm: &Arc<VmFd>) -> Result<()> {
|
||||||
// This routine handle VfioPciDevice dropped but not unmap memory
|
let ctx = self.context.lock().unwrap().get_device_manager_context();
|
||||||
if self.context.upgrade().is_none() {
|
|
||||||
for region in self.regions.iter_mut() {
|
|
||||||
if region.mappable() {
|
|
||||||
region.unmap(vm, &self.vfio_container)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
let ctx = self
|
|
||||||
.context
|
|
||||||
.upgrade()
|
|
||||||
.ok_or(VfioPciError::BusIsDropped)?
|
|
||||||
.get_device_manager_context();
|
|
||||||
let mut tx = ctx.begin_tx();
|
let mut tx = ctx.begin_tx();
|
||||||
|
|
||||||
for region in self.regions.iter_mut() {
|
for region in self.regions.iter_mut() {
|
||||||
@@ -1380,11 +1361,8 @@ impl<C: PciSystemContext> VfioPciDeviceState<C> {
|
|||||||
} else {
|
} else {
|
||||||
// Safe to unwrap because activate() has set self.device to a valid value.
|
// Safe to unwrap because activate() has set self.device to a valid value.
|
||||||
let device = self.device.as_ref().unwrap().clone();
|
let device = self.device.as_ref().unwrap().clone();
|
||||||
let ctx: <C as PciSystemContext>::D = self
|
let ctx: <C as PciSystemContext>::D =
|
||||||
.context
|
self.context.lock().unwrap().get_device_manager_context();
|
||||||
.upgrade()
|
|
||||||
.ok_or(VfioPciError::BusIsDropped)?
|
|
||||||
.get_device_manager_context();
|
|
||||||
let mut tx = ctx.begin_tx();
|
let mut tx = ctx.begin_tx();
|
||||||
|
|
||||||
if let Err(e) = region.retrap(
|
if let Err(e) = region.retrap(
|
||||||
@@ -1561,7 +1539,7 @@ impl<C: PciSystemContext> VfioPciDevice<C> {
|
|||||||
path: String,
|
path: String,
|
||||||
bus: Weak<PciBus>,
|
bus: Weak<PciBus>,
|
||||||
device: VfioDevice,
|
device: VfioDevice,
|
||||||
context: Weak<C>,
|
context: Arc<Mutex<C>>,
|
||||||
vm_fd: Arc<VmFd>,
|
vm_fd: Arc<VmFd>,
|
||||||
vendor_device_id: u32,
|
vendor_device_id: u32,
|
||||||
clique_id: Option<u8>,
|
clique_id: Option<u8>,
|
||||||
@@ -1649,11 +1627,7 @@ impl<C: PciSystemContext> VfioPciDevice<C> {
|
|||||||
state.interrupt.add_msi_irq_resource(base, size);
|
state.interrupt.add_msi_irq_resource(base, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
let irq_manager = state
|
let irq_manager = state.context.lock().unwrap().get_interrupt_manager();
|
||||||
.context
|
|
||||||
.upgrade()
|
|
||||||
.ok_or(VfioPciError::BusIsDropped)?
|
|
||||||
.get_interrupt_manager();
|
|
||||||
state.interrupt.initialize(irq_manager)?;
|
state.interrupt.initialize(irq_manager)?;
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
self.set_device_id(&mut state);
|
self.set_device_id(&mut state);
|
||||||
|
|||||||
1637
src/dragonball/dbs_pci/src/virtio_pci.rs
Normal file
1637
src/dragonball/dbs_pci/src/virtio_pci.rs
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user