|
@@ -60,15 +60,21 @@ jobs:
|
|
|
name: packages-mac
|
|
|
path: _packages/.
|
|
|
|
|
|
- build-docker-images:
|
|
|
+ build-docker-images-and-plugins:
|
|
|
runs-on: ubuntu-latest
|
|
|
-
|
|
|
+
|
|
|
strategy:
|
|
|
matrix:
|
|
|
- suffix:
|
|
|
- - fat
|
|
|
- - slim
|
|
|
- - alpine
|
|
|
+ plugin:
|
|
|
+ - sinks/file
|
|
|
+ - sinks/influxdb
|
|
|
+ - sinks/taos
|
|
|
+ - sinks/zmq
|
|
|
+ - sources/random
|
|
|
+ - sources/zmq
|
|
|
+ - functions/accumulateWordCount
|
|
|
+ - functions/countPlusOne
|
|
|
+ - functions/echo
|
|
|
|
|
|
steps:
|
|
|
- uses: actions/checkout@v1
|
|
@@ -91,24 +97,74 @@ jobs:
|
|
|
docker buildx create --use --name mybuild
|
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
- name: build docker image
|
|
|
- if: matrix.suffix == 'fat'
|
|
|
- run: docker build --no-cache -t emqx/kuiper:$(git describe --tags --always) -f deploy/docker/Dockerfile .
|
|
|
-
|
|
|
- - name: build docker image
|
|
|
- if: matrix.suffix != 'fat'
|
|
|
+ run: make docker -j4
|
|
|
+ - name: buiild debian plugins
|
|
|
env:
|
|
|
- SUFFIX: ${{ matrix.suffix }}
|
|
|
- run: docker build --no-cache -t emqx/kuiper:$(git describe --tags --always)-$SUFFIX -f deploy/docker/Dockerfile-$SUFFIX .
|
|
|
-
|
|
|
- - name: test docker image
|
|
|
+ PLUGIN: ${{ matrix.plugin }}
|
|
|
+ run: make ${PLUGIN}
|
|
|
+ - name: buiild alpine plugins
|
|
|
+ env:
|
|
|
+ PLUGIN: ${{ matrix.plugin }}
|
|
|
+ run: make alpine/${PLUGIN}
|
|
|
+ - name: test docker and plugins
|
|
|
+ env:
|
|
|
+ PLUGIN: ${{ matrix.plugin }}
|
|
|
run: |
|
|
|
set -e -x -u
|
|
|
- image_id=$(docker images emqx/kuiper -q | head -1)
|
|
|
- container_id=$(docker run -d $image_id)
|
|
|
- ip_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container_id)
|
|
|
- sleep 10
|
|
|
- if ! curl ${ip_address}:9081 >/dev/null 2>&1; then echo "docker image failed"; exit 1; fi
|
|
|
+ plugin_type=$(echo ${PLUGIN%%/*})
|
|
|
+ plugin_name=$(echo ${PLUGIN##*/})
|
|
|
+
|
|
|
+ for image_id in $(docker images emqx/kuiper -q); do
|
|
|
+ container_id=$(docker run -d -v $(pwd)/_plugins:/var/plugins $image_id)
|
|
|
+ ip_address=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container_id)
|
|
|
+ os=$(docker exec -i ${container_id} sh -c "sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g'" )
|
|
|
+
|
|
|
+ sleep 5
|
|
|
+ if ! curl ${ip_address}:9081 >/dev/null 2>&1; then echo "docker image failed"; exit 1; fi
|
|
|
+ curl ${ip_address}:9081/plugins/${plugin_type} -X POST -d "{\"name\":\"${plugin_name}\", \"file\":\"file:///var/plugins/${os}/${plugin_type}/${plugin_name}_amd64.zip\"}"
|
|
|
+ [ $plugin_name = $(curl ${ip_address}:9081/plugins/${plugin_type}/${plugin_name} | jq '.name'| sed 's/\"//g' ) ] || exit 1
|
|
|
+ done
|
|
|
+ - uses: actions/upload-artifact@v2
|
|
|
+ with:
|
|
|
+ name: plugins
|
|
|
+ path: "_plugins/"
|
|
|
+
|
|
|
+ build-docker-manifest-images:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+
|
|
|
+
|
|
|
+ needs:
|
|
|
+ - build-docker-images-and-plugins
|
|
|
+
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ suffix:
|
|
|
+ - fat
|
|
|
+ - slim
|
|
|
+ - alpine
|
|
|
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v1
|
|
|
+ - name: install docker
|
|
|
+ if: github.event_name == 'release'
|
|
|
+ run: |
|
|
|
+ sudo apt-get remove docker docker-engine docker.io containerd runc
|
|
|
+ sudo apt-get update
|
|
|
+ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
|
|
|
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
|
+ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
|
|
+ sudo apt-get update
|
|
|
+ sudo apt-get install docker-ce docker-ce-cli containerd.io jq
|
|
|
+ - name: prepare docker
|
|
|
+ if: github.event_name == 'release'
|
|
|
+ run: |
|
|
|
+ mkdir -p $HOME/.docker
|
|
|
+ echo '{ "experimental": "enabled" }' | tee $HOME/.docker/config.json
|
|
|
+ echo '{ "experimental": true, "storage-driver": "overlay2", "max-concurrent-downloads": 50, "max-concurrent-uploads": 50, "graph": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json
|
|
|
+ sudo systemctl restart docker
|
|
|
+ docker version
|
|
|
+ docker buildx create --use --name mybuild
|
|
|
+ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
- name: cross build docker images
|
|
|
if: (matrix.suffix == 'fat') && (github.event_name == 'release')
|
|
|
run: |
|
|
@@ -119,7 +175,6 @@ jobs:
|
|
|
-t emqx/kuiper:$(git describe --tags --always) \
|
|
|
-f deploy/docker/Dockerfile . \
|
|
|
--push
|
|
|
-
|
|
|
- name: cross build docker images
|
|
|
if: (matrix.suffix != 'fat') && (github.event_name == 'release')
|
|
|
env:
|
|
@@ -177,7 +232,10 @@ jobs:
|
|
|
release:
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
- needs: [build, build-on-mac]
|
|
|
+ needs:
|
|
|
+ - build
|
|
|
+ - build-on-mac
|
|
|
+ - build-docker-images-and-plugins
|
|
|
|
|
|
steps:
|
|
|
- uses: actions/checkout@v1
|
|
@@ -189,6 +247,10 @@ jobs:
|
|
|
with:
|
|
|
name: packages-mac
|
|
|
path: _packages
|
|
|
+ - uses: actions/download-artifact@v1
|
|
|
+ with:
|
|
|
+ name: plugins
|
|
|
+ path: _plugins
|
|
|
- name: check packages
|
|
|
run: |
|
|
|
cd _packages && for var in $( ls |grep -v sha256); do
|
|
@@ -213,7 +275,8 @@ jobs:
|
|
|
aws configure set default.region us-west-2
|
|
|
aws s3 rm --quiet --recursive s3://packages.emqx.io/kuiper/$version
|
|
|
aws s3 cp --quiet --recursive ./_packages s3://packages.emqx.io/kuiper/$version
|
|
|
- aws cloudfront create-invalidation --distribution-id E3TYD0WSP4S14P --paths "/kuiper/$version/*"
|
|
|
+ aws s3 cp --quiet --recursive ./_plugins s3://packages.emqx.io/kuiper-plugins/$version
|
|
|
+ aws cloudfront create-invalidation --distribution-id E3TYD0WSP4S14P --paths "/kuiper/$version/*,/kuiper-plugins/$version/*"
|
|
|
- name: update emqx.io
|
|
|
if: github.event_name == 'release'
|
|
|
run: |
|