-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add soci-snapshotter to bottlerocket and aws-dev
Add the SOCI snapshotter package to aws-dev. This is a lazy-loading plugin for containerd. See: https://github.com/awslabs/soci-snapshotter
- Loading branch information
Showing
6 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "soci-snapshotter" | ||
version = "0.1.0" | ||
publish = false | ||
build = "../build.rs" | ||
edition = "2021" | ||
|
||
[lib] | ||
path = "../packages.rs" | ||
|
||
[package.metadata.build-package] | ||
releases-url = "https://github.com/awslabs/soci-snapshotter/releases" | ||
|
||
[[package.metadata.build-package.external-files]] | ||
url = "https://github.com/awslabs/soci-snapshotter/archive/refs/tags/v0.5.0.tar.gz" | ||
sha512 = "9980688b71c149ea0f36c52906ba0cc862ca65b9ee0e4b813fef0df83716e313137886986cc78b694e35516fb21095b0cd0436caf485d4b63bd01b150769b6f4" | ||
bundle-root-path = "soci-snapshotter-0.5.0/cmd" | ||
bundle-output-path = "bundled-cmd.tar.gz" | ||
bundle-modules = [ "go" ] | ||
|
||
[[package.metadata.build-package.external-files]] | ||
url = "https://github.com/awslabs/soci-snapshotter/archive/refs/tags/v0.5.0.tar.gz" | ||
sha512 = "9980688b71c149ea0f36c52906ba0cc862ca65b9ee0e4b813fef0df83716e313137886986cc78b694e35516fb21095b0cd0436caf485d4b63bd01b150769b6f4" | ||
bundle-modules = [ "go" ] | ||
|
||
# RPM BuildRequires | ||
[build-dependencies] | ||
glibc = { path = "../glibc" } | ||
libz = { path = "../libz" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[clarify."sigs.k8s.io/yaml"] | ||
expression = "MIT AND Apache-2.0" | ||
license-files = [ | ||
{ path = "LICENSE", hash = 0xcdf3ae00}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=soci snapshotter containerd plugin | ||
Documentation=https://github.com/awslabs/soci-snapshotter | ||
After=configured.target | ||
Wants=configured.target | ||
Before=containerd.service | ||
|
||
[Service] | ||
Type=notify | ||
ExecStart=/usr/bin/soci-snapshotter-grpc | ||
Restart=always | ||
RestartSec=5 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
RequiredBy=containerd.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
%global gorepo soci-snapshotter | ||
%global gover 0.5.0 | ||
%global rpmver %{gover} | ||
|
||
Name: %{_cross_os}soci-snapshotter | ||
Version: %{gover} | ||
Release: 1%{?dist} | ||
Summary: A containerd snapshotter plugin which enables lazy loading for OCI images. | ||
License: Apache-2.0 | ||
URL: https://github.com/awslabs/soci-snapshotter | ||
Source0: https://github.com/awslabs/soci-snapshotter/archive/refs/tags/v0.5.0.tar.gz | ||
Source1: bundled-v%{gover}.tar.gz | ||
Source2: bundled-cmd.tar.gz | ||
Source101: soci-snapshotter.service | ||
Source1000: clarify.toml | ||
|
||
BuildRequires: %{_cross_os}glibc-devel | ||
BuildRequires: %{_cross_os}libz-devel | ||
Requires: %{name}(binaries) | ||
|
||
%description | ||
%{summary}. | ||
|
||
%package bin | ||
Summary: Remote management agent binaries | ||
Provides: %{name}(binaries) | ||
Requires: (%{_cross_os}image-feature(no-fips) and %{name}) | ||
Conflicts: (%{_cross_os}image-feature(fips) or %{name}-fips-bin) | ||
|
||
%description bin | ||
%{summary}. | ||
|
||
%package fips-bin | ||
Summary: Remote management agent binaries, FIPS edition | ||
Provides: %{name}(binaries) | ||
Requires: (%{_cross_os}image-feature(fips) and %{name}) | ||
Conflicts: (%{_cross_os}image-feature(no-fips) or %{name}-bin) | ||
|
||
%description fips-bin | ||
%{summary}. | ||
|
||
%prep | ||
%setup -n %{gorepo}-%{gover} -q | ||
%setup -T -D -n %{gorepo}-%{gover} -b 1 -q | ||
%setup -T -D -n %{gorepo}-%{gover} -b 2 -q | ||
|
||
%build | ||
%set_cross_go_flags | ||
|
||
go build -C cmd -ldflags="${GOLDFLAGS}" -o "../out/soci-snapshotter-grpc" ./soci-snapshotter-grpc | ||
go build -C cmd -ldflags="${GOLDFLAGS}" -o "../out/soci" ./soci | ||
|
||
gofips build -C cmd -ldflags="${GOLDFLAGS}" -o "../out/fips/soci-snapshotter-grpc" ./soci-snapshotter-grpc | ||
gofips build -C cmd -ldflags="${GOLDFLAGS}" -o "../out/fips/soci" ./soci | ||
|
||
%install | ||
install -d %{buildroot}%{_cross_bindir} | ||
install -d %{buildroot}%{_cross_fips_bindir} | ||
install -d %{buildroot}%{_cross_unitdir} | ||
install -p -m 0755 out/soci-snapshotter-grpc %{buildroot}%{_cross_bindir} | ||
install -p -m 0755 out/soci %{buildroot}%{_cross_bindir} | ||
install -p -m 0755 out/fips/soci-snapshotter-grpc %{buildroot}%{_cross_fips_bindir} | ||
install -p -m 0755 out/fips/soci %{buildroot}%{_cross_fips_bindir} | ||
install -D -p -m 0644 %{S:101} %{buildroot}%{_cross_unitdir} | ||
|
||
%cross_scan_attribution --clarify %{S:1000} go-vendor vendor | ||
|
||
%files | ||
%license LICENSE NOTICE.md | ||
%{_cross_unitdir}/soci-snapshotter.service | ||
%{_cross_attribution_vendor_dir} | ||
%{_cross_attribution_file} | ||
|
||
%files bin | ||
%{_cross_bindir}/soci-snapshotter-grpc | ||
%{_cross_bindir}/soci | ||
|
||
%files fips-bin | ||
%{_cross_fips_bindir}/soci-snapshotter-grpc | ||
%{_cross_fips_bindir}/soci | ||
|
||
%changelog |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters