edgexfoundry / app-functions-sdk-go Goto Github PK
View Code? Open in Web Editor NEWOwner: Applications WG
License: Apache License 2.0
Owner: Applications WG
License: Apache License 2.0
device-sdk-go and edgex-go both have been update to use github.com/ugorji/go v1.1.4. (cbor codec)
need to do the same for app-functions-sdk-go.
Need some way for exports functions to indicate to the SDK that the event was exported so the SDK can then make the call to Core Data.
The import paths in some of the code refers to github.com/edgexfoundry-holdings...
Holding should be singular, but regardless just make this github.com/edgexfoundry...
. This will make the move over to the real repo easier and makes it easy for reviewers that want to clone this into their GOPATH.
latest merge of go-mod-messaging has namespace changes do to some refactoring.
First update go.mod to pull in latest go-mode-registry
Then update any failing imports and namespaces.
appsdk.MakeItRun()
calls os.Exit(0)
(src/github.com/edgexfoundry/app-functions-sdk-go/appsdk/sdk.go:191) which prevents the defer close(httpErrors)
statement from executing. It also prevents any SDK-based application from executing clean up code after appsdk.MakeItRun()
returns.
Based on 4b9771a.
Once PR edgexfoundry/go-mod-registry#6 has been merged,
go-mod-registry
will have been refactored to conform with using /pkg
and /internal
appropriately. This will require some imports and namespace changes.
First update go.mod to pull in latest go-mode-registry
Then update any failing imports and namespaces.
device-simple from device-sdk-go now produces CBOR encoded data. It sends a png image of an on
light bulb and a jpg of an off
light bulb.
A example app service that receives these images is needed to demonstrate CBOR end to end.
Currently the App functions SDK expects the data pulled from the message bus to be an EdgeX Event. This require and data that is pushed back to the message bus under a different topic to be wrapped in a dummy event.
Proposed solution is to allow the App Service to initialize the SDK with a custom type to be used when un-marshaling the data. If not specified, the SDK uses EdgeX Event.
The SDK should be published as a module, similar to the device-sdk-go. In addition, any dependencies should be managed accordingly using the new go module approach.
Something has changed with the default decoding of float values causing the following errors in the advanced sample:
level=ERROR ts=2019-06-06T08:41:25.034644884Z app=AppFunctionsSDK source=convert.go:48 msg="Unable to Base 64 decode float32/64 value ('3.840383e+307'): illegal base64 data at input byte 1"
level=ERROR ts=2019-06-06T08:41:25.042110489Z app=AppFunctionsSDK source=convert.go:65 msg="Unable to decode float64 value bytes: EOF"
Create interface with an initial implementation for ZeroMQ
At a minimum the SDK should log trace correlation ID messages when the events are received and when they are published.
From Boston F2F notes:
The SDK should allow tracing of execution into and out of the application service but not into and out of each function –via the correlation ID
Once the following modules are tagged to v0.1.0 update the edgex-go go.mod and submit the PR. This will be the final task before the edinburgh branch is cut.
go-mod-core-contracts
go-mod-messaging
go-mod-registry
It's standard practice within the edgex services to provide a makefile. Can we add one for this project too?
Example from device-sdk-go
https://github.com/edgexfoundry/device-sdk-go/blob/master/Makefile
ReadMaxLimit is one item never used. There may be others.
Service crashing when Consul service has been fixed in latest go-mod-registry.
For full context regarding this interlock, please see here edgexfoundry/go-mod-core-contracts#46
PR edgexfoundry/go-mod-core-contracts#47 is pending. If the dependency in the go.mod is updated after this PR is merged, then the import path will need to be changed.
The sdk should take care of the standard integrating with Registry from go-mod-registry for configuration and registration. The sdk should also self seed the configuration into the Registry when it isn't found to be in the Registry.
Integrate with Abstract Message Bus from go-mod-messaging to receive event message from core-data
go fmt
is required to be run for all PRs. To enforce this we are adding running go fmt
to the test
target in all makefiles. As part of doing this effort make test
should be run to ensure all go files are formatted so that subsequent PRs don't have changes to unrelated files just for formatting.
I notice this SDK uses JSON for configuration but everywhere else we use TOML. Probably want to change this to TOML
examples/config.json
After the edinburgh branch is cut the following version file need to be incremented to 1.1.0
https://github.com/edgexfoundry/app-functions-sdk-go/blob/master/VERSION
Currently the simple example filter on Devices Name(s) from the old Java Device Virtual. These need to be changed to Device Name(s) from the new Go Device Virtual. Specifically, use Random-Float-Generator01
and/or any of the other device names. Not that the postman json file must also be updated with proper event data for the new virtual device(s)
New abstract messaging that decouples from zeromq is being implemented in go-mode-messaging. Once available, app-functions-sdk-go needs to use it for subscribing and publishing.
// TODO: Log rather than print
fmt.Printf("SDK initialization failed: %v\n", err)
needs to be replaced with:
edgexSdk.LoggingClient.Error("SDK initialization failed: " + err.Error())
Add API to send a notification
All docker files in the examples need to be updated to use golang:1.12-alpine build image
go-mod-messaging has been update to no longer use a pointer to the Message Envelope for the messaging channel. Subscriber code in App Functions SDK will need to be adjusted for this change.
When incoming messages are can now be either JSON or CBOR. The Message Envelope has the ContentType of the message to determine if it is JSON or CBOR. Un-marshal the CBOR encode message needs to be added.
SDK should log the StartupMsg from config as do other edgex service.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.