projectatomic / atomic

Atomic Run Tool for installing/running/managing container images.
Other
526 stars 140 forks source link

Atomic scan D-Bus interface is insufficient for cockpit #740

Open larskarlitski opened 8 years ago

larskarlitski commented 8 years ago

I've started working on integrating the results of image scanning into cockpit's "Container" page and noticed several problems:

It does not provide any information about ongoing scans (or even the completion of a scan). Cockpit needs that information so that it can show that scans are in progress, disable the "Scan again" button, and update warning badges about vulnerable containers.

It is not remotable: scan results are only accessible via the file system. Cockpit can access those files, but we'd rather deal with one API instead of two.

It is unidiomatic D-Bus: methods return JSON-encoded strings instead of D-Bus values. Again, cockpit can parse the resulting JSON, but it makes dealing with the API unnecessarily complex.

rhatdan commented 8 years ago

Great, Handing python dictionary structures over DBUS is not pretty, which is why we switched to json. But I guess we could attempt to switch back. I think it would also cause issues with people trying to talk to the dbus via C or other languages, where everyone support json.

@baude will have to investigate how we get info on ongoing scans, that would be a lot more invasive, since we don't require "scanners" at this point to give us status information.

We could easily add interfaces to return scan results. Just need to figure out the API that you want.

baude commented 8 years ago

@larskarlitski On the structure, i would rather not revert back as the scan verb has gone under so many different, significant changes recently. I think Dan is on the right track however. I would think a DBUS API that specifically returns results in a form you prefer is attainable and straight-forward. And also probably useful for other projects and integrations.

We can likely perform more status related events if we switch to Martin's async approach. Frankly, this is probably the direction we need to head towards for cockpits scanning as the brower will otherwise need to wait until the scan is complete. And if the browser goes to a new page or connection is lost, I'm not sure that can be handled correctly. In the coming days, Dan and I are supposed to work through the dbus scan interactions again. Look for more soon.

baude commented 7 years ago

https://github.com/projectatomic/atomic/pull/885