Hi Dominique,
On 03.03.21 10:10, Dominique MARTINET wrote:
> Hi,
> (thanks for swupdate!)
>
You're welcome.
> Some background first:
> I'd like to use swupdate to update podman container images from data
> inside the .swu (this comes as a tar file that can be piped to 'podman
> load' for example)
It is a nice feature.
> The use case would be updating devices without internet, or just a way
> of verifying images without going through the trouble of setting up a
> registry.
>
Fully agree, feature understood. It will be nice to get it into SWUpdate.
>
> As far as I can see, I can:
> - use the rawfile handler to put the update tarball, then a postinstall
> script to run the load command.
> This has the advantage to be simple, but requires to store the tarball
> as a file as well so for large images can be quite the overhead.
Right. This is simple, but it is nasty, it cannot use streaming and it
eats a lot of resources.
>
> - write a new handler that spawns the podman import process, stream the
> data to its stdin, and collect the return code like the shell script
> handler (probably extend run_system_cmd -- by the way calling execl like
> that rubs me wrong, if you're ok with it I'll submit something to change
> the "cmd" argument to argv format regardless of the outcome of this
> discussion...)
> I can't think of something else that would be streamed data right now
> but I think that could be quite useful in general; for users who can
> rely on a minimum of userspace tools actually most handlers could be
> trivially reimplemented like that (piping to dd, tar, whatever)
>
>
> From what I've seen on the list archives and documentation however I
> don't think that'll get welcomed -- swupdate obviously wants to be as
> much self-contained as possible.
That is correct - I can accept the implementation above, but only after
discussion and if we have not found any other suitable way. Rather,
linking a go library with another language is a nightmare.
The preferred solution is that we can link in some way "libpod" and then
call it from a new handler. I will like to check first if this way is
praticable, and to fall back to the implementation based on
run_system_cmd if no other solution is possible. Do you have already
investigated ?
> In my case the base OS is read-only and only container images get
> updated so I can trust the base - or rather if anything in it got
> overwritten there's high odds the whole device can be considered done
> for, so piping image data to a system command would be a great way to
> keep development/test cost low and be useable as is.
Your use case is clear, thanks.
>
>
> With that being said, what do you suggest?
> I can obviously make a handler specific to podman if that has more
> chances of being accepted, even if it's a bit of a shame for me, but
> would there be any interest for one?
I would try to investigate if there are some chances to get a library to
drive podman. I appreciate if you can check this, and we can discuss
then here the results. And if there will be really no chance to do in
another way, I can accept the solution above with a handler calling
run_system_cmd().
>
> Or did I miss another way of doing this that wouldn't require an extra
> temporary buffer?
No, everything you say is correct. We can avoid temporary buffers only
if we have a handler (and then, we have without costs all general
features, like compression, encryption, hash verification,...) that
stream into the container.
> The remote handler could more or less work but
> implementing one sounds like more work than implementing a handler.
Frankly speaking: I do not think is a solution. I implemented the remote
handler just for one customer, because he did not want to publish his
code used to update some microcontrollers under GPL. It is overkilling
in most cases as it was for that project, and SWUpdate loses the full
control, making more difficult to debug issues in case something went
wrong. Please stay with the handler solution, it is the technical best
choice.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================