Skip to content

Commit

Permalink
chore: add extensions validator
Browse files Browse the repository at this point in the history
Add validation for extensions rootfs and names.

Fixes: #379

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed May 23, 2024
1 parent d1a0ce8 commit d07caf7
Show file tree
Hide file tree
Showing 48 changed files with 347 additions and 34 deletions.
52 changes: 51 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-05-09T13:22:16Z by kres 1e986af.
# Generated on 2024-05-23T15:58:32Z by kres 2688b70.

name: default
concurrency:
Expand Down Expand Up @@ -41,6 +41,31 @@ jobs:
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
steps:
- name: gather-system-info
id: system-info
uses: kenchan0130/[email protected]
continue-on-error: true
- name: print-system-info
run: |
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
OUTPUTS=(
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
"Hostname: ${{ steps.system-info.outputs.hostname }}"
"NodeName: ${NODE_NAME}"
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
"Name: ${{ steps.system-info.outputs.name }}"
"Platform: ${{ steps.system-info.outputs.platform }}"
"Release: ${{ steps.system-info.outputs.release }}"
"Total memory: ${MEMORY_GB} GB"
)
for OUTPUT in "${OUTPUTS[@]}";do
echo "${OUTPUT}"
done
continue-on-error: true
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
Expand Down Expand Up @@ -124,6 +149,31 @@ jobs:
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
steps:
- name: gather-system-info
id: system-info
uses: kenchan0130/[email protected]
continue-on-error: true
- name: print-system-info
run: |
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
OUTPUTS=(
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
"Hostname: ${{ steps.system-info.outputs.hostname }}"
"NodeName: ${NODE_NAME}"
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
"Name: ${{ steps.system-info.outputs.name }}"
"Platform: ${{ steps.system-info.outputs.platform }}"
"Release: ${{ steps.system-info.outputs.release }}"
"Total memory: ${MEMORY_GB} GB"
)
for OUTPUT in "${OUTPUTS[@]}";do
echo "${OUTPUT}"
done
continue-on-error: true
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-05-09T13:22:16Z by kres 1e986af.
# Generated on 2024-05-23T15:58:32Z by kres 2688b70.

name: weekly
concurrency:
Expand All @@ -24,6 +24,31 @@ jobs:
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
steps:
- name: gather-system-info
id: system-info
uses: kenchan0130/[email protected]
continue-on-error: true
- name: print-system-info
run: |
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
OUTPUTS=(
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
"Hostname: ${{ steps.system-info.outputs.hostname }}"
"NodeName: ${NODE_NAME}"
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
"Name: ${{ steps.system-info.outputs.name }}"
"Platform: ${{ steps.system-info.outputs.platform }}"
"Release: ${{ steps.system-info.outputs.release }}"
"Total memory: ${MEMORY_GB} GB"
)
for OUTPUT in "${OUTPUTS[@]}";do
echo "${OUTPUT}"
done
continue-on-error: true
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-05-22T11:43:14Z by kres 04ecdaf.
# Generated on 2024-05-23T15:58:32Z by kres 2688b70.

# common variables

Expand Down
2 changes: 1 addition & 1 deletion Pkgfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax = ghcr.io/siderolabs/bldr:v0.3.0
# syntax = ghcr.io/siderolabs/bldr:v0.3.1

format: v1alpha2

Expand Down
6 changes: 6 additions & 0 deletions container-runtime/ecr-credential-provider/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ steps:
- install -D -m 0755
${GOPATH}/src/k8s.io/cloud-provider-aws/dist/ecr-credential-provider
/rootfs/usr/local/lib/kubelet/credentialproviders/ecr-credential-provider
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
15 changes: 11 additions & 4 deletions container-runtime/gvisor-debug/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ steps:
- prepare:
- |
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
install:
- |
mkdir -p /rootfs/etc/cri/conf.d
cp /pkg/gvisor-debug.part /rootfs/etc/cri/conf.d/gvisor-debug.part
cp /pkg/runsc.toml /rootfs/etc/cri/conf.d/runsc.toml
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /pkg/manifest.yaml
to: /
- from: /pkg/gvisor-debug.part
to: /rootfs/etc/cri/conf.d/gvisor-debug.part
- from: /pkg/runsc.toml
to: /rootfs/etc/cri/conf.d/runsc.toml
6 changes: 6 additions & 0 deletions container-runtime/gvisor/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ steps:
cp ./bin/containerd-shim-runsc-v1 /rootfs/usr/local/bin/containerd-shim-runsc-v1
chmod +x /rootfs/usr/local/bin/containerd-shim-runsc-v1
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions container-runtime/kata-containers/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ steps:
- |
cd ${GOPATH}/src/github.com/kata-containers/src/runtime
cp containerd-shim-kata-v2 /rootfs/usr/local/bin/containerd-shim-kata-v2
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions container-runtime/spin/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ steps:
mkdir -p /rootfs/usr/local/bin
tar xf containerd-shim-spin.tar.gz -C /rootfs/usr/local/bin
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions container-runtime/stargz-snapshotter/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ steps:
cp ./out/ctr-remote /rootfs/usr/local/lib/containers/stargz-snapshotter/ctr-remote
chmod +x /rootfs/usr/local/lib/containers/stargz-snapshotter/ctr-remote
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
11 changes: 9 additions & 2 deletions container-runtime/wasmedge/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ steps:
install:
- |
mkdir -p /rootfs/usr/local/bin
mkdir -p /rootfs/etc/cri/conf.d
cp /pkg/wasm.part /rootfs/etc/cri/conf.d/wasm.part
tar xf containerd-shim-wasmedge.tar.gz -C /rootfs/usr/local/bin
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /
- from: /pkg/wasm.part
to: /rootfs/etc/cri/conf.d/wasm.part
5 changes: 5 additions & 0 deletions drivers/chelsio/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ steps:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions drivers/gasket/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ steps:
mkdir -p /rootfs/lib/modules
cp -R /lib/modules/* /rootfs/lib/modules
- test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions drivers/mellanox-ofed/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ steps:
mkdir -p /rootfs/lib/modules
cp -R /lib/modules/* /rootfs/lib/modules
- test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
5 changes: 5 additions & 0 deletions drivers/thunderbolt/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ steps:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
5 changes: 5 additions & 0 deletions drivers/usb-modem/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ steps:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
5 changes: 5 additions & 0 deletions drivers/v4l-uvc/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ steps:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions examples/hello-world-service/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ steps:
mkdir -p /rootfs/usr/local/lib/containers/hello-world
cp -p /pkg/src/hello-world /rootfs/usr/local/lib/containers/hello-world/
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions firmware/amd-ucode/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ steps:
- |
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/amd-ucode /rootfs/lib/firmware
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions firmware/amdgpu-firmware/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ steps:
- |
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/amdgpu /rootfs/lib/firmware
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions firmware/bnx2-bnx2x/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ steps:
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/bnx2 /rootfs/lib/firmware
cp -R -p /lib/firmware/bnx2x /rootfs/lib/firmware
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions firmware/chelsio/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ steps:
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/cxgb3 /rootfs/lib/firmware
cp -R -p /lib/firmware/cxgb4 /rootfs/lib/firmware
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions firmware/i915-ucode/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ steps:
- |
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/i915 /rootfs/lib/firmware
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
6 changes: 6 additions & 0 deletions firmware/intel-ice-firmware/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ steps:
- |
mkdir -p /rootfs/lib/firmware/intel/ice/ddp
cp /lib/firmware/intel/ice/ddp/ice-*.pkg /rootfs/lib/firmware/intel/ice/ddp/ice.pkg
test:
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
finalize:
- from: /rootfs
to: /rootfs
Expand Down
Loading

0 comments on commit d07caf7

Please sign in to comment.