Skip to content

Commit

Permalink
[FLINK-35974][e2e] Use docker compose v2 for E2E tests
Browse files Browse the repository at this point in the history
GitHub CI image dropped support of Docker Compose v1 (with syntax `docker-compose`). The new v2 version (`docker compose`) should be used for E2E scripts
  • Loading branch information
PatrickRen committed Aug 6, 2024
1 parent 18c8fa2 commit 7a7a257
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
1 change: 0 additions & 1 deletion flink-end-to-end-tests/test-scripts/common_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ set -o pipefail
source "$(dirname "$0")"/common.sh

docker --version
docker-compose --version

function containers_health_check() {
local container_names=${@:1}
Expand Down
6 changes: 3 additions & 3 deletions flink-end-to-end-tests/test-scripts/common_yarn_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ function cluster_shutdown {
if [ ${TRAPPED_EXIT_CODE} != 0 ];then
debug_copy_and_show_logs
fi
docker-compose -f "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/docker-compose.yml" down
docker compose -f "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/docker-compose.yml" down
rm "${FLINK_TARBALL_DIR}/${FLINK_TARBALL}"
}
on_exit cluster_shutdown

function start_hadoop_cluster() {
echo "Starting Hadoop cluster"
docker-compose -f "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/docker-compose.yml" up -d
docker compose -f "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/docker-compose.yml" up -d

# Wait for kerberos to be set up
local start_time
Expand Down Expand Up @@ -103,7 +103,7 @@ function build_image() {
ln "${cache_path}" "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/hadoop/hadoop.tar.gz"

echo "Building Hadoop Docker container"
docker-compose -f "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/docker-compose.yml" build
docker compose -f "${END_TO_END_DIR}/test-scripts/docker-hadoop-secure-cluster/docker-compose.yml" build
}

function start_hadoop_cluster_and_prepare_flink() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Run image
```
cd flink-end-to-end-tests/test-scripts/docker-hadoop-secure-cluster
wget -O hadoop/hadoop.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-2.10.2/hadoop-2.10.2.tar.gz
docker-compose build
docker-compose up
docker compose build
docker compose up
```

Usage
Expand Down Expand Up @@ -56,15 +56,15 @@ Known issues
### Unable to obtain Kerberos password

#### Error
docker-compose up fails for the first time with the error
docker compose up fails for the first time with the error

```
Login failure for nn/[email protected] from keytab /etc/security/keytabs/nn.service.keytab: javax.security.auth.login.LoginException: Unable to obtain password from user
```

#### Solution

Stop the containers with `docker-compose down` and start again with `docker-compose up -d`.
Stop the containers with `docker compose down` and start again with `docker compose up -d`.

### Java Keystore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ if ! retry_times $DOCKER_IMAGE_BUILD_RETRIES ${BUILD_BACKOFF_TIME} "build_image
fi

export USER_LIB=${FLINK_DIR}/examples/batch
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml up --force-recreate --abort-on-container-exit --exit-code-from job-cluster &> /dev/null
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml logs job-cluster > $FLINK_LOG_DIR/jobmanager.log
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml logs taskmanager > $FLINK_LOG_DIR/taskmanager.log
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml rm -f
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml up --force-recreate --abort-on-container-exit --exit-code-from job-cluster &> /dev/null
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml logs job-cluster > $FLINK_LOG_DIR/jobmanager.log
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml logs taskmanager > $FLINK_LOG_DIR/taskmanager.log
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.test.yml rm -f

check_result_hash "WordCount" $OUTPUT_VOLUME/docker_wc_out "${RESULT_HASH}"
10 changes: 5 additions & 5 deletions flink-end-to-end-tests/test-scripts/test_nat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ fi
popd

export USER_LIB=${FLINK_DIR}/examples/batch
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml up --force-recreate --abort-on-container-exit --exit-code-from job-cluster &> /dev/null
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml logs job-cluster > $FLINK_LOG_DIR/jobmanager.log
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml logs taskmanager1 > $FLINK_LOG_DIR/taskmanager1.log
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml logs taskmanager2 > $FLINK_LOG_DIR/taskmanager2.log
docker-compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml rm -f
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml up --force-recreate --abort-on-container-exit --exit-code-from job-cluster &> /dev/null
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml logs job-cluster > $FLINK_LOG_DIR/jobmanager.log
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml logs taskmanager1 > $FLINK_LOG_DIR/taskmanager1.log
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml logs taskmanager2 > $FLINK_LOG_DIR/taskmanager2.log
docker compose -f ${DOCKER_SCRIPTS}/docker-compose.nat.yml rm -f

check_result_hash "WordCount" ${OUTPUT_VOLUME}/${OUTPUT_PREFIX}/ "${RESULT_HASH}"

0 comments on commit 7a7a257

Please sign in to comment.