Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
feat: edgex geneva upgrade, add ds-cv-inference, rm ds-inference-mock
Browse files Browse the repository at this point in the history
Signed-off-by: charles-knox-intel <[email protected]>
  • Loading branch information
charles-knox-intel committed Jul 24, 2020
1 parent 432c8ce commit bddbb18
Show file tree
Hide file tree
Showing 139 changed files with 50,507 additions and 2,977 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ DOCKERS= \
as-controller-board-status \
ds-card-reader \
ds-controller-board \
ds-inference-mock \
ds-cv-inference \
ms-authentication \
ms-inventory \
ms-ledger
ms-ledger \


.PHONY: $(DOCKERS)

getlatest:
git submodule update --init --recursive --remote

docker-rm:
-docker rm $$(docker ps -aq)

Expand Down
4 changes: 2 additions & 2 deletions as-controller-board-status/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LABEL license='SPDX-License-Identifier: BSD-3-Clause' \
copyright='Copyright (c) 2020: Intel'

RUN apk --no-cache add zeromq
COPY --from=builder /usr/local/bin/as-controller-board-status/res/docker/configuration.toml /res/docker/configuration.toml
COPY --from=builder /usr/local/bin/as-controller-board-status/res/configuration.toml /res/configuration.toml
COPY --from=builder /usr/local/bin/as-controller-board-status/main /as-controller-board-status

CMD [ "/as-controller-board-status","--profile=docker","--confdir=/res", "-r"]
CMD [ "/as-controller-board-status","--confdir=/res", "-cp=consul.http://edgex-core-consul:8500", "-r"]
56 changes: 54 additions & 2 deletions as-controller-board-status/functions/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,58 @@ import (
assert "github.com/stretchr/testify/assert"
)

// These constants are used to simplify code repetition when working with the
// config map/struct
const (
AverageTemperatureMeasurementDuration = "AverageTemperatureMeasurementDuration"
DeviceName = "DeviceName"
MaxTemperatureThreshold = "MaxTemperatureThreshold"
MinTemperatureThreshold = "MinTemperatureThreshold"
MQTTEndpoint = "MQTTEndpoint"
NotificationCategory = "NotificationCategory"
NotificationEmailAddresses = "NotificationEmailAddresses"
NotificationHost = "NotificationHost"
NotificationLabels = "NotificationLabels"
NotificationReceiver = "NotificationReceiver"
NotificationSender = "NotificationSender"
NotificationSeverity = "NotificationSeverity"
NotificationSlug = "NotificationSlug"
NotificationSlugPrefix = "NotificationSlugPrefix"
NotificationSubscriptionMaxRESTRetries = "NotificationSubscriptionMaxRESTRetries"
NotificationSubscriptionRESTRetryInterval = "NotificationSubscriptionRESTRetryInterval"
NotificationThrottleDuration = "NotificationThrottleDuration"
RESTCommandTimeout = "RESTCommandTimeout"
SubscriptionHost = "SubscriptionHost"
VendingEndpoint = "VendingEndpoint"
)

// GetCommonSuccessConfig is used in test cases to quickly build out
// an example of a successful ControllerBoardStatusAppSettings configuration
func GetCommonSuccessConfig() ControllerBoardStatusAppSettings {
return ControllerBoardStatusAppSettings{
AverageTemperatureMeasurementDuration: -15 * time.Second,
DeviceName: "ds-controller-board",
MaxTemperatureThreshold: 83.0,
MinTemperatureThreshold: 10.0,
MQTTEndpoint: "http://localhost:48082/api/v1/device/name/Inference-MQTT-device/command/vendingDoorStatus",
NotificationCategory: "HW_HEALTH",
NotificationEmailAddresses: []string{"[email protected]", "[email protected]"},
NotificationHost: "http://localhost:48060/api/v1/notification",
NotificationLabels: []string{"HW_HEALTH"},
NotificationReceiver: "System Administrator",
NotificationSender: "Automated Checkout Maintenance Notification",
NotificationSeverity: "CRITICAL",
NotificationSlug: "sys-admin",
NotificationSlugPrefix: "maintenance-notification",
NotificationSubscriptionMaxRESTRetries: 10,
NotificationSubscriptionRESTRetryInterval: 10 * time.Second,
NotificationThrottleDuration: 1 * time.Minute,
RESTCommandTimeout: 15 * time.Second,
SubscriptionHost: "http://localhost:48060/api/v1/subscription",
VendingEndpoint: "http://localhost:48099/boardStatus",
}
}

// GetHTTPTestServer returns a basic HTTP test server that does nothing more than respond with
// a desired status code
func GetHTTPTestServer(statusCodeResponse int, response string) *httptest.Server {
Expand Down Expand Up @@ -107,7 +159,7 @@ func prepRESTCommandJSONTest() ([]testTableRESTCommandJSONStruct, []*httptest.Se
InputRESTMethod: RESTGet,
InputInterface: "",
HTTPTestServer: testServerThrowError,
Output: fmt.Errorf("Failed to submit REST %v request due to error: %v %v: %v", RESTGet, "Get", testServerThrowError.URL, "EOF"),
Output: fmt.Errorf("Failed to submit REST %v request due to error: %v \"%v\": %v", RESTGet, "Get", testServerThrowError.URL, "EOF"),
})
output = append(output,
testTableRESTCommandJSONStruct{
Expand Down Expand Up @@ -150,7 +202,7 @@ func TestRESTCommandJSON(t *testing.T) {
t.Run(ct.TestCaseName, func(t *testing.T) {
assert := assert.New(t)
err := testCase.Config.RESTCommandJSON(testCase.HTTPTestServer.URL, testCase.InputRESTMethod, testCase.InputInterface)
assert.Equal(err, ct.Output, "Expected output to be the same")
assert.Equal(ct.Output, err, "Expected output to be the same")
})
}

Expand Down
124 changes: 0 additions & 124 deletions as-controller-board-status/functions/config.go

This file was deleted.

Loading

0 comments on commit bddbb18

Please sign in to comment.