File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 7
7
# Export the TEST_SUITE variable, eg. 'oss' or 'xpack' defaults to 'oss'.
8
8
# Export the NUMBER_OF_NODES variable to start more than 1 node
9
9
10
- # Version 1.1 .0
10
+ # Version 1.2 .0
11
11
# - Initial version of the run-elasticsearch.sh script
12
12
# - Deleting the volume should not dependent on the container still running
13
13
# - Fixed `ES_JAVA_OPTS` config
14
14
# - Moved to STACK_VERSION and TEST_VERSION
15
15
# - Refactored into functions and imports
16
16
# - Support NUMBER_OF_NODES
17
+ # - Added 5 retries on docker pull for fixing transient network errors
17
18
18
19
script_path=$( dirname $( realpath -s $0 ) )
19
20
source $script_path /functions/imports.sh
@@ -67,6 +68,17 @@ if [[ "$TEST_SUITE" == "xpack" ]]; then
67
68
cert_validation_flags=" --insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name} :443:127.0.0.1"
68
69
fi
69
70
71
+ # Pull the container, retry on failures up to 5 times with
72
+ # short delays between each attempt. Fixes most transient network errors.
73
+ docker_pull_attempts=0
74
+ until [ " $docker_pull_attempts " -ge 5 ]
75
+ do
76
+ docker pull docker.elastic.co/elasticsearch/" $elasticsearch_container " && break
77
+ docker_pull_attempts=$(( docker_pull_attempts+ 1 ))
78
+ echo " Failed to pull image, retrying in 10 seconds (retry $docker_pull_attempts /5)..."
79
+ sleep 10
80
+ done
81
+
70
82
NUMBER_OF_NODES=${NUMBER_OF_NODES-1}
71
83
http_port=9200
72
84
for (( i= 0 ; i< $NUMBER_OF_NODES ; i++, http_port++ )) ; do
You can’t perform that action at this time.
0 commit comments