aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/heat/onap-oom/k8s_vm_entrypoint.sh
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-10-16 11:01:07 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-10-16 11:36:40 -0700
commitb0e3650bd4717fe97a5fcd2e8fa8575bc0aa2e23 (patch)
tree1d78cb6eed5b66919d59810e422ca3d4f55e66e2 /deployment/heat/onap-oom/k8s_vm_entrypoint.sh
parentce82c4ce6aaeb5cb8ea931ee9ad7e0ba47c3efe8 (diff)
Add retries to handle intermittent network issues
Change-Id: I1fbdbd27b9b480dfafed87b12cdad23e4f3626f6 Issue-ID: INT-586 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'deployment/heat/onap-oom/k8s_vm_entrypoint.sh')
-rw-r--r--deployment/heat/onap-oom/k8s_vm_entrypoint.sh27
1 files changed, 16 insertions, 11 deletions
diff --git a/deployment/heat/onap-oom/k8s_vm_entrypoint.sh b/deployment/heat/onap-oom/k8s_vm_entrypoint.sh
index 54a674125..52f120498 100644
--- a/deployment/heat/onap-oom/k8s_vm_entrypoint.sh
+++ b/deployment/heat/onap-oom/k8s_vm_entrypoint.sh
@@ -32,29 +32,34 @@ Acquire::http { Proxy "http://__apt_proxy__"; };
Acquire::https::Proxy "DIRECT";
EOF
fi
-apt-get -y update
mkdir -p /dockerdata-nfs
echo "__rancher_private_ip_addr__:/dockerdata-nfs /dockerdata-nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" | tee -a /etc/fstab
-apt-get -y install linux-image-extra-$(uname -r) jq nfs-common
-
-cd ~
-
-# install docker 17.03
-curl -s https://releases.rancher.com/install-docker/__docker_version__.sh | sh
-usermod -aG docker ubuntu
-
# Fix virtual memory allocation for onap-log:elasticsearch:
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
sysctl -p
-sleep 100
+
+while ! hash jq &> /dev/null; do
+ apt-get -y update
+ apt-get -y install linux-image-extra-$(uname -r) jq nfs-common
+ sleep 10
+done
+
+# install docker 17.03
+while ! hash docker &> /dev/null; do
+ curl -s https://releases.rancher.com/install-docker/__docker_version__.sh | sh
+ usermod -aG docker ubuntu
+ sleep 10
+done
while [ ! -e /dockerdata-nfs/rancher_agent_cmd.sh ]; do
mount /dockerdata-nfs
- sleep 5
+ sleep 10
done
+
+cd ~
cp /dockerdata-nfs/rancher_agent_cmd.sh .
sed -i "s/docker run/docker run -e CATTLE_AGENT_IP=${HOST_IP}/g" rancher_agent_cmd.sh
source rancher_agent_cmd.sh