-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prometheus-collab <[email protected]> Signed-off-by: fuchendou <[email protected]> Providing a Common MQTT Mapper Signed-off-by: Prometheus-collab <[email protected]> Signed-off-by: fuchendou <[email protected]> Provide a Common MQTT Mapper Signed-off-by: fuchendou <[email protected]> Provide a Common MQTT Mapper Signed-off-by: fuchendou <[email protected]> Provide a Common MQTT Mapper Signed-off-by: fuchendou <[email protected]>
- Loading branch information
Showing
36 changed files
with
2,705 additions
and
3,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 19 additions & 19 deletions
38
...e-v1.17.0/mqtt-mapper/Dockerfile_nostream → ...e-v1beta1/mqtt-mapper/Dockerfile_nostream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
FROM golang:1.21.11-alpine3.19 AS builder | ||
|
||
WORKDIR /build | ||
|
||
ENV GO111MODULE=on \ | ||
GOPROXY=https://goproxy.cn,direct | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o main cmd/main.go | ||
|
||
|
||
FROM ubuntu:18.04 | ||
|
||
RUN mkdir -p kubeedge | ||
|
||
COPY --from=builder /build/main kubeedge/ | ||
COPY ./config.yaml kubeedge/ | ||
|
||
FROM golang:1.21.11-alpine3.19 AS builder | ||
WORKDIR /build | ||
ENV GO111MODULE=on \ | ||
GOPROXY=https://goproxy.cn,direct | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o main cmd/main.go | ||
FROM ubuntu:18.04 | ||
RUN mkdir -p kubeedge | ||
COPY --from=builder /build/main kubeedge/ | ||
COPY ./config.yaml kubeedge/ | ||
WORKDIR kubeedge |
68 changes: 34 additions & 34 deletions
68
...dge-v1.17.0/mqtt-mapper/Dockerfile_stream → ...ice-v1beta1/mqtt-mapper/Dockerfile_stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
FROM golang:1.21.11-bullseye AS builder | ||
|
||
WORKDIR /build | ||
|
||
ENV GO111MODULE=on \ | ||
GOPROXY=https://goproxy.cn,direct | ||
|
||
COPY . . | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y bzip2 curl upx-ucl gcc-aarch64-linux-gnu libc6-dev-arm64-cross gcc-arm-linux-gnueabi libc6-dev-armel-cross libva-dev libva-drm2 libx11-dev libvdpau-dev libxext-dev libsdl1.2-dev libxcb1-dev libxau-dev libxdmcp-dev yasm | ||
|
||
RUN curl -sLO https://ffmpeg.org/releases/ffmpeg-4.1.6.tar.bz2 && \ | ||
tar -jx --strip-components=1 -f ffmpeg-4.1.6.tar.bz2 && \ | ||
./configure && make && \ | ||
make install | ||
|
||
RUN GOOS=linux go build -o main cmd/main.go | ||
|
||
FROM ubuntu:18.04 | ||
|
||
RUN mkdir -p kubeedge | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y bzip2 curl upx-ucl gcc-aarch64-linux-gnu libc6-dev-arm64-cross gcc-arm-linux-gnueabi libc6-dev-armel-cross libva-dev libva-drm2 libx11-dev libvdpau-dev libxext-dev libsdl1.2-dev libxcb1-dev libxau-dev libxdmcp-dev yasm | ||
|
||
RUN curl -sLO https://ffmpeg.org/releases/ffmpeg-4.1.6.tar.bz2 && \ | ||
tar -jx --strip-components=1 -f ffmpeg-4.1.6.tar.bz2 && \ | ||
./configure && make && \ | ||
make install | ||
|
||
COPY --from=builder /build/main kubeedge/ | ||
COPY ./config.yaml kubeedge/ | ||
|
||
FROM golang:1.21.11-bullseye AS builder | ||
WORKDIR /build | ||
ENV GO111MODULE=on \ | ||
GOPROXY=https://goproxy.cn,direct | ||
COPY . . | ||
RUN apt-get update && \ | ||
apt-get install -y bzip2 curl upx-ucl gcc-aarch64-linux-gnu libc6-dev-arm64-cross gcc-arm-linux-gnueabi libc6-dev-armel-cross libva-dev libva-drm2 libx11-dev libvdpau-dev libxext-dev libsdl1.2-dev libxcb1-dev libxau-dev libxdmcp-dev yasm | ||
RUN curl -sLO https://ffmpeg.org/releases/ffmpeg-4.1.6.tar.bz2 && \ | ||
tar -jx --strip-components=1 -f ffmpeg-4.1.6.tar.bz2 && \ | ||
./configure && make && \ | ||
make install | ||
RUN GOOS=linux go build -o main cmd/main.go | ||
FROM ubuntu:18.04 | ||
RUN mkdir -p kubeedge | ||
RUN apt-get update && \ | ||
apt-get install -y bzip2 curl upx-ucl gcc-aarch64-linux-gnu libc6-dev-arm64-cross gcc-arm-linux-gnueabi libc6-dev-armel-cross libva-dev libva-drm2 libx11-dev libvdpau-dev libxext-dev libsdl1.2-dev libxcb1-dev libxau-dev libxdmcp-dev yasm | ||
RUN curl -sLO https://ffmpeg.org/releases/ffmpeg-4.1.6.tar.bz2 && \ | ||
tar -jx --strip-components=1 -f ffmpeg-4.1.6.tar.bz2 && \ | ||
./configure && make && \ | ||
make install | ||
COPY --from=builder /build/main kubeedge/ | ||
COPY ./config.yaml kubeedge/ | ||
WORKDIR kubeedge |
120 changes: 60 additions & 60 deletions
120
.../kubeedge-v1.17.0/mqtt-mapper/cmd/main.go → ...rs/device-v1beta1/mqtt-mapper/cmd/main.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
package main | ||
|
||
import ( | ||
"errors" | ||
|
||
"k8s.io/klog/v2" | ||
|
||
"github.com/kubeedge/kubeedge-v1.17.0/device" | ||
"github.com/kubeedge/mapper-framework/pkg/common" | ||
"github.com/kubeedge/mapper-framework/pkg/config" | ||
"github.com/kubeedge/mapper-framework/pkg/grpcclient" | ||
"github.com/kubeedge/mapper-framework/pkg/grpcserver" | ||
"github.com/kubeedge/mapper-framework/pkg/httpserver" | ||
) | ||
|
||
func main() { | ||
var err error | ||
var c *config.Config | ||
|
||
klog.InitFlags(nil) | ||
defer klog.Flush() | ||
|
||
if c, err = config.Parse(); err != nil { | ||
klog.Fatal(err) | ||
} | ||
klog.Infof("config: %+v", c) | ||
|
||
klog.Infoln("Mapper will register to edgecore") | ||
deviceList, deviceModelList, err := grpcclient.RegisterMapper(true) | ||
if err != nil { | ||
klog.Fatal(err) | ||
} | ||
klog.Infoln("Mapper register finished") | ||
|
||
panel := device.NewDevPanel() | ||
err = panel.DevInit(deviceList, deviceModelList) | ||
if err != nil && !errors.Is(err, device.ErrEmptyData) { | ||
klog.Fatal(err) | ||
} | ||
klog.Infoln("devInit finished") | ||
go panel.DevStart() | ||
|
||
// start http server | ||
httpServer := httpserver.NewRestServer(panel, c.Common.HTTPPort) | ||
go httpServer.StartServer() | ||
|
||
// start grpc server | ||
grpcServer := grpcserver.NewServer( | ||
grpcserver.Config{ | ||
SockPath: c.GrpcServer.SocketPath, | ||
Protocol: common.ProtocolCustomized, | ||
}, | ||
panel, | ||
) | ||
defer grpcServer.Stop() | ||
if err = grpcServer.Start(); err != nil { | ||
klog.Fatal(err) | ||
} | ||
|
||
} | ||
package main | ||
|
||
import ( | ||
"errors" | ||
|
||
"k8s.io/klog/v2" | ||
|
||
"github.com/kubeedge/mqtt/device" | ||
"github.com/kubeedge/mapper-framework/pkg/common" | ||
"github.com/kubeedge/mapper-framework/pkg/config" | ||
"github.com/kubeedge/mapper-framework/pkg/grpcclient" | ||
"github.com/kubeedge/mapper-framework/pkg/grpcserver" | ||
"github.com/kubeedge/mapper-framework/pkg/httpserver" | ||
) | ||
|
||
func main() { | ||
var err error | ||
var c *config.Config | ||
|
||
klog.InitFlags(nil) | ||
defer klog.Flush() | ||
|
||
if c, err = config.Parse(); err != nil { | ||
klog.Fatal(err) | ||
} | ||
klog.Infof("config: %+v", c) | ||
|
||
klog.Infoln("Mapper will register to edgecore") | ||
deviceList, deviceModelList, err := grpcclient.RegisterMapper(true) | ||
if err != nil { | ||
klog.Fatal(err) | ||
} | ||
klog.Infoln("Mapper register finished") | ||
|
||
panel := device.NewDevPanel() | ||
err = panel.DevInit(deviceList, deviceModelList) | ||
if err != nil && !errors.Is(err, device.ErrEmptyData) { | ||
klog.Fatal(err) | ||
} | ||
klog.Infoln("devInit finished") | ||
go panel.DevStart() | ||
|
||
// start http server | ||
httpServer := httpserver.NewRestServer(panel, c.Common.HTTPPort) | ||
go httpServer.StartServer() | ||
|
||
// start grpc server | ||
grpcServer := grpcserver.NewServer( | ||
grpcserver.Config{ | ||
SockPath: c.GrpcServer.SocketPath, | ||
Protocol: common.ProtocolCustomized, | ||
}, | ||
panel, | ||
) | ||
defer grpcServer.Stop() | ||
if err = grpcServer.Start(); err != nil { | ||
klog.Fatal(err) | ||
} | ||
|
||
} |
18 changes: 9 additions & 9 deletions
18
.../kubeedge-v1.17.0/mqtt-mapper/config.yaml → ...rs/device-v1beta1/mqtt-mapper/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
grpc_server: | ||
socket_path: /etc/kubeedge/kubeedge-v1.17.0.sock | ||
common: | ||
name: Kubeedge-V1.17.0-mapper | ||
version: v1.13.0 | ||
api_version: v1.0.0 | ||
protocol: # TODO add your protocol name | ||
address: 127.0.0.1 | ||
edgecore_sock: /etc/kubeedge/dmi.sock | ||
grpc_server: | ||
socket_path: /etc/kubeedge/mqtt.sock | ||
common: | ||
name: Mqtt-mapper | ||
version: v1.13.0 | ||
api_version: v1.0.0 | ||
protocol: # TODO add your protocol name | ||
address: 127.0.0.1 | ||
edgecore_sock: /etc/kubeedge/dmi.sock |
Oops, something went wrong.