Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Core Keeper implementation #10

Open
wants to merge 1 commit into
base: edgex-go-v3.2.0-dev.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ __debug_bin
cmd/core-command/core-command
cmd/core-data/core-data
cmd/core-metadata/core-metadata
cmd/core-common-config-bootstrapper/core-common-config-bootstrapper
cmd/core-keeper/core-keeper
cmd/security-proxy-setup/security-proxy-setup
cmd/security-file-token-provider/security-file-token-provider
cmd/security-secretstore-setup/security-secretstore-setup
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
# Copyright 2022-2023 Intel Corporation
# Copyright (c) 2018 Cavium
# Copyright (C) 2024 IOTech Ltd
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -19,6 +20,7 @@ DOCKERS= \
docker_core_metadata \
docker_core_command \
docker_core_common_config \
docker_core_keeper \
docker_support_notifications \
docker_support_scheduler \
docker_security_proxy_auth \
Expand All @@ -37,6 +39,7 @@ MICROSERVICES= \
cmd/core-metadata/core-metadata \
cmd/core-command/core-command \
cmd/core-common-config-bootstrapper/core-common-config-bootstrapper \
cmd/core-keeper/core-keeper \
cmd/support-notifications/support-notifications \
cmd/support-scheduler/support-scheduler \
cmd/security-proxy-auth/security-proxy-auth \
Expand Down Expand Up @@ -103,6 +106,10 @@ common-config: cmd/core-common-config-bootstrapper/core-common-config-bootstrapp
cmd/core-common-config-bootstrapper/core-common-config-bootstrapper:
$(GO) build -tags "$(ADD_BUILD_TAGS) $(NON_DELAYED_START_GO_BUILD_TAG_FOR_CORE)" $(GOFLAGS) -o $@ ./cmd/core-common-config-bootstrapper

keeper: cmd/core-keeper/core-keeper
cmd/core-keeper/core-keeper:
$(GO) build -tags "$(ADD_BUILD_TAGS) $(NON_DELAYED_START_GO_BUILD_TAG_FOR_CORE)" $(GOFLAGS) -o $@ ./cmd/core-keeper

support: notifications scheduler

notifications: cmd/support-notifications/support-notifications
Expand Down Expand Up @@ -237,6 +244,19 @@ docker_core_common_config: docker_base
-t edgexfoundry/core-common-config-bootstrapper:$(DOCKER_TAG) \
.

dkeeper: docker_core_keeper
docker_core_keeper: docker_base
docker build \
--build-arg ADD_BUILD_TAGS=$(ADD_BUILD_TAGS) \
--build-arg http_proxy \
--build-arg https_proxy \
--build-arg BUILDER_BASE=$(LOCAL_CACHE_IMAGE) \
-f cmd/core-keeper/Dockerfile \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/core-keeper:$(GIT_SHA) \
-t edgexfoundry/core-keeper:$(DOCKER_TAG) \
.

dsupport: dnotifications dscheduler

dnotifications: docker_support_notifications
Expand Down
57 changes: 57 additions & 0 deletions cmd/core-keeper/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# ----------------------------------------------------------------------------------
# Copyright (C) 2024 IOTech Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ----------------------------------------------------------------------------------

# Docker image for Golang Core Keeper micro service
ARG BUILDER_BASE=golang:1.21-alpine3.18
FROM ${BUILDER_BASE} AS builder

WORKDIR /edgex-go

# The main mirrors are giving us timeout issues on builds periodically.
# So we can try these.

RUN sed -e 's/dl-cdn[.]alpinelinux.org/dl-4.alpinelinux.org/g' -i~ /etc/apk/repositories

RUN apk add --update --no-cache make git

COPY go.mod vendor* ./
RUN [ ! -d "vendor" ] && go mod download all || echo "skipping..."

COPY . .
RUN make cmd/core-keeper/core-keeper

#Next image - Copy built Go binary into new workspace
FROM alpine:3.18

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2024: IOTech'

ENV APP_PORT=59890
#expose core keeper port
EXPOSE $APP_PORT

# The main mirrors are giving us timeout issues on builds periodically.
# So we can try these.
RUN sed -e 's/dl-cdn[.]alpinelinux.org/dl-4.alpinelinux.org/g' -i~ /etc/apk/repositories

RUN apk add --update --no-cache dumb-init
COPY --from=builder /edgex-go/Attribution.txt /
COPY --from=builder /edgex-go/cmd/core-keeper/core-keeper /
COPY --from=builder /edgex-go/cmd/core-keeper/res/configuration.toml /res/configuration.toml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yaml file now.


ENTRYPOINT ["/core-keeper"]
CMD ["--confdir=/res"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove --confdir=/res since it is the default. This has been done removed for for all the other services

19 changes: 19 additions & 0 deletions cmd/core-keeper/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Copyright (C) 2024 IOTech Ltd
//
// SPDX-License-Identifier: Apache-2.0

package main

import (
"context"

"github.com/edgexfoundry/edgex-go/internal/core/keeper"

"github.com/labstack/echo/v4"
)

func main() {
ctx, cancel := context.WithCancel(context.Background())
keeper.Main(ctx, cancel, echo.New())
}
67 changes: 67 additions & 0 deletions cmd/core-keeper/res/configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Writable:
LogLevel: INFO
InsecureSecrets:
mqtt:
SecretName: mqtt
SecretData:
username: ""
password: ""
cacert: ""
clientcert: ""
clientkey: ""
DB:
SecretName: "redisdb"
SecretData:
username: ""
password: ""
Service:
Host: localhost
Port: 59890
StartupMsg: "This is the Core Keeper Microservice"
HealthCheckInterval: "10s"
ServerBindAddr: "" # Leave blank so default to Host value unless different value is needed.
MaxResultCount: 1024
MaxRequestSize: 0 # Not currently used. Defines the maximum size of http request body in bytes
RequestTimeout: "5s"
EnableNameFieldEscape: false # The name field escape could allow the system to use special or Chinese characters in the different name fields, including device, profile, and so on. If the EnableNameFieldEscape is false, some special characters might cause system error. TODO: This is set to false by default to avoid breaking change and will be removed in EdgeX 4.0
CORSConfiguration:
EnableCORS: false
CORSAllowCredentials: false
CORSAllowedOrigin: "https://localhost"
CORSAllowedMethods: "GET, POST, PUT, PATCH, DELETE"
CORSAllowedHeaders: "Authorization, Accept, Accept-Language, Content-Language, Content-Type, X-Correlation-ID"
CORSExposeHeaders: "Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified, Pragma, X-Correlation-ID"
CORSMaxAge: 3600
Database:
Host: "localhost"
Port: 6379
Timeout: "5s"
Type: "redisdb"
MessageBus:
Protocol: "redis"
Host: "localhost"
Port: 6379
Type: "redis"
AuthMode: "usernamepassword" # required for redis MessageBus (secure or insecure).
SecretName: "redisdb"
BaseTopicPrefix: "edgex/configs" # /<key> will be added to this Base Topic prefix
Optional:
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
Qos: "0" # Quality of Service values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive: "10" # Seconds (must be 2 or greater)
Retained: "false"
AutoReconnect: "true"
ConnectTimeout: "5" # Seconds
SkipCertVerify: "false"
# Additional Default NATS Specific options that need to be here to enable environment variable overrides of them
Format: "nats"
RetryOnFailedConnect: "true"
QueueGroup: ""
Durable: ""
AutoProvision: "true"
Deliver: "new"
DefaultPubRetryAttempts: "2"
Subject: "edgex/#" # Required for NATS JetStream only for stream auto-provisioning
ClientId: core-keeper


3 changes: 3 additions & 0 deletions cmd/security-file-token-provider/res/token-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"core-common-config-bootstrapper": {
"edgex_use_defaults": true
},
"core-keeper": {
"edgex_use_defaults": true
},
"security-bootstrapper-redis": {
"edgex_use_defaults": true
},
Expand Down
3 changes: 3 additions & 0 deletions cmd/security-secretstore-setup/res/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Databases:
coredata:
Service: core-data
Username: core-data
corekeeper:
Service: core-keeper
Username: core-keeper
rulesengine:
Service: app-rules-engine
Username: app-rules-engine
Expand Down
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/google/uuid v1.5.0
github.com/labstack/echo/v4 v4.11.4
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/spf13/cast v1.6.0
github.com/spiffe/go-spiffe/v2 v2.1.6
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.18.0
Expand Down Expand Up @@ -79,3 +80,11 @@ require (
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)

replace github.com/edgexfoundry/go-mod-core-contracts/v3 => github.com/jackchenjc/go-mod-core-contracts/v3 v3.2.0-dev.4.0.20240130071054-92a2e48bc6ca

replace github.com/edgexfoundry/go-mod-registry/v3 => github.com/jackchenjc/go-mod-registry/v3 v3.2.0-dev.1.0.20240130024331-d0f728a41496

replace github.com/edgexfoundry/go-mod-configuration/v3 => github.com/jackchenjc/go-mod-configuration/v3 v3.2.0-dev.1.0.20240130054648-e25c4056b9df

replace github.com/edgexfoundry/go-mod-bootstrap/v3 => github.com/jackchenjc/go-mod-bootstrap/v3 v3.2.0-dev.10.0.20240125072932-e0925013f378
Comment on lines +84 to +90

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this Keeper Service need modified versions of the go-mods?

I expect the go-mods to be modified for the new Client, not the Service.

25 changes: 16 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,17 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik=
github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.10 h1:x0aQrrWdA0dlK9yArcVzCCEq3F/mmvoe8Wl+Gc3gLhE=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.2.0-dev.10/go.mod h1:/t/ne1daGiXNbAC4XXOBDz0xJvAnj+xXYkPGlMJXvBM=
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.1 h1:efuxuoKUQQ5MmX847XUm/kQE3CkO70YRsTcn1T4rfrs=
github.com/edgexfoundry/go-mod-configuration/v3 v3.2.0-dev.1/go.mod h1:Un2xgWH5Wf8rfuLZBUVcE0uPyFCHsVhzyOaY+WKnPB4=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.4 h1:xUENFgvpWbeAwzIZdhz67wcjdM3kKMHoSswqlE7KWGc=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.2.0-dev.4/go.mod h1:1lucShe1bgw9jYy93L2uFPSBt7o+CzyccYzHnQtRuAg=
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.5 h1:6mNaqSh+Rq30Nphs9dBcKbGw6kk59nOKR9jLt4oblNU=
github.com/edgexfoundry/go-mod-messaging/v3 v3.2.0-dev.5/go.mod h1:UtIbjFHPiMqc8n1lrTjwEkurp91yK0eMJAjz2c55qlg=
github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.1 h1:kjh49tgnzqxGalaomvd0OVi9ikMt6Exsg4iCRzGwc6U=
github.com/edgexfoundry/go-mod-registry/v3 v3.2.0-dev.1/go.mod h1:HkAwzgWKvE0Nx+mvWVprVHd8r4HHciIf1Sl1wRpTB7U=
github.com/edgexfoundry/go-mod-secrets/v3 v3.2.0-dev.4 h1:sfvWxAEgUN6VlH+AYEZZZx1xzK5n76t1pcDaPB9HlUs=
github.com/edgexfoundry/go-mod-secrets/v3 v3.2.0-dev.4/go.mod h1:GR/hD294eFFDpEmd31C21Y7cl2qouZ/nXlfo4CnrmSM=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE=
github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
Expand Down Expand Up @@ -140,15 +134,24 @@ github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/jackchenjc/go-mod-bootstrap/v3 v3.2.0-dev.10.0.20240125072932-e0925013f378 h1:NNwV8XYBlm52m1Kc6G7Oz6F9tv4vNis3vGCqMBTlYIY=
github.com/jackchenjc/go-mod-bootstrap/v3 v3.2.0-dev.10.0.20240125072932-e0925013f378/go.mod h1:8vk1PfJ6WRHHxAYxizf+T5yFaf25tnJwdhsIlPhy7ME=
github.com/jackchenjc/go-mod-configuration/v3 v3.2.0-dev.1.0.20240130054648-e25c4056b9df h1:cY8AL3QhmRs1VEtSoqTWNF/jr7bt1NfhWCNOfYc2rbM=
github.com/jackchenjc/go-mod-configuration/v3 v3.2.0-dev.1.0.20240130054648-e25c4056b9df/go.mod h1:P8lYW2Nbm82XSHlS5cojECX5IT2JNm5Dqf1Qg1QB9u8=
github.com/jackchenjc/go-mod-core-contracts/v3 v3.2.0-dev.4.0.20240130071054-92a2e48bc6ca h1:HDCQmr+lex7SlFSuJ236fHBGQObX6mWqN+eJS1c6TuE=
github.com/jackchenjc/go-mod-core-contracts/v3 v3.2.0-dev.4.0.20240130071054-92a2e48bc6ca/go.mod h1:1lucShe1bgw9jYy93L2uFPSBt7o+CzyccYzHnQtRuAg=
github.com/jackchenjc/go-mod-registry/v3 v3.2.0-dev.1.0.20240130024331-d0f728a41496 h1:vxFSXSXBIV8GTwSQa0O9m3MvKFH6B3xbTAD/EZHTcF0=
github.com/jackchenjc/go-mod-registry/v3 v3.2.0-dev.1.0.20240130024331-d0f728a41496/go.mod h1:HkAwzgWKvE0Nx+mvWVprVHd8r4HHciIf1Sl1wRpTB7U=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g=
github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -231,11 +234,15 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spiffe/go-spiffe/v2 v2.1.6 h1:4SdizuQieFyL9eNU+SPiCArH4kynzaKOOj0VvM8R7Xo=
github.com/spiffe/go-spiffe/v2 v2.1.6/go.mod h1:eVDqm9xFvyqao6C+eQensb9ZPkyNEeaUbqbBpOhBnNk=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
53 changes: 53 additions & 0 deletions internal/core/keeper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# EdgeX Foundry Core Keeper Service
[![license](https://img.shields.io/badge/license-Apache%20v2.0-blue.svg)](LICENSE)

Core Keeper is a lightweight configuration and registry service that is aimed to replace Consul in the EdgeX architecture. It uses Redis from the existing EdgeX service architecture as the data persistent store, and implements the configuration and registry abstractions by adopting the go-mod-configuration and go-mod-registry modules from EdgeX.

# Install and Deploy Native #

### Installation and Execution ###
To fetch the code and build the microservice execute the following:

```
cd $GOPATH/src
go get github.com/edgexfoundry/edgex-go
cd $GOPATH/src/github.com/edgexfoundry/edgex-go
# pull the 3rd party / vendor packages
make prepare
# build the microservice
make keeper
# get to the command microservice executable
cd cmd/core-keeper
# run the microservice (may require other dependent services to run correctly)
./core-keeper
```

# Install and Deploy via Docker Container #
This project has facilities to create and run Docker containers. A Dockerfile is included in the repo. Make sure you have already run make prepare to update the dependencies. To do a Docker build using the included Docker file, run the following:

### Prerequisites ###
See https://docs.docker.com/install/ to learn how to obtain and install Docker.

### Installation and Execution ###

```
cd $GOPATH/src
go get github.com/edgexfoundry/edgex-go
cd $GOPATH/src/github.com/edgexfoundry/edgex-go
# To create the Docker image
sudo make docker_core_keeper
# To create a containter from the image
sudo docker create --name "[DOCKER_CONTAINER_NAME]" --network "[DOCKER_NETWORK]" [DOCKER_IMAGE_NAME]
# To run the container
sudo docker start [DOCKER_CONTAINER_NAME]
```

*Note* - creating and running the container above requires Docker network setup, may require dependent containers to be setup on that network, and appropriate port access configuration (among other start up parameters). For this reason, EdgeX recommends use of Docker Compose for pulling, building, and running containers. See The Getting Started Guides for more detail.


## Community
- Chat: [https://edgexfoundry.slack.com](https://join.slack.com/t/edgexfoundry/shared_invite/enQtNDgyODM5ODUyODY0LWVhY2VmOTcyOWY2NjZhOWJjOGI1YzQ2NzYzZmIxYzAzN2IzYzY0NTVmMWZhZjNkMjVmODNiZGZmYTkzZDE3MTA)
- Mailing lists: https://lists.edgexfoundry.org/mailman/listinfo

## License
[Apache-2.0](LICENSE)
Loading