-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
777bc2e
to
fb20b64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Triggered the snap verify jobs and updated the PR description. This PR is now ready for review/merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the CMake file think a simpler fix is just to add "-pthread" to CMAKE_C_FLAGS.
Also although nothing to do with PR. IMHO better setting C version with "set (CMAKE_C_STANDARD 99)" as opposed to the gcc specific "std=c99"
Previously, this would fail in a clean ubuntu 18.04 instance with: [100%] Linking C executable device-grove /usr/bin/ld: CMakeFiles/device-grove.dir/main.c.o: undefined reference to symbol 'sem_post@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status This is the simplest way to link to pthreads from this project without digging into the c-sdk, etc. Also set the c standard to c99 in a more portable way by setting CMAKE_C_STANDARD. Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* Add an install hook to copy the configuration file and default device profile from read-only $SNAP into $SNAP_DATA for use from the service. This is so users can modify the configuration.toml file and device profile easily * Build the device-sdk-c from source on the edinburgh branch * Use sed to modify the hostname for EdgeX services as localhost by default * Patch libmraa using the patch in this repo before building it * Stage all of the source files from iotech-c-utils and tomlc99 into $SNAPCRAFT_STAGE, then copy from there to the src directory of device-sdk-c before building device-sdk-c to handle the deps. This mirrors what the upstream build.sh script does as close as possible. * Use environment variables for the options to launch device-grove due to https://bugs.launchpad.net/snapd/+bug/1827392 because we can't have "=" in the snap command specification Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
fb20b64
to
64b6da3
Compare
@SteveOss okay, updated both things |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This adds a snap of (currently Fuji since it's the master branch) device-grove-c.
This PR is currently a draft to setup the branches so we can test the jobs in the sandbox and get the jobs setup in Jenkins on ci-mangement
Fixes: #11
ci-management PR here has been merged: edgexfoundry/ci-management#433
This PR is now ready for review.
To test this snap, on an Raspberry Pi 3B+ that is running an arm64 image, such as what you get by following the setup instructions for the ubuntu server 18.04.2 found here, do the following to build and install the snap:
snapcraft
andlxd
withsnap install snapcraft --classic
and by following the instructions here for lxdsnapcraft --use-lxd
.edgexfoundry
snap from theedinburgh/beta
channel withsnap install edgexfoundry --channel=edinburgh/beta
- note you should do this first so that the EdgeX services are available when device-grove starts up after being install in the next stepedgex-device-grove*.snap
, install this snap withsnap install --dangerous edgex-device-grove*.snap
Assuming all of the above works, the snap is installed and the things to check are:
[ ] the daemon in the snap starts up, check with
snap services edgex-device-grove
all services listed there should beactive
andenabled
[ ] the daemon loads the default Grove_Device.yaml file from
/var/snap/edgex-device-grove/current/config/device-grove/profiles/Grove_Device.yaml
into core-metadata, etc.[ ] the configuration.toml file doesn't contain any references to the revision, i.e. all paths under
/var/snap/edgex-device-grove/
start withcurrent
as in/var/snap/edgex-device-grove/current/...
and not/var/snap/edgex-device-grove/x1/...
Additionally, if you have access to the grove sensors, try loading some of the device profiles from
/snap/edgex-device-grove/current/config/edgex-device-grove/res/example-profiles
and make sure that curl commands produce correct output. I don't have access to any grove sensors so unfortunately I was unable to do this, but since it's basically the same code as the docker container it should work the same I think.You can see logs from the daemon with
snap logs -f -n=all edgex-device-grove
orjournalctl -ef -u snap.edgex-device-grove.*