Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.61 KB

230118.load_containers.md

File metadata and controls

34 lines (26 loc) · 1.61 KB

2023-01-18

https://discordapp.com/channels/918498540232253480/918498540232253483/1065231002210926632

Rikke

Can I somehow start a container, or call a function from a separate container? I've looked into /lib/system/containers and /lib/system/api/containers but I haven't found a way run/start other containers on run time.

kasperl

@Rikke Jaguar starts containers on demand here: https://github.com/toitlang/jaguar/blob/main/src/jaguar.toit#L232.

kasperl

The "image" is given as a uuid and it was you get back from the call to ContainerImageWriter.commit; see https://github.com/toitlang/toit/blob/master/lib/system/containers.toit#L77.
You can list all installed images, but maybe you'll be missing a great way to find the one you're looking for.
If you want to call a function from another container, you can use discoverable services.

Rikke

and this isnt limited to jag right? when i call install container with build/host/sdk/tools/firmware -e build/esp32/firmware.envelope container install name path it works like with jag, but i have a harder time to find the right uuid

kasperl

Yeah, it works without jaguar, but I see how it might be useful to be able to find the containers based on name even in that case. Let me think about how we can best support that. Jaguar keeps the name for dynamically installed containers.

Rikke

Yeah I can get the uuids, but with no container name atteched. But it isnt a big problem right now
would be cool if the name was included in

class ContainerImage:
  id/uuid.Uuid
  flags/int
  data/int
  constructor .id .flags .data:

kasperl

Yeah!