diff --git a/package.json b/package.json index 7328afa..750830c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mimik_ohorchestrator", - "version": "1.1.1", + "version": "1.1.2", "swaggerFile": { "version": "1.1.0", "account": "mimik", @@ -44,18 +44,18 @@ "private": true, "dependencies": { "@mimik/cluster": "2.4.0", - "@mimik/configuration": "4.4.4", + "@mimik/configuration": "4.4.8", "@mimik/init": "3.6.0", "@mimik/response-helper": "2.6.0", "@mimik/request-helper": "1.7.3", "@mimik/request-retry": "2.0.6", "@mimik/sumologic-winston-logger": "1.6.6", - "@mimik/swagger-helper": "2.5.0", + "@mimik/swagger-helper": "2.5.1", "@mimik/systeminfo": "2.3.8", "bluebird": "3.7.2", "connect": "3.7.0", "form-data": "4.0.0", - "fs-extra": "10.0.0", + "fs-extra": "10.0.1", "get-port": "5.1.1", "uuid": "8.3.2" }, diff --git a/src/scripts/anax.sh b/src/scripts/anax.sh index ff2926a..b641595 100755 --- a/src/scripts/anax.sh +++ b/src/scripts/anax.sh @@ -11,6 +11,7 @@ # export HOST_SHARE_PATH="${HOME}/.oh/${HZN_NODE_ID}" # export ESS_AUTH_DIR="${HOST_SHARE_PATH}/essAuth" # export ESS_SOCKET_DIR="${HOST_SHARE_PATH}/essSocket" +# export CONTAINER_LABEL=containerType=anaxNode # ### Required envs in config file # @@ -34,6 +35,7 @@ ARCH=${ARCH:-$(dpkg --print-architecture)} DOCKER_NAME=anax_${HZN_NODE_ID} ANAX_IMAGE=${ANAX_IMAGE:-openhorizon/${ARCH}_anax} ANAX_TAG=${ANAX_TAG:-2.30.0-708} +CONTAINER_LABEL=${CONTAINER_LABEL:-containerType=anaxNode} validateStart() { [[ -z "${HZN_NODE_ID}" ]] && echo "HZN_NODE_ID is required env" 1>&2 && exit 1 @@ -54,7 +56,7 @@ start() { docker run -d -t --restart always --name $DOCKER_NAME --privileged \ -p 127.0.0.1:${HORIZON_AGENT_PORT}:8510 -e DOCKER_NAME=${DOCKER_NAME} \ --e HZN_VAR_RUN_BASE=/var/tmp/horizon/${DOCKER_NAME} \ +-e HZN_VAR_RUN_BASE=/var/tmp/horizon/${DOCKER_NAME} -l ${CONTAINER_LABEL} \ -v ${DOCKER_SOCKET}:/var/run/docker.sock -v ${CONFIG_PATH}:/etc/default/horizon \ -v ${ESS_AUTH_DIR}:/var/horizon/ess-auth -v ${ESS_SOCKET_DIR}:/var/tmp/horizon/${DOCKER_NAME} \ ${ANAX_IMAGE}:${ANAX_TAG} diff --git a/src/util/anaxUtil.js b/src/util/anaxUtil.js index 58cf895..64d4309 100644 --- a/src/util/anaxUtil.js +++ b/src/util/anaxUtil.js @@ -2,10 +2,12 @@ const { nodesDir, } = require('../configuration/config'); +const anaxNodeContainerLabel = 'containerType=anaxNode'; + const scriptCommandValues = { REGISTER_ANAX: 'hzn register', UNREGISTER_ANAX: 'echo "y" | hzn unregister', - NUKE_DOCKER: 'docker rm -f $(docker ps -a -q)', + NUKE_DOCKER: `docker rm -f $(docker ps -a -q --filter label=${anaxNodeContainerLabel})`, }; const getArch = () => {