From d42df1d5b5d8e79ba988d5b7f80092ac943530ca Mon Sep 17 00:00:00 2001 From: Andrew Shvayka Date: Fri, 6 Jul 2018 15:45:49 +0300 Subject: [PATCH 1/5] Automatic message routing during tellNext based on originator ID --- .../server/actors/app/AppActor.java | 1 + .../RemoteToRuleChainTellNextMsg.java | 45 +++++++++++++++++++ .../actors/ruleChain/RuleChainActor.java | 1 + .../RuleChainActorMessageProcessor.java | 30 +++++++++++-- .../ruleChain/RuleChainToRuleChainMsg.java | 8 +++- .../RuleNodeToRuleChainTellNextMsg.java | 2 +- .../server/actors/tenant/TenantActor.java | 8 ++-- .../server/common/msg/MsgType.java | 11 ++++- .../common/msg/aware/RuleChainAwareMsg.java | 24 ++++++++++ 9 files changed, 120 insertions(+), 10 deletions(-) create mode 100644 application/src/main/java/org/thingsboard/server/actors/ruleChain/RemoteToRuleChainTellNextMsg.java create mode 100644 common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleChainAwareMsg.java diff --git a/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java b/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java index d453e594ba..8e7a9ae7e1 100644 --- a/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java +++ b/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java @@ -111,6 +111,7 @@ public class AppActor extends RuleChainManagerActor { case DEVICE_NAME_OR_TYPE_UPDATE_TO_DEVICE_ACTOR_MSG: case DEVICE_RPC_REQUEST_TO_DEVICE_ACTOR_MSG: case SERVER_RPC_RESPONSE_TO_DEVICE_ACTOR_MSG: + case REMOTE_TO_RULE_CHAIN_TELL_NEXT_MSG: onToDeviceActorMsg((TenantAwareMsg) msg); break; case ACTOR_SYSTEM_TO_DEVICE_SESSION_ACTOR_MSG: diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RemoteToRuleChainTellNextMsg.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RemoteToRuleChainTellNextMsg.java new file mode 100644 index 0000000000..5c1769a242 --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RemoteToRuleChainTellNextMsg.java @@ -0,0 +1,45 @@ +/** + * Copyright © 2016-2018 The Thingsboard Authors + * + * 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. + */ +package org.thingsboard.server.actors.ruleChain; + +import lombok.Data; +import org.thingsboard.server.common.data.id.RuleChainId; +import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.common.msg.MsgType; +import org.thingsboard.server.common.msg.aware.RuleChainAwareMsg; +import org.thingsboard.server.common.msg.aware.TenantAwareMsg; + +/** + * Created by ashvayka on 19.03.18. + */ +@Data +final class RemoteToRuleChainTellNextMsg extends RuleNodeToRuleChainTellNextMsg implements TenantAwareMsg, RuleChainAwareMsg { + + private final TenantId tenantId; + private final RuleChainId ruleChainId; + + public RemoteToRuleChainTellNextMsg(RuleNodeToRuleChainTellNextMsg original, TenantId tenantId, RuleChainId ruleChainId) { + super(original.getOriginator(), original.getRelationTypes(), original.getMsg()); + this.tenantId = tenantId; + this.ruleChainId = ruleChainId; + } + + @Override + public MsgType getMsgType() { + return MsgType.REMOTE_TO_RULE_CHAIN_TELL_NEXT_MSG; + } + +} diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActor.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActor.java index 3ba646aaf8..c1a55fbdad 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActor.java +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActor.java @@ -49,6 +49,7 @@ public class RuleChainActor extends ComponentActor relations = nodeRoutes.get(originator).stream() - .filter(r -> contains(envelope.getRelationTypes(), r.getType())) - .collect(Collectors.toList()); + TbMsg msg = envelope.getMsg(); + EntityId originatorEntityId = msg.getOriginator(); + Optional address = systemContext.getRoutingService().resolveById(originatorEntityId); + + if (address.isPresent()) { + onRemoteTellNext(address.get(), envelope); + } else { + onLocalTellNext(envelope); + } + } + private void onRemoteTellNext(ServerAddress serverAddress, RuleNodeToRuleChainTellNextMsg envelope) { TbMsg msg = envelope.getMsg(); + logger.debug("Forwarding [{}] msg to remote server [{}] due to changed originator id: [{}]", msg.getId(), serverAddress, msg.getOriginator()); + envelope = new RemoteToRuleChainTellNextMsg(envelope, tenantId, entityId); + systemContext.getRpcService().tell(systemContext.getEncodingService().convertToProtoDataMessage(serverAddress, envelope)); + } + + private void onLocalTellNext(RuleNodeToRuleChainTellNextMsg envelope) { + TbMsg msg = envelope.getMsg(); + RuleNodeId originatorNodeId = envelope.getOriginator(); + List relations = nodeRoutes.get(originatorNodeId).stream() + .filter(r -> contains(envelope.getRelationTypes(), r.getType())) + .collect(Collectors.toList()); int relationsCount = relations.size(); EntityId ackId = msg.getRuleNodeId() != null ? msg.getRuleNodeId() : msg.getRuleChainId(); if (relationsCount == 0) { diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainToRuleChainMsg.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainToRuleChainMsg.java index 8b13747fb6..ae4ae4521d 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainToRuleChainMsg.java +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainToRuleChainMsg.java @@ -20,12 +20,13 @@ import org.thingsboard.server.common.data.id.RuleChainId; import org.thingsboard.server.common.msg.MsgType; import org.thingsboard.server.common.msg.TbActorMsg; import org.thingsboard.server.common.msg.TbMsg; +import org.thingsboard.server.common.msg.aware.RuleChainAwareMsg; /** * Created by ashvayka on 19.03.18. */ @Data -public final class RuleChainToRuleChainMsg implements TbActorMsg { +public final class RuleChainToRuleChainMsg implements TbActorMsg, RuleChainAwareMsg { private final RuleChainId target; private final RuleChainId source; @@ -33,6 +34,11 @@ public final class RuleChainToRuleChainMsg implements TbActorMsg { private final String fromRelationType; private final boolean enqueue; + @Override + public RuleChainId getRuleChainId() { + return target; + } + @Override public MsgType getMsgType() { return MsgType.RULE_CHAIN_TO_RULE_CHAIN_MSG; diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeToRuleChainTellNextMsg.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeToRuleChainTellNextMsg.java index c0a475c953..9414892a98 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeToRuleChainTellNextMsg.java +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeToRuleChainTellNextMsg.java @@ -27,7 +27,7 @@ import java.util.Set; * Created by ashvayka on 19.03.18. */ @Data -final class RuleNodeToRuleChainTellNextMsg implements TbActorMsg { +class RuleNodeToRuleChainTellNextMsg implements TbActorMsg { private final RuleNodeId originator; private final Set relationTypes; diff --git a/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java b/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java index dc48e881cd..b4ab0d2cb2 100644 --- a/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java +++ b/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java @@ -35,6 +35,7 @@ import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.msg.TbActorMsg; import org.thingsboard.server.common.msg.aware.DeviceAwareMsg; +import org.thingsboard.server.common.msg.aware.RuleChainAwareMsg; import org.thingsboard.server.common.msg.plugin.ComponentLifecycleMsg; import org.thingsboard.server.common.msg.system.ServiceToRuleEngineMsg; import scala.concurrent.duration.Duration; @@ -94,7 +95,8 @@ public class TenantActor extends RuleChainManagerActor { onToDeviceActorMsg((DeviceAwareMsg) msg); break; case RULE_CHAIN_TO_RULE_CHAIN_MSG: - onRuleChainMsg((RuleChainToRuleChainMsg) msg); + case REMOTE_TO_RULE_CHAIN_TELL_NEXT_MSG: + onRuleChainMsg((RuleChainAwareMsg) msg); break; default: return false; @@ -120,8 +122,8 @@ public class TenantActor extends RuleChainManagerActor { else logger.info("[{}] No Root Chain", msg); } - private void onRuleChainMsg(RuleChainToRuleChainMsg msg) { - ruleChainManager.getOrCreateActor(context(), msg.getTarget()).tell(msg, self()); + private void onRuleChainMsg(RuleChainAwareMsg msg) { + ruleChainManager.getOrCreateActor(context(), msg.getRuleChainId()).tell(msg, self()); } diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/MsgType.java b/common/message/src/main/java/org/thingsboard/server/common/msg/MsgType.java index 7702788704..c8b5c4ee8d 100644 --- a/common/message/src/main/java/org/thingsboard/server/common/msg/MsgType.java +++ b/common/message/src/main/java/org/thingsboard/server/common/msg/MsgType.java @@ -62,6 +62,11 @@ public enum MsgType { */ RULE_TO_RULE_CHAIN_TELL_NEXT_MSG, + /** + * Message forwarded from original rule chain to remote rule chain due to change in the cluster structure or originator entity of the TbMsg. + */ + REMOTE_TO_RULE_CHAIN_TELL_NEXT_MSG, + /** * Message that is sent by RuleActor implementation to RuleActor itself to log the error. */ @@ -101,6 +106,10 @@ public enum MsgType { /** * Message that is sent from Rule Engine to the Device Actor when message is successfully pushed to queue. */ - RULE_ENGINE_QUEUE_PUT_ACK_MSG, ACTOR_SYSTEM_TO_DEVICE_SESSION_ACTOR_MSG, TRANSPORT_TO_DEVICE_SESSION_ACTOR_MSG, SESSION_TIMEOUT_MSG, SESSION_CTRL_MSG; + RULE_ENGINE_QUEUE_PUT_ACK_MSG, + ACTOR_SYSTEM_TO_DEVICE_SESSION_ACTOR_MSG, + TRANSPORT_TO_DEVICE_SESSION_ACTOR_MSG, + SESSION_TIMEOUT_MSG, + SESSION_CTRL_MSG; } diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleChainAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleChainAwareMsg.java new file mode 100644 index 0000000000..e261cbb771 --- /dev/null +++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleChainAwareMsg.java @@ -0,0 +1,24 @@ +/** + * Copyright © 2016-2018 The Thingsboard Authors + * + * 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. + */ +package org.thingsboard.server.common.msg.aware; + +import org.thingsboard.server.common.data.id.RuleChainId; + +public interface RuleChainAwareMsg { + + RuleChainId getRuleChainId(); + +} From 595174709561e4786d663c03d3ea41885163cc2d Mon Sep 17 00:00:00 2001 From: Jan Bols Date: Fri, 6 Jul 2018 17:19:33 +0200 Subject: [PATCH 2/5] When firing an RpcBroadcastMsg message or a ToAllNodesMsg from one node, the other nodes never get notified because the messages doesn't have a serverAddress. As a result firing such a method is not forwarded to the other cluster nodes. This PR adds the serverAddress for each node that the message is sent to so the other nodes get the message and can react to component lifecycle changes. --- .../server/actors/rpc/RpcManagerActor.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java index 3f3f70b424..2034d6fbd3 100644 --- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java +++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -29,11 +29,7 @@ import org.thingsboard.server.common.msg.cluster.ServerAddress; import org.thingsboard.server.gen.cluster.ClusterAPIProtos; import org.thingsboard.server.service.cluster.discovery.ServerInstance; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; -import java.util.Queue; -import java.util.UUID; +import java.util.*; /** * @author Andrew Shvayka @@ -88,7 +84,17 @@ public class RpcManagerActor extends ContextAwareActor { private void onMsg(RpcBroadcastMsg msg) { log.debug("Forwarding msg to session actors {}", msg); - sessionActors.keySet().forEach(address -> onMsg(msg.getMsg())); + sessionActors.keySet().forEach(address -> { + ClusterAPIProtos.ClusterMessage msgWithServerAddress = msg.getMsg() + .toBuilder() + .setServerAddress(ClusterAPIProtos.ServerAddress + .newBuilder() + .setHost(address.getHost()) + .setPort(address.getPort()) + .build()) + .build(); + onMsg(msgWithServerAddress); + }); pendingMsgs.values().forEach(queue -> queue.add(msg.getMsg())); } From 5f258b95d92a5049f2b20354761982aed0aff94a Mon Sep 17 00:00:00 2001 From: Jan Bols Date: Fri, 6 Jul 2018 22:37:04 +0200 Subject: [PATCH 3/5] Keep exact header. --- .../java/org/thingsboard/server/actors/rpc/RpcManagerActor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java index 2034d6fbd3..9e38c17aff 100644 --- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java +++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java @@ -5,7 +5,7 @@ * 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 + * 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, From 52ffd5345cae984c8f91de1c94ed10ffa9da415e Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 12 Jul 2018 12:51:42 +0300 Subject: [PATCH 4/5] Refactoring of Generator Node --- .../RuleChainActorMessageProcessor.java | 8 ++++-- .../rule/engine/debug/TbMsgGeneratorNode.java | 27 ++++++++++++++----- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActorMessageProcessor.java index cae377cc2d..fe02335223 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActorMessageProcessor.java +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleChainActorMessageProcessor.java @@ -248,7 +248,9 @@ public class RuleChainActorMessageProcessor extends ComponentMsgProcessor {ctx.tellNext(m, SUCCESS); sentTickMsg(ctx);}, - t -> {ctx.tellFailure(msg, t); sentTickMsg(ctx);}); + m -> { + ctx.tellNext(m, SUCCESS); + scheduleTickMsg(ctx); + }, + t -> { + ctx.tellFailure(msg, t); + scheduleTickMsg(ctx); + }); } } - private void sentTickMsg(TbContext ctx) { + private void scheduleTickMsg(TbContext ctx) { + long curTs = System.currentTimeMillis(); + if (lastScheduledTs == 0L) { + lastScheduledTs = curTs; + } + lastScheduledTs = lastScheduledTs + delay; + long curDelay = Math.max(0L, (lastScheduledTs - curTs)); TbMsg tickMsg = ctx.newMsg(TB_MSG_GENERATOR_NODE_MSG, ctx.getSelfId(), new TbMsgMetaData(), ""); nextTickId = tickMsg.getId(); - ctx.tellSelf(tickMsg, delay); + ctx.tellSelf(tickMsg, curDelay); } private ListenableFuture generate(TbContext ctx) { return ctx.getJsExecutor().executeAsync(() -> { if (prevMsg == null) { - prevMsg = ctx.newMsg( "", originatorId, new TbMsgMetaData(), "{}"); + prevMsg = ctx.newMsg("", originatorId, new TbMsgMetaData(), "{}"); } TbMsg generated = jsEngine.executeGenerate(prevMsg); prevMsg = ctx.newMsg(generated.getType(), originatorId, generated.getMetaData(), generated.getData()); From ed7623af2c968484cbc27b2413cc0db6578f9276 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Fri, 13 Jul 2018 18:19:58 +0300 Subject: [PATCH 5/5] Added cassandra upgrade docker image and kubernetes yaml file --- docker/cassandra-upgrade/Dockerfile | 24 ++++++++++++++++ docker/cassandra-upgrade/Makefile | 12 ++++++++ docker/cassandra-upgrade/upgrade.sh | 28 +++++++++++++++++++ docker/k8s/cassandra-upgrade.yaml | 43 +++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 docker/cassandra-upgrade/Dockerfile create mode 100644 docker/cassandra-upgrade/Makefile create mode 100755 docker/cassandra-upgrade/upgrade.sh create mode 100644 docker/k8s/cassandra-upgrade.yaml diff --git a/docker/cassandra-upgrade/Dockerfile b/docker/cassandra-upgrade/Dockerfile new file mode 100644 index 0000000000..312db0d4e3 --- /dev/null +++ b/docker/cassandra-upgrade/Dockerfile @@ -0,0 +1,24 @@ +# +# Copyright © 2016-2018 The Thingsboard Authors +# +# 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. +# + +FROM openjdk:8-jre + +ADD upgrade.sh /upgrade.sh +ADD thingsboard.deb /thingsboard.deb + +RUN apt-get update \ + && apt-get install -y nmap \ + && chmod +x /upgrade.sh diff --git a/docker/cassandra-upgrade/Makefile b/docker/cassandra-upgrade/Makefile new file mode 100644 index 0000000000..f4c6825fc3 --- /dev/null +++ b/docker/cassandra-upgrade/Makefile @@ -0,0 +1,12 @@ +VERSION=2.0.3 +PROJECT=thingsboard +APP=cassandra-upgrade + +build: + cp ../../application/target/thingsboard.deb . + docker build --pull -t ${PROJECT}/${APP}:${VERSION} -t ${PROJECT}/${APP}:latest . + rm thingsboard.deb + +push: build + docker push ${PROJECT}/${APP}:${VERSION} + docker push ${PROJECT}/${APP}:latest diff --git a/docker/cassandra-upgrade/upgrade.sh b/docker/cassandra-upgrade/upgrade.sh new file mode 100755 index 0000000000..dac49191b2 --- /dev/null +++ b/docker/cassandra-upgrade/upgrade.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright © 2016-2018 The Thingsboard Authors +# +# 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. +# + + +dpkg -i /thingsboard.deb + +until nmap $CASSANDRA_HOST -p $CASSANDRA_PORT | grep "$CASSANDRA_PORT/tcp open" +do + echo "Wait for cassandra db to start..." + sleep 10 +done + +echo "Upgrading 'Thingsboard' schema..." +/usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=$UPGRADE_FROM_VERSION diff --git a/docker/k8s/cassandra-upgrade.yaml b/docker/k8s/cassandra-upgrade.yaml new file mode 100644 index 0000000000..881c5b8e51 --- /dev/null +++ b/docker/k8s/cassandra-upgrade.yaml @@ -0,0 +1,43 @@ +# +# Copyright © 2016-2018 The Thingsboard Authors +# +# 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. +# + +apiVersion: v1 +kind: Pod +metadata: + name: cassandra-upgrade +spec: + containers: + - name: cassandra-upgrade + imagePullPolicy: Always + image: thingsboard/cassandra-upgrade:2.0.3 + env: + - name: ADD_DEMO_DATA + value: "true" + - name : CASSANDRA_HOST + value: "cassandra-headless" + - name : CASSANDRA_PORT + value: "9042" + - name : DATABASE_TYPE + value: "cassandra" + - name : CASSANDRA_URL + value: "cassandra-headless:9042" + - name : UPGRADE_FROM_VERSION + value: "1.4.0" + command: + - sh + - -c + - /upgrade.sh + restartPolicy: Never