Skip to content

Commit

Permalink
Update docker compose scripts for docker compose v2
Browse files Browse the repository at this point in the history
Update docker compose scripts for docker compose v2, as legacy
docker-compose v1 is no longer supported for github actions.
  • Loading branch information
rschlussel authored and tdcmeehan committed Aug 2, 2024
1 parent d41ba1c commit 4f5c431
Show file tree
Hide file tree
Showing 44 changed files with 43 additions and 65 deletions.
2 changes: 1 addition & 1 deletion presto-docs/src/main/sphinx/clients/superset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Follow these steps to configure Superset to query Presto.
displayed, continue.

Note: If your Presto server is running locally, ``localhost`` may not resolve
DNS successfully from the Superset docker-compose launched instance to the
DNS successfully from the Superset docker compose launched instance to the
local Presto server. Replace ``<Presto-IP-address>`` with your system's actual
IP address.

Expand Down
14 changes: 7 additions & 7 deletions presto-hive-hadoop2/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function retry() {
}

function hadoop_master_container(){
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" ps -q hadoop-master
docker compose -f "${DOCKER_COMPOSE_LOCATION}" ps -q hadoop-master
}

function hadoop_master_ip() {
Expand Down Expand Up @@ -54,7 +54,7 @@ function stop_unnecessary_hadoop_services() {

function cleanup_docker_containers() {
# stop containers started with "up"
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" down
docker compose -f "${DOCKER_COMPOSE_LOCATION}" down

# docker logs processes are being terminated as soon as docker container are stopped
# wait for docker logs termination
Expand All @@ -76,7 +76,7 @@ PROJECT_ROOT="${INTEGRATION_TESTS_ROOT}/.."
DOCKER_COMPOSE_LOCATION="${INTEGRATION_TESTS_ROOT}/conf/docker-compose.yml"

# check docker and docker compose installation
docker-compose version
docker compose version
docker version

# extract proxy IP
Expand All @@ -89,21 +89,21 @@ fi

function start_docker_containers() {
# stop already running containers
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" down || true
docker compose -f "${DOCKER_COMPOSE_LOCATION}" down || true

# catch terminate signals
trap termination_handler INT TERM

# pull docker images
if [[ "${CONTINUOUS_INTEGRATION:-false}" == 'true' ]]; then
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" pull
docker compose -f "${DOCKER_COMPOSE_LOCATION}" pull
fi

# start containers
retry docker-compose -f "${DOCKER_COMPOSE_LOCATION}" up -d
retry docker compose -f "${DOCKER_COMPOSE_LOCATION}" up -d

# start docker logs for hadoop container
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" logs --no-color hadoop-master &
docker compose -f "${DOCKER_COMPOSE_LOCATION}" logs --no-color hadoop-master &

# wait until hadoop processes is started
retry check_hadoop
Expand Down
1 change: 0 additions & 1 deletion presto-hive-hadoop2/conf/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
hadoop-master:
hostname: hadoop-master
Expand Down
6 changes: 3 additions & 3 deletions presto-kudu/bin/run_kudu_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ fi

function start_docker_container() {
# stop already running containers
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" down || true
docker compose -f "${DOCKER_COMPOSE_LOCATION}" down || true

# start containers
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" up -d
docker compose -f "${DOCKER_COMPOSE_LOCATION}" up -d
}

function cleanup_docker_container() {
docker-compose -f "${DOCKER_COMPOSE_LOCATION}" down
docker compose -f "${DOCKER_COMPOSE_LOCATION}" down
}


Expand Down
1 change: 0 additions & 1 deletion presto-kudu/conf/docker-compose-single-node.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
kudu:
hostname: kudu
Expand Down
1 change: 0 additions & 1 deletion presto-kudu/conf/docker-compose-three-nodes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
kudu1:
hostname: kudu1
Expand Down
10 changes: 4 additions & 6 deletions presto-native-execution/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
# 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.
version: '3.5'

services:
ubuntu-native-dependency:
# Usage:
# docker-compose build ubuntu-native-dependency
# docker compose build ubuntu-native-dependency
# podman compose build ubuntu-native-dependency
image: presto/prestissimo-dependency:ubuntu-22.04
build:
Expand All @@ -23,7 +21,7 @@ services:

ubuntu-native-runtime:
# Usage:
# docker-compose build ubuntu-native-runtime
# docker compose build ubuntu-native-runtime
# podman compose build ubuntu-native-runtime
image: presto/prestissimo-runtime:ubuntu-22.04
build:
Expand All @@ -42,7 +40,7 @@ services:

centos-native-dependency:
# Usage:
# docker-compose build centos-native-dependency
# docker compose build centos-native-dependency
# podman compose build centos-native-dependency
image: presto/prestissimo-dependency:centos8
build:
Expand All @@ -51,7 +49,7 @@ services:

centos-native-runtime:
# Usage:
# docker-compose build centos-native-runtime
# docker compose build centos-native-runtime
# podman compose build centos-native-runtime
image: presto/prestissimo-runtime:centos8
build:
Expand Down
12 changes: 6 additions & 6 deletions presto-product-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ broken.
wget -qO- https://get.docker.com/ | sh
```
* [`docker-compose >= 1.8.1`](https://docs.docker.com/compose/install/)
* [`docker compose >= 2.3.4`](https://docs.docker.com/compose/install/)
```
pip install docker-compose
sudo apt-get install docker-compose-plugin
```
### OS X using Docker for Mac
* Install [Docker for Mac](https://docs.docker.com/docker-for-mac/)
* Install [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/)
* Add entries in `/etc/hosts` for all services running in docker containers:
`hadoop-master`, `mysql`, `postgres`, `cassandra`, `presto-master`.
Expand All @@ -55,10 +55,10 @@ and deficiencies of `extends:` syntax (see the note
[here](https://docs.docker.com/compose/extends/#extending-services)).
To ease the pain of passing multiple `-f` arguments to `docker-compose`,
To ease the pain of passing multiple `-f` arguments to `docker compose`,
each environment has a `compose.sh` wrapper script. Thanks to it, instead of e.g.
`docker-compose -f ./docker-compose.yml -f ../common/standard.yml [compose commands]`
`docker compose -f ./docker-compose.yml -f ../common/standard.yml [compose commands]`
one can simply write
Expand Down Expand Up @@ -405,7 +405,7 @@ running the debugger.
## Troubleshooting
Use the `docker-compose` (probably using a [wrapper](#use-the-docker-compose-wrappers))
Use the `docker compose` (probably using a [wrapper](#use-the-docker-compose-wrappers))
and `docker` utilities to control and troubleshoot containers.
In the following examples ``<profile>`` is [profiles](#profiles).
Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "${BASH_SOURCE%/*}/locations.sh"

# docker-compose down is not good enough because it's ignores services created with "run" command
# docker compose down is not good enough because it's ignores services created with "run" command
function stop_all_containers() {
local ENVIRONMENT
for ENVIRONMENT in $(getAvailableEnvironments)
Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/bin/run_on_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ elif [[ "$ENVIRONMENT" == "multinode-tls-kerberos" ]]; then
fi

# check docker and docker compose installation
docker-compose version
docker compose version
docker version

stop_all_containers
Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/conf/docker/common/compose-commons.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-compose has a limited understanding of relative paths and interprets them relative to
# docker compose has a limited understanding of relative paths and interprets them relative to
# compose-file location. We can't guarantee the shape of the paths coming from env variables,
# so we canonicalize them.
function export_canonical_path() {
Expand Down
1 change: 0 additions & 1 deletion presto-product-tests/conf/docker/common/standard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

java-8-base:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPT_DIRECTORY=${BASH_SOURCE%/*}

source ${SCRIPT_DIRECTORY}/../common/compose-commons.sh

docker-compose \
docker compose \
-f ${SCRIPT_DIRECTORY}/../common/standard.yml \
-f ${SCRIPT_DIRECTORY}/../common/kerberos.yml \
-f ${SCRIPT_DIRECTORY}/docker-compose.yml \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/conf/docker/multinode-tls/compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SCRIPT_DIRECTORY=${BASH_SOURCE%/*}

source "${SCRIPT_DIRECTORY}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${SCRIPT_DIRECTORY}/../common/standard.yml \
-f ${SCRIPT_DIRECTORY}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/conf/docker/multinode/compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

cassandra:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

kafka:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/../common/kerberos.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source ${BASH_SOURCE%/*}/../common/compose-commons.sh

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/../common/kerberos.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/../common/kerberos.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/../common/kerberos.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

presto-master:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

mysql:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:

postgres:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
docker compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
Loading

0 comments on commit 4f5c431

Please sign in to comment.