Iotedge: IoTEdge as a ubuntu core snap

Created on 6 Nov 2018  路  11Comments  路  Source: Azure/iotedge

This is more of a question than a issue but i was not sure where to ask it so ill try here.

In Iot-Edge v1 there is a guide on how to get IoTEdge to work as a snap on ubuntu core. Is there any information on how to do the same for the current IoTEdge?

//Tim

customer-reported enhancement iotedge

Most helpful comment

Yeah, we've been discussing what to do with the initial setup. It is a little unfortunate that the service fails right after installation using the default configuration.

We've discussed including a provisioning type of None, instead of Manual or DPS. This would allow the daemon to start but it wouldn't attempt to start the Edge Agent. This would then require updating the config file and restarting.

All 11 comments

Thanks for this request, we will look into this enhancement request. I have added this to our task backlog.

We often propose the Dell IoT Gateway 3000 devices as an IoT Edge device for our projects. These devices either run Windows 10 IoT or Ubuntu Core. As a few projects are going to start in January based on these devices and we want to stick to Ubuntu Core, I started to create a snap for iotedge (https://github.com/Oquila/iotedge_v2_snap).

However as this is my first attempt in creating a snap I'm not even close at getting something that works :-). I'll try to spend some time on this in the coming weeks. Feel free to contact me if somebody want to join forces to create one that actually works.

Looks like I'm running into the first hurdle: the default edge home directory for the edge hsm client is /var/lib/iotedge, which isn't writeable for the snap. We should be able to configure this in some way (e.g. point to /$SNAP/iotedge or something similar).

See edge_hsm_client_store.c

if (make_dir(DEFAULT_EDGE_HOME_DIR_UNIX) != 0) { LOG_ERROR("Could not create home dir %s", DEFAULT_EDGE_HOME_DIR_UNIX); result = NULL; } else if ((PLATFORM_BASE_PATH = STRING_construct(DEFAULT_EDGE_HOME_DIR_UNIX)) == NULL) { LOG_ERROR("Could not create string handle for default base path"); result = NULL; } else { result = DEFAULT_EDGE_HOME_DIR_UNIX; }

and hsm_constants.h

You can specify the location of the home directory in the config.yaml: https://github.com/Azure/iotedge/blob/master/edgelet/contrib/config/linux/config.yaml#L146

@myagley Yep, I figured that out. In the meantime I've got a workable snap based on the apt-get package for ubuntu (https://github.com/Oquila/iotedge_v2_snap).
There are however still a few drawbacks that I can't solve. The biggest one is the fact that I'm unable to run iotedge as a service as during install the snap tries to start the service, which fails because the config.yaml file doesn't contain the device connection string yet. This throws an error and causes the installation to fail.

Yeah, we've been discussing what to do with the initial setup. It is a little unfortunate that the service fails right after installation using the default configuration.

We've discussed including a provisioning type of None, instead of Manual or DPS. This would allow the daemon to start but it wouldn't attempt to start the Edge Agent. This would then require updating the config file and restarting.

@myagley Hi Mike, any idea when a solution for this is planned?

This has not been prioritized at this time unfortunately. Will update this thread as soon as this gets picked up and implemented.

One year later: has it come onto the priority list already?

Yes is there any update on formal support for Ubuntu Core? More and more edge devices have standard this OS

There is no ETA for support for Ubuntu Core. We've had some initial conversations with Canonical about this; however Ubuntu Core has more issues for support than many other Linux OS variants. We also see more desire for support of CentOS, Debian, and Yocto so currently those are prioritized higher.

Was this page helpful?
0 / 5 - 0 ratings