Skip to content

Commit c5e3ab5

Browse files
adoroszlaielek
authored andcommitted
HDDS-1793. Acceptance test of ozone-topology cluster is failing
Closes #1096
1 parent d21eccf commit c5e3ab5

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

hadoop-ozone/dist/src/main/compose/ozone-topology/docker-compose.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ services:
1919
datanode_1:
2020
image: apache/ozone-runner:${HADOOP_RUNNER_VERSION}
2121
privileged: true #required by the profiler
22-
container_name: datanode_1
2322
volumes:
2423
- ../..:/opt/hadoop
2524
ports:
@@ -34,7 +33,6 @@ services:
3433
datanode_2:
3534
image: apache/ozone-runner:${HADOOP_RUNNER_VERSION}
3635
privileged: true #required by the profiler
37-
container_name: datanode_2
3836
volumes:
3937
- ../..:/opt/hadoop
4038
ports:
@@ -49,7 +47,6 @@ services:
4947
datanode_3:
5048
image: apache/ozone-runner:${HADOOP_RUNNER_VERSION}
5149
privileged: true #required by the profiler
52-
container_name: datanode_3
5350
volumes:
5451
- ../..:/opt/hadoop
5552
ports:
@@ -64,7 +61,6 @@ services:
6461
datanode_4:
6562
image: apache/ozone-runner:${HADOOP_RUNNER_VERSION}
6663
privileged: true #required by the profiler
67-
container_name: datanode_4
6864
volumes:
6965
- ../..:/opt/hadoop
7066
ports:
@@ -79,7 +75,6 @@ services:
7975
om:
8076
image: apache/ozone-runner:${HADOOP_RUNNER_VERSION}
8177
privileged: true #required by the profiler
82-
container_name: om
8378
volumes:
8479
- ../..:/opt/hadoop
8580
ports:
@@ -95,7 +90,6 @@ services:
9590
scm:
9691
image: apache/ozone-runner:${HADOOP_RUNNER_VERSION}
9792
privileged: true #required by the profiler
98-
container_name: scm
9993
volumes:
10094
- ../..:/opt/hadoop
10195
ports:

hadoop-ozone/dist/src/main/compose/ozone-topology/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export COMPOSE_DIR
2121
# shellcheck source=/dev/null
2222
source "$COMPOSE_DIR/../testlib.sh"
2323

24-
start_docker_env
24+
start_docker_env 4
2525

2626
#Due to the limitation of the current auditparser test, it should be the
2727
#first test in a clean cluster.

hadoop-ozone/dist/src/main/compose/testlib.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ mkdir -p "$RESULT_DIR"
2828
#Should be writeable from the docker containers where user is different.
2929
chmod ogu+w "$RESULT_DIR"
3030

31-
## @description wait until 3 datanodes are up (or 30 seconds)
31+
## @description wait until datanodes are up (or 30 seconds)
3232
## @param the docker-compose file
33+
## @param number of datanodes to wait for (default: 3)
3334
wait_for_datanodes(){
35+
local compose_file=$1
36+
local -i datanode_count=${2:-3}
3437

3538
#Reset the timer
3639
SECONDS=0
@@ -40,30 +43,33 @@ wait_for_datanodes(){
4043

4144
#This line checks the number of HEALTHY datanodes registered in scm over the
4245
# jmx HTTP servlet
43-
datanodes=$(docker-compose -f "$1" exec -T scm curl -s 'http://localhost:9876/jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo' | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value')
44-
if [[ "$datanodes" == "3" ]]; then
46+
datanodes=$(docker-compose -f "${compose_file}" exec -T scm curl -s 'http://localhost:9876/jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo' | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value')
47+
if [[ "$datanodes" ]]; then
48+
if [[ ${datanodes} -ge ${datanode_count} ]]; then
4549

46-
#It's up and running. Let's return from the function.
50+
#It's up and running. Let's return from the function.
4751
echo "$datanodes datanodes are up and registered to the scm"
4852
return
49-
else
53+
else
5054

51-
#Print it only if a number. Could be not a number if scm is not yet started
52-
if [[ "$datanodes" ]]; then
53-
echo "$datanodes datanode is up and healthy (until now)"
55+
#Print it only if a number. Could be not a number if scm is not yet started
56+
echo "$datanodes datanode is up and healthy (until now)"
5457
fi
55-
fi
58+
fi
5659

5760
sleep 2
5861
done
5962
echo "WARNING! Datanodes are not started successfully. Please check the docker-compose files"
6063
}
6164

6265
## @description Starts a docker-compose based test environment
66+
## @param number of datanodes to start and wait for (default: 3)
6367
start_docker_env(){
68+
local -i datanode_count=${1:-3}
69+
6470
docker-compose -f "$COMPOSE_FILE" down
65-
docker-compose -f "$COMPOSE_FILE" up -d --scale datanode=3
66-
wait_for_datanodes "$COMPOSE_FILE"
71+
docker-compose -f "$COMPOSE_FILE" up -d --scale datanode="${datanode_count}"
72+
wait_for_datanodes "$COMPOSE_FILE" "${datanode_count}"
6773
sleep 10
6874
}
6975

0 commit comments

Comments
 (0)