2023-11-14 14:42:38 |
Paul Mars |
description |
This is not possible to properly resume when we stopped just after the germinate state. The following command will work, but the next one (executed after the first one) will crash.
sudo ./ubuntu-image --debug classic --thru germinate --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml
sudo ./ubuntu-image --debug classic --resume --thru install_packages --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml
Error: invalid steps taken count (9). The state machine only have 4 steps
This is not specific to the germinate state, I also reproduced this issue by stopping after the build_gadget_tree state (and this case, even encountered a panic!).
Even if the command did not crash, the state "install_packages" would not installed any packages found by germinate because the list is not saved in the state written to disk.
The resume feature needs more work to be able to stop/resume at any state. This may be important for the imagecraft integration. |
This is not possible to properly resume when we stopped just after the germinate state. The following command will work, but the next one (executed after the first one) will crash.
sudo ./ubuntu-image --debug classic --thru germinate --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml
sudo ./ubuntu-image --debug classic --resume --thru install_packages --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml
Error: invalid steps taken count (9). The state machine only have 4 steps
Even if the command did not crash, the state "install_packages" would not installed any packages found by germinate because the list is not saved in the state written to disk.
This is not specific to the germinate state, I also reproduced this issue by stopping after the build_gadget_tree state and in this case I encountered the following panic:
sudo ubuntu-image classic -v test.yaml -w ./test -t build_gadget_tree
[0] parse_image_definition
[1] calculate_states
[2] make_temporary_directories
[3] determine_output_directory
[4] build_gadget_tree
sudo ubuntu-image classic -v test.yaml -w ./test -r
panic: runtime error: slice bounds out of range [5:4]
goroutine 1 [running]:
github.com/canonical/ubuntu-image/internal/statemachine.(*StateMachine).readMetadata(0xc0002d7680)
/build/ubuntu-image/parts/ubuntu-image/build/internal/statemachine/state_machine.go:362 +0x591
github.com/canonical/ubuntu-image/internal/statemachine.(*ClassicStateMachine).Setup(0xc0002d7680)
/build/ubuntu-image/parts/ubuntu-image/build/internal/statemachine/classic.go:51 +0x9f
main.executeStateMachine(0xc0002e3f10, 0xc0002e6180, 0xc0000b5560)
/build/ubuntu-image/parts/ubuntu-image/build/cmd/ubuntu-image/main.go:46 +0x2e5
main.main()
/build/ubuntu-image/parts/ubuntu-image/build/cmd/ubuntu-image/main.go:157 +0x6fa
The resume feature needs fixing to be able to stop/resume at any state. This may be important for the imagecraft integration. |
|