Skip to content

Commit

Permalink
[build][docs]: update docker-compose to docker compose
Browse files Browse the repository at this point in the history
Following: https://github.blog/changelog/2024-04-10-github-hosted-runner-images-deprecation-notice-docker-compose-v1/ - Docker Compose v1 has been deprecated

Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Apr 11, 2024
1 parent 12eb550 commit 436bd77
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ body:
description: |
What command do you use to start Selenium Grid with Docker (or Kubernetes)?
placeholder: |
Please share the script or docker-compose file used. This will be automatically
Please share the script or docker compose file used. This will be automatically
formatted into code, so no need for backticks.
If Kubernetes used, please share the YAML file, or chart values used to deploy the cluster.
Be sure to include an SSCCE (Short, Self Contained, Correct
Expand Down Expand Up @@ -64,6 +64,6 @@ body:
attributes:
label: Selenium Grid chart version (chart version)
description: What version of Selenium Grid chart are you using?
placeholder: 0.26.2?
placeholder: 0.29.1?
validations:
required: false
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ test_parallel: hub chrome firefox edge
echo NODE=$$node >> .env ; \
echo UID=$$(id -u) >> .env ; \
echo BINDING_VERSION=$(BINDING_VERSION) >> .env ; \
docker-compose -f docker-compose-v3-test-parallel.yml up --no-log-prefix --exit-code-from tests --build ; \
docker compose -f docker-compose-v3-test-parallel.yml up --no-log-prefix --exit-code-from tests --build ; \
done

# This should run on its own CI job. There is no need to combine it with the other tests.
# Its main purpose is to check that a video file was generated.
test_video: video hub chrome firefox edge
# Running a few tests with docker-compose to generate the videos
# Running a few tests with docker compose to generate the videos
rm -rf ./tests/videos; mkdir -p ./tests/videos
for node in NodeChrome NodeFirefox NodeEdge ; do \
cd ./tests || true ; \
Expand All @@ -425,7 +425,7 @@ test_video: video hub chrome firefox edge
echo BROWSER=firefox >> .env ; \
echo VIDEO_FILE_NAME=firefox_video.mp4 >> .env ; \
fi ; \
docker-compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build ; \
docker compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build ; \
done
# Using ffmpeg to verify file integrity
# https://superuser.com/questions/100288/how-can-i-check-the-integrity-of-a-video-file-avi-mpeg-mp4
Expand All @@ -435,6 +435,7 @@ test_video: video hub chrome firefox edge

test_node_docker: hub standalone_docker standalone_chrome standalone_firefox standalone_edge video
rm -rf ./tests/videos; mkdir -p ./tests/videos
sudo chmod 777 ./tests/videos
for node in DeploymentAutoscaling JobAutoscaling ; do \
cd tests || true ; \
echo NAMESPACE=$(NAME) > .env ; \
Expand All @@ -449,7 +450,7 @@ test_node_docker: hub standalone_docker standalone_chrome standalone_firefox sta
echo BINDING_VERSION=$(BINDING_VERSION) >> .env ; \
export $$(cat .env | xargs) ; \
envsubst < config.toml > ./videos/config.toml ; \
docker-compose -f docker-compose-v3-test-node-docker.yaml up --no-log-prefix --exit-code-from tests --build ; \
docker compose -f docker-compose-v3-test-node-docker.yaml up --no-log-prefix --exit-code-from tests --build ; \
if [ $$? -ne 0 ]; then exit 1; fi ; \
done

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ $ docker run --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalon

**docker-compose-v3-beta-channel.yml:**
```bash
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-beta-channel.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-beta-channel.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-beta-channel.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-beta-channel.yml down`
version: "3"
services:
chrome:
Expand Down Expand Up @@ -229,9 +229,9 @@ services:

**docker-compose-v3-dev-channel.yml:**
```bash
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-dev-channel.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-dev-channel.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-dev-channel.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-dev-channel.yml down`
version: "3"
services:
chrome:
Expand Down Expand Up @@ -484,7 +484,7 @@ linked resources below, save them locally and check the execution instructions o
##### Version 3
[`docker-compose-v3.yml`](docker-compose-v3.yml)

To stop the Grid and cleanup the created containers, run `docker-compose down`.
To stop the Grid and cleanup the created containers, run `docker compose down`.

##### Version 3 with Swarm support
[`docker-compose-v3-swarm.yml`](docker-compose-v3-swarm.yml)
Expand All @@ -494,7 +494,7 @@ ___
### Fully distributed mode - Router, Queue, Distributor, EventBus, SessionMap and Nodes

It is possible to start a Selenium Grid with all its components apart. For simplicity, only an
example with docker-compose will be provided. Save the file locally, and check the execution
example with docker compose will be provided. Save the file locally, and check the execution
instructions on top of it.

[`docker-compose-v3-full-grid.yml`](docker-compose-v3-full-grid.yml)
Expand All @@ -515,7 +515,7 @@ Docker image. One container is needed per each container where a browser is runn
running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1.

Currently, the only way to do this mapping is manually (either starting the containers manually or through
`docker-compose`). We are iterating on this process and probably this setup will be more simple in the future.
`docker compose`). We are iterating on this process and probably this setup will be more simple in the future.

The video Docker image we provide is based on the ffmpeg Ubuntu image provided by the
[jrottenberg/ffmpeg](https://github.com/jrottenberg/ffmpeg) project, thank you for providing this image and
Expand Down Expand Up @@ -1345,7 +1345,7 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \
selenium/node-firefox:4.19.1-20240402
```

You can also refer to the below docker-compose yaml files to be able to start a simple grid (or) a dynamic grid.
You can also refer to the below docker compose yaml files to be able to start a simple grid (or) a dynamic grid.

* Simple Grid [v3 yaml file](docker-compose-v3-tracing.yml)
* Simple Grid [v2 yaml file](docker-compose-v2-tracing.yml)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v2-tracing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v2-tracing.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v2-tracing.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v2-tracing.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v2-tracing.yml down`
version: '2'
services:
jaeger:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v2.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v2.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v2.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v2.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v2.yml down`
version: '2'
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-basicauth.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-basicauth.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-basicauth.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-basicauth.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-basicauth.yml down`
version: "3"
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-beta-channel.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-beta-channel.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-beta-channel.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-beta-channel.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-beta-channel.yml down`
version: "3"
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-dev-channel.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-dev-channel.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-dev-channel.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-dev-channel.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-dev-channel.yml down`
version: "3"
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-dev.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-dev.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-dev.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-dev.yml down`
version: "3"
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-dynamic-grid.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-dynamic-grid.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-dynamic-grid.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-dynamic-grid.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-dynamic-grid.yml down`
version: "3"
services:
node-docker:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-full-grid-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-full-grid-dev.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-full-grid-dev.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-full-grid-dev.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-full-grid-dev.yml down`
version: "3"
services:
selenium-event-bus:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-full-grid-tracing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-full-grid-tracing.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-full-grid-tracing.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-full-grid-tracing.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-full-grid-tracing.yml down`
version: "3"
services:
jaeger:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose-v3-full-grid.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-full-grid.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-full-grid.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-full-grid.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-full-grid.yml down`
version: "3"
services:
selenium-event-bus:
Expand Down Expand Up @@ -92,4 +92,4 @@ services:
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
4 changes: 2 additions & 2 deletions docker-compose-v3-tracing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-tracing.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-tracing.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-tracing.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-tracing.yml down`
version: "3"
services:
jaeger:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-video-upload.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-video-upload.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-video-upload.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-video-upload.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-video-upload.yml down`
# ${variable_pattern} get value from .env in the same directory
version: "3"
services:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3-video.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-video.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-video.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-video.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-video.yml down`
version: "3"
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-v3.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3.yml up`
# To execute this docker compose yml file use `docker compose -f docker-compose-v3.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3.yml down`
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3.yml down`
version: "3"
services:
chrome:
Expand Down
2 changes: 2 additions & 0 deletions tests/docker-compose-v3-test-node-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "3"
services:
node-docker:
image: ${NAMESPACE}/node-docker:${TAG}
user: root
volumes:
- ./videos:/opt/selenium/assets
- ./videos/config.toml:/opt/bin/config.toml
Expand All @@ -17,6 +18,7 @@ services:

selenium-hub:
image: ${NAMESPACE}/hub:${TAG}
user: ${UID}
container_name: selenium-hub
environment:
- SE_LOG_LEVEL=${LOG_LEVEL}
Expand Down
4 changes: 2 additions & 2 deletions tests/docker-compose-v3-test-parallel.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to run this?
# docker-compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build
# To clean up, `docker-compose -f docker-compose-v3-test-video.yml down`
# docker compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build
# To clean up, `docker compose -f docker-compose-v3-test-video.yml down`
version: "3"
services:
chrome:
Expand Down
4 changes: 2 additions & 2 deletions tests/docker-compose-v3-test-video.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to run this?
# docker-compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build
# To clean up, `docker-compose -f docker-compose-v3-test-video.yml down`
# docker compose -f docker-compose-v3-test-video.yml up --abort-on-container-exit --build
# To clean up, `docker compose -f docker-compose-v3-test-video.yml down`
version: "3"
services:
browser:
Expand Down
4 changes: 2 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def standalone_browser_container_matches(container):
# Flag for failure (for posterity)
failed = False

# Avoiding to start the containers when running inside docker-compose
# Avoiding to start the containers when running inside docker compose
test_container_id = ''
hub_id = ''
if not run_in_docker_compose:
Expand Down Expand Up @@ -240,7 +240,7 @@ def standalone_browser_container_matches(container):
logger.fatal(e)
failed = True

# Avoiding a container cleanup if tests run inside docker-compose
# Avoiding a container cleanup if tests run inside docker compose
if not run_in_docker_compose:
logger.info("Cleaning up...")

Expand Down

0 comments on commit 436bd77

Please sign in to comment.