Skip to content

Commit

Permalink
fea(edgex): support edgex nats message bus (#1474)
Browse files Browse the repository at this point in the history
* fix(edgex): upgrade edgex-foundry dependency version

Signed-off-by: Jianxiang Ran <[email protected]>

* fix(edgex): support edgex nats message bus

Signed-off-by: Jianxiang Ran <[email protected]>

* fix(edgex): add edgex nats message bus for json config

Signed-off-by: Jianxiang Ran <[email protected]>

* fix(edgex): add configuration for nats

Signed-off-by: Jianxiang Ran <[email protected]>

* fix(edgex): update extensions.mod

Signed-off-by: Jianxiang Ran <[email protected]>

* fix(edgex): update docs about nats message bus

Signed-off-by: Jianxiang Ran <[email protected]>

Signed-off-by: Jianxiang Ran <[email protected]>
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
superrxan authored and Rory-Z committed Nov 7, 2022
1 parent c36e1b3 commit 862ca42
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 72 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
suffix:
- ""
- "-alpine"
- "-dev"
- "-slim"
- "-slim-python"
golang:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_fvt_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ jobs:
sudo ./get_helm.sh
helm version
- name: build kuiper for docker
run: sudo docker build --no-cache -t lfedge/ekuiper:$(git describe --tags --alway)-alpine -f deploy/docker/Dockerfile-alpine .
run: sudo docker build --no-cache -t lfedge/ekuiper:$(git describe --tags --alway) -f deploy/docker/Dockerfile .
- name: run emqx on chart
env:
KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
Expand All @@ -287,7 +287,7 @@ jobs:
version=$(git describe --tags --always)
emqx_address=$(kubectl get svc --namespace default emqx -o jsonpath="{.spec.clusterIP}")
sudo docker save lfedge/ekuiper:$version-alpine -o kuier.tar.gz
sudo docker save lfedge/ekuiper:$version -o kuier.tar.gz
sudo k3s ctr image import kuier.tar.gz
sed -i -r "s/^appVersion: .*$/appVersion: \"${version}\"/g" deploy/chart/ekuiper/Chart.yaml
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ real_pkg:
docker:
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION) -f deploy/docker/Dockerfile . --load
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION)-slim -f deploy/docker/Dockerfile-slim . --load
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION)-alpine -f deploy/docker/Dockerfile-alpine . --load
docker buildx build --no-cache --platform=linux/amd64 -t $(TARGET):$(VERSION)-dev -f deploy/docker/Dockerfile-dev . --load

PLUGINS := sinks/file \
sinks/influx \
Expand Down
2 changes: 1 addition & 1 deletion deploy/chart/ekuiper/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: ekuiper
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}-alpine"
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.ekuiperEnv.enabled }}
env:
Expand Down
37 changes: 27 additions & 10 deletions deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,45 @@
# limitations under the License.

ARG GO_VERSION=1.18.5
FROM ghcr.io/lf-edge/ekuiper/base:$GO_VERSION-debian AS builder
FROM ghcr.io/lf-edge/ekuiper/base:$GO_VERSION-alpine AS builder

COPY . /go/kuiper

WORKDIR /go/kuiper

RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN make build_with_edgex

RUN make build_with_edgex \
&& ln -s /go/kuiper/_build/kuiper-$(git describe --tags --always)-$(go env GOOS)-$(go env GOARCH) /kuiper
FROM alpine:3.16

RUN ln -s /go/kuiper/deploy/docker/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
# Set environment vars
ENV MAINTAINER="emqx.io" \
KUIPER_HOME="/kuiper" \
KUIPER__BASIC__CONSOLELOG=true

EXPOSE 9081 20498
# These vars are not persisted in the final image layer
ARG KUIPER_USER="kuiper"
ARG KUIPER_USER_ID="1001"

ENV MAINTAINER="emqx.io"
ENV KUIPER_HOME /kuiper
ENV KUIPER__BASIC__CONSOLELOG true
# (root) Add packages and "kuiper" user
RUN apk add sed libzmq

WORKDIR ${KUIPER_HOME}

# Set appropriate ownership to allow binary full access to KUIPER_HOME dir
RUN adduser -DH -s /sbin/nologin -u ${KUIPER_USER_ID} ${KUIPER_USER} && \
chown -Rh ${KUIPER_USER}:${KUIPER_USER} ${KUIPER_HOME} && \
mkdir -p /usr/local/taos && \
chown -Rh ${KUIPER_USER}:${KUIPER_USER} /usr/local/taos

# Run the kuiper process under the kuiper user
USER ${KUIPER_USER}

COPY --chown=${KUIPER_USER}:${KUIPER_USER} ./deploy/docker/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
COPY --chown=${KUIPER_USER}:${KUIPER_USER} --from=builder /go/kuiper/_build/kuiper-* /kuiper/

VOLUME ["${KUIPER_HOME}/etc", "${KUIPER_HOME}/data", "${KUIPER_HOME}/plugins", "${KUIPER_HOME}/log"]
EXPOSE 9081 20498

ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]

CMD ["./bin/kuiperd"]
57 changes: 0 additions & 57 deletions deploy/docker/Dockerfile-alpine

This file was deleted.

1 change: 1 addition & 0 deletions deploy/docker/Dockerfile-alpine
40 changes: 40 additions & 0 deletions deploy/docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2021 EMQ Technologies Co., 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.

ARG GO_VERSION=1.18.5
FROM ghcr.io/lf-edge/ekuiper/base:$GO_VERSION-debian AS builder

COPY . /go/kuiper

WORKDIR /go/kuiper

RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN make build_with_edgex \
&& ln -s /go/kuiper/_build/kuiper-$(git describe --tags --always)-$(go env GOOS)-$(go env GOARCH) /kuiper

RUN ln -s /go/kuiper/deploy/docker/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh

EXPOSE 9081 20498

ENV MAINTAINER="emqx.io"
ENV KUIPER_HOME /kuiper
ENV KUIPER__BASIC__CONSOLELOG true

WORKDIR ${KUIPER_HOME}
VOLUME ["${KUIPER_HOME}/etc", "${KUIPER_HOME}/data", "${KUIPER_HOME}/plugins", "${KUIPER_HOME}/log"]
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]

CMD ["./bin/kuiperd"]
2 changes: 1 addition & 1 deletion deploy/docker/Dockerfile-kubernetes-tool
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WORKDIR /go/kuiper/tools/kubernetes

RUN go build -o kuiper-kubernetes-tool main.go

FROM alpine:3.15
FROM alpine:3.16

WORKDIR /kuiper-kubernetes-tool

Expand Down

0 comments on commit 862ca42

Please sign in to comment.