containerd / accelerated-container-image

A production-ready remote container image format (overlaybd) and snapshotter based on block-device.
Apache License 2.0
411 stars 76 forks source link

Modify Dev's Info #235

Closed qi0523 closed 1 year ago

qi0523 commented 1 year ago

Firstly, i add a flag policy to nerdctl run command. In this way, overlaybd-snapshotter can get this flag's value. Then, overlaybd-snapshotter passes the value to overlaybd. err = os.WriteFile(path.Join(targetPath, "control"), ([]byte)(fmt.Sprintf("dev_config=overlaybd/%s/%s", policy, o.overlaybdConfPath(snID))), 0666) if err != nil { return errors.Wrapf(err, "failed to write target dev_config for %s", targetPath) }

20231025205237

Finally, overlaybd can get the value from dev's info. However, when nerdctl create a container, it occurs exec /bin/bash: no such file or directory. Does modifying the dev's info affect rootfs?

Besides,in the top snapshot of image, we can find the bash file. 20231026071037

The overlaybd-tcmu logs are as follow. 20231026072137

/proc/pid/root/bin are as follows. image

When in /proc/pid/root/ exec bash get the same as error. image

qi0523 commented 1 year ago

When keeping download's config unable,get the bin/bash: No such file or directory. Is the problem due to lazy pulling?

However, when keeping download enable, it is exit(0). The image’ config cmd is bin/bash -c cd pythonAction && python runningforever.py, so it shouldn't be exited 0. I cat the runningforever.py, it is empty. Is Exit(0) also due to lazy pulling?

qi0523 commented 1 year ago

The problem is because the image is not complete. I don't know why because no errors occurred when using command /opt/overlaybd/snapshotter/ctr obdconv . Now the runningforever.py file is not empty.

liulanzheng commented 1 year ago

@qi0523 which kernel did you use? We met some kernel that data was not synced when umount device。

qi0523 commented 1 year ago

@liulanzheng the kernel is 5.15.0-1047-aws. Container start from other image i reconvert,it is common in kernel 5.15.0-1047-aws. In kernel 5.15.0-1047-aws, the obd's image is smaller than the reconverted image.

liulanzheng commented 1 year ago

@qi0523 I suggest to try to replace the kernel with other version.W e had a user on Azure who encountered this issue before, and resolved by updating to a new minor version. Also you may try the userspace convertor.