Skip to content

Getting Started with EdgeX Snaps

snap store badge

Introduction

Snaps are a hybrid of traditional Linux packages and containers. Snaps can be installed on any Linux distro with snap support enabled, although full confinement currently requires some flavor of Ubuntu (Desktop/Server or Core).

Canonical publishes snaps (amd64 & arm64) for each release of EdgeX to the Snap Store. In contrast to docker deployment, all core, security, support, and runtime dependencies are provided in a single snap called edgexfoundry. Additional snaps are available for App Service Configurable, as well as the standard set of EdgeX reference device services (see list below). The edgexfoundry snap also includes Device Virtual to allow users to experiment with EdgeX without installing additional snaps.

Installing EdgeX Foundry Jakarta Snaps

The Snap Store allows multiple versions of a snap to be published to version-specific tracks. If not specified, snaps are installed from the latest/stable track.

You can see the current snap tracks and revisions available for your machine's architecture by running the command:

snap info edgexfoundry

In order to install Jakarta versions of the EdgeX snaps, you need to specify the --channel=2.1 command-line option:

sudo snap install edgexfoundry --channel=2.1

Note

The snap has only been tested on Ubuntu Desktop/Server LTS 18.04/20.04, as well as Ubuntu Core versions 18 and 20.

Using the EdgeX Snap

Upon installation, the following EdgeX services are automatically and immediately started:

  • consul
  • vault
  • redis
  • kong
  • postgres
  • core-data
  • core-command
  • core-metadata
  • security-services (see Security Services section below)

The following services are disabled by default:

  • app-service-configurable (required for eKuiper)
  • device-virtual
  • kuiper
  • support-notifications
  • support-scheduler
  • sys-mgmt-agent

Any disabled services can be enabled and started up using snap set:

sudo snap set edgexfoundry support-notifications=on

To turn a service off (thereby disabling and immediately stopping it) set the service to off:

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

The EdgeX snaps support configuration overrides via snap configure hooks which generate service-specific .env files which are used to provide a custom environment to the service, overriding the default configuration provided by the service's configuration.toml file. If a configuration override is made after a service has already started, then the service must be restarted via command-line (e.g. snap restart edgexfoundry.<service>), or snapd's REST API. If the overrides are provided via the snap configuration defaults capability of a gadget snap, the overrides will be picked up when the services are first started.

The following syntax is used to specify service-specific configuration overrides for the edgexfoundry snap:

env.<service>.<stanza>.<config option>

For instance, to setup an override of core data's port use:

sudo snap set edgexfoundry env.core-data.service.port=2112

And restart the service:

sudo snap restart edgexfoundry.core-data

Note - at this time changes to configuration values in the [Writable] section are not supported.

For details on the mapping of configuration options to Config options, please refer to Service Environment Configuration Overrides. For details on configuration overrides please refer to documentations for app service configurable snap or device service snaps.

Viewing logs

To view the logs for all services in an EdgeX snap use the snap log command:

sudo snap logs edgexfoundry

Individual service logs may be viewed by specifying the service name:

sudo snap logs edgexfoundry.consul

Or by using the systemd unit name and journalctl:

journalctl -u snap.edgexfoundry.consul

These techniques can be used with any snap including application snap and device services snaps.

Security services

Currently, The EdgeX snap has security (Secret Store and API Gateway) enabled by default. The security services constitute the following components:

  • kong-daemon (API Gateway a.k.a. Reverse Proxy)
  • postgres (kong's database)
  • vault (Secret Store)

Oneshot services which perform the necessary security setup and stop, when listed using snap services, they show up as enabled/inactive:

  • security-proxy-setup (kong setup)
  • security-secretstore-setup (vault setup)
  • security-bootstrapper-redis (secure redis setup)
  • security-consul-bootstrapper (secure consul setup)

Vault is known within EdgeX as the Secret Store, while Kong+PostgreSQL are used to provide the EdgeX API Gateway.

For more details please refer to the snap's Secret Store and API Gateway documentation.

Device Service Snaps

The following is the current list EdgeX 2.x device service snaps:

Development Tools

The following snaps can be used to assist the development and management of EdgeX: