mirror of
https://github.com/emqx/neuron.git
synced 2026-10-21 16:55:53 +08:00
Merge pull request #532 from eeff/eeff/ci
Revert deb packaging with ekuiper
This commit is contained in:
@@ -39,28 +39,6 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: fetch ekuiper
|
||||
if: ${{ matrix.arch[5] != 'armhf' }}
|
||||
uses: dsaltares/fetch-gh-release-asset@master
|
||||
env:
|
||||
EKUIPER_VERSION: 1.5.0
|
||||
with:
|
||||
repo: "lf-edge/ekuiper"
|
||||
version: "tags/${{ env.EKUIPER_VERSION }}"
|
||||
file: "kuiper-${{ env.EKUIPER_VERSION }}-linux-${{ matrix.arch[5] }}.tar.gz"
|
||||
target: "ekuiper.tar.gz"
|
||||
|
||||
- name: fetch ekuiper arm
|
||||
if: ${{ matrix.arch[5] == 'armhf' }}
|
||||
uses: dsaltares/fetch-gh-release-asset@master
|
||||
env:
|
||||
EKUIPER_VERSION: 1.5.0
|
||||
with:
|
||||
repo: "lf-edge/ekuiper"
|
||||
version: "tags/${{ env.EKUIPER_VERSION }}"
|
||||
file: "kuiper-${{ env.EKUIPER_VERSION }}-linux-arm.tar.gz"
|
||||
target: "ekuiper.tar.gz"
|
||||
|
||||
- name: install
|
||||
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.arch[2] }} ${{ matrix.arch[3] }} pkg-config alien
|
||||
|
||||
@@ -74,7 +52,6 @@ jobs:
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/${{ matrix.arch[0] }}.cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release -DDISABLE_UT=ON
|
||||
make -j4
|
||||
|
||||
- name: get version
|
||||
id: get_version
|
||||
run: echo "::set-output name=version::$(cat version)"
|
||||
@@ -83,10 +60,6 @@ jobs:
|
||||
env:
|
||||
ARCH: ${{ matrix.arch[5] }}
|
||||
run: |
|
||||
pwd
|
||||
find . -iname "*kuiper*"
|
||||
mkdir -p build/ekuiper
|
||||
tar xvf ekuiper.tar.gz --strip-components=1 -C build/ekuiper
|
||||
./package.sh -p ${ARCH} -n neuron-${{ steps.get_version.outputs.version }}
|
||||
cd package
|
||||
python3 create_neuron_deb.py ${{ steps.get_version.outputs.version }} ${{ matrix.arch[5] }}
|
||||
@@ -102,7 +75,6 @@ jobs:
|
||||
*.tar.gz
|
||||
*.deb
|
||||
*.rpm
|
||||
!ekuiper.tar.gz
|
||||
|
||||
- name: Create neuron sdk package
|
||||
run: |
|
||||
|
||||
@@ -189,7 +189,6 @@ file(COPY ${CMAKE_SOURCE_DIR}/neuron.key DESTINATION ${CMAKE_BINARY_DIR}/config)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/neuron.pem DESTINATION ${CMAKE_BINARY_DIR}/config)
|
||||
|
||||
#setup default plugins for persistence
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/persistence DESTINATION ${CMAKE_BINARY_DIR}/)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/default_plugins.json DESTINATION ${CMAKE_BINARY_DIR}/persistence)
|
||||
file(RENAME ${CMAKE_BINARY_DIR}/persistence/default_plugins.json ${CMAKE_BINARY_DIR}/persistence/plugins.json)
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ fi
|
||||
cp zlog/src/libzlog.so.1.2 ${package_name}
|
||||
|
||||
cp .gitkeep ${package_name}/logs/
|
||||
cp -r persistence ${package_name}/
|
||||
cp default_plugins.json ${package_name}/persistence/plugins.json
|
||||
cp zlog.conf ${package_name}/config/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import sys
|
||||
rules = []
|
||||
|
||||
rules.append(mkdeb.FileMap("deb/neuron/conffiles",
|
||||
"/DEBIAN/", "r", "conffiles"))
|
||||
"/DEBIAN/", "r", "conffiles"))
|
||||
rules.append(mkdeb.FileMap("deb/neuron/postinst", "/DEBIAN/", "r", "postinst"))
|
||||
rules.append(mkdeb.FileMap("deb/neuron/preinst", "/DEBIAN/", "r", "preinst"))
|
||||
rules.append(mkdeb.FileMap("deb/neuron/prerm", "/DEBIAN/", "r", "prerm"))
|
||||
@@ -24,9 +24,8 @@ rules.append(mkdeb.FileMap("../.gitkeep", "/opt/neuron/core/"))
|
||||
rules.append(mkdeb.FileMap("../neuron.key", "/opt/neuron/config/"))
|
||||
rules.append(mkdeb.FileMap("../neuron.pem", "/opt/neuron/config/"))
|
||||
|
||||
rules.append(mkdeb.FileMap("../persistence", "/opt/neuron/"))
|
||||
rules.append(mkdeb.FileMap("../default_plugins.json",
|
||||
"/opt/neuron/persistence/", "r", "plugins.json"))
|
||||
"/opt/neuron/persistence/", "r", "plugins.json"))
|
||||
|
||||
rules.append(mkdeb.FileMap("../build/libneuron-base.so", "/usr/local/lib/"))
|
||||
|
||||
@@ -44,10 +43,6 @@ rules.append(mkdeb.FileMap(
|
||||
rules.append(mkdeb.FileMap(
|
||||
"../plugins/modbus/modbus-tcp.json", "/opt/neuron/plugins/schema/"))
|
||||
|
||||
rules.append(mkdeb.FileMap("../build/ekuiper", "/opt/neuron/"))
|
||||
rules.append(mkdeb.FileMap("ekuiper.sh", "/opt/neuron/ekuiper/", "x"))
|
||||
rules.append(mkdeb.FileMap("neuron.ekuiper.service", "/lib/systemd/system/"))
|
||||
|
||||
|
||||
mkdeb.create_deb_file(rules)
|
||||
mkdeb.create_control("neuron", sys.argv[1], sys.argv[2], "neuron", "")
|
||||
|
||||
@@ -4,12 +4,4 @@ echo "postinst"
|
||||
ldconfig
|
||||
systemctl daemon-reload
|
||||
systemctl enable neuron
|
||||
systemctl start neuron
|
||||
systemctl enable neuron.ekuiper
|
||||
systemctl start neuron.ekuiper
|
||||
|
||||
# create ekuiper stream for neuron
|
||||
sleep 1
|
||||
curl -X POST --location http://127.0.0.1:9081/streams \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"sql":"CREATE STREAM neuronStream() WITH (TYPE=\"neuron\",FORMAT=\"json\",SHARED=\"true\");"}'
|
||||
systemctl start neuron
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "prerm"
|
||||
systemctl disable neuron.ekuiper
|
||||
systemctl stop neuron.ekuiper
|
||||
systemctl disable neuron
|
||||
systemctl stop neuron
|
||||
systemctl stop neuron
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# NEURON IIoT System for Industry 4.0
|
||||
# Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
set -e -u
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
nohup /opt/neuron/ekuiper/bin/kuiperd >> /opt/neuron/ekuiper/log/nohup.out &
|
||||
;;
|
||||
stop)
|
||||
pid=$(ps -ef |grep kuiperd |grep -v "grep" | awk '{print $2}')
|
||||
while $(kill "$pid" 2>/dev/null); do
|
||||
sleep 1
|
||||
done
|
||||
;;
|
||||
ping)
|
||||
if [ "$(curl -sl -w %{http_code} 127.0.0.1:9081 -o /dev/null)" = "200" ]; then
|
||||
echo pong
|
||||
else
|
||||
echo "Ping kuiper failed"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|ping|restart|force-reload|status}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
+2
-5
@@ -78,17 +78,14 @@ def create_deb_file(rules):
|
||||
src = r.src
|
||||
dstpath = fix_dri + r.dst
|
||||
dst = dstpath + r.filename
|
||||
if not os.path.exists(src):
|
||||
if not os.path.isfile(src):
|
||||
print("%s not exist!" % src)
|
||||
continue
|
||||
|
||||
if not os.path.exists(dstpath):
|
||||
os.makedirs(dstpath)
|
||||
|
||||
if os.path.isfile(src):
|
||||
shutil.copyfile(src, dst)
|
||||
else:
|
||||
shutil.copytree(src, dst, dirs_exist_ok=True)
|
||||
shutil.copyfile(src, dst)
|
||||
if r.mode == "x":
|
||||
os.chmod(dst,
|
||||
stat.S_IXUSR | stat.S_IRUSR | stat.S_IWUSR | stat.S_IXGRP | stat.S_IWGRP | stat.S_IRGRP)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
[Unit]
|
||||
Description=ekuiper daemon
|
||||
After=neuron.service
|
||||
Requires=neuron.service
|
||||
PartOf=neuron.service
|
||||
|
||||
[Service]
|
||||
Group=root
|
||||
Type=forking
|
||||
Environment=HOME=/opt/neuron/ekuiper
|
||||
WorkingDirectory=/opt/neuron/ekuiper
|
||||
ExecStart=/bin/sh /opt/neuron/ekuiper/ekuiper.sh start
|
||||
LimitNOFILE=1048576
|
||||
ExecStop=/bin/sh /opt/neuron/ekuiper/ekuiper.sh stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=neuron.service
|
||||
@@ -1,7 +1,6 @@
|
||||
[Unit]
|
||||
Description=Neuron daemon
|
||||
After=network.target
|
||||
Wants=neuron.ekuiper.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"id": 3,
|
||||
"type": 2,
|
||||
"state": 3,
|
||||
"name": "ekuiper",
|
||||
"plugin_name": "ekuiper"
|
||||
}
|
||||
Reference in New Issue
Block a user