Getting Started with Snap
Just like Docker containers, the EdgeX project creates and publishes a snap for each release to the snap store. The snap currently supports running on both amd64 and arm64 platforms. See snap documents for help on using or installing snap.
Installing EdgeX Foundry as a snap
The snap is published in the snap store at https://snapcraft.io/edgexfoundry. You can see the current revisions available for your machine's architecture by running the command:
$ snap info edgexfoundry
$ sudo snap install edgexfoundry --edge
$ sudo snap install edgexfoundry --channel=fuji
The snap has only been tested on Ubuntu Desktop/Server versions 18.04 and 16.04, as well as Ubuntu Core versions 16 and 18.
Running the EdgeX snap on a machine setup for EdgeX development can create conflicts and result in the platform errors/issues.
Using the EdgeX snap
Upon installation, the following EdgeX services are automatically and immediately started:
- consul - redis - core-data - core-command - core-metadata - security-services (see note below)
The following services are disabled by default:
- app-service-configurable (required for Kuiper and support-rulesengine) - device-virtual - kuiper - support-logging - support-notifications - support-rulesengine (deprecated) - support-scheduler - sys-mgmt-agent
Any disabled services can be enabled and started up using snap set:
$ sudo snap set edgexfoundry support-notifications=on
$ sudo snap set edgexfoundry support-notifications=off
All services which are installed on the system as systemd units, which if enabled will automatically start running when the system boots or reboots.
Configuring individual services
All default configuration files are shipped with the snap inside $SNAP/config, however because $SNAP isn't writable, all of the config files are copied during snap installation (specifically during the install hook, see snap/hooks/install in this repository) to $SNAP_DATA/config.
$ sudo snap restart edgexfoundry
Currently, all log files for the snap's can be found inside $SNAP_COMMON, which is usually /var/snap/edgexfoundry/common. Once all the services are supported as daemons, you can also use sudo snap logs edgexfoundry to view logs.
Additionally, logs can be viewed using the system journal or snap logs. To view the logs for all services in the edgexfoundry snap use:
$ sudo snap logs edgexfoundry
$ sudo snap logs edgexfoundry.consul
$ journalctl -u snap.edgexfoundry.consul
Currently, the security services are enabled by default. The security services consitute the following components:
- Kong - PostgreSQL - Vault - security-secrets-setup - security-secretstore-setup - security-proxy-setup
Vault is used for secret management, and Kong is used as an HTTPS proxy for all the services.
Kong can be disabled by using the following command:
$ sudo snap set edgexfoundry security-proxy=off
Vault can be also be disabled, but doing so will also disable Kong, as it depends on Vault. Thus the following command will disable both:
Kong is currently not supported in the snap when installed on an arm64-based device, so it will be disabled on install.