Skip to content

Commit 8a3c568

Browse files
zlangbertfrezbo
authored andcommitted
feat: add soci snapshotter extension
Adds the AWS SOCI containerd snapshotter, allowing for lazy pulls (similar to stargz) Signed-off-by: Noel Georgi <[email protected]>
1 parent 313ae03 commit 8a3c568

File tree

11 files changed

+155
-0
lines changed

11 files changed

+155
-0
lines changed

.kres.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ spec:
5353
- qlogic-firmware
5454
- realtek-firmware
5555
- revpi-firmware
56+
- soci-snapshotter
5657
- spin
5758
- stargz-snapshotter
5859
- tailscale

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ TARGETS += qemu-guest-agent
110110
TARGETS += qlogic-firmware
111111
TARGETS += realtek-firmware
112112
TARGETS += revpi-firmware
113+
TARGETS += soci-snapshotter
113114
TARGETS += spin
114115
TARGETS += stargz-snapshotter
115116
TARGETS += tailscale

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ tiers based on support level:
6565
| [gvisor](container-runtime/gvisor) | :green_square: core | [ghcr.io/siderolabs/gvisor](https://github.com/siderolabs/extensions/pkgs/container/gvisor) | `20251103.0` | This system extension provides gVisor using containerd's runtime handler. |
6666
| [gvisor-debug](container-runtime/gvisor-debug) | :yellow_square: extra | [ghcr.io/siderolabs/gvisor-debug](https://github.com/siderolabs/extensions/pkgs/container/gvisor-debug) | `v1.0.0` | This system extension enables gVisor debug logging. |
6767
| [kata-containers](container-runtime/kata-containers) | :yellow_square: extra | [ghcr.io/siderolabs/kata-containers](https://github.com/siderolabs/extensions/pkgs/container/kata-containers) | `3.22.0` | This system extension provides kata-container using containerd's runtime handler. |
68+
| [soci-snapshotter](container-runtime/soci-snapshotter) | :yellow_square: extra | [ghcr.io/siderolabs/soci-snapshotter](https://github.com/siderolabs/extensions/pkgs/container/soci-snapshotter) | `v0.11.1` | This system extension provides AWS SOCI Snapshotter using containerd's runtime handler. |
6869
| [spin](container-runtime/spin) | :yellow_square: extra | [ghcr.io/siderolabs/spin](https://github.com/siderolabs/extensions/pkgs/container/spin) | `v0.22.0` | This system extension provides support for spin runtime (WebAssembly) containers. |
6970
| [stargz-snapshotter](container-runtime/stargz-snapshotter) | :green_square: core | [ghcr.io/siderolabs/stargz-snapshotter](https://github.com/siderolabs/extensions/pkgs/container/stargz-snapshotter) | `v0.18.1` | This system extension provides Stargz Snapshotter using containerd's runtime handler. |
7071
| [wasmedge](container-runtime/wasmedge) | :yellow_square: extra | [ghcr.io/siderolabs/wasmedge](https://github.com/siderolabs/extensions/pkgs/container/wasmedge) | `v0.6.0` | This system extension provides support for WasmEdge runtime (WebAssembly) containers. |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[proxy_plugins]
2+
[proxy_plugins.soci]
3+
type = "snapshot"
4+
address = "/var/run/soci-snapshotter/soci-snapshotter-grpc.sock"
5+
6+
[plugins."io.containerd.cri.v1.images"]
7+
snapshotter = "soci"
8+
disable_snapshot_annotations = false
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AWS SOCI Snapshotter extension
2+
3+
## Installation
4+
5+
See [Installing Extensions](https://github.com/siderolabs/extensions#installing-extensions).
6+
7+
## Pulling from Privte Registries
8+
9+
To pull from private registries an additional step is required. You must configure the Kubelet to use the SOCI snapshotter as an image service proxy. This is explained in more detail in the [SOCI docs](https://github.com/awslabs/soci-snapshotter/blob/main/docs/registry-authentication.md#kubernetes-cri-credentials). An example config patch:
10+
11+
```yaml
12+
machine:
13+
kubelet:
14+
extraConfig:
15+
imageServiceEndpoint: unix:///var/run/soci-snapshotter/soci-snapshotter-grpc.sock
16+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SOCI Snapshotter configuration
2+
3+
# Enable use of the SOCI snapshotter as a proxy ImageService so it can pull
4+
# images from private registries.
5+
[cri_keychain]
6+
enable_keychain = true
7+
image_service_path = "/var/run/containerd/containerd.sock"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1alpha1
2+
metadata:
3+
name: soci-snapshotter
4+
version: "{{ .VERSION }}"
5+
author: Sidero Labs
6+
description: |
7+
[{{ .TIER }}] This system extension provides AWS SOCI Snapshotter using containerd's runtime handler.
8+
compatibility:
9+
talos:
10+
version: ">= v1.8.0"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: soci-snapshotter
2+
variant: scratch
3+
shell: /bin/bash
4+
dependencies:
5+
- stage: base
6+
steps:
7+
- sources:
8+
- url: https://github.com/awslabs/soci-snapshotter/archive/refs/tags/{{ .SOCI_SNAPSHOTTER_VERSION }}.tar.gz
9+
destination: soci-snapshotter.tar.gz
10+
sha256: {{ .SOCI_SNAPSHOTTER_SHA256 }}
11+
sha512: {{ .SOCI_SNAPSHOTTER_SHA512 }}
12+
env:
13+
GOPATH: /tmp/go
14+
VERSION: {{ .SOCI_SNAPSHOTTER_VERSION }}
15+
REVISION: {{ .SOCI_SNAPSHOTTER_REV }}
16+
cachePaths:
17+
- /.cache/go-build
18+
- /tmp/go/pkg
19+
- network: default
20+
prepare:
21+
- |
22+
mkdir -p ${GOPATH}/src/github.com/awslabs/soci-snapshotter
23+
24+
tar -xzf soci-snapshotter.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/awslabs/soci-snapshotter
25+
- |
26+
cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter/cmd
27+
go mod download
28+
- network: none
29+
build:
30+
- |
31+
cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter
32+
33+
make soci-snapshotter-grpc
34+
make soci
35+
install:
36+
- |
37+
mkdir -p /rootfs/usr/local/bin
38+
mkdir -p /rootfs/usr/local/lib/containers/soci-snapshotter
39+
40+
cd ${GOPATH}/src/github.com/awslabs/soci-snapshotter
41+
42+
cp ./out/soci-snapshotter-grpc /rootfs/usr/local/lib/containers/soci-snapshotter/soci-snapshotter-grpc
43+
chmod +x /rootfs/usr/local/lib/containers/soci-snapshotter/soci-snapshotter-grpc
44+
45+
cp ./out/soci /rootfs/usr/local/lib/containers/soci-snapshotter/soci
46+
chmod +x /rootfs/usr/local/lib/containers/soci-snapshotter/soci
47+
48+
mkdir -p /rootfs/usr/local/lib/containers/soci-snapshotter/etc/soci-snapshotter-grpc/
49+
cp /pkg/config.toml /rootfs/usr/local/lib/containers/soci-snapshotter/etc/soci-snapshotter-grpc/config.toml
50+
- |
51+
mkdir -p /rootfs/etc/cri/conf.d
52+
cp /pkg/10-soci-snapshotter.part /rootfs/etc/cri/conf.d/10-soci-snapshotter.part
53+
54+
mkdir -p /rootfs/usr/local/etc/containers
55+
cp /pkg/soci-snapshotter.yaml /rootfs/usr/local/etc/containers/
56+
test:
57+
- |
58+
mkdir -p /extensions-validator-rootfs
59+
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
60+
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
61+
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
62+
sbom:
63+
outputPath: /rootfs/usr/local/share/spdx/soci-snapshotter.spdx.json
64+
version: {{ .SOCI_SNAPSHOTTER_VERSION }}
65+
licenses:
66+
- Apache-2.0
67+
finalize:
68+
- from: /rootfs
69+
to: /rootfs
70+
- from: /pkg/manifest.yaml
71+
to: /
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: soci-snapshotter
2+
depends:
3+
- service: cri
4+
restart: always
5+
container:
6+
entrypoint: ./soci-snapshotter-grpc
7+
args:
8+
- -log-level=debug
9+
- -address=/var/run/soci-snapshotter/soci-snapshotter-grpc.sock
10+
- -root=/var/lib/containerd/io.containerd.snapshotter.v1.soci
11+
security:
12+
rootfsPropagation: shared
13+
mounts:
14+
- source: /var
15+
destination: /var
16+
type: bind
17+
options:
18+
- rshared
19+
- rbind
20+
- rw
21+
- source: /run
22+
destination: /run
23+
type: bind
24+
options:
25+
- rshared
26+
- rbind
27+
- rw
28+
- source: /etc/ssl/certs
29+
destination: /etc/ssl/certs
30+
type: bind
31+
options:
32+
- rbind
33+
- ro
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VERSION: "{{ .SOCI_SNAPSHOTTER_VERSION }}"
2+
TIER: "extra"

0 commit comments

Comments
 (0)