mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-22 14:54:23 +00:00
Compare commits
260 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acae4480ac | ||
|
|
0220b4d661 | ||
|
|
09efcfbd86 | ||
|
|
9f04d8e121 | ||
|
|
a9c8377073 | ||
|
|
0b4c434ece | ||
|
|
35629d0690 | ||
|
|
162ba19b85 | ||
|
|
42339e9cdf | ||
|
|
1795361589 | ||
|
|
28929f5b3e | ||
|
|
e66aa1ef8c | ||
|
|
d60513ece9 | ||
|
|
55aae75ed7 | ||
|
|
aaeb3b3221 | ||
|
|
21ccaf4a80 | ||
|
|
60f312b4ae | ||
|
|
1351ccb2de | ||
|
|
7f5f032aca | ||
|
|
6dc4c0faae | ||
|
|
2fe9df16cc | ||
|
|
45b44742de | ||
|
|
fa9ff1b299 | ||
|
|
d0e7a51f7b | ||
|
|
222393375a | ||
|
|
60c3d89767 | ||
|
|
3143787f69 | ||
|
|
497a3620c2 | ||
|
|
17ce44083c | ||
|
|
3b5cd2aad6 | ||
|
|
41d41d51f7 | ||
|
|
7d709a0759 | ||
|
|
4a6c718f23 | ||
|
|
47184e82f5 | ||
|
|
d9daddce28 | ||
|
|
629c942d4b | ||
|
|
1508e6f0f5 | ||
|
|
5a4050660a | ||
|
|
a786dc48b0 | ||
|
|
eb2bfbf7ac | ||
|
|
cef9485634 | ||
|
|
41a608e5ce | ||
|
|
e56f493191 | ||
|
|
bb820714cb | ||
|
|
549fd2a196 | ||
|
|
a7e27b9b68 | ||
|
|
8741f2ab3d | ||
|
|
1a75c12651 | ||
|
|
4c776167e5 | ||
|
|
cd79108c77 | ||
|
|
9185ef1a67 | ||
|
|
219ad505c2 | ||
|
|
a4d22fe330 | ||
|
|
6dabb3683f | ||
|
|
405f5283f0 | ||
|
|
32d40849fa | ||
|
|
ca4f96ed00 | ||
|
|
82b890349d | ||
|
|
51f41b1669 | ||
|
|
75d23b8884 | ||
|
|
83f54eec52 | ||
|
|
752c8b611e | ||
|
|
2a52351822 | ||
|
|
c8183a2c14 | ||
|
|
9cebbab29d | ||
|
|
c8b7a51d72 | ||
|
|
c56c896fc6 | ||
|
|
a282fa6865 | ||
|
|
0d2993dcfd | ||
|
|
a4597672c0 | ||
|
|
b7af7f344b | ||
|
|
aac555eeff | ||
|
|
4415a47fff | ||
|
|
11c744c5c3 | ||
|
|
fa7598f6ec | ||
|
|
3e86f3a95c | ||
|
|
56c0c172fa | ||
|
|
b76efa2a25 | ||
|
|
4da31bf2f9 | ||
|
|
d219fc20e1 | ||
|
|
3577e4bb43 | ||
|
|
19001af1e2 | ||
|
|
028f25ac84 | ||
|
|
90bc749a19 | ||
|
|
da17b06d28 | ||
|
|
97a4a1574e | ||
|
|
18597588c0 | ||
|
|
661d88b11f | ||
|
|
579d373623 | ||
|
|
f5decea13e | ||
|
|
0fa2cd8202 | ||
|
|
a224b4f9e4 | ||
|
|
f0f1974e14 | ||
|
|
8dfeed77cd | ||
|
|
806d63d1d8 | ||
|
|
c8f40fe12c | ||
|
|
4a79c2520d | ||
|
|
9cc14e4908 | ||
|
|
92160c82ff | ||
|
|
5f08cc75b3 | ||
|
|
878e50f978 | ||
|
|
fb22e873cd | ||
|
|
87e41e2a09 | ||
|
|
f22272b8f7 | ||
|
|
7cd4e3278a | ||
|
|
c740896b1c | ||
|
|
3916507553 | ||
|
|
c5ceae887b | ||
|
|
4039506740 | ||
|
|
3fbe493edc | ||
|
|
0b5b8f549d | ||
|
|
d37183d754 | ||
|
|
ffa3a5a15e | ||
|
|
c68eb58f3f | ||
|
|
09297b7955 | ||
|
|
bca31d5a4d | ||
|
|
5f17e61d11 | ||
|
|
842e17b756 | ||
|
|
7bc25b0259 | ||
|
|
967f66f677 | ||
|
|
f96b8fb690 | ||
|
|
b7bf46fdfa | ||
|
|
b8838140d0 | ||
|
|
990c4e68ee | ||
|
|
3c7a670129 | ||
|
|
e4da3b84a3 | ||
|
|
294b2c1c10 | ||
|
|
afedad0965 | ||
|
|
ecac3d2d28 | ||
|
|
8eebcef8fb | ||
|
|
675ea86aba | ||
|
|
ff7ac58579 | ||
|
|
fcaade24f4 | ||
|
|
110f68a0f1 | ||
|
|
2c2995b7b0 | ||
|
|
ef545eed86 | ||
|
|
d291e9bda0 | ||
|
|
a2faf93211 | ||
|
|
fd21c9df59 | ||
|
|
679cc9d47c | ||
|
|
1c718dbcdd | ||
|
|
362ea54763 | ||
|
|
2e35a8067d | ||
|
|
6f23608e96 | ||
|
|
7ffbdf7b3a | ||
|
|
7845129bdc | ||
|
|
fe532f9d04 | ||
|
|
c3b2d69452 | ||
|
|
8723eedad2 | ||
|
|
c857f59a1a | ||
|
|
2b95facc6f | ||
|
|
8f8b196705 | ||
|
|
fb1c35335a | ||
|
|
72a38457f0 | ||
|
|
210844ce6b | ||
|
|
95d513b379 | ||
|
|
0347698c59 | ||
|
|
7a59d7f937 | ||
|
|
8d86bcea4b | ||
|
|
8d7d859e30 | ||
|
|
e7b9eddced | ||
|
|
07b41c88de | ||
|
|
6932beb01f | ||
|
|
abbe1be69f | ||
|
|
9dd365fdb5 | ||
|
|
1cbea890f1 | ||
|
|
6adec0737c | ||
|
|
bd2dc1422e | ||
|
|
d7f998fbd5 | ||
|
|
68c8c31718 | ||
|
|
9ebbc08d70 | ||
|
|
5b1459e623 | ||
|
|
8784cebb84 | ||
|
|
b7c1d04a47 | ||
|
|
9839c17cad | ||
|
|
1a06bd1f08 | ||
|
|
f886e82f03 | ||
|
|
ce524a3958 | ||
|
|
f04bb3f34c | ||
|
|
b024d8737c | ||
|
|
69d2c078d1 | ||
|
|
e66baf503b | ||
|
|
8d4e3b47b1 | ||
|
|
91cadb7bfe | ||
|
|
e2b93fff3f | ||
|
|
fe5d43b4bd | ||
|
|
61b12d4e1b | ||
|
|
a43e06e0eb | ||
|
|
d94085916e | ||
|
|
820c1389db | ||
|
|
bb2a427a8a | ||
|
|
8c57beb943 | ||
|
|
ac928218f3 | ||
|
|
b6cd6e6914 | ||
|
|
a1aa3e79d4 | ||
|
|
1ff54a95d2 | ||
|
|
34c8cd810d | ||
|
|
e6e4cd91b8 | ||
|
|
e5f44fae30 | ||
|
|
866d3facba | ||
|
|
ed0c0b2367 | ||
|
|
9a1d4fc5d6 | ||
|
|
9079c8e598 | ||
|
|
d53c720ac1 | ||
|
|
290fda9b97 | ||
|
|
c7da62dd1e | ||
|
|
bebe377f0d | ||
|
|
9ff30c6aeb | ||
|
|
69c706b570 | ||
|
|
eae62ca9ac | ||
|
|
4719c08184 | ||
|
|
48c8e0f296 | ||
|
|
648fef4f52 | ||
|
|
2d43b3f9fc | ||
|
|
74eccc54e7 | ||
|
|
43739cefdf | ||
|
|
9bdbd82690 | ||
|
|
1c59516d72 | ||
|
|
a3671b7a5c | ||
|
|
7df29605a4 | ||
|
|
9a51ade4e2 | ||
|
|
ceaae3049c | ||
|
|
871465f5d3 | ||
|
|
afcb042c28 | ||
|
|
d6d8497b56 | ||
|
|
4a4361393c | ||
|
|
5c8170dbb9 | ||
|
|
6ea1494701 | ||
|
|
8c1482a221 | ||
|
|
9b21d062c9 | ||
|
|
4ca394f4fc | ||
|
|
2603ee66b8 | ||
|
|
89dcc8fb27 | ||
|
|
0a57e09259 | ||
|
|
8aecf14b34 | ||
|
|
62c9845623 | ||
|
|
649e31340b | ||
|
|
6dd025d0ed | ||
|
|
4f245df4a0 | ||
|
|
4e57cc0ed2 | ||
|
|
8c1f6e827d | ||
|
|
1d2d2cc3d5 | ||
|
|
9685e2aeca | ||
|
|
e204847df5 | ||
|
|
e11fc3334e | ||
|
|
0aa80313eb | ||
|
|
b22135f4e5 | ||
|
|
6628ba3208 | ||
|
|
9d3b9fb438 | ||
|
|
4bfa74c2a5 | ||
|
|
353b4bc853 | ||
|
|
cac1cb75ce | ||
|
|
900d9be55e | ||
|
|
d9defd5102 | ||
|
|
0f1c326ca0 | ||
|
|
cc27966aa1 | ||
|
|
e093919b42 | ||
|
|
776c89453c | ||
|
|
71d1cdf40a | ||
|
|
822f54c800 |
1
.github/actionlint.yaml
vendored
1
.github/actionlint.yaml
vendored
@@ -19,7 +19,6 @@ self-hosted-runner:
|
||||
- metrics
|
||||
- ppc64le
|
||||
- riscv-builder
|
||||
- sev
|
||||
- sev-snp
|
||||
- s390x
|
||||
- s390x-large
|
||||
|
||||
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
@@ -19,20 +19,23 @@ updates:
|
||||
ignore:
|
||||
# rust-vmm repos might cause incompatibilities on patch versions, so
|
||||
# lets handle them manually for now.
|
||||
- dependency-name: "vhost"
|
||||
- dependency-name: "vhost-user-backend"
|
||||
- dependency-name: "event-manager"
|
||||
- dependency-name: "kvm-bindings"
|
||||
- dependency-name: "kvm-ioctls"
|
||||
- dependency-name: "linux-loader"
|
||||
- dependency-name: "seccompiler"
|
||||
- dependency-name: "vfio-bindings"
|
||||
- dependency-name: "vfio-ioctls"
|
||||
- dependency-name: "virtio-bindings"
|
||||
- dependency-name: "virtio-queue"
|
||||
- dependency-name: "virtio-vsock"
|
||||
- dependency-name: "vm-fdt"
|
||||
- dependency-name: "vm-memory"
|
||||
- dependency-name: "vm-superio"
|
||||
- dependency-name: "vmm-sys-util"
|
||||
# As we often have up to 8/9 components that need the same versions bumps
|
||||
# create groups for common dependencies, so they can all go in a single PR
|
||||
# We can extend this as we see more frequent groups
|
||||
groups:
|
||||
atty:
|
||||
patterns:
|
||||
- atty
|
||||
bit-vec:
|
||||
patterns:
|
||||
- bit-vec
|
||||
|
||||
1
.github/workflows/PR-wip-checks.yaml
vendored
1
.github/workflows/PR-wip-checks.yaml
vendored
@@ -22,7 +22,6 @@ jobs:
|
||||
name: WIP Check
|
||||
steps:
|
||||
- name: WIP Check
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||
uses: tim-actions/wip-check@1c2a1ca6c110026b3e2297bb2ef39e1747b5a755 # master (2021-06-10)
|
||||
with:
|
||||
labels: '["do-not-merge", "wip", "rfc"]'
|
||||
|
||||
2
.github/workflows/actionlint.yaml
vendored
2
.github/workflows/actionlint.yaml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
38
.github/workflows/basic-ci-amd64.yaml
vendored
38
.github/workflows/basic-ci-amd64.yaml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
SANDBOXER: "shim"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
run: bash tests/integration/cri-containerd/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
SANDBOXER: "podsandbox"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
run: bash tests/stability/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
GOPATH: ${{ github.workspace }}
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -134,7 +134,7 @@ jobs:
|
||||
run: bash tests/integration/nydus/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -153,7 +153,7 @@ jobs:
|
||||
env:
|
||||
CONTAINERD_VERSION: lts
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -169,7 +169,7 @@ jobs:
|
||||
run: bash tests/integration/runk/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -195,7 +195,7 @@ jobs:
|
||||
env:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -211,7 +211,7 @@ jobs:
|
||||
run: bash tests/functional/tracing/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -239,7 +239,7 @@ jobs:
|
||||
GOPATH: ${{ github.workspace }}
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -255,7 +255,7 @@ jobs:
|
||||
run: bash tests/functional/vfio/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -280,7 +280,7 @@ jobs:
|
||||
env:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -296,7 +296,7 @@ jobs:
|
||||
run: bash tests/integration/docker/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -324,7 +324,7 @@ jobs:
|
||||
env:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -342,7 +342,7 @@ jobs:
|
||||
run: bash tests/integration/nerdctl/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -360,7 +360,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
- name: Archive artifacts ${{ matrix.vmm }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: nerdctl-tests-garm-${{ matrix.vmm }}
|
||||
path: /tmp/artifacts
|
||||
@@ -369,7 +369,7 @@ jobs:
|
||||
run-kata-agent-apis:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -385,7 +385,7 @@ jobs:
|
||||
run: bash tests/functional/kata-agent-apis/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
|
||||
12
.github/workflows/basic-ci-s390x.yaml
vendored
12
.github/workflows/basic-ci-s390x.yaml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
SANDBOXER: "shim"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
run: bash tests/integration/cri-containerd/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-s390x${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
SANDBOXER: "podsandbox"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
run: bash tests/stability/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-s390x${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
env:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
run: bash tests/integration/docker/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-s390x${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
sudo rm -f /tmp/kata_hybrid* # Sometime we got leftover from test_setup_hvsock_failed()
|
||||
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
2
.github/workflows/build-checks.yaml
vendored
2
.github/workflows/build-checks.yaml
vendored
@@ -70,7 +70,7 @@ jobs:
|
||||
sudo rm -f /tmp/kata_hybrid* # Sometime we got leftover from test_setup_hvsock_failed()
|
||||
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/attest-build-provenance@v1
|
||||
- uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
|
||||
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
||||
with:
|
||||
subject-name: ${{ steps.parse-oci-segments.outputs.oci-name }}
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
push-to-registry: true
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-amd64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
|
||||
- name: store-extratarballs-artifact ${{ matrix.asset }}
|
||||
if: ${{ startsWith(matrix.asset, 'kernel-nvidia-gpu') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-amd64-${{ matrix.asset }}-headers${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}-headers.tar.xz
|
||||
@@ -168,8 +168,8 @@ jobs:
|
||||
- rootfs-image-mariner
|
||||
- rootfs-initrd
|
||||
- rootfs-initrd-confidential
|
||||
- rootfs-nvidia-gpu-initrd
|
||||
- rootfs-nvidia-gpu-confidential-initrd
|
||||
- rootfs-initrd-nvidia-gpu
|
||||
- rootfs-initrd-nvidia-gpu-confidential
|
||||
steps:
|
||||
- name: Login to Kata Containers quay.io
|
||||
if: ${{ inputs.push-to-registry == 'yes' }}
|
||||
@@ -179,7 +179,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -192,7 +192,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-amd64-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -217,7 +217,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-amd64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -270,7 +270,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -283,7 +283,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-amd64-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -309,7 +309,7 @@ jobs:
|
||||
MEASURED_ROOTFS: yes
|
||||
|
||||
- name: store-artifact shim-v2
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-amd64-shim-v2${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-shim-v2.tar.xz
|
||||
@@ -323,10 +323,11 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
persist-credentials: false
|
||||
- name: Rebase atop of the latest target branch
|
||||
run: |
|
||||
@@ -334,7 +335,7 @@ jobs:
|
||||
env:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-amd64-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -342,8 +343,10 @@ jobs:
|
||||
- name: merge-artifacts
|
||||
run: |
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
|
||||
env:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
- name: store-artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-static.tar.xz
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/attest-build-provenance@v1
|
||||
- uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
|
||||
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
||||
with:
|
||||
subject-name: ${{ steps.parse-oci-segments.outputs.oci-name }}
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
push-to-registry: true
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -127,7 +127,7 @@ jobs:
|
||||
|
||||
- name: store-extratarballs-artifact ${{ matrix.asset }}
|
||||
if: ${{ startsWith(matrix.asset, 'kernel-nvidia-gpu') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-arm64-${{ matrix.asset }}-headers${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}-headers.tar.xz
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
asset:
|
||||
- rootfs-image
|
||||
- rootfs-initrd
|
||||
- rootfs-nvidia-gpu-initrd
|
||||
- rootfs-initrd-nvidia-gpu
|
||||
steps:
|
||||
- name: Login to Kata Containers quay.io
|
||||
if: ${{ inputs.push-to-registry == 'yes' }}
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -168,7 +168,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-arm64-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -192,7 +192,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -242,7 +242,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -255,7 +255,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-arm64-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -279,7 +279,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact shim-v2
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-arm64-shim-v2${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-shim-v2.tar.xz
|
||||
@@ -293,10 +293,11 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
persist-credentials: false
|
||||
- name: Rebase atop of the latest target branch
|
||||
run: |
|
||||
@@ -304,7 +305,7 @@ jobs:
|
||||
env:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-arm64-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -312,8 +313,10 @@ jobs:
|
||||
- name: merge-artifacts
|
||||
run: |
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
|
||||
env:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
- name: store-artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-static-tarball-arm64${{ inputs.tarball-suffix }}
|
||||
path: kata-static.tar.xz
|
||||
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-ppc64le-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-ppc64le-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-ppc64le-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -181,7 +181,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -194,7 +194,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-ppc64le-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -218,7 +218,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact shim-v2
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-ppc64le-shim-v2${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-shim-v2.tar.xz
|
||||
@@ -236,10 +236,11 @@ jobs:
|
||||
run: |
|
||||
sudo chown -R "$USER":"$USER" "$GITHUB_WORKSPACE"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
persist-credentials: false
|
||||
- name: Rebase atop of the latest target branch
|
||||
run: |
|
||||
@@ -247,7 +248,7 @@ jobs:
|
||||
env:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-ppc64le-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -255,8 +256,10 @@ jobs:
|
||||
- name: merge-artifacts
|
||||
run: |
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
|
||||
env:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
- name: store-artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-static-tarball-ppc64le${{ inputs.tarball-suffix }}
|
||||
path: kata-static.tar.xz
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-riscv64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/attest-build-provenance@v1
|
||||
- uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
|
||||
if: ${{ env.PERFORM_ATTESTATION == 'yes' }}
|
||||
with:
|
||||
subject-name: ${{ steps.parse-oci-segments.outputs.oci-name }}
|
||||
@@ -112,7 +112,7 @@ jobs:
|
||||
push-to-registry: true
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-s390x-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -141,7 +141,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-s390x-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -179,7 +179,7 @@ jobs:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
|
||||
- name: store-artifact ${{ matrix.asset }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-s390x-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||
@@ -193,7 +193,7 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Rebase atop of the latest target branch
|
||||
@@ -203,7 +203,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-s390x-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -227,7 +227,7 @@ jobs:
|
||||
HKD_PATH: "host-key-document"
|
||||
|
||||
- name: store-artifact boot-image-se
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-s390x${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-boot-image-se.tar.xz
|
||||
@@ -265,7 +265,7 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||
@@ -278,7 +278,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-s390x-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -304,7 +304,7 @@ jobs:
|
||||
MEASURED_ROOTFS: no
|
||||
|
||||
- name: store-artifact shim-v2
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-artifacts-s390x-shim-v2${{ inputs.tarball-suffix }}
|
||||
path: kata-build/kata-static-shim-v2.tar.xz
|
||||
@@ -322,10 +322,11 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
persist-credentials: false
|
||||
- name: Rebase atop of the latest target branch
|
||||
run: |
|
||||
@@ -333,7 +334,7 @@ jobs:
|
||||
env:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
pattern: kata-artifacts-s390x-*${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -341,8 +342,10 @@ jobs:
|
||||
- name: merge-artifacts
|
||||
run: |
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
|
||||
env:
|
||||
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||
- name: store-artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: kata-static-tarball-s390x${{ inputs.tarball-suffix }}
|
||||
path: kata-static.tar.xz
|
||||
|
||||
5
.github/workflows/cargo-deny-runner.yaml
vendored
5
.github/workflows/cargo-deny-runner.yaml
vendored
@@ -20,16 +20,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Generate Action
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||
run: bash cargo-deny-generator.sh
|
||||
working-directory: ./.github/cargo-deny-composite-action/
|
||||
env:
|
||||
GOPATH: ${{ github.workspace }}/kata-containers
|
||||
- name: Run Action
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||
uses: ./.github/cargo-deny-composite-action
|
||||
|
||||
5
.github/workflows/ci-coco-stability.yaml
vendored
5
.github/workflows/ci-coco-stability.yaml
vendored
@@ -1,7 +1,8 @@
|
||||
name: Kata Containers CoCo Stability Tests Weekly
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
# Note: This workload is not currently maintained, so skipping it's scheduled runs
|
||||
# schedule:
|
||||
# - cron: '0 0 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
||||
1
.github/workflows/ci-on-push.yaml
vendored
1
.github/workflows/ci-on-push.yaml
vendored
@@ -16,7 +16,6 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
|
||||
2
.github/workflows/ci-weekly.yaml
vendored
2
.github/workflows/ci-weekly.yaml
vendored
@@ -69,7 +69,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
|
||||
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@@ -185,7 +185,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -227,7 +227,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -240,7 +240,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64-${{ inputs.tag }}
|
||||
path: kata-artifacts
|
||||
|
||||
2
.github/workflows/cleanup-resources.yaml
vendored
2
.github/workflows/cleanup-resources.yaml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
environment: ci
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
10
.github/workflows/commit-message-check.yaml
vendored
10
.github/workflows/commit-message-check.yaml
vendored
@@ -27,7 +27,6 @@ jobs:
|
||||
name: Commit Message Check
|
||||
steps:
|
||||
- name: Get PR Commits
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||
id: 'get-pr-commits'
|
||||
uses: tim-actions/get-pr-commits@c64db31d359214d244884dd68f971a110b29ab83 # v1.2.0
|
||||
with:
|
||||
@@ -43,19 +42,18 @@ jobs:
|
||||
filter_out_pattern: '^Revert "|^Reapply "'
|
||||
|
||||
- name: DCO Check
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||
uses: tim-actions/dco@2fd0504dc0d27b33f542867c300c60840c6dcb20 # master (2020-04-28)
|
||||
with:
|
||||
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
||||
|
||||
- name: Commit Body Missing Check
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }}
|
||||
if: ${{ success() || failure() }}
|
||||
uses: tim-actions/commit-body-check@d2e0e8e1f0332b3281c98867c42a2fbe25ad3f15 # v1.0.2
|
||||
with:
|
||||
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
||||
|
||||
- name: Check Subject Line Length
|
||||
if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }}
|
||||
if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && ( success() || failure() ) }}
|
||||
uses: tim-actions/commit-message-checker-with-regex@d6d9770051dd6460679d1cab1dcaa8cffc5c2bbd # v0.3.1
|
||||
with:
|
||||
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
||||
@@ -64,7 +62,7 @@ jobs:
|
||||
post_error: ${{ env.error_msg }}
|
||||
|
||||
- name: Check Body Line Length
|
||||
if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }}
|
||||
if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && ( success() || failure() ) }}
|
||||
uses: tim-actions/commit-message-checker-with-regex@d6d9770051dd6460679d1cab1dcaa8cffc5c2bbd # v0.3.1
|
||||
with:
|
||||
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
||||
@@ -95,7 +93,7 @@ jobs:
|
||||
post_error: ${{ env.error_msg }}
|
||||
|
||||
- name: Check Subsystem
|
||||
if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }}
|
||||
if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && ( success() || failure() ) }}
|
||||
uses: tim-actions/commit-message-checker-with-regex@d6d9770051dd6460679d1cab1dcaa8cffc5c2bbd # v0.3.1
|
||||
with:
|
||||
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
||||
|
||||
4
.github/workflows/darwin-tests.yaml
vendored
4
.github/workflows/darwin-tests.yaml
vendored
@@ -19,11 +19,11 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.10
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Build utils
|
||||
|
||||
4
.github/workflows/docs-url-alive-check.yaml
vendored
4
.github/workflows/docs-url-alive-check.yaml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
target_branch: ${{ github.base_ref }}
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: 1.23.10
|
||||
env:
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
|
||||
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
2
.github/workflows/gatekeeper-skipper.yaml
vendored
2
.github/workflows/gatekeeper-skipper.yaml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
skip_test: ${{ steps.skipper.outputs.skip_test }}
|
||||
skip_static: ${{ steps.skipper.outputs.skip_static }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
|
||||
2
.github/workflows/gatekeeper.yaml
vendored
2
.github/workflows/gatekeeper.yaml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Ensure the split out runtime classes match the all-in-one file
|
||||
|
||||
41
.github/workflows/osv-scanner.yaml
vendored
Normal file
41
.github/workflows/osv-scanner.yaml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# A sample workflow which sets up periodic OSV-Scanner scanning for vulnerabilities,
|
||||
# in addition to a PR check which fails if new vulnerabilities are introduced.
|
||||
#
|
||||
# For more examples and options, including how to ignore specific vulnerabilities,
|
||||
# see https://google.github.io/osv-scanner/github-action/
|
||||
|
||||
name: OSV-Scanner
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
schedule:
|
||||
- cron: '0 1 * * 0'
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
scan-scheduled:
|
||||
permissions:
|
||||
actions: read # # Required to upload SARIF file to CodeQL
|
||||
contents: read # Read commit contents
|
||||
security-events: write # Require writing security events to upload SARIF file to security tab
|
||||
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
|
||||
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@b00f71e051ddddc6e46a193c31c8c0bf283bf9e6" # v2.1.0
|
||||
with:
|
||||
scan-args: |-
|
||||
-r
|
||||
./
|
||||
scan-pr:
|
||||
permissions:
|
||||
actions: read # Required to upload SARIF file to CodeQL
|
||||
contents: read # Read commit contents
|
||||
security-events: write # Require writing security events to upload SARIF file to security tab
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@b00f71e051ddddc6e46a193c31c8c0bf283bf9e6" # v2.1.0
|
||||
with:
|
||||
# Example of specifying custom arguments
|
||||
scan-args: |-
|
||||
-r
|
||||
./
|
||||
2
.github/workflows/payload-after-push.yaml
vendored
2
.github/workflows/payload-after-push.yaml
vendored
@@ -143,7 +143,7 @@ jobs:
|
||||
needs: [publish-kata-deploy-payload-amd64, publish-kata-deploy-payload-arm64, publish-kata-deploy-payload-s390x, publish-kata-deploy-payload-ppc64le]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
packages: write
|
||||
runs-on: ${{ inputs.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-kata-tarball for ${{ inputs.arch }}
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-${{ inputs.arch}}${{ inputs.tarball-suffix }}
|
||||
|
||||
@@ -79,7 +79,12 @@ jobs:
|
||||
|
||||
- name: build-and-push-kata-payload for ${{ inputs.arch }}
|
||||
id: build-and-push-kata-payload
|
||||
env:
|
||||
REGISTRY: ${{ inputs.registry }}
|
||||
REPO: ${{ inputs.repo }}
|
||||
TAG: ${{ inputs.tag }}
|
||||
run: |
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz \
|
||||
${{ inputs.registry }}/${{ inputs.repo }} ${{ inputs.tag }}
|
||||
"$(pwd)/kata-static.tar.xz" \
|
||||
"${REGISTRY}/${REPO}" \
|
||||
"${TAG}"
|
||||
|
||||
10
.github/workflows/release-amd64.yaml
vendored
10
.github/workflows/release-amd64.yaml
vendored
@@ -47,16 +47,18 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64
|
||||
|
||||
- name: build-and-push-kata-deploy-ci-amd64
|
||||
id: build-and-push-kata-deploy-ci-amd64
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
run: |
|
||||
# We need to do such trick here as the format of the $GITHUB_REF
|
||||
# is "refs/tags/<tag>"
|
||||
@@ -70,8 +72,8 @@ jobs:
|
||||
for tag in "${tags[@]}"; do
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
done
|
||||
|
||||
10
.github/workflows/release-arm64.yaml
vendored
10
.github/workflows/release-arm64.yaml
vendored
@@ -47,16 +47,18 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-arm64
|
||||
|
||||
- name: build-and-push-kata-deploy-ci-arm64
|
||||
id: build-and-push-kata-deploy-ci-arm64
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
run: |
|
||||
# We need to do such trick here as the format of the $GITHUB_REF
|
||||
# is "refs/tags/<tag>"
|
||||
@@ -70,8 +72,8 @@ jobs:
|
||||
for tag in "${tags[@]}"; do
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
done
|
||||
|
||||
10
.github/workflows/release-ppc64le.yaml
vendored
10
.github/workflows/release-ppc64le.yaml
vendored
@@ -47,16 +47,18 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-ppc64le
|
||||
|
||||
- name: build-and-push-kata-deploy-ci-ppc64le
|
||||
id: build-and-push-kata-deploy-ci-ppc64le
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
run: |
|
||||
# We need to do such trick here as the format of the $GITHUB_REF
|
||||
# is "refs/tags/<tag>"
|
||||
@@ -70,8 +72,8 @@ jobs:
|
||||
for tag in "${tags[@]}"; do
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
done
|
||||
|
||||
10
.github/workflows/release-s390x.yaml
vendored
10
.github/workflows/release-s390x.yaml
vendored
@@ -51,16 +51,18 @@ jobs:
|
||||
username: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-s390x
|
||||
|
||||
- name: build-and-push-kata-deploy-ci-s390x
|
||||
id: build-and-push-kata-deploy-ci-s390x
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
run: |
|
||||
# We need to do such trick here as the format of the $GITHUB_REF
|
||||
# is "refs/tags/<tag>"
|
||||
@@ -74,8 +76,8 @@ jobs:
|
||||
for tag in "${tags[@]}"; do
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "ghcr.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
./tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh \
|
||||
"$(pwd)"/kata-static.tar.xz "quay.io/kata-containers/kata-deploy" \
|
||||
"${tag}-${{ inputs.target-arch }}"
|
||||
"${tag}-${TARGET_ARCH}"
|
||||
done
|
||||
|
||||
31
.github/workflows/release.yaml
vendored
31
.github/workflows/release.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
contents: write # needed for the `gh release create` command
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
packages: write # needed to push the multi-arch manifest to ghcr.io
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -120,7 +120,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
echo "KATA_STATIC_TARBALL=${tarball}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Download amd64 artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64
|
||||
|
||||
@@ -142,7 +142,7 @@ jobs:
|
||||
ARCHITECTURE: amd64
|
||||
|
||||
- name: Download arm64 artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-arm64
|
||||
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
ARCHITECTURE: arm64
|
||||
|
||||
- name: Download s390x artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-s390x
|
||||
|
||||
@@ -166,7 +166,7 @@ jobs:
|
||||
ARCHITECTURE: s390x
|
||||
|
||||
- name: Download ppc64le artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-ppc64le
|
||||
|
||||
@@ -184,7 +184,7 @@ jobs:
|
||||
contents: write # needed for the `gh release` commands
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -201,7 +201,7 @@ jobs:
|
||||
contents: write # needed for the `gh release` commands
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -218,7 +218,7 @@ jobs:
|
||||
contents: write # needed for the `gh release` commands
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -236,7 +236,7 @@ jobs:
|
||||
packages: write # needed to push the helm chart to ghcr.io
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -251,9 +251,12 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Login to the OCI registries
|
||||
env:
|
||||
QUAY_DEPLOYER_USERNAME: ${{ vars.QUAY_DEPLOYER_USERNAME }}
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
run: |
|
||||
echo "${{ secrets.QUAY_DEPLOYER_PASSWORD }}" | helm registry login quay.io --username "${{ vars.QUAY_DEPLOYER_USERNAME }}" --password-stdin
|
||||
echo "${{ github.token }}" | helm registry login ghcr.io --username "${{ github.actor }}" --password-stdin
|
||||
echo "${{ secrets.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
|
||||
|
||||
- name: Push helm chart to the OCI registries
|
||||
run: |
|
||||
@@ -268,7 +271,7 @@ jobs:
|
||||
contents: write # needed for the `gh release` commands
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
GOPATH: ${{ github.workspace }}
|
||||
KATA_HYPERVISOR: ${{ inputs.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
run: bash tests/integration/cri-containerd/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball for ${{ inputs.arch }}
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-${{ inputs.arch }}${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
|
||||
12
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
12
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
@@ -85,7 +85,7 @@ jobs:
|
||||
GENPOLICY_PULL_METHOD: ${{ matrix.genpolicy-pull-method }}
|
||||
AUTO_GENERATE_POLICY: ${{ matrix.auto-generate-policy }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -107,7 +107,9 @@ jobs:
|
||||
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
|
||||
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
|
||||
with:
|
||||
version: 'latest'
|
||||
|
||||
- name: Log into the Azure account
|
||||
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
||||
@@ -129,7 +131,9 @@ jobs:
|
||||
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
||||
|
||||
- name: Install `kubectl`
|
||||
run: bash tests/integration/kubernetes/gha-run.sh install-kubectl
|
||||
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
|
||||
with:
|
||||
version: 'latest'
|
||||
|
||||
- name: Download credentials for the Kubernetes CLI to use them
|
||||
run: bash tests/integration/kubernetes/gha-run.sh get-cluster-credentials
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
K8S_TEST_HOST_TYPE: all
|
||||
CONTAINER_RUNTIME: ${{ matrix.container_runtime }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -79,6 +79,8 @@ jobs:
|
||||
|
||||
- name: Deploy ${{ matrix.k8s }}
|
||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s
|
||||
env:
|
||||
CONTAINER_RUNTIME: ${{ matrix.container_runtime }}
|
||||
|
||||
- name: Configure the ${{ matrix.snapshotter }} snapshotter
|
||||
if: matrix.snapshotter != ''
|
||||
@@ -101,7 +103,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
- name: Archive artifacts ${{ matrix.vmm }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: k8s-tests-${{ matrix.vmm }}-${{ matrix.snapshotter }}-${{ matrix.k8s }}-${{ inputs.tag }}
|
||||
path: /tmp/artifacts
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
K8S_TEST_HOST_TYPE: all
|
||||
TARGET_ARCH: "aarch64"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
- name: Archive artifacts ${{ matrix.vmm }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: k8s-tests-${{ matrix.vmm }}-${{ matrix.k8s }}-${{ inputs.tag }}
|
||||
path: /tmp/artifacts
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
USING_NFD: "false"
|
||||
TARGET_ARCH: "ppc64le"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
|
||||
2
.github/workflows/run-k8s-tests-on-zvsi.yaml
vendored
2
.github/workflows/run-k8s-tests-on-zvsi.yaml
vendored
@@ -81,7 +81,7 @@ jobs:
|
||||
AUTHENTICATED_IMAGE_USER: ${{ vars.AUTHENTICATED_IMAGE_USER }}
|
||||
AUTHENTICATED_IMAGE_PASSWORD: ${{ secrets.AUTHENTICATED_IMAGE_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
SNAPSHOTTER: ${{ matrix.snapshotter }}
|
||||
USING_NFD: "false"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -114,7 +114,9 @@ jobs:
|
||||
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
||||
|
||||
- name: Install `kubectl`
|
||||
run: bash tests/integration/kubernetes/gha-run.sh install-kubectl
|
||||
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
|
||||
with:
|
||||
version: 'latest'
|
||||
|
||||
- name: Download credentials for the Kubernetes CLI to use them
|
||||
run: bash tests/integration/kubernetes/gha-run.sh get-cluster-credentials
|
||||
|
||||
13
.github/workflows/run-kata-coco-tests.yaml
vendored
13
.github/workflows/run-kata-coco-tests.yaml
vendored
@@ -70,7 +70,7 @@ jobs:
|
||||
ITA_KEY: ${{ secrets.ITA_KEY }}
|
||||
AUTO_GENERATE_POLICY: "yes"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -126,7 +126,6 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
run: bash tests/integration/kubernetes/gha-run.sh delete-csi-driver
|
||||
|
||||
# AMD has deprecated SEV support on Kata and henceforth SNP will be the only feature supported for Kata Containers.
|
||||
run-k8s-tests-sev-snp:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -156,7 +155,7 @@ jobs:
|
||||
AUTHENTICATED_IMAGE_PASSWORD: ${{ secrets.AUTHENTICATED_IMAGE_PASSWORD }}
|
||||
AUTO_GENERATE_POLICY: "yes"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -248,7 +247,7 @@ jobs:
|
||||
USING_NFD: "false"
|
||||
AUTO_GENERATE_POLICY: "yes"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -261,7 +260,7 @@ jobs:
|
||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
@@ -292,7 +291,9 @@ jobs:
|
||||
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
||||
|
||||
- name: Install `kubectl`
|
||||
run: bash tests/integration/kubernetes/gha-run.sh install-kubectl
|
||||
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
|
||||
with:
|
||||
version: 'latest'
|
||||
|
||||
- name: Download credentials for the Kubernetes CLI to use them
|
||||
run: bash tests/integration/kubernetes/gha-run.sh get-cluster-credentials
|
||||
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
KUBERNETES: "vanilla"
|
||||
USING_NFD: "false"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -95,7 +95,9 @@ jobs:
|
||||
run: bash tests/functional/kata-deploy/gha-run.sh install-bats
|
||||
|
||||
- name: Install `kubectl`
|
||||
run: bash tests/functional/kata-deploy/gha-run.sh install-kubectl
|
||||
uses: azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
|
||||
with:
|
||||
version: 'latest'
|
||||
|
||||
- name: Download credentials for the Kubernetes CLI to use them
|
||||
run: bash tests/functional/kata-deploy/gha-run.sh get-cluster-credentials
|
||||
|
||||
2
.github/workflows/run-kata-deploy-tests.yaml
vendored
2
.github/workflows/run-kata-deploy-tests.yaml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
KUBERNETES: ${{ matrix.k8s }}
|
||||
USING_NFD: "false"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
#CONTAINERD_VERSION: ${{ matrix.containerd_version }}
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
run: bash tests/functional/kata-monitor/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
|
||||
4
.github/workflows/run-metrics.yaml
vendored
4
.github/workflows/run-metrics.yaml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
USING_NFD: "false"
|
||||
KUBERNETES: kubeadm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
run: bash tests/metrics/gha-run.sh make-tarball-results
|
||||
|
||||
- name: archive metrics results ${{ matrix.vmm }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: metrics-artifacts-${{ matrix.vmm }}
|
||||
path: results-${{ matrix.vmm }}.tar.gz
|
||||
|
||||
4
.github/workflows/run-runk-tests.yaml
vendored
4
.github/workflows/run-runk-tests.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
env:
|
||||
CONTAINERD_VERSION: lts
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.commit-hash }}
|
||||
fetch-depth: 0
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
run: bash tests/integration/runk/gha-run.sh install-dependencies
|
||||
|
||||
- name: get-kata-tarball
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||
with:
|
||||
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||
path: kata-artifacts
|
||||
|
||||
60
.github/workflows/scorecard.yaml
vendored
Normal file
60
.github/workflows/scorecard.yaml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
||||
# by a third-party and are governed by separate terms of service, privacy
|
||||
# policy, and support documentation.
|
||||
|
||||
name: Scorecard supply-chain security
|
||||
on:
|
||||
# For Branch-Protection check. Only the default branch is supported. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||
branch_protection_rule:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
|
||||
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
|
||||
# Public repositories:
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
2
.github/workflows/shellcheck.yaml
vendored
2
.github/workflows/shellcheck.yaml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
2
.github/workflows/shellcheck_required.yaml
vendored
2
.github/workflows/shellcheck_required.yaml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
2
.github/workflows/stale.yaml
vendored
2
.github/workflows/stale.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
|
||||
with:
|
||||
stale-pr-message: 'This PR has been opened without with no activity for 180 days. Comment on the issue otherwise it will be closed in 7 days'
|
||||
days-before-pr-stale: 180
|
||||
|
||||
14
.github/workflows/static-checks.yaml
vendored
14
.github/workflows/static-checks.yaml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
- edited
|
||||
- reopened
|
||||
- synchronize
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -27,7 +28,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@@ -69,7 +70,7 @@ jobs:
|
||||
component-path: src/dragonball
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@@ -105,9 +106,12 @@ jobs:
|
||||
- "make static-checks"
|
||||
env:
|
||||
GOPATH: ${{ github.workspace }}
|
||||
permissions:
|
||||
contents: read # for checkout
|
||||
packages: write # for push to ghcr.io
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@@ -131,6 +135,10 @@ jobs:
|
||||
cd "${GOPATH}/src/github.com/${{ github.repository }}"
|
||||
./tests/install_opa.sh
|
||||
- name: Install regorus
|
||||
env:
|
||||
ARTEFACT_REPOSITORY: "${{ github.repository }}"
|
||||
ARTEFACT_REGISTRY_USERNAME: "${{ github.actor }}"
|
||||
ARTEFACT_REGISTRY_PASSWORD: "${{ secrets.GITHUB_TOKEN }}"
|
||||
run: |
|
||||
"${GOPATH}/src/github.com/${{ github.repository }}/tests/install_regorus.sh"
|
||||
- name: Run check
|
||||
|
||||
29
.github/workflows/zizmor.yaml
vendored
Normal file
29
.github/workflows/zizmor.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: GHA security analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
zizmor:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run zizmor
|
||||
uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1
|
||||
@@ -1,6 +1,7 @@
|
||||
<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://scorecard.dev/viewer/?uri=github.com/kata-containers/kata-containers)
|
||||
|
||||
# Kata Containers
|
||||
|
||||
|
||||
634
src/agent/Cargo.lock
generated
634
src/agent/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -8,18 +8,19 @@ license = "Apache-2.0"
|
||||
rust-version = "1.85.1"
|
||||
|
||||
[workspace.dependencies]
|
||||
oci-spec = { version = "0.6.8", features = ["runtime"] }
|
||||
oci-spec = { version = "0.8.1", features = ["runtime"] }
|
||||
lazy_static = "1.3.0"
|
||||
ttrpc = { version = "0.8.4", features = ["async"], default-features = false }
|
||||
protobuf = "=3.7.1"
|
||||
protobuf = "3.7.2"
|
||||
libc = "0.2.94"
|
||||
nix = "0.24.2"
|
||||
# Notes: nix needs to stay in sync with libs
|
||||
nix = "0.26.4"
|
||||
capctl = "0.2.0"
|
||||
scan_fmt = "0.2.6"
|
||||
scopeguard = "1.0.0"
|
||||
thiserror = "1.0.26"
|
||||
regex = "1.10.5"
|
||||
serial_test = "0.5.1"
|
||||
serial_test = "0.10.0"
|
||||
url = "2.5.0"
|
||||
derivative = "2.2.0"
|
||||
const_format = "0.2.30"
|
||||
@@ -30,7 +31,7 @@ async-recursion = "0.3.2"
|
||||
futures = "0.3.30"
|
||||
|
||||
# Async runtime
|
||||
tokio = { version = "1.44.2", features = ["full"] }
|
||||
tokio = { version = "1.46.1", features = ["full"] }
|
||||
tokio-vsock = "0.3.4"
|
||||
|
||||
netlink-sys = { version = "0.7.0", features = ["tokio_socket"] }
|
||||
@@ -49,7 +50,7 @@ slog-stdlog = "4.0.0"
|
||||
log = "0.4.11"
|
||||
|
||||
cfg-if = "1.0.0"
|
||||
prometheus = { version = "0.13.0", features = ["process"] }
|
||||
prometheus = { version = "0.14.0", features = ["process"] }
|
||||
procfs = "0.12.0"
|
||||
|
||||
anyhow = "1"
|
||||
@@ -66,7 +67,7 @@ opentelemetry = { version = "0.14.0", features = ["rt-tokio-current-thread"] }
|
||||
serde = { version = "1.0.129", features = ["derive"] }
|
||||
serde_json = "1.0.39"
|
||||
toml = "0.5.8"
|
||||
clap = { version = "3.0.1", features = ["derive"] }
|
||||
clap = { version = "4.5.40", features = ["derive"] }
|
||||
strum = "0.26.2"
|
||||
strum_macros = "0.26.2"
|
||||
|
||||
@@ -80,7 +81,7 @@ kata-agent-policy = { path = "policy" }
|
||||
rustjail = { path = "rustjail" }
|
||||
vsock-exporter = { path = "vsock-exporter" }
|
||||
|
||||
mem-agent = { path = "../mem-agent" }
|
||||
mem-agent = { path = "../mem-agent", package = "mem-agent-lib" }
|
||||
|
||||
kata-sys-util = { path = "../libs/kata-sys-util" }
|
||||
kata-types = { path = "../libs/kata-types" }
|
||||
@@ -163,7 +164,7 @@ strum.workspace = true
|
||||
strum_macros.workspace = true
|
||||
|
||||
# Agent Policy
|
||||
cdi = { git = "https://github.com/cncf-tags/container-device-interface-rs", rev = "fba5677a8e7cc962fc6e495fcec98d7d765e332a" }
|
||||
cdi = { git = "https://github.com/cncf-tags/container-device-interface-rs", rev = "3b1e83dda5efcc83c7a4f134466ec006b37109c9" }
|
||||
|
||||
# Local dependencies
|
||||
kata-agent-policy = { workspace = true, optional = true }
|
||||
|
||||
@@ -32,6 +32,7 @@ use crate::cgroups::{DevicesCgroupInfo, Manager};
|
||||
use crate::console;
|
||||
use crate::log_child;
|
||||
use crate::process::Process;
|
||||
use crate::process::ProcessOperations;
|
||||
#[cfg(feature = "seccomp")]
|
||||
use crate::seccomp;
|
||||
use crate::selinux;
|
||||
@@ -261,7 +262,7 @@ pub struct LinuxContainer {
|
||||
pub init_process_start_time: u64,
|
||||
pub uid_map_path: String,
|
||||
pub gid_map_path: String,
|
||||
pub processes: HashMap<pid_t, Process>,
|
||||
pub processes: HashMap<String, Process>,
|
||||
pub status: ContainerStatus,
|
||||
pub created: SystemTime,
|
||||
pub logger: Logger,
|
||||
@@ -933,17 +934,13 @@ impl BaseContainer for LinuxContainer {
|
||||
}
|
||||
|
||||
fn processes(&self) -> Result<Vec<i32>> {
|
||||
Ok(self.processes.keys().cloned().collect())
|
||||
Ok(self.processes.values().map(|p| p.pid).collect())
|
||||
}
|
||||
|
||||
fn get_process(&mut self, eid: &str) -> Result<&mut Process> {
|
||||
for (_, v) in self.processes.iter_mut() {
|
||||
if eid == v.exec_id.as_str() {
|
||||
return Ok(v);
|
||||
}
|
||||
}
|
||||
|
||||
Err(anyhow!("invalid eid {}", eid))
|
||||
self.processes
|
||||
.get_mut(eid)
|
||||
.ok_or_else(|| anyhow!("invalid eid {}", eid))
|
||||
}
|
||||
|
||||
fn stats(&self) -> Result<StatsContainerResponse> {
|
||||
@@ -967,6 +964,12 @@ impl BaseContainer for LinuxContainer {
|
||||
|
||||
async fn start(&mut self, mut p: Process) -> Result<()> {
|
||||
let logger = self.logger.new(o!("eid" => p.exec_id.clone()));
|
||||
|
||||
// Check if exec_id is already in use to prevent collisions
|
||||
if self.processes.contains_key(p.exec_id.as_str()) {
|
||||
return Err(anyhow!("exec_id '{}' already exists", p.exec_id));
|
||||
}
|
||||
|
||||
let tty = p.tty;
|
||||
let fifo_file = format!("{}/{}", &self.root, EXEC_FIFO_FILENAME);
|
||||
info!(logger, "enter container.start!");
|
||||
@@ -1235,7 +1238,7 @@ impl BaseContainer for LinuxContainer {
|
||||
let spec = self.config.spec.as_mut().unwrap();
|
||||
update_namespaces(&self.logger, spec, p.pid)?;
|
||||
}
|
||||
self.processes.insert(p.pid, p);
|
||||
self.processes.insert(p.exec_id.clone(), p);
|
||||
|
||||
info!(logger, "wait on child log handler");
|
||||
let _ = log_handler
|
||||
@@ -1261,13 +1264,13 @@ impl BaseContainer for LinuxContainer {
|
||||
let spec = self.config.spec.as_ref().unwrap();
|
||||
let st = self.oci_state()?;
|
||||
|
||||
for pid in self.processes.keys() {
|
||||
match signal::kill(Pid::from_raw(*pid), Some(Signal::SIGKILL)) {
|
||||
for process in self.processes.values() {
|
||||
match signal::kill(process.pid(), Some(Signal::SIGKILL)) {
|
||||
Err(Errno::ESRCH) => {
|
||||
info!(
|
||||
self.logger,
|
||||
"kill encounters ESRCH, pid: {}, container: {}",
|
||||
pid,
|
||||
process.pid(),
|
||||
self.id.clone()
|
||||
);
|
||||
continue;
|
||||
@@ -2081,13 +2084,14 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_linuxcontainer_get_process() {
|
||||
#[tokio::test]
|
||||
async fn test_linuxcontainer_get_process() {
|
||||
let _ = new_linux_container_and_then(|mut c: LinuxContainer| {
|
||||
c.processes.insert(
|
||||
1,
|
||||
Process::new(&sl(), &oci::Process::default(), "123", true, 1, None).unwrap(),
|
||||
);
|
||||
let process =
|
||||
Process::new(&sl(), &oci::Process::default(), "123", true, 1, None).unwrap();
|
||||
let exec_id = process.exec_id.clone();
|
||||
c.processes.insert(exec_id, process);
|
||||
|
||||
let p = c.get_process("123");
|
||||
assert!(p.is_ok(), "Expecting Ok, Got {:?}", p);
|
||||
Ok(())
|
||||
|
||||
@@ -1144,7 +1144,6 @@ mod tests {
|
||||
use std::fs::remove_dir_all;
|
||||
use std::fs::remove_file;
|
||||
use std::io;
|
||||
use std::os::unix::fs;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use tempfile::tempdir;
|
||||
use test_utils::assert_result;
|
||||
|
||||
@@ -179,6 +179,11 @@ impl Process {
|
||||
p.parent_stdin = Some(pstdin);
|
||||
p.stdin = Some(stdin);
|
||||
|
||||
// Make sure the parent stdin writer be inserted into
|
||||
// p.writes hashmap, thus the cleanup_process_stream can
|
||||
// cleanup and close the parent stdin fd.
|
||||
let _ = p.get_writer(StreamType::ParentStdin);
|
||||
|
||||
// These pipes are necessary as the stdout/stderr of the child process
|
||||
// cannot be a socket. Otherwise, some images relying on the /dev/stdout(stderr)
|
||||
// and /proc/self/fd/1(2) will fail to boot as opening an existing socket
|
||||
@@ -308,8 +313,8 @@ mod tests {
|
||||
assert_eq!(max_size, actual_size);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_process() {
|
||||
#[tokio::test]
|
||||
async fn test_process() {
|
||||
let id = "abc123rgb";
|
||||
let init = true;
|
||||
let process = Process::new(
|
||||
|
||||
@@ -323,31 +323,31 @@ impl FromStr for AgentConfig {
|
||||
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_disable,
|
||||
mac.memcg_config.disabled
|
||||
mac.memcg_config.default.disabled
|
||||
);
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_swap,
|
||||
mac.memcg_config.swap
|
||||
mac.memcg_config.default.swap
|
||||
);
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_swappiness_max,
|
||||
mac.memcg_config.swappiness_max
|
||||
mac.memcg_config.default.swappiness_max
|
||||
);
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_period_secs,
|
||||
mac.memcg_config.period_secs
|
||||
mac.memcg_config.default.period_secs
|
||||
);
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_period_psi_percent_limit,
|
||||
mac.memcg_config.period_psi_percent_limit
|
||||
mac.memcg_config.default.period_psi_percent_limit
|
||||
);
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_eviction_psi_percent_limit,
|
||||
mac.memcg_config.eviction_psi_percent_limit
|
||||
mac.memcg_config.default.eviction_psi_percent_limit
|
||||
);
|
||||
mem_agent_config_override!(
|
||||
agent_config_builder.mem_agent_memcg_eviction_run_aging_count_min,
|
||||
mac.memcg_config.eviction_run_aging_count_min
|
||||
mac.memcg_config.default.eviction_run_aging_count_min
|
||||
);
|
||||
|
||||
mem_agent_config_override!(
|
||||
@@ -549,43 +549,43 @@ impl AgentConfig {
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_DISABLE,
|
||||
mac.memcg_config.disabled,
|
||||
mac.memcg_config.default.disabled,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_SWAP,
|
||||
mac.memcg_config.swap,
|
||||
mac.memcg_config.default.swap,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_SWAPPINESS_MAX,
|
||||
mac.memcg_config.swappiness_max,
|
||||
mac.memcg_config.default.swappiness_max,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_PERIOD_SECS,
|
||||
mac.memcg_config.period_secs,
|
||||
mac.memcg_config.default.period_secs,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_PERIOD_PSI_PERCENT_LIMIT,
|
||||
mac.memcg_config.period_psi_percent_limit,
|
||||
mac.memcg_config.default.period_psi_percent_limit,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_EVICTION_PSI_PERCENT_LIMIT,
|
||||
mac.memcg_config.eviction_psi_percent_limit,
|
||||
mac.memcg_config.default.eviction_psi_percent_limit,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
param,
|
||||
MEM_AGENT_MEMCG_EVICTION_RUN_AGING_COUNT_MIN,
|
||||
mac.memcg_config.eviction_run_aging_count_min,
|
||||
mac.memcg_config.default.eviction_run_aging_count_min,
|
||||
get_number_value
|
||||
);
|
||||
parse_cmdline_param!(
|
||||
@@ -1408,7 +1408,10 @@ mod tests {
|
||||
contents: "agent.mem_agent_enable=1\nagent.mem_agent_memcg_period_secs=300",
|
||||
mem_agent: Some(MemAgentConfig {
|
||||
memcg_config: mem_agent::memcg::Config {
|
||||
period_secs: 300,
|
||||
default: mem_agent::memcg::SingleConfig {
|
||||
period_secs: 300,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
@@ -1419,7 +1422,10 @@ mod tests {
|
||||
contents: "agent.mem_agent_enable=1\nagent.mem_agent_memcg_period_secs=300\nagent.mem_agent_compact_order=6",
|
||||
mem_agent: Some(MemAgentConfig {
|
||||
memcg_config: mem_agent::memcg::Config {
|
||||
period_secs: 300,
|
||||
default: mem_agent::memcg::SingleConfig {
|
||||
period_secs: 300,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
compact_config: mem_agent::compact::Config {
|
||||
|
||||
@@ -15,7 +15,7 @@ use anyhow::{bail, Context, Result};
|
||||
use async_compression::tokio::bufread::GzipDecoder;
|
||||
use base64::{engine::general_purpose::STANDARD, Engine};
|
||||
use const_format::concatcp;
|
||||
use serde::Deserialize;
|
||||
use kata_types::initdata::InitData;
|
||||
use sha2::{Digest, Sha256, Sha384, Sha512};
|
||||
use slog::Logger;
|
||||
use tokio::io::{AsyncReadExt, AsyncSeekExt};
|
||||
@@ -23,6 +23,13 @@ use tokio::io::{AsyncReadExt, AsyncSeekExt};
|
||||
/// This is the target directory to store the extracted initdata.
|
||||
pub const INITDATA_PATH: &str = "/run/confidential-containers/initdata";
|
||||
|
||||
const AA_CONFIG_KEY: &str = "aa.toml";
|
||||
const CDH_CONFIG_KEY: &str = "cdh.toml";
|
||||
const POLICY_KEY: &str = "policy.rego";
|
||||
|
||||
/// The path of initdata toml
|
||||
pub const INITDATA_TOML_PATH: &str = concatcp!(INITDATA_PATH, "/initdata.toml");
|
||||
|
||||
/// The path of AA's config file
|
||||
pub const AA_CONFIG_PATH: &str = concatcp!(INITDATA_PATH, "/aa.toml");
|
||||
|
||||
@@ -32,30 +39,6 @@ pub const CDH_CONFIG_PATH: &str = concatcp!(INITDATA_PATH, "/cdh.toml");
|
||||
/// Magic number of initdata device
|
||||
pub const INITDATA_MAGIC_NUMBER: &[u8] = b"initdata";
|
||||
|
||||
/// Now only initdata `0.1.0` is defined.
|
||||
const INITDATA_VERSION: &str = "0.1.0";
|
||||
|
||||
/// Initdata defined in
|
||||
/// <https://github.com/confidential-containers/trustee/blob/47d7a2338e0be76308ac19be5c0c172c592780aa/kbs/docs/initdata.md>
|
||||
#[derive(Deserialize)]
|
||||
pub struct Initdata {
|
||||
version: String,
|
||||
algorithm: String,
|
||||
data: DefinedFields,
|
||||
}
|
||||
|
||||
/// Well-defined keys for initdata of kata/CoCo
|
||||
#[derive(Deserialize, Default)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct DefinedFields {
|
||||
#[serde(rename = "aa.toml")]
|
||||
aa_config: Option<String>,
|
||||
#[serde(rename = "cdh.toml")]
|
||||
cdh_config: Option<String>,
|
||||
#[serde(rename = "policy.rego")]
|
||||
policy: Option<String>,
|
||||
}
|
||||
|
||||
async fn detect_initdata_device(logger: &Logger) -> Result<Option<String>> {
|
||||
let dev_dir = Path::new("/dev");
|
||||
let mut read_dir = tokio::fs::read_dir(dev_dir).await?;
|
||||
@@ -115,7 +98,7 @@ pub async fn read_initdata(device_path: &str) -> Result<Vec<u8>> {
|
||||
}
|
||||
|
||||
pub struct InitdataReturnValue {
|
||||
pub digest: Vec<u8>,
|
||||
pub _digest: Vec<u8>,
|
||||
pub _policy: Option<String>,
|
||||
}
|
||||
|
||||
@@ -137,40 +120,41 @@ pub async fn initialize_initdata(logger: &Logger) -> Result<Option<InitdataRetur
|
||||
.await
|
||||
.inspect_err(|e| error!(logger, "Failed to read initdata: {e:?}"))?;
|
||||
|
||||
let initdata: Initdata =
|
||||
let initdata: InitData =
|
||||
toml::from_slice(&initdata_content).context("parse initdata failed")?;
|
||||
info!(logger, "Initdata version: {}", initdata.version);
|
||||
info!(logger, "Initdata version: {}", initdata.version());
|
||||
initdata.validate()?;
|
||||
|
||||
if initdata.version != INITDATA_VERSION {
|
||||
bail!("Unsupported initdata version");
|
||||
}
|
||||
tokio::fs::write(INITDATA_TOML_PATH, &initdata_content)
|
||||
.await
|
||||
.context("write initdata toml failed")?;
|
||||
|
||||
let digest = match &initdata.algorithm[..] {
|
||||
let _digest = match initdata.algorithm() {
|
||||
"sha256" => Sha256::digest(&initdata_content).to_vec(),
|
||||
"sha384" => Sha384::digest(&initdata_content).to_vec(),
|
||||
"sha512" => Sha512::digest(&initdata_content).to_vec(),
|
||||
others => bail!("Unsupported hash algorithm {others}"),
|
||||
};
|
||||
|
||||
if let Some(config) = initdata.data.aa_config {
|
||||
if let Some(config) = initdata.get_coco_data(AA_CONFIG_KEY) {
|
||||
tokio::fs::write(AA_CONFIG_PATH, config)
|
||||
.await
|
||||
.context("write aa config failed")?;
|
||||
info!(logger, "write AA config from initdata");
|
||||
}
|
||||
|
||||
if let Some(config) = initdata.data.cdh_config {
|
||||
if let Some(config) = initdata.get_coco_data(CDH_CONFIG_KEY) {
|
||||
tokio::fs::write(CDH_CONFIG_PATH, config)
|
||||
.await
|
||||
.context("write cdh config failed")?;
|
||||
info!(logger, "write CDH config from initdata");
|
||||
}
|
||||
|
||||
debug!(logger, "Initdata digest: {}", STANDARD.encode(&digest));
|
||||
debug!(logger, "Initdata digest: {}", STANDARD.encode(&_digest));
|
||||
|
||||
let res = InitdataReturnValue {
|
||||
digest,
|
||||
_policy: initdata.data.policy,
|
||||
_digest,
|
||||
_policy: initdata.get_coco_data(POLICY_KEY).cloned(),
|
||||
};
|
||||
|
||||
Ok(Some(res))
|
||||
|
||||
@@ -19,9 +19,8 @@ extern crate scopeguard;
|
||||
extern crate slog;
|
||||
|
||||
use anyhow::{anyhow, bail, Context, Result};
|
||||
use base64::Engine;
|
||||
use cfg_if::cfg_if;
|
||||
use clap::{AppSettings, Parser};
|
||||
use clap::Parser;
|
||||
use const_format::concatcp;
|
||||
use initdata::{InitdataReturnValue, AA_CONFIG_PATH, CDH_CONFIG_PATH};
|
||||
use nix::fcntl::OFlag;
|
||||
@@ -128,7 +127,7 @@ lazy_static! {
|
||||
|
||||
#[derive(Parser)]
|
||||
// The default clap version info doesn't match our form, so we need to override it
|
||||
#[clap(global_setting(AppSettings::DisableVersionFlag))]
|
||||
#[clap(disable_version_flag = true)]
|
||||
struct AgentOpts {
|
||||
/// Print the version information
|
||||
#[clap(short, long)]
|
||||
@@ -485,12 +484,9 @@ async fn launch_guest_component_procs(
|
||||
|
||||
debug!(logger, "spawning attestation-agent process {}", AA_PATH);
|
||||
let mut aa_args = vec!["--attestation_sock", AA_ATTESTATION_URI];
|
||||
let initdata_parameter;
|
||||
if let Some(initdata_return_value) = initdata_return_value {
|
||||
initdata_parameter =
|
||||
base64::engine::general_purpose::STANDARD.encode(&initdata_return_value.digest);
|
||||
aa_args.push("--initdata");
|
||||
aa_args.push(&initdata_parameter);
|
||||
if initdata_return_value.is_some() {
|
||||
aa_args.push("--initdata-toml");
|
||||
aa_args.push(initdata::INITDATA_TOML_PATH);
|
||||
}
|
||||
|
||||
launch_process(
|
||||
|
||||
@@ -554,7 +554,7 @@ impl AgentService {
|
||||
req: protocols::agent::WaitProcessRequest,
|
||||
) -> Result<protocols::agent::WaitProcessResponse> {
|
||||
let cid = req.container_id;
|
||||
let eid = req.exec_id;
|
||||
let mut eid = req.exec_id;
|
||||
let mut resp = WaitProcessResponse::new();
|
||||
|
||||
info!(
|
||||
@@ -587,7 +587,7 @@ impl AgentService {
|
||||
.get_container(&cid)
|
||||
.ok_or_else(|| anyhow!("Invalid container id"))?;
|
||||
|
||||
let p = match ctr.processes.get_mut(&pid) {
|
||||
let p = match ctr.processes.values_mut().find(|p| p.pid == pid) {
|
||||
Some(p) => p,
|
||||
None => {
|
||||
// Lost race, pick up exit code from channel
|
||||
@@ -600,6 +600,8 @@ impl AgentService {
|
||||
}
|
||||
};
|
||||
|
||||
eid = p.exec_id.clone();
|
||||
|
||||
// need to close all fd
|
||||
// ignore errors for some fd might be closed by stream
|
||||
p.cleanup_process_stream();
|
||||
@@ -611,7 +613,7 @@ impl AgentService {
|
||||
let _ = s.send(p.exit_code).await;
|
||||
}
|
||||
|
||||
ctr.processes.remove(&pid);
|
||||
ctr.processes.remove(&eid);
|
||||
|
||||
Ok(resp)
|
||||
}
|
||||
@@ -708,13 +710,15 @@ fn mem_agent_memcgconfig_to_memcg_optionconfig(
|
||||
mc: &protocols::agent::MemAgentMemcgConfig,
|
||||
) -> mem_agent::memcg::OptionConfig {
|
||||
mem_agent::memcg::OptionConfig {
|
||||
disabled: mc.disabled,
|
||||
swap: mc.swap,
|
||||
swappiness_max: mc.swappiness_max.map(|x| x as u8),
|
||||
period_secs: mc.period_secs,
|
||||
period_psi_percent_limit: mc.period_psi_percent_limit.map(|x| x as u8),
|
||||
eviction_psi_percent_limit: mc.eviction_psi_percent_limit.map(|x| x as u8),
|
||||
eviction_run_aging_count_min: mc.eviction_run_aging_count_min,
|
||||
default: mem_agent::memcg::SingleOptionConfig {
|
||||
disabled: mc.disabled,
|
||||
swap: mc.swap,
|
||||
swappiness_max: mc.swappiness_max.map(|x| x as u8),
|
||||
period_secs: mc.period_secs,
|
||||
period_psi_percent_limit: mc.period_psi_percent_limit.map(|x| x as u8),
|
||||
eviction_psi_percent_limit: mc.eviction_psi_percent_limit.map(|x| x as u8),
|
||||
eviction_run_aging_count_min: mc.eviction_run_aging_count_min,
|
||||
},
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
@@ -2621,11 +2625,6 @@ mod tests {
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
TestData {
|
||||
has_fd: false,
|
||||
result: Err(anyhow!(ERR_CANNOT_GET_WRITER)),
|
||||
..Default::default()
|
||||
},
|
||||
];
|
||||
|
||||
for (i, d) in tests.iter().enumerate() {
|
||||
@@ -2673,7 +2672,7 @@ mod tests {
|
||||
}
|
||||
linux_container
|
||||
.processes
|
||||
.insert(exec_process_id, exec_process);
|
||||
.insert(exec_process.exec_id.clone(), exec_process);
|
||||
|
||||
sandbox.add_container(linux_container);
|
||||
}
|
||||
|
||||
@@ -272,8 +272,10 @@ impl Sandbox {
|
||||
|
||||
pub fn find_process(&mut self, pid: pid_t) -> Option<&mut Process> {
|
||||
for (_, c) in self.containers.iter_mut() {
|
||||
if let Some(p) = c.processes.get_mut(&pid) {
|
||||
return Some(p);
|
||||
for p in c.processes.values_mut() {
|
||||
if p.pid == pid {
|
||||
return Some(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +288,11 @@ impl Sandbox {
|
||||
.ok_or_else(|| anyhow!(ERR_INVALID_CONTAINER_ID))?;
|
||||
|
||||
if eid.is_empty() {
|
||||
let init_pid = ctr.init_process_pid;
|
||||
return ctr
|
||||
.processes
|
||||
.get_mut(&ctr.init_process_pid)
|
||||
.values_mut()
|
||||
.find(|p| p.pid == init_pid)
|
||||
.ok_or_else(|| anyhow!("cannot find init process!"));
|
||||
}
|
||||
|
||||
@@ -1014,23 +1018,26 @@ mod tests {
|
||||
linux_container.init_process_pid = 1;
|
||||
linux_container.id = cid.to_string();
|
||||
// add init process
|
||||
linux_container.processes.insert(
|
||||
1,
|
||||
Process::new(&logger, &oci::Process::default(), "1", true, 1, None).unwrap(),
|
||||
);
|
||||
let mut init_process =
|
||||
Process::new(&logger, &oci::Process::default(), "1", true, 1, None).unwrap();
|
||||
init_process.pid = 1;
|
||||
linux_container
|
||||
.processes
|
||||
.insert("1".to_string(), init_process);
|
||||
// add exec process
|
||||
linux_container.processes.insert(
|
||||
123,
|
||||
Process::new(
|
||||
&logger,
|
||||
&oci::Process::default(),
|
||||
"exec-123",
|
||||
false,
|
||||
1,
|
||||
None,
|
||||
)
|
||||
.unwrap(),
|
||||
);
|
||||
let mut exec_process = Process::new(
|
||||
&logger,
|
||||
&oci::Process::default(),
|
||||
"exec-123",
|
||||
false,
|
||||
1,
|
||||
None,
|
||||
)
|
||||
.unwrap();
|
||||
exec_process.pid = 123;
|
||||
linux_container
|
||||
.processes
|
||||
.insert("exec-123".to_string(), exec_process);
|
||||
|
||||
s.add_container(linux_container);
|
||||
|
||||
@@ -1081,8 +1088,8 @@ mod tests {
|
||||
.unwrap();
|
||||
// processes interally only have pids when manually set
|
||||
test_process.pid = test_pid;
|
||||
|
||||
linux_container.processes.insert(test_pid, test_process);
|
||||
let test_exec_id = test_process.exec_id.clone();
|
||||
linux_container.processes.insert(test_exec_id, test_process);
|
||||
|
||||
s.add_container(linux_container);
|
||||
|
||||
|
||||
597
src/dragonball/Cargo.lock
generated
597
src/dragonball/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -87,7 +87,7 @@ linux-loader = {workspace = true}
|
||||
log = "0.4.14"
|
||||
nix = "0.24.2"
|
||||
procfs = "0.12.0"
|
||||
prometheus = { version = "0.13.0", features = ["process"] }
|
||||
prometheus = { version = "0.14.0", features = ["process"] }
|
||||
seccompiler = {workspace = true}
|
||||
serde = "1.0.27"
|
||||
serde_derive = "1.0.27"
|
||||
|
||||
1
src/dragonball/out
Normal file
1
src/dragonball/out
Normal file
File diff suppressed because one or more lines are too long
@@ -9,8 +9,9 @@
|
||||
use std::fs::File;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender, TryRecvError};
|
||||
use crossbeam_channel::{Receiver, Sender, TryRecvError};
|
||||
use log::{debug, error, info, warn};
|
||||
use std::sync::mpsc;
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::error::{Result, StartMicroVmError, StopMicrovmError};
|
||||
@@ -284,7 +285,7 @@ pub enum VmmData {
|
||||
/// Return vfio device's slot number in guest.
|
||||
VfioDeviceData(Option<u8>),
|
||||
/// Sync Hotplug
|
||||
SyncHotplug((Sender<Option<i32>>, Receiver<Option<i32>>)),
|
||||
SyncHotplug((mpsc::Sender<Option<i32>>, mpsc::Receiver<Option<i32>>)),
|
||||
}
|
||||
|
||||
/// Request data type used to communicate between the API and the VMM.
|
||||
@@ -900,7 +901,7 @@ impl VmmService {
|
||||
}
|
||||
})?;
|
||||
|
||||
let (sender, receiver) = unbounded();
|
||||
let (sender, receiver) = mpsc::channel();
|
||||
|
||||
// It is safe because we don't expect poison lock.
|
||||
let vfio_manager = vm.device_manager.vfio_manager.lock().unwrap();
|
||||
@@ -965,15 +966,17 @@ impl VmmService {
|
||||
));
|
||||
}
|
||||
|
||||
let (sender, revceiver) = mpsc::channel();
|
||||
|
||||
#[cfg(feature = "dbs-upcall")]
|
||||
vm.resize_vcpu(config, None).map_err(|e| {
|
||||
vm.resize_vcpu(config, Some(sender.clone())).map_err(|e| {
|
||||
if let VcpuResizeError::UpcallServerNotReady = e {
|
||||
return VmmActionError::UpcallServerNotReady;
|
||||
}
|
||||
VmmActionError::ResizeVcpu(e)
|
||||
})?;
|
||||
|
||||
Ok(VmmData::Empty)
|
||||
Ok(VmmData::SyncHotplug((sender, revceiver)))
|
||||
}
|
||||
|
||||
#[cfg(feature = "virtio-mem")]
|
||||
|
||||
@@ -16,9 +16,9 @@ use std::collections::HashMap;
|
||||
use std::ops::Deref;
|
||||
use std::os::fd::RawFd;
|
||||
use std::path::Path;
|
||||
use std::sync::mpsc::Sender;
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
use crossbeam_channel::Sender;
|
||||
use dbs_device::resources::Resource::LegacyIrq;
|
||||
use dbs_device::resources::{DeviceResources, Resource, ResourceConstraint};
|
||||
use dbs_device::DeviceIo;
|
||||
|
||||
@@ -225,7 +225,7 @@ pub struct VcpuManager {
|
||||
vm_as: GuestAddressSpaceImpl,
|
||||
pub(crate) vm_fd: Arc<VmFd>,
|
||||
|
||||
action_sycn_tx: Option<Sender<bool>>,
|
||||
action_sycn_tx: Option<Sender<Option<i32>>>,
|
||||
vcpus_in_action: (VcpuAction, Vec<u8>),
|
||||
pub(crate) reset_event_fd: Option<EventFd>,
|
||||
|
||||
@@ -756,7 +756,9 @@ impl VcpuManager {
|
||||
|
||||
fn sync_action_finish(&mut self, got_error: bool) {
|
||||
if let Some(tx) = self.action_sycn_tx.take() {
|
||||
if let Err(e) = tx.send(got_error) {
|
||||
let result = if got_error { 0 } else { -1 };
|
||||
|
||||
if let Err(e) = tx.send(Some(result)) {
|
||||
debug!("cpu sync action send to closed channel {}", e);
|
||||
}
|
||||
}
|
||||
@@ -856,7 +858,7 @@ mod hotplug {
|
||||
pub fn resize_vcpu(
|
||||
&mut self,
|
||||
vcpu_count: u8,
|
||||
sync_tx: Option<Sender<bool>>,
|
||||
sync_tx: Option<Sender<Option<i32>>>,
|
||||
) -> std::result::Result<(), VcpuResizeError> {
|
||||
if self.get_vcpus_action() != VcpuAction::None {
|
||||
return Err(VcpuResizeError::VcpuIsHotplugging);
|
||||
|
||||
@@ -832,7 +832,7 @@ impl Vm {
|
||||
pub fn resize_vcpu(
|
||||
&mut self,
|
||||
config: VcpuResizeInfo,
|
||||
sync_tx: Option<Sender<bool>>,
|
||||
sync_tx: Option<Sender<Option<i32>>>,
|
||||
) -> std::result::Result<(), VcpuResizeError> {
|
||||
if self.upcall_client().is_none() {
|
||||
Err(VcpuResizeError::UpcallClientMissing)
|
||||
|
||||
1
src/libs/.gitignore
vendored
Normal file
1
src/libs/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Cargo.lock
|
||||
2700
src/libs/Cargo.lock
generated
2700
src/libs/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ common-path = "=1.0.0"
|
||||
fail = "0.5.0"
|
||||
lazy_static = "1.4.0"
|
||||
libc = "0.2.100"
|
||||
nix = "0.24.2"
|
||||
nix = "0.26.4"
|
||||
once_cell = "1.9.0"
|
||||
serde = { version = "1.0.138", features = ["derive"] }
|
||||
serde_json = "1.0.73"
|
||||
@@ -32,7 +32,7 @@ pci-ids = "0.2.5"
|
||||
mockall = "0.13.1"
|
||||
|
||||
kata-types = { path = "../kata-types" }
|
||||
oci-spec = { version = "0.6.8", features = ["runtime"] }
|
||||
oci-spec = { version = "0.8.1", features = ["runtime"] }
|
||||
runtime-spec = { path = "../runtime-spec" }
|
||||
safe-path = { path = "../safe-path" }
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ mod tests {
|
||||
|
||||
let actual = arch_guest_protection("/xyz/tmp", path.to_str().unwrap());
|
||||
assert!(actual.is_ok());
|
||||
assert_eq!(actual.unwrap(), GuestProtection::Snp);
|
||||
assert!(matches!(actual.unwrap(), GuestProtection::Snp(_)));
|
||||
|
||||
writeln!(snp_file, "N").unwrap();
|
||||
let actual = arch_guest_protection("/xyz/tmp", path.to_str().unwrap());
|
||||
@@ -244,7 +244,7 @@ mod tests {
|
||||
|
||||
let actual = arch_guest_protection(sev_path.to_str().unwrap(), "/xyz/tmp");
|
||||
assert!(actual.is_ok());
|
||||
assert_eq!(actual.unwrap(), GuestProtection::Sev);
|
||||
assert!(matches!(actual.unwrap(), GuestProtection::Sev(_)));
|
||||
|
||||
writeln!(sev_file, "N").unwrap();
|
||||
let actual = arch_guest_protection(sev_path.to_str().unwrap(), "/xyz/tmp");
|
||||
|
||||
@@ -27,14 +27,17 @@ thiserror = "1.0"
|
||||
toml = "0.5.8"
|
||||
serde-enum-str = "0.4"
|
||||
sysinfo = "0.34.2"
|
||||
sha2 = "0.10.8"
|
||||
flate2 = { version = "1.0", features = ["zlib"] }
|
||||
hex = "0.4"
|
||||
|
||||
oci-spec = { version = "0.6.8", features = ["runtime"] }
|
||||
oci-spec = { version = "0.8.1", features = ["runtime"] }
|
||||
safe-path = { path = "../safe-path" }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.19.1"
|
||||
test-utils = { path = "../test-utils" }
|
||||
nix = "0.24.2"
|
||||
nix = "0.26.4"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
@@ -15,6 +15,7 @@ use serde::Deserialize;
|
||||
use crate::config::hypervisor::{get_hypervisor_plugin, HugePageType};
|
||||
|
||||
use crate::config::TomlConfig;
|
||||
use crate::initdata::add_hypervisor_initdata_overrides;
|
||||
use crate::sl;
|
||||
|
||||
use self::cri_containerd::{SANDBOX_CPU_PERIOD_KEY, SANDBOX_CPU_QUOTA_KEY, SANDBOX_MEM_KEY};
|
||||
@@ -271,6 +272,17 @@ pub const KATA_ANNO_CFG_HYPERVISOR_VIRTIO_FS_EXTRA_ARGS: &str =
|
||||
"io.katacontainers.config.hypervisor.virtio_fs_extra_args";
|
||||
/// A sandbox annotation to specify as the msize for 9p shares.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_MSIZE_9P: &str = "io.katacontainers.config.hypervisor.msize_9p";
|
||||
/// The initdata annotation passed in when CVM launchs
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_INIT_DATA: &str =
|
||||
"io.katacontainers.config.hypervisor.cc_init_data";
|
||||
|
||||
/// GPU specific annotations for remote hypervisor to help with instance selection
|
||||
/// It's for minimum number of GPUs required for the VM.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPUS: &str =
|
||||
"io.katacontainers.config.hypervisor.default_gpus";
|
||||
/// It's for the GPU model(tesla, h100, a100, radeon etc.) required for the VM.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPU_MODEL: &str =
|
||||
"io.katacontainers.config.hypervisor.default_gpu_model";
|
||||
|
||||
// Runtime related annotations
|
||||
/// Prefix for Runtime configurations.
|
||||
@@ -303,6 +315,9 @@ pub const KATA_ANNO_CFG_DISABLE_NEW_NETNS: &str =
|
||||
pub const KATA_ANNO_CFG_VFIO_MODE: &str = "io.katacontainers.config.runtime.vfio_mode";
|
||||
/// An annotation to declare shared mount points, which is a set of mount points that directly share mounted objects between containers.
|
||||
pub const KATA_ANNO_CFG_SHARED_MOUNTS: &str = "io.katacontainers.config.runtime.shared_mounts";
|
||||
/// An annotation to set timeout value in second when do create container
|
||||
pub const KATA_ANNO_CFG_RUNTIME_CREATE_CONTAINTER_TIMEOUT: &str =
|
||||
"io.katacontainers.config.runtime.create_container_timeout";
|
||||
|
||||
/// A sandbox annotation used to specify prefetch_files.list host path container image
|
||||
/// being used,
|
||||
@@ -880,6 +895,21 @@ impl Annotation {
|
||||
hv.security_info.validate_path(value)?;
|
||||
hv.security_info.guest_hook_path = value.to_string();
|
||||
}
|
||||
KATA_ANNO_CFG_HYPERVISOR_INIT_DATA => {
|
||||
hv.security_info.initdata =
|
||||
add_hypervisor_initdata_overrides(value).unwrap();
|
||||
}
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPUS => match self.get_value::<u32>(key) {
|
||||
Ok(r) => {
|
||||
hv.remote_info.default_gpus = r.unwrap_or_default();
|
||||
}
|
||||
Err(_e) => {
|
||||
return Err(u32_err);
|
||||
}
|
||||
},
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPU_MODEL => {
|
||||
hv.remote_info.default_gpu_model = value.to_string();
|
||||
}
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_ROOTLESS_HYPERVISOR => {
|
||||
match self.get_value::<bool>(key) {
|
||||
Ok(r) => {
|
||||
@@ -962,6 +992,14 @@ impl Annotation {
|
||||
return Err(u32_err);
|
||||
}
|
||||
},
|
||||
KATA_ANNO_CFG_RUNTIME_CREATE_CONTAINTER_TIMEOUT => match self.get_value::<u32>(key) {
|
||||
Ok(v) => {
|
||||
ag.request_timeout_ms = v.unwrap_or_default() * 1000;
|
||||
}
|
||||
Err(_e) => {
|
||||
return Err(u32_err);
|
||||
}
|
||||
},
|
||||
// update runtime config
|
||||
KATA_ANNO_CFG_RUNTIME_NAME => {
|
||||
let runtime = vec!["virt-container", "linux-container", "wasm-container"];
|
||||
|
||||
@@ -112,7 +112,10 @@ pub struct Agent {
|
||||
pub reconnect_timeout_ms: u32,
|
||||
|
||||
/// Agent request timeout value in millisecond
|
||||
#[serde(default = "default_request_timeout")]
|
||||
/// This timeout value is used to set the maximum duration for the agent to process a CreateContainerRequest.
|
||||
/// It's also used to ensure that workloads, especially those involving large image pulls within the guest,
|
||||
/// have sufficient time to complete.
|
||||
#[serde(default = "default_request_timeout", rename = "create_container_timeout")]
|
||||
pub request_timeout_ms: u32,
|
||||
|
||||
/// Agent health check request timeout value in millisecond
|
||||
|
||||
@@ -885,6 +885,12 @@ pub struct SecurityInfo {
|
||||
#[serde(default)]
|
||||
pub guest_hook_path: String,
|
||||
|
||||
/// Initdata is dynamic configuration (like policies, configs, and identity files) with encoded format that users inject
|
||||
/// into the TEE Guest upon CVM launch. And it's implemented based on the `InitData Specification`:
|
||||
/// https://github.com/confidential-containers/trustee/blob/61c1dc60ee1f926c2eb95d69666c2430c3fea808/kbs/docs/initdata.md
|
||||
#[serde(default)]
|
||||
pub initdata: String,
|
||||
|
||||
/// List of valid annotation names for the hypervisor.
|
||||
///
|
||||
/// Each member of the list is a regular expression, which is the base name of the annotation,
|
||||
@@ -1104,6 +1110,14 @@ pub struct RemoteInfo {
|
||||
/// Remote hyperisor timeout of creating (in seconds)
|
||||
#[serde(default)]
|
||||
pub hypervisor_timeout: i32,
|
||||
|
||||
/// GPU specific annotations (currently only applicable for Remote Hypervisor)
|
||||
/// default_gpus specifies the number of GPUs required for the Kata VM
|
||||
#[serde(default)]
|
||||
pub default_gpus: u32,
|
||||
/// default_gpu_model specifies GPU model like tesla, h100, a100, readeon etc.
|
||||
#[serde(default)]
|
||||
pub default_gpu_model: String,
|
||||
}
|
||||
|
||||
/// Common configuration information for hypervisors.
|
||||
|
||||
351
src/libs/kata-types/src/initdata.rs
Normal file
351
src/libs/kata-types/src/initdata.rs
Normal file
@@ -0,0 +1,351 @@
|
||||
// Copyright (c) 2025 Ant Group
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use flate2::read::GzDecoder;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256, Sha384, Sha512};
|
||||
use std::{collections::HashMap, io::Read};
|
||||
|
||||
/// Currently, initdata only supports version 0.1.0.
|
||||
const INITDATA_VERSION: &str = "0.1.0";
|
||||
/// supported algorithms list
|
||||
const SUPPORTED_ALGORITHMS: [&str; 3] = ["sha256", "sha384", "sha512"];
|
||||
|
||||
/// TEE platform type
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
pub enum ProtectedPlatform {
|
||||
/// Tdx platform for Intel TDX
|
||||
Tdx,
|
||||
/// Snp platform for AMD SEV-SNP
|
||||
Snp,
|
||||
/// Cca platform for ARM CCA
|
||||
Cca,
|
||||
/// Default with no protection
|
||||
#[default]
|
||||
NoProtection,
|
||||
}
|
||||
|
||||
#[allow(clippy::doc_lazy_continuation)]
|
||||
/// <https://github.com/confidential-containers/trustee/blob/47d7a2338e0be76308ac19be5c0c172c592780aa/kbs/docs/initdata.md>
|
||||
/// The Initdata specification defines the key data structures and algorithms for injecting any well-defined data
|
||||
/// from an untrusted host into a TEE (Trusted Execution Environment). To guarantee the integrity of the data,
|
||||
/// either the hostdata capability of TEE evidence or the (v)TPM dynamic measurement capability will be utilized.
|
||||
/// And its format looks like as below:
|
||||
/// ```toml
|
||||
/// algorithm = "sha384"
|
||||
/// version = "0.1.0"
|
||||
///
|
||||
/// [data]
|
||||
/// key1 = "value1"
|
||||
/// key2 = "value2"
|
||||
///```
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct InitData {
|
||||
/// version of InitData Spec
|
||||
version: String,
|
||||
/// algorithm: sha256, sha512, sha384
|
||||
algorithm: String,
|
||||
/// data for specific "key:value"
|
||||
data: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl InitData {
|
||||
/// new InitData
|
||||
pub fn new(algorithm: impl Into<String>, version: impl Into<String>) -> Self {
|
||||
Self {
|
||||
version: version.into(),
|
||||
algorithm: algorithm.into(),
|
||||
data: HashMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// get coco data
|
||||
pub fn get_coco_data(&self, key: &str) -> Option<&String> {
|
||||
self.data.get(key)
|
||||
}
|
||||
|
||||
/// insert data items
|
||||
pub fn insert_data(&mut self, key: impl Into<String>, value: impl Into<String>) {
|
||||
self.data.insert(key.into(), value.into());
|
||||
}
|
||||
|
||||
/// get algorithm
|
||||
pub fn algorithm(&self) -> &str {
|
||||
&self.algorithm
|
||||
}
|
||||
|
||||
/// get version
|
||||
pub fn version(&self) -> &str {
|
||||
&self.version
|
||||
}
|
||||
|
||||
/// get data
|
||||
pub fn data(&self) -> &HashMap<String, String> {
|
||||
&self.data
|
||||
}
|
||||
|
||||
/// serialize it to Vec<u8>
|
||||
pub fn to_vec(&self) -> Result<Vec<u8>> {
|
||||
Ok(toml::to_vec(&self)?)
|
||||
}
|
||||
|
||||
/// serialize config to TOML string
|
||||
pub fn to_string(&self) -> Result<String> {
|
||||
Ok(toml::to_string_pretty(self)?)
|
||||
}
|
||||
|
||||
/// Validate InitData
|
||||
pub fn validate(&self) -> Result<()> {
|
||||
// Currently, it only supports 0.1.0
|
||||
if self.version != INITDATA_VERSION {
|
||||
return Err(anyhow!(
|
||||
"unsupported version: {}, expected: {}",
|
||||
self.version,
|
||||
INITDATA_VERSION
|
||||
));
|
||||
}
|
||||
|
||||
if !SUPPORTED_ALGORITHMS
|
||||
.iter()
|
||||
.any(|&alg| alg == self.algorithm)
|
||||
{
|
||||
return Err(anyhow!(
|
||||
"unsupported algorithm: {}, supported algorithms: {}",
|
||||
self.algorithm,
|
||||
SUPPORTED_ALGORITHMS.join(", ")
|
||||
));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// calculate initdata digest
|
||||
fn calculate_digest(algorithm: &str, data: &str) -> Result<Vec<u8>> {
|
||||
let digest = match algorithm {
|
||||
"sha256" => {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(&data);
|
||||
hasher.finalize().to_vec()
|
||||
}
|
||||
"sha384" => {
|
||||
let mut hasher = Sha384::new();
|
||||
hasher.update(&data);
|
||||
hasher.finalize().to_vec()
|
||||
}
|
||||
"sha512" => {
|
||||
let mut hasher = Sha512::new();
|
||||
hasher.update(&data);
|
||||
hasher.finalize().to_vec()
|
||||
}
|
||||
_ => return Err(anyhow!("unsupported Hash algorithm: {}", algorithm).into()),
|
||||
};
|
||||
|
||||
Ok(digest)
|
||||
}
|
||||
|
||||
/// Handle digest for different TEE platform
|
||||
fn adjust_digest(digest: &[u8], platform: ProtectedPlatform) -> Vec<u8> {
|
||||
let required_len = match platform {
|
||||
ProtectedPlatform::Tdx => 48,
|
||||
ProtectedPlatform::Snp => 32,
|
||||
ProtectedPlatform::Cca => 64,
|
||||
ProtectedPlatform::NoProtection => digest.len(),
|
||||
};
|
||||
|
||||
let mut adjusted = Vec::with_capacity(required_len);
|
||||
|
||||
if digest.len() >= required_len {
|
||||
adjusted.extend_from_slice(&digest[..required_len]);
|
||||
} else {
|
||||
adjusted.extend_from_slice(digest);
|
||||
adjusted.resize(required_len, 0u8); // padding with zero
|
||||
}
|
||||
|
||||
// Vec<u8>
|
||||
adjusted
|
||||
}
|
||||
|
||||
/// Parse initdata
|
||||
fn parse_initdata(initdata_str: &str) -> Result<InitData> {
|
||||
let initdata: InitData = toml::from_str(&initdata_str)?;
|
||||
initdata.validate()?;
|
||||
|
||||
Ok(initdata)
|
||||
}
|
||||
|
||||
/// calculate initdata digest
|
||||
/// 1. Parse InitData
|
||||
/// 2. Calculate Digest
|
||||
/// 3. Adjust Digest with Platform
|
||||
/// 4. Encode digest with base64/Standard
|
||||
pub fn calculate_initdata_digest(
|
||||
initdata_toml: &str,
|
||||
platform: ProtectedPlatform,
|
||||
) -> Result<String> {
|
||||
// 1. Parse InitData
|
||||
let initdata: InitData = parse_initdata(initdata_toml).context("parse initdata")?;
|
||||
let algorithm: &str = &initdata.algorithm;
|
||||
|
||||
// 2. Calculate Digest
|
||||
let digest = calculate_digest(algorithm, &initdata_toml).context("calculate digest")?;
|
||||
|
||||
// 3. Adjust Digest with Platform
|
||||
let digest_platform = adjust_digest(&digest, platform);
|
||||
|
||||
// 4. Encode digest with base64/Standard
|
||||
let b64encoded_digest = base64::encode_config(digest_platform, base64::STANDARD);
|
||||
|
||||
Ok(b64encoded_digest)
|
||||
}
|
||||
|
||||
/// The argument `initda_annotation` is a Standard base64 encoded string containing a TOML formatted content.
|
||||
/// This function decodes the base64 string, parses the TOML content into an InitData structure.
|
||||
pub fn add_hypervisor_initdata_overrides(initda_annotation: &str) -> Result<String> {
|
||||
// Base64 decode the annotation value
|
||||
let b64_decoded =
|
||||
base64::decode_config(initda_annotation, base64::STANDARD).context("base64 decode")?;
|
||||
|
||||
// Gzip decompress the decoded data
|
||||
let mut gz_decoder = GzDecoder::new(&b64_decoded[..]);
|
||||
let mut initdata_str = String::new();
|
||||
gz_decoder
|
||||
.read_to_string(&mut initdata_str)
|
||||
.context("gz decoder failed")?;
|
||||
|
||||
// Parse the initdata
|
||||
let initdata: InitData = parse_initdata(&initdata_str).context("parse initdata overrides")?;
|
||||
|
||||
// initdata within a TOML string
|
||||
initdata.to_string()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use flate2::write::GzEncoder;
|
||||
use flate2::Compression;
|
||||
use std::io::Write;
|
||||
|
||||
/// Test InitData creation and serialization
|
||||
#[test]
|
||||
fn test_init_data() {
|
||||
let mut init_data = InitData::new("sha384", "0.1.0");
|
||||
init_data.insert_data("initdata_key", "initdata_value");
|
||||
|
||||
// Verify data insertion
|
||||
assert_eq!(
|
||||
init_data.data().get("initdata_key").unwrap(),
|
||||
"initdata_value"
|
||||
);
|
||||
assert_eq!(init_data.version(), "0.1.0");
|
||||
assert_eq!(init_data.algorithm(), "sha384");
|
||||
|
||||
// Test TOML serialization
|
||||
let toml_str = init_data.to_string().unwrap();
|
||||
assert!(toml_str.contains("initdata_key = 'initdata_value'\n"));
|
||||
assert!(toml_str.starts_with("version = '0.1.0'"));
|
||||
}
|
||||
|
||||
/// Test calculate_digest with different algorithms
|
||||
#[test]
|
||||
fn test_calculate_digest() {
|
||||
let data = "test_data";
|
||||
|
||||
// Test SHA256
|
||||
let sha256 = calculate_digest("sha256", data).unwrap();
|
||||
assert_eq!(sha256.len(), 32);
|
||||
|
||||
// Test SHA384
|
||||
let sha384 = calculate_digest("sha384", data).unwrap();
|
||||
assert_eq!(sha384.len(), 48);
|
||||
|
||||
// Test SHA512
|
||||
let sha512 = calculate_digest("sha512", data).unwrap();
|
||||
assert_eq!(sha512.len(), 64);
|
||||
|
||||
// Test invalid algorithm
|
||||
assert!(calculate_digest("md5", data).is_err());
|
||||
}
|
||||
|
||||
/// Test digest adjustment for different platforms
|
||||
#[test]
|
||||
fn test_adjust_digest() {
|
||||
let sample_digest = vec![0xAA; 64]; // 64-byte digest
|
||||
|
||||
// Test TDX platform (requires 48 bytes)
|
||||
let tdx_result = adjust_digest(&sample_digest, ProtectedPlatform::Tdx);
|
||||
assert_eq!(tdx_result.len(), 48);
|
||||
assert_eq!(&tdx_result[..48], &sample_digest[..48]);
|
||||
|
||||
// Test SNP platform (requires 32 bytes)
|
||||
let snp_result = adjust_digest(&sample_digest, ProtectedPlatform::Snp);
|
||||
assert_eq!(snp_result.len(), 32);
|
||||
|
||||
// Test short digest with CCA platform (requires 64 bytes)
|
||||
let short_digest = vec![0xBB; 32];
|
||||
let cca_result = adjust_digest(&short_digest, ProtectedPlatform::Cca);
|
||||
assert_eq!(cca_result.len(), 64);
|
||||
assert_eq!(&cca_result[..32], &short_digest[..]);
|
||||
assert_eq!(&cca_result[32..], vec![0u8; 32]);
|
||||
}
|
||||
|
||||
/// Test hypervisor initdata processing with compression
|
||||
#[test]
|
||||
fn test_hypervisor_initdata_processing() {
|
||||
// Create test initdata
|
||||
let mut init_data = InitData::new("sha512", "0.1.0");
|
||||
init_data.insert_data("hypervisor_key", "config_value");
|
||||
|
||||
// Create compressed annotation
|
||||
let mut encoder = GzEncoder::new(Vec::new(), Compression::default());
|
||||
encoder
|
||||
.write_all(init_data.to_string().unwrap().as_bytes())
|
||||
.unwrap();
|
||||
let compressed = encoder.finish().unwrap();
|
||||
let b64_annotation = base64::encode(compressed);
|
||||
|
||||
// Test processing
|
||||
let result = add_hypervisor_initdata_overrides(&b64_annotation).unwrap();
|
||||
assert!(result.contains("hypervisor_key = 'config_value'\n"));
|
||||
assert!(result.contains("algorithm = 'sha512'\n"));
|
||||
}
|
||||
|
||||
/// Test input validation
|
||||
#[test]
|
||||
fn test_initdata_validation() {
|
||||
// Valid TOML
|
||||
let valid_toml = r#"
|
||||
version = "0.1.0"
|
||||
algorithm = "sha384"
|
||||
|
||||
[data]
|
||||
valid_key = "valid_value"
|
||||
"#;
|
||||
assert!(parse_initdata(valid_toml).is_ok());
|
||||
|
||||
// Invalid TOML (missing version)
|
||||
let invalid_toml = r#"
|
||||
algorithm = "sha256"
|
||||
|
||||
[data]
|
||||
key = "value"
|
||||
"#;
|
||||
assert!(parse_initdata(invalid_toml).is_err());
|
||||
}
|
||||
|
||||
/// Test error handling for malformed inputs
|
||||
#[test]
|
||||
fn test_error_handling() {
|
||||
// Invalid base64
|
||||
assert!(add_hypervisor_initdata_overrides("invalid_base64!!").is_err());
|
||||
|
||||
// Invalid compression format
|
||||
let invalid_data = base64::encode("raw uncompressed data");
|
||||
assert!(add_hypervisor_initdata_overrides(&invalid_data).is_err());
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,10 @@ pub(crate) mod utils;
|
||||
/// hypervisor capabilities
|
||||
pub mod capabilities;
|
||||
|
||||
/// The Initdata specification defines the key data structures and algorithms for injecting
|
||||
/// any well-defined data from an untrusted host into a TEE (Trusted Execution Environment).
|
||||
pub mod initdata;
|
||||
|
||||
/// Common error codes.
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum Error {
|
||||
|
||||
@@ -47,6 +47,9 @@ pub const SANDBOX_BIND_MOUNTS_RO: &str = ":ro";
|
||||
/// SANDBOX_BIND_MOUNTS_RO is for sandbox bindmounts with readwrite
|
||||
pub const SANDBOX_BIND_MOUNTS_RW: &str = ":rw";
|
||||
|
||||
/// KATA_VIRTUAL_VOLUME_PREFIX is for container image guest pull
|
||||
pub const KATA_VIRTUAL_VOLUME_PREFIX: &str = "io.katacontainers.volume=";
|
||||
|
||||
/// Directly assign a block volume to vm and mount it inside guest.
|
||||
pub const KATA_VIRTUAL_VOLUME_DIRECT_BLOCK: &str = "direct_block";
|
||||
/// Present a container image as a generic block device.
|
||||
@@ -384,7 +387,15 @@ impl KataVirtualVolume {
|
||||
pub fn from_base64(value: &str) -> Result<Self> {
|
||||
let json = base64::decode(value)?;
|
||||
let volume: KataVirtualVolume = serde_json::from_slice(&json)?;
|
||||
|
||||
Ok(volume)
|
||||
}
|
||||
|
||||
/// Decode and deserialize a virtual volume object from base64 encoded json string and validate it.
|
||||
pub fn from_base64_and_validate(value: &str) -> Result<Self> {
|
||||
let volume = Self::from_base64(value)?;
|
||||
volume.validate()?;
|
||||
|
||||
Ok(volume)
|
||||
}
|
||||
}
|
||||
@@ -532,7 +543,7 @@ pub fn adjust_rootfs_mounts() -> Result<Vec<Mount>> {
|
||||
// Create a new Vec<Mount> with a single Mount entry.
|
||||
// This Mount's options will contain the base64-encoded virtual volume.
|
||||
Ok(vec![Mount {
|
||||
options: vec![format!("{}={}", "io.katacontainers.volume", b64_vol)],
|
||||
options: vec![format!("{}{}", KATA_VIRTUAL_VOLUME_PREFIX, b64_vol)],
|
||||
..Default::default() // Use default values for other Mount fields
|
||||
}])
|
||||
}
|
||||
@@ -647,7 +658,8 @@ mod tests {
|
||||
volume.direct_volume = Some(DirectAssignedVolume { metadata });
|
||||
|
||||
let value = volume.to_base64().unwrap();
|
||||
let volume2: KataVirtualVolume = KataVirtualVolume::from_base64(value.as_str()).unwrap();
|
||||
let volume2: KataVirtualVolume =
|
||||
KataVirtualVolume::from_base64_and_validate(value.as_str()).unwrap();
|
||||
assert_eq!(volume.volume_type, volume2.volume_type);
|
||||
assert_eq!(volume.source, volume2.source);
|
||||
assert_eq!(volume.fs_type, volume2.fs_type);
|
||||
|
||||
@@ -13,9 +13,13 @@ serde_json = "1.0.73"
|
||||
# - Dynamic keys required to allow HashMap keys to be slog::Serialized.
|
||||
# - The 'max_*' features allow changing the log level at runtime
|
||||
# (by stopping the compiler from removing log calls).
|
||||
slog = { version = "2.5.2", features = ["dynamic-keys", "max_level_trace", "release_max_level_debug"] }
|
||||
slog = { version = "2.5.2", features = [
|
||||
"dynamic-keys",
|
||||
"max_level_trace",
|
||||
"release_max_level_debug",
|
||||
] }
|
||||
slog-json = "2.4.0"
|
||||
slog-term = "2.9.0"
|
||||
slog-term = "2.9.1"
|
||||
slog-async = "2.7.0"
|
||||
slog-scope = "4.4.0"
|
||||
lazy_static = "1.3.0"
|
||||
|
||||
@@ -13,11 +13,11 @@ async = ["ttrpc/async", "async-trait"]
|
||||
[dependencies]
|
||||
ttrpc = "0.8.4"
|
||||
async-trait = { version = "0.1.42", optional = true }
|
||||
protobuf = { version = "=3.7.1" }
|
||||
protobuf = { version = "3.7.2" }
|
||||
serde = { version = "1.0.130", features = ["derive"] }
|
||||
serde_json = "1.0.68"
|
||||
oci-spec = { version = "0.6.8", features = ["runtime"] }
|
||||
oci-spec = { version = "0.8.1", features = ["runtime"] }
|
||||
|
||||
[build-dependencies]
|
||||
ttrpc-codegen = "0.5.0"
|
||||
protobuf = { version = "=3.7.1" }
|
||||
ttrpc-codegen = "0.6.0"
|
||||
protobuf = { version = "3.7.2" }
|
||||
|
||||
@@ -13,7 +13,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "^1.0"
|
||||
nix = "0.24.0"
|
||||
nix = "0.26.4"
|
||||
tokio = { version = "1.44.2", features = ["rt-multi-thread"] }
|
||||
hyper = { version = "0.14.20", features = ["stream", "server", "http1"] }
|
||||
hyperlocal = "0.8"
|
||||
|
||||
@@ -12,4 +12,4 @@ license = "Apache-2.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
nix = "0.24.2"
|
||||
nix = "0.26.4"
|
||||
|
||||
5
src/mem-agent/.gitignore
vendored
5
src/mem-agent/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
/target
|
||||
/example/target
|
||||
/.vscode
|
||||
.vscode-ctags
|
||||
|
||||
917
src/mem-agent/Cargo.lock
generated
917
src/mem-agent/Cargo.lock
generated
@@ -1,917 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
|
||||
dependencies = [
|
||||
"gimli",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "adler"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "android-tzdata"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
||||
|
||||
[[package]]
|
||||
name = "android_system_properties"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.81"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
|
||||
|
||||
[[package]]
|
||||
name = "arc-swap"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f"
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.77"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"miniz_oxide",
|
||||
"object",
|
||||
"rustc-demangle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.15.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.90"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a"
|
||||
dependencies = [
|
||||
"android-tzdata",
|
||||
"iana-time-zone",
|
||||
"js-sys",
|
||||
"num-traits",
|
||||
"wasm-bindgen",
|
||||
"windows-targets 0.52.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation-sys"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.5.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
|
||||
dependencies = [
|
||||
"powerfmt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs-next"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"dirs-sys-next",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs-sys-next"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"redox_users",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gimli"
|
||||
version = "0.28.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc"
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.60"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"core-foundation-sys",
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone-haiku"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "is-terminal"
|
||||
version = "0.4.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.172"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
|
||||
|
||||
[[package]]
|
||||
name = "maplit"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
||||
|
||||
[[package]]
|
||||
name = "mem-agent"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"chrono",
|
||||
"lazy_static",
|
||||
"maplit",
|
||||
"nix",
|
||||
"once_cell",
|
||||
"page_size",
|
||||
"slog",
|
||||
"slog-async",
|
||||
"slog-scope",
|
||||
"slog-term",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
|
||||
dependencies = [
|
||||
"adler",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.23.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"memoffset",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-conv"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.32.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||
|
||||
[[package]]
|
||||
name = "page_size"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.9.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
||||
|
||||
[[package]]
|
||||
name = "powerfmt"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"libredox",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.210"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.210"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook-registry"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "slog"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06"
|
||||
|
||||
[[package]]
|
||||
name = "slog-async"
|
||||
version = "2.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72c8038f898a2c79507940990f05386455b3a317d8f18d4caea7cbc3d5096b84"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"slog",
|
||||
"take_mut",
|
||||
"thread_local",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "slog-scope"
|
||||
version = "4.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"lazy_static",
|
||||
"slog",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "slog-term"
|
||||
version = "2.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6e022d0b998abfe5c3782c1f03551a596269450ccd677ea51c56f8b214610e8"
|
||||
dependencies = [
|
||||
"is-terminal",
|
||||
"slog",
|
||||
"term",
|
||||
"thread_local",
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.52"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "take_mut"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
|
||||
|
||||
[[package]]
|
||||
name = "term"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
|
||||
dependencies = [
|
||||
"dirs-next",
|
||||
"rustversion",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "1.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
"num-conv",
|
||||
"powerfmt",
|
||||
"serde",
|
||||
"time-core",
|
||||
"time-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time-core"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.44.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
"libc",
|
||||
"mio",
|
||||
"parking_lot",
|
||||
"pin-project-lite",
|
||||
"signal-hook-registry",
|
||||
"socket2",
|
||||
"tokio-macros",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"wasm-bindgen-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||
dependencies = [
|
||||
"winapi-i686-pc-windows-gnu",
|
||||
"winapi-x86_64-pc-windows-gnu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-i686-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
||||
dependencies = [
|
||||
"windows-targets 0.52.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||
dependencies = [
|
||||
"windows-targets 0.52.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.48.5",
|
||||
"windows_aarch64_msvc 0.48.5",
|
||||
"windows_i686_gnu 0.48.5",
|
||||
"windows_i686_msvc 0.48.5",
|
||||
"windows_x86_64_gnu 0.48.5",
|
||||
"windows_x86_64_gnullvm 0.48.5",
|
||||
"windows_x86_64_msvc 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.52.4",
|
||||
"windows_aarch64_msvc 0.52.4",
|
||||
"windows_i686_gnu 0.52.4",
|
||||
"windows_i686_msvc 0.52.4",
|
||||
"windows_x86_64_gnu 0.52.4",
|
||||
"windows_x86_64_gnullvm 0.52.4",
|
||||
"windows_x86_64_msvc 0.52.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "mem-agent"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
name = "mem-agent-lib"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
slog = "2.5.2"
|
||||
@@ -9,13 +9,14 @@ slog-scope = "4.1.2"
|
||||
anyhow = "1.0"
|
||||
page_size = "0.6"
|
||||
chrono = "0.4"
|
||||
tokio = { version = "1.44.2", features = ["full"] }
|
||||
tokio = { version = "1.45.1", features = ["full"] }
|
||||
async-trait = "0.1"
|
||||
lazy_static = "1.4"
|
||||
nix = "0.23.2"
|
||||
maplit = "1.0"
|
||||
nix = { version = "0.30.1", features = ["fs", "sched"] }
|
||||
|
||||
[dev-dependencies]
|
||||
maplit = "1.0"
|
||||
slog-term = "2.9.0"
|
||||
slog-async = "2.7"
|
||||
once_cell = "1.9.0"
|
||||
lazy_static = "1.4"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# Copyright (C) 2024 Ant group. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
default:
|
||||
cd example; cargo build --examples --target x86_64-unknown-linux-musl
|
||||
1641
src/mem-agent/example/Cargo.lock
generated
1641
src/mem-agent/example/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,36 +0,0 @@
|
||||
[package]
|
||||
name = "mem-agent-bin"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
slog = "2.5.2"
|
||||
slog-scope = "4.1.2"
|
||||
slog-term = "2.9.0"
|
||||
slog-async = "2.7"
|
||||
structopt = "0.3"
|
||||
anyhow = "1.0"
|
||||
libc = "0.2"
|
||||
page_size = "0.6"
|
||||
chrono = "0.4"
|
||||
maplit = "1.0"
|
||||
ttrpc = { version = "0.8", features = ["async"] }
|
||||
tokio = { version = "1.44.2", features = ["full"] }
|
||||
async-trait = "0.1"
|
||||
byteorder = "1.5"
|
||||
protobuf = "3.1"
|
||||
lazy_static = "1.4"
|
||||
# Rust 1.68 doesn't support 0.5.9
|
||||
home = "=0.5.5"
|
||||
mem-agent = { path = "../" }
|
||||
|
||||
[[example]]
|
||||
name = "mem-agent-srv"
|
||||
path = "./srv.rs"
|
||||
|
||||
[[example]]
|
||||
name = "mem-agent-ctl"
|
||||
path = "./ctl.rs"
|
||||
|
||||
[build-dependencies]
|
||||
ttrpc-codegen = "0.4"
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright (C) 2024 Ant group. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use ttrpc_codegen::{Codegen, Customize, ProtobufCustomize};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let protos = vec![
|
||||
"protocols/protos/mem-agent.proto",
|
||||
"protocols/protos/google/protobuf/empty.proto",
|
||||
"protocols/protos/google/protobuf/timestamp.proto",
|
||||
];
|
||||
|
||||
let protobuf_customized = ProtobufCustomize::default().gen_mod_rs(false);
|
||||
|
||||
Codegen::new()
|
||||
.out_dir("protocols/")
|
||||
.inputs(&protos)
|
||||
.include("protocols/protos/")
|
||||
.rust_protobuf()
|
||||
.customize(Customize {
|
||||
async_all: true,
|
||||
..Default::default()
|
||||
})
|
||||
.rust_protobuf_customize(protobuf_customized.clone())
|
||||
.run()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
// Copyright (C) 2023 Ant group. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
mod protocols;
|
||||
mod share;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use protocols::empty;
|
||||
use protocols::mem_agent_ttrpc;
|
||||
use share::option::{CompactSetOption, MemcgSetOption};
|
||||
use structopt::StructOpt;
|
||||
use ttrpc::r#async::Client;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
enum Command {
|
||||
#[structopt(name = "memcgstatus", about = "get memory cgroup status")]
|
||||
MemcgStatus,
|
||||
|
||||
#[structopt(name = "memcgset", about = "set memory cgroup")]
|
||||
MemcgSet(MemcgSetOption),
|
||||
|
||||
#[structopt(name = "compactset", about = "set compact")]
|
||||
CompactSet(CompactSetOption),
|
||||
}
|
||||
|
||||
#[derive(StructOpt, Debug)]
|
||||
#[structopt(name = "mem-agent-ctl", about = "Memory agent controler")]
|
||||
struct Opt {
|
||||
#[structopt(long, default_value = "unix:///var/run/mem-agent.sock")]
|
||||
addr: String,
|
||||
|
||||
#[structopt(subcommand)]
|
||||
command: Command,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let opt = Opt::from_args();
|
||||
|
||||
// setup client
|
||||
let c = Client::connect(&opt.addr).unwrap();
|
||||
let client = mem_agent_ttrpc::ControlClient::new(c.clone());
|
||||
|
||||
match opt.command {
|
||||
Command::MemcgStatus => {
|
||||
let mss = client
|
||||
.memcg_status(ttrpc::context::with_timeout(0), &empty::Empty::new())
|
||||
.await
|
||||
.map_err(|e| anyhow!("client.memcg_status fail: {}", e))?;
|
||||
for mcg in mss.mem_cgroups {
|
||||
println!("{:?}", mcg);
|
||||
for (numa_id, n) in mcg.numa {
|
||||
if let Some(t) = n.last_inc_time.into_option() {
|
||||
println!("{} {:?}", numa_id, share::misc::timestamp_to_datetime(t)?);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Command::MemcgSet(c) => {
|
||||
let config = c.to_rpc_memcg_config();
|
||||
client
|
||||
.memcg_set(ttrpc::context::with_timeout(0), &config)
|
||||
.await
|
||||
.map_err(|e| anyhow!("client.memcg_status fail: {}", e))?;
|
||||
}
|
||||
|
||||
Command::CompactSet(c) => {
|
||||
let config = c.to_rpc_compact_config();
|
||||
client
|
||||
.compact_set(ttrpc::context::with_timeout(0), &config)
|
||||
.await
|
||||
.map_err(|e| anyhow!("client.memcg_status fail: {}", e))?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (C) 2023 Ant group. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pub mod empty;
|
||||
pub mod mem_agent;
|
||||
pub mod mem_agent_ttrpc;
|
||||
pub mod timestamp;
|
||||
@@ -1,52 +0,0 @@
|
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2008 Google Inc. All rights reserved.
|
||||
// https://developers.google.com/protocol-buffers/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option go_package = "types";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "EmptyProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option cc_enable_arenas = true;
|
||||
|
||||
// A generic empty message that you can re-use to avoid defining duplicated
|
||||
// empty messages in your APIs. A typical example is to use it as the request
|
||||
// or the response type of an API method. For instance:
|
||||
//
|
||||
// service Foo {
|
||||
// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
// }
|
||||
//
|
||||
// The JSON representation for `Empty` is empty JSON object `{}`.
|
||||
message Empty {}
|
||||
@@ -1,138 +0,0 @@
|
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2008 Google Inc. All rights reserved.
|
||||
// https://developers.google.com/protocol-buffers/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "github.com/golang/protobuf/ptypes/timestamp";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "TimestampProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
|
||||
// A Timestamp represents a point in time independent of any time zone or local
|
||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
// Gregorian calendar backwards to year one.
|
||||
//
|
||||
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
// second table is needed for interpretation, using a [24-hour linear
|
||||
// smear](https://developers.google.com/time/smear).
|
||||
//
|
||||
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
// restricting to that range, we ensure that we can convert to and from [RFC
|
||||
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
//
|
||||
// # Examples
|
||||
//
|
||||
// Example 1: Compute Timestamp from POSIX `time()`.
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(time(NULL));
|
||||
// timestamp.set_nanos(0);
|
||||
//
|
||||
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
//
|
||||
// struct timeval tv;
|
||||
// gettimeofday(&tv, NULL);
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(tv.tv_sec);
|
||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
//
|
||||
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
//
|
||||
// FILETIME ft;
|
||||
// GetSystemTimeAsFileTime(&ft);
|
||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
//
|
||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
//
|
||||
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
//
|
||||
// long millis = System.currentTimeMillis();
|
||||
//
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
//
|
||||
//
|
||||
// Example 5: Compute Timestamp from current time in Python.
|
||||
//
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
//
|
||||
// # JSON Mapping
|
||||
//
|
||||
// In JSON format, the Timestamp type is encoded as a string in the
|
||||
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||
// where {year} is always expressed using four digits while {month}, {day},
|
||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
// able to accept both UTC and other timezones (as indicated by an offset).
|
||||
//
|
||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
// 01:30 UTC on January 15, 2017.
|
||||
//
|
||||
// In JavaScript, one can convert a Date object to this format using the
|
||||
// standard
|
||||
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
// to this format using
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
//
|
||||
message Timestamp {
|
||||
// Represents seconds of UTC time since Unix epoch
|
||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
// 9999-12-31T23:59:59Z inclusive.
|
||||
int64 seconds = 1;
|
||||
|
||||
// Non-negative fractions of a second at nanosecond resolution. Negative
|
||||
// second values with fractions must still have non-negative nanos values
|
||||
// that count forward in time. Must be from 0 to 999,999,999
|
||||
// inclusive.
|
||||
int32 nanos = 2;
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
// Copyright (C) 2023 Ant group. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package MemAgent;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service Control {
|
||||
rpc MemcgStatus(google.protobuf.Empty) returns (MemcgStatusReply);
|
||||
rpc MemcgSet(MemcgConfig) returns (google.protobuf.Empty);
|
||||
rpc CompactSet(CompactConfig) returns (google.protobuf.Empty);
|
||||
}
|
||||
|
||||
message EvictionCount {
|
||||
uint64 page = 1;
|
||||
uint64 no_min_lru_file = 2;
|
||||
uint64 min_lru_inc = 3;
|
||||
uint64 other_error = 4;
|
||||
uint64 error = 5;
|
||||
uint64 psi_exceeds_limit = 6;
|
||||
}
|
||||
|
||||
message StatusNuma {
|
||||
google.protobuf.Timestamp last_inc_time = 1;
|
||||
uint64 max_seq = 2;
|
||||
uint64 min_seq = 3;
|
||||
uint64 run_aging_count = 4;
|
||||
EvictionCount eviction_count = 5;
|
||||
}
|
||||
|
||||
message MemCgroup {
|
||||
uint32 id = 1;
|
||||
uint64 ino = 2;
|
||||
string path = 3;
|
||||
uint64 sleep_psi_exceeds_limit = 4;
|
||||
map<uint32, StatusNuma> numa = 5;
|
||||
}
|
||||
|
||||
message MemcgStatusReply {
|
||||
repeated MemCgroup mem_cgroups = 1;
|
||||
}
|
||||
|
||||
message MemcgConfig {
|
||||
optional bool disabled = 1;
|
||||
optional bool swap = 2;
|
||||
optional uint32 swappiness_max = 3;
|
||||
optional uint64 period_secs = 4;
|
||||
optional uint32 period_psi_percent_limit = 5;
|
||||
optional uint32 eviction_psi_percent_limit = 6;
|
||||
optional uint64 eviction_run_aging_count_min = 7;
|
||||
}
|
||||
|
||||
message CompactConfig {
|
||||
optional bool disabled = 1;
|
||||
optional uint64 period_secs = 2;
|
||||
optional uint32 period_psi_percent_limit = 3;
|
||||
optional uint32 compact_psi_percent_limit = 4;
|
||||
optional int64 compact_sec_max = 5;
|
||||
optional uint32 compact_order = 6;
|
||||
optional uint64 compact_threshold = 7;
|
||||
optional uint64 compact_force_times = 8;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright (C) 2023 Ant group. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use chrono::{DateTime, LocalResult, TimeZone, Utc};
|
||||
use protobuf::well_known_types::timestamp::Timestamp;
|
||||
|
||||
pub fn datatime_to_timestamp(dt: DateTime<Utc>) -> Timestamp {
|
||||
let seconds = dt.timestamp();
|
||||
let nanos = dt.timestamp_subsec_nanos();
|
||||
|
||||
Timestamp {
|
||||
seconds,
|
||||
nanos: nanos as i32,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn timestamp_to_datetime(timestamp: Timestamp) -> Result<DateTime<Utc>> {
|
||||
let seconds = timestamp.seconds;
|
||||
let nanos = timestamp.nanos;
|
||||
|
||||
match Utc.timestamp_opt(seconds, nanos as u32) {
|
||||
LocalResult::Single(t) => Ok(t),
|
||||
_ => Err(anyhow!("Utc.timestamp_opt {} fail", timestamp)),
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user