Skip to content

Commit c1cf5a1

Browse files
authored
Merge pull request #165 from WaberZhuang/main
add doc for standalone userspace image-convertor
2 parents fbdabc5 + 66a6eb7 commit c1cf5a1

File tree

4 files changed

+47
-18
lines changed

4 files changed

+47
-18
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@ Accelerated Container Image is a __non-core__ sub-project of containerd.
3838

3939
It is a [containerd](https://containerd.io/) snapshotter plugin for overlaybd image. This snapshotter is compatible for OCI image, as well as overlayfs snapshotter.
4040

41-
* image-convertor
41+
* embedded image-convertor
4242

4343
We provide a modified CLI tool(ctr) to facilitate image pull, and custom conversion from traditional OCI tarball format to overlaybd format.
4444

4545
The convertor supports layer deduplication, which prevents duplication of layer conversion for every image conversion.
4646

47+
* standalone userspace image-convertor (Experimental)
48+
49+
Standalone userspace image-convertor has similar functionality to embedded image-convertor but runs in the userspace. It does not require root privilege and dependence on tcmu, configfs, snapshotter, or even on containerd. which makes it much more convenient to run in a container.
50+
51+
What's more, standalone userspace image-convertor is faster than embedded image-convertor when used with our [customized libext2fs](https://github.com/data-accelerator/e2fsprogs). See [USERSPACE_CONVERTOR](https://github.com/containerd/accelerated-container-image/blob/main/docs/USERSPACE_CONVERTOR.md) for more details.
52+
4753
* [buildkit for overlaybd](https://github.com/data-accelerator/buildkit) (Experimental)
4854

4955
It is a customized buildkit for overlaybd images. It fetches the data of base images on demand without pulling whole data and uses overlaybd writable layer to build new layers.
@@ -62,9 +68,9 @@ Accelerated Container Image is a __non-core__ sub-project of containerd.
6268

6369
* See how to convert OCI image into overlaybd with specified file system at [MULTI_FS_SUPPORT](docs/MULTI_FS_SUPPORT.md).
6470

65-
* See how to use layer deduplication for image conversion at [IMAGE_CONVERTOR](docs/IMAGE_CONVERTOR.md)
71+
* See how to use layer deduplication for image conversion at [IMAGE_CONVERTOR](docs/IMAGE_CONVERTOR.md).
6672

67-
* See how to use overlaybd writable layer at [WRITABLE](docs/WRITABLE.md)
73+
* See how to use overlaybd writable layer at [WRITABLE](docs/WRITABLE.md).
6874

6975
* Welcome to contribute! [CONTRIBUTING](docs/CONTRIBUTING.md)
7076

docs/IMAGE_CONVERTOR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Image Convertor
1+
# Embedded Image Convertor
22

33
We provide a ctr command tool to convert OCIv1 images into overlaybd format, which is stored in `bin` after `make` or downloading the release package.
44

docs/QUICKSTART.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ Install dependencies:
9595
- cmake 3.15+
9696
- gcc/g++ 7+
9797
- development dependencies:
98-
- CentOS/Fedora: sudo yum install libaio-devel libcurl-devel openssl-devel libnl3-devel
99-
- Debian/Ubuntu: sudo apt install libcurl4-openssl-dev libssl-dev libaio-dev libnl-3-dev libnl-genl-3-dev libgflags-dev
98+
- CentOS 7/Fedora: `sudo yum install libaio-devel libcurl-devel openssl-devel libnl3-devel libzstd-static e2fsprogs-devel`
99+
- CentOS 8: `sudo yum install libaio-devel libcurl-devel openssl-devel libnl3-devel libzstd-devel e2fsprogs-devel`
100+
- Debian/Ubuntu: `sudo apt install libcurl4-openssl-dev libssl-dev libaio-dev libnl-3-dev libnl-genl-3-dev libgflags-dev libzstd-dev libext2fs-dev`
100101

101102
Run the following commands to build:
102103
```bash
@@ -196,13 +197,15 @@ There are several methods.
196197
sudo ctr run --net-host --snapshotter=overlaybd --rm -t registry.hub.docker.com/overlaybd/redis:6.2.1_obd demo
197198
```
198199

199-
- usr k8s/cri
200+
- use k8s/cri
200201

201202
Run with k8s or crictl, refer to [EXAMPLES_CRI](https://github.com/containerd/accelerated-container-image/blob/main/docs/EXAMPLES_CRI.md).
202203

203204
## Image conversion
204205

205-
Images can be convert from oci format to overlaybd format by the following commands.
206+
There are 2 ways to convert images from oci format to overlaybd format, by using embedded image-convertor or using standalone userspace image-convertor respectively.
207+
208+
- use embedded image-convertor
206209

207210
```bash
208211
# pull the source image (nerdctl or ctr)
@@ -218,6 +221,13 @@ sudo nerdctl push registry.hub.docker.com/overlaybd/redis:6.2.1_obd_new
218221
sudo nerdctl rmi registry.hub.docker.com/overlaybd/redis:6.2.1_obd_new
219222
```
220223

224+
- use standalone userspace image-convertor
225+
226+
```bash
227+
# userspace-image-convertor will automatically pull and push images from and to the registry
228+
sudo /opt/overlaybd/snapshotter/convertor -r registry.hub.docker.com/library -i redis:6.2.1 -o 6.2.1_obd_new
229+
```
230+
221231
## Image build
222232

223233
Overlaybd images can be efficiently built from overlaybd images by using the [customized buildkit](https://github.com/data-accelerator/buildkit).

docs/USERSPACE_CONVERTOR.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
1-
# Userspace Image Convertor
1+
# Standalone Userspace Image Convertor
22

3-
We provide a tool to convert OCIv1 images into overlaybd format in userspace, without the dependences of containerd and tcmu. Only several ovelraybd tools binary are required.
3+
Standalone userspace image-convertor is a tool to convert OCIv1 images into overlaybd format in userspace, without the dependences of containerd and tcmu. Only several ovelraybd tools binary are required.
44

55
This convertor is stored in `bin` after `make`.
66

77
This is an experimental feature and will be continuously improved.
88

99

10-
# Requirement
10+
## Requirement
1111

1212
There's no need to install containerd, no need to launch and mount tcmu devices, no need to run as root.
1313
Only several tools are required:
1414

15-
- overlaybd-create and overlaybd-commit
15+
- overlaybd-create, overlaybd-commit and overlaybd-apply
1616

17-
Two overlaybd tools provided in [overlaybd](https://github.com/containerd/overlaybd), stored at `/opt/overlaybd/bin`.
18-
19-
- overlaybd-apply
20-
21-
A tool to apply oci layers into overlaybd, provided in [overlaybd-apply](https://github.com/data-accelerator/overlaybd-apply), stored at `/opt/overlaybd/bin`.
17+
Three overlaybd tools provided in [overlaybd](https://github.com/containerd/overlaybd), stored at `/opt/overlaybd/bin`.
2218

2319
- baselayer
2420

2521
stored at `/opt/overlaybd/baselayers/ext4_64` after installing [overlaybd](https://github.com/containerd/overlaybd). This is only required just for now. Once the automatic mkfs is implemented, it's no longer needed.
2622

2723
Overall, the requirements are `/opt/overlaybd/bin/{overlaybd-create,overlaybd-commit,overlaybd-apply}` and `/opt/overlaybd/baselayers/ext4_64`.
2824

29-
# Basic Usage
25+
## Basic Usage
3026

3127
```bash
3228
# usage
@@ -50,3 +46,20 @@ Flags:
5046
$ bin/convertor -r docker.io/overlaybd/redis -u user:pass -i 6.2.6 -o 6.2.6_obd
5147

5248
```
49+
50+
## libext2fs
51+
52+
Standalone userspace image-convertor is developed based on [libext2fs](https://github.com/tytso/e2fsprogs), and we have provided a [customized libext2fs](https://github.com/data-accelerator/e2fsprogs) to make the conversion faster. We used `standalone userspace image-convertor (with custom libext2fs)`, `standalone userspace image-convertor (with origin libext2fs)` and `embedded image-convertor` to convert some images and did a comparison for reference.
53+
54+
### Performance
55+
56+
| Image | Image Size | with custom libext2fs | with origin libext2fs | embedded image-convertor |
57+
|:-------------------:|:----------:|:---------------------:|:---------------------:|:------------------------:|
58+
| jupyter-notebook | 4.84 GB | 93 s | 238 s | 101 s |
59+
| php-laravel-nginx | 567 MB | 13 s | 20 s | 15 s |
60+
| ai-cat-or-dog | 1.81 GB | 27 s | 54 s | 60 s |
61+
| cypress-chrome | 2.73 GB | 70 s | 212 s | 87 s |
62+
63+
### Use with origin libext2fs
64+
65+
Standalone userspace image-convertor uses customized libext2fs by default. If you want to use original libext2fs instead of it, see the cmake cache entry `-D ORIGIN_EXT2FS=1` of [overlaybd](https://github.com/containerd/overlaybd#build).

0 commit comments

Comments
 (0)