unikraft / kraftkit

Build and use highly customized and ultra-lightweight unikernel VMs.
https://unikraft.org/docs/cli
BSD 3-Clause "New" or "Revised" License
227 stars 62 forks source link

`kraft cloud image remove` is inconsistent #1305

Open craciunoiuc opened 7 months ago

craciunoiuc commented 7 months ago

Describe the bug

The command kraft cloud image remove has shown to be buggy and not consistent with what it should actually do.

There are currently two bugs.

1. Now Fully Broken

 kraft cloud img rm http-python312-flask30
 i  removing http-python312-flask30
 W  http-python312-flask30 not found. This is expected if you have already removed it.
➜  webinstall git:(staging) ✗ kraft cloud img rm http-python312-flask30:latest
 i  removing http-python312-flask30:latest
 W  http-python312-flask30:latest not found. This is expected if you have already removed it.
➜  webinstall git:(staging) ✗ kraft cloud img rm cezar.unikraft.io/http-python312-flask30:latest
 i  removing http-python312-flask30:latest
 W  http-python312-flask30:latest not found. This is expected if you have already removed it.

These three cases should all work, but somehow do not delete the image anymore.

The warning displayed was introduced in https://github.com/unikraft/kraftkit/commit/e0f401586b4634da2ba7337c7bf6cd349ecdd193 as a response to the bug detailed in 2. After that was introduced, somehow images were no longer removed at all.

As it can be seen in https://github.com/unikraft/kraftkit/commit/e0f401586b4634da2ba7337c7bf6cd349ecdd193 the actual deletion happens in the go-sdk not kraftkit.

2. Then Partially Broken

Before these "fixes" were introduced it had an inconsistency problem.

Images were correctly deleted, and usually (50/50) disappeared and no longer showed up in kraft cloud img ls. For the rest of the time they still showed up and trying to delete them again resulted in a nasty NOT_FOUND error from harbor.

This was not a harbor issue I think, as the artifacts no longer showed up in the dashboard and I also ran the garbage collector on them. This means that the no-update happened somewhere between Harbor<->Platform. Those images actually disappeared from the list after 2-3 minutes, but that is of course too much.

The fix that caused 1. was done to hide the error and print a prettier message to let people know that there's nothing to worry about.

Steps to reproduce

  1. Use latest kraftkit
  2. push/deploy an image
  3. kraft cloud img rm it

Expected behavior

No response

Which architectures were you using or does this bug affect?

No response

Which operating system were you using or does this bug affect?

No response

Relevant log output

No response

craciunoiuc commented 7 months ago

Update: This happens because of how the cleanup cycle operates currently. It is not a bug in KraftKit. Will leave the Issue open to track it.