Skip to content

Commit bb7bdf8

Browse files
authored
Add tardev-snapshotter package to specs-extended (#13127)
1 parent 1b305fa commit bb7bdf8

6 files changed

Lines changed: 134 additions & 1 deletion

File tree

LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSES-AND-NOTICES/SPECS/data/licenses.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,7 @@
24532453
"SymCrypt",
24542454
"SymCrypt-OpenSSL",
24552455
"systemd-boot-signed",
2456+
"tardev-snapshotter",
24562457
"tensorflow",
24572458
"tinyxml2",
24582459
"toml11",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
set -euox pipefail
4+
5+
NAME=tardev-snapshotter
6+
VERSION=3.2.0.tardev1
7+
8+
SOURCE_DIR=$(pwd)
9+
WORK_DIR=$(mktemp -d)
10+
pushd $WORK_DIR
11+
12+
trap "popd && rm -rf $WORK_DIR" EXIT
13+
14+
git clone -b "3.2.0.tardev1" https://github.com/microsoft/kata-containers
15+
pushd kata-containers
16+
cp LICENSE src/tardev-snapshotter
17+
mv src/tardev-snapshotter $NAME-$VERSION
18+
tar -czf $NAME-$VERSION.tar.gz $NAME-$VERSION
19+
mv $NAME-$VERSION.tar.gz $WORK_DIR
20+
popd
21+
22+
wget https://raw.githubusercontent.com/microsoft/azurelinux/3.0/toolkit/scripts/build_cargo_cache.sh
23+
chmod +x ./build_cargo_cache.sh
24+
./build_cargo_cache.sh $NAME-$VERSION.tar.gz $NAME-$VERSION
25+
26+
mv $NAME-$VERSION.tar.gz $SOURCE_DIR/
27+
mv $NAME-$VERSION-cargo.tar.gz $SOURCE_DIR/
28+
29+
function update-signature {
30+
local FILE=$1
31+
32+
jq ".Signatures.\"$FILE\" = \"$(sha256sum $FILE | cut -d ' ' -f 1)\"" $NAME.signatures.json > $NAME.signatures.json.tmp
33+
mv $NAME.signatures.json.tmp $NAME.signatures.json
34+
}
35+
36+
# Update the signatures json with the new sha256 hashes
37+
pushd $SOURCE_DIR
38+
update-signature $NAME-$VERSION.tar.gz
39+
update-signature $NAME-$VERSION-cargo.tar.gz
40+
popd
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Signatures": {
3+
"tardev-snapshotter-3.2.0.tardev1.tar.gz": "eadeca3704dc668576e673322ad4ab7cd623f0557691e62d5afb5ec85b648278",
4+
"tardev-snapshotter-3.2.0.tardev1-cargo.tar.gz": "67df489758a17f77cd7e9113e67ab5db16843d8a8db9d4660bfb1c8646c41a13"
5+
}
6+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
%global debug_package %{nil}
2+
3+
Summary: Tardev Snapshotter for containerd
4+
Name: tardev-snapshotter
5+
Version: 3.2.0.tardev1
6+
Release: 1%{?dist}
7+
License: ASL 2.0
8+
Group: Tools/Container
9+
Vendor: Microsoft Corporation
10+
Distribution: Azure Linux
11+
12+
Source0:https://github.com/microsoft/kata-containers/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
13+
# Note: the %%{name}-%%{name}-%%{version}-cargo.tar.gz file contains a cache created by capturing the contents downloaded into $CARGO_HOME.
14+
# To update the cache run regenerate-archives.sh
15+
Source1: %{_distro_sources_url}/%{name}-%{version}-cargo.tar.gz
16+
17+
%{?systemd_requires}
18+
19+
BuildRequires: clang-devel
20+
BuildRequires: cmake
21+
BuildRequires: device-mapper-devel
22+
BuildRequires: git
23+
BuildRequires: make
24+
BuildRequires: openssl-devel
25+
BuildRequires: pkgconfig(libudev)
26+
BuildRequires: protobuf-compiler
27+
BuildRequires: rust
28+
29+
%description
30+
tardev-snapshotter is a snapshotter for containerd that uses tar archives to store snapshots.
31+
32+
%prep
33+
# Setup .cargo directory
34+
mkdir -p $HOME
35+
pushd $HOME
36+
tar xf %{SOURCE1} --no-same-owner
37+
popd
38+
39+
%autosetup -p1
40+
41+
%build
42+
export CARGO_NET_OFFLINE=true
43+
make
44+
45+
%install
46+
mkdir -p %{buildroot}/%{_unitdir}
47+
install -D -p -m 0644 %{name}.service %{buildroot}%{_unitdir}/%{name}.service
48+
install -D -m 0755 target/release/%{name} %{buildroot}%{_bindir}/%{name}
49+
50+
%post
51+
%systemd_post %{name}.service
52+
53+
if [ $1 -eq 1 ]; then # Package install
54+
systemctl enable %{name}.service > /dev/null 2>&1 || :
55+
systemctl start %{name}.service > /dev/null 2>&1 || :
56+
fi
57+
58+
%preun
59+
%systemd_preun %{name}.service
60+
61+
%postun
62+
%systemd_postun_with_restart %{name}.service
63+
64+
%files
65+
%license LICENSE
66+
%{_bindir}/%{name}
67+
%config(noreplace) %{_unitdir}/%{name}.service
68+
69+
%changelog
70+
* Fri Mar 28 2025 Dallas Delaney <dadelan@microsoft.com> - 3.2.0.tardev1-1
71+
- Add package to specs-extended
72+
- License verified
73+
- Original version for Azure Linux
74+
75+
* Tue Dec 31 2024 Jiri Appl <jiria@microsoft.com> - 0.0.13-1
76+
- Initial version

cgmanifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28841,6 +28841,16 @@
2884128841
}
2884228842
}
2884328843
},
28844+
{
28845+
"component": {
28846+
"type": "other",
28847+
"other": {
28848+
"name": "tardev-snapshotter",
28849+
"version": "3.2.0.tardev1",
28850+
"downloadUrl": "https://github.com/microsoft/kata-containers/archive/refs/tags/3.2.0.tardev1.tar.gz"
28851+
}
28852+
}
28853+
},
2884428854
{
2884528855
"component": {
2884628856
"type": "other",

0 commit comments

Comments
 (0)