Closed tianouya-db closed 10 months ago
Please let me know if there are steps I can follow to collect the relevant logs.
It looks that auto-expansion is needed.
func (e *overlaybdBuilderEngine) create(ctx context.Context, dir string) error {
return utils.Create(ctx, dir, "-s", "64")
}
currently, it is a 64GB hard code for overlaybd device size, you can change it to temporarily avoid this problem
func (o *snapshotter) prepareWritableOverlaybd(ctx context.Context, snID string) error {
// TODO(fuweid): 256GB can be configurable?
args := []string{"64"}
if o.writableLayerType == "sparse" {
args = append(args, "-s")
}
return utils.Create(ctx, o.blockPath(snID), args...)
}
"64" (64GB) is default size, you can modify it for POC.
An option could be added to config overlaybd device size after release v1.0.0
Thanks for the responses. To confirm, for userspace conversion, I can change it in overlaybd_builder.go to work around. And for obdconv, I can change pkg/snapshot/storage.go. Is that correct?
Thanks for the responses. To confirm, for userspace conversion, I can change it in overlaybd_builder.go to work around. And for obdconv, I can change pkg/snapshot/storage.go. Is that correct?
Yes, that is it.
Made the changes and tried. It fixed obdconv but not userspace conversion.
256
) and run make
. mv bin/* /opt/overlaybd/snapshotter
systemctl restart overlaybd-snapshotter
, and also systemctl restart overlaybd-tcmu
. obdconv
and it worked
/opt/overlaybd/snapshotter/ctr obdconv large-image:0.1 large-image:0.1_obd
/opt/overlaybd/snapshotter/convertor -r my.registry.com/project/repo -u user:password -i 0.1 --overlaybd 0.1_obd
INFO[0151] layer 13 committed, uuid: 245daafe-aa32-31b7-7c10-d18dcbf9895e, parent uuid: 076fb541-99fc-ce35-9782-e3b35fbd6bac INFO[0152] layer 13 converted INFO[0169] layer sha256:723afa92c821479af9243dbb6b21b69694a0e3ae66bdf874396b0be38c53028d exists INFO[0169] layer 13 uploaded INFO[2051] downloaded layer 14 ERRO[2613] failed to build overlaybd: failed to convert layer 14: failed to overlaybd-apply[native]: 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/build/_deps/photon-src/io/signal.cpp:265|sync_signal_init:signalfd initialized 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:169|read_global_config_and_set:using config /etc/overlaybd/overlaybd.json 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:183|read_global_config_and_set:set audit_path:/var/log/overlaybd-audit.log 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:195|read_global_config_and_set:[global_conf.logConfig().logPath()=] 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:209|read_global_config_and_set:set log_level: 1 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:212|read_global_config_and_set:set log_path: /var/log/overlaybd.log, log_size: 10485760, log_num: 3 failed to extract : exit status 255
Let me know if I missed anything.
Made the changes and tried. It fixed obdconv but not userspace conversion.
Steps I did
- Make the changes (I updated to
256
) and runmake
.- Run
mv bin/* /opt/overlaybd/snapshotter
- Restart
systemctl restart overlaybd-snapshotter
, and alsosystemctl restart overlaybd-tcmu
.Verify
- Convert with
obdconv
and it worked/opt/overlaybd/snapshotter/ctr obdconv large-image:0.1 large-image:0.1_obd
- Convert in userspace and it failed with the same error
/opt/overlaybd/snapshotter/convertor -r my.registry.com/project/repo -u user:password -i 0.1 --overlaybd 0.1_obd INFO[0151] layer 13 committed, uuid: 245daafe-aa32-31b7-7c10-d18dcbf9895e, parent uuid: 076fb541-99fc-ce35-9782-e3b35fbd6bac INFO[0152] layer 13 converted INFO[0169] layer sha256:723afa92c821479af9243dbb6b21b69694a0e3ae66bdf874396b0be38c53028d exists INFO[0169] layer 13 uploaded INFO[2051] downloaded layer 14 ERRO[2613] failed to build overlaybd: failed to convert layer 14: failed to overlaybd-apply[native]: 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/build/_deps/photon-src/io/signal.cpp:265|sync_signal_init:signalfd initialized 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:169|read_global_config_and_set:using config /etc/overlaybd/overlaybd.json 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:183|read_global_config_and_set:set audit_path:/var/log/overlaybd-audit.log 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:195|read_global_config_and_set:[global_conf.logConfig().logPath()=] 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:209|read_global_config_and_set:set log_level: 1 2023/09/12 21:29:48|INFO |th=0000555F24695800|/src/src/image_service.cpp:212|read_global_config_and_set:set log_path: /var/log/overlaybd.log, log_size: 10485760, log_num: 3 failed to extract : exit status 255
Let me know if I missed anything.
You may try pulling the latest commit, #222 . add --mkfs flag for convertor.
You may try pulling the latest commit, https://github.com/containerd/accelerated-container-image/pull/222 . add --mkfs flag for convertor.
Tried it but got the same error:
/opt/overlaybd/snapshotter/convertor -r my.registry.com/project/repo -u user:password --mkfs -i 0.1 --overlaybd 0.1_obd
INFO[0140] downloaded layer 13
INFO[0140] layer 13 converted
INFO[0156] layer sha256:723afa92c821479af9243dbb6b21b69694a0e3ae66bdf874396b0be38c53028d exists
INFO[0156] layer 13 uploaded
INFO[1950] downloaded layer 14
ERRO[2522] failed to build overlaybd: failed to convert layer 14: failed to overlaybd-apply[native]: 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/signal.cpp:265|sync_signal_init:signalfd initialized
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:169|read_global_config_and_set:using config /etc/overlaybd/overlaybd.json
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:183|read_global_config_and_set:set audit_path:/var/log/overlaybd-audit.log
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:195|read_global_config_and_set:[global_conf.logConfig().logPath()=]
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:209|read_global_config_and_set:set log_level: 1
2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:212|read_global_config_and_set:set log_path: /var/log/overlaybd.log, log_size: 10485760, log_num: 3
failed to extract
: exit status 255
You may try pulling the latest commit, #222 . add --mkfs flag for convertor.
Tried it but got the same error:
/opt/overlaybd/snapshotter/convertor -r my.registry.com/project/repo -u user:password --mkfs -i 0.1 --overlaybd 0.1_obd INFO[0140] downloaded layer 13 INFO[0140] layer 13 converted INFO[0156] layer sha256:723afa92c821479af9243dbb6b21b69694a0e3ae66bdf874396b0be38c53028d exists INFO[0156] layer 13 uploaded INFO[1950] downloaded layer 14 ERRO[2522] failed to build overlaybd: failed to convert layer 14: failed to overlaybd-apply[native]: 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/signal.cpp:265|sync_signal_init:signalfd initialized 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:169|read_global_config_and_set:using config /etc/overlaybd/overlaybd.json 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:183|read_global_config_and_set:set audit_path:/var/log/overlaybd-audit.log 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:195|read_global_config_and_set:[global_conf.logConfig().logPath()=] 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:209|read_global_config_and_set:set log_level: 1 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:212|read_global_config_and_set:set log_path: /var/log/overlaybd.log, log_size: 10485760, log_num: 3 failed to extract : exit status 255
for convertor
, more logs is output to /var/log/overlaybd.log
. Please check this log for more information.
You may try pulling the latest commit, #222 . add --mkfs flag for convertor.
Tried it but got the same error:
/opt/overlaybd/snapshotter/convertor -r my.registry.com/project/repo -u user:password --mkfs -i 0.1 --overlaybd 0.1_obd INFO[0140] downloaded layer 13 INFO[0140] layer 13 converted INFO[0156] layer sha256:723afa92c821479af9243dbb6b21b69694a0e3ae66bdf874396b0be38c53028d exists INFO[0156] layer 13 uploaded INFO[1950] downloaded layer 14 ERRO[2522] failed to build overlaybd: failed to convert layer 14: failed to overlaybd-apply[native]: 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/signal.cpp:265|sync_signal_init:signalfd initialized 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:169|read_global_config_and_set:using config /etc/overlaybd/overlaybd.json 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:183|read_global_config_and_set:set audit_path:/var/log/overlaybd-audit.log 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:195|read_global_config_and_set:[global_conf.logConfig().logPath()=] 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:209|read_global_config_and_set:set log_level: 1 2023/09/13 05:35:15|INFO |th=0000561DA5F1A8C0|/src/src/image_service.cpp:212|read_global_config_and_set:set log_path: /var/log/overlaybd.log, log_size: 10485760, log_num: 3 failed to extract : exit status 255
64 is still need to change to larger number. did you change it?
Yes I changed to 256.
cmd/convertor/builder/overlaybd_builder.go
func (e *overlaybdBuilderEngine) create(ctx context.Context, dir string, mkfs bool) error {
opts := []string{"-s", "256"}
if mkfs {
opts = append(opts, "--mkfs")
}
return utils.Create(ctx, dir, opts...)
}
pkg/snapshot/storage.go
func (o *snapshotter) prepareWritableOverlaybd(ctx context.Context, snID string) error {
// TODO(fuweid): 256GB can be configurable?
args := []string{"256"}
if o.writableLayerType == "sparse" {
args = append(args, "-s")
}
return utils.Create(ctx, o.blockPath(snID), args...)
}
@tianouya-db please pull commit #225 and retry.
If it still fails, please check /var/log/overlaybd.log
for more details, and let me know.
@yuchen0cc it seems to work now. Thanks for the fix! Meanwhile, will there be a change to increase 64 to a larger number, e.g. 256?
An option --vsize
is added to convertor
to custamize overlaybd virtual block device size.
What happened in your environment?
Trying to convert a large image (48GB) in the userspace:
The conversion always fails with an error
ERRO[2451] failed to build overlaybd: failed to convert layer 17: failed to overlaybd-apply: 2023/09/11 15:24:27|INFO |th=000055B14C24B120|/src/build/_deps/photon-src/io/epoll.cpp:289|new_epoll_engine:Init event engine: epoll
.Output:
The layer 17 mentioned in the error is the largest layer of the image which is ~45GB.
What did you expect to happen?
Conversion should succeed.
How can we reproduce it?
I haven't found a way to repro it with a random image I built with a 45GB layer.
What is the version of your Accelerated Container Image?
0.6.7
What is your OS environment?
Ubuntu 20.04
Are you willing to submit PRs to fix it?