diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d7d0ce96..378495a59 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,7 +126,8 @@ jobs: - run: name: "Prepare workflow environment variables" command: | - export SELENIUM_VERSION=$(grep selenium-server Base/Dockerfile | sed 's/.*-\([^-]*\)\.jar \\/\1/' | head -n 1) + export SELENIUM_VERSION=$(grep BASE_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) + export BINDING_VERSION=$(grep BINDING_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) echo "Prepare workflow environment variables" echo 'export BRANCH='$SELENIUM_VERSION >> $BASH_ENV echo 'export BUILD_DATE=$(date '+%Y%m%d')' >> $BASH_ENV @@ -229,6 +230,7 @@ jobs: command: | echo "export SELENIUM_VERSION=$(grep BASE_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)" >> $BASH_ENV echo "export RELEASE=$(grep BASE_RELEASE Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)" >> $BASH_ENV + echo "export BINDING_VERSION=$(grep BINDING_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)" >> $BASH_ENV source $BASH_ENV echo "Prepare workflow environment variables" echo 'export BRANCH='$SELENIUM_VERSION >> $BASH_ENV diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index fb017051d..138881323 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -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 @@ -56,7 +56,7 @@ body: attributes: label: Docker Selenium version (image tag) description: What version of Docker Selenium are you using? - placeholder: 4.19.0-20240328? Please use the full tag, avoid "latest" + placeholder: 4.20.0-20240425? Please use the full tag, avoid "latest" validations: required: true - type: input @@ -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 diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1c7727499..a18a18563 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -19,10 +19,18 @@ jobs: name: Build & test Docker images with random user runs-on: ubuntu-latest strategy: + fail-fast: false matrix: use-random-user: [false, true] steps: - uses: actions/checkout@main + - name: Set up QEMU + uses: docker/setup-qemu-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + with: + platforms: linux/amd64,linux/arm64 + use: false - name: Output Docker info run: docker info - name: Set up Python @@ -42,10 +50,26 @@ jobs: TARGET_BRANCH: ${{ github.head_ref }} - name: Output branch name run: echo ${BRANCH} + - name: Set Selenium base version + if: contains(toJson(github.event.commits), '[deploy]') == false + run: | + make set_nightly_env + cat .env | xargs -I {} echo {} >> $GITHUB_ENV - name: Sets build date - run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV + run: | + echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV + echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV + env: + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} - name: Build Docker images - run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build + uses: nick-invision/retry@master + with: + timeout_minutes: 12 + max_attempts: 3 + retry_wait_seconds: 60 + command: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build + - name: Count image layers + run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make count_image_layers - name: Test Docker images uses: nick-invision/retry@master with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 82ee2a4b5..e19b8f205 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,7 @@ on: jobs: deploy: # Only continue if the commit message has '[deploy]' in it - if: contains(toJson(github.event.commits), '[deploy]') == true + if: contains(toJson(github.event.commits), '[deploy]') == true || github.event_name == 'workflow_dispatch' name: Deploy Docker images runs-on: ubuntu-latest permissions: write-all @@ -19,6 +19,13 @@ jobs: with: persist-credentials: false fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + with: + platforms: linux/amd64,linux/arm64 + use: false - name: Output Docker info run: docker info - name: Sets build date @@ -27,6 +34,7 @@ jobs: echo "NAME=${NAMESPACE}" >> $GITHUB_ENV env: NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} - name: Sets prerelease to false by default run: echo "PRERELEASE=false" >> $GITHUB_ENV - name: Build base image to get Grid version @@ -52,7 +60,12 @@ jobs: - name: Update chart CHANGELOG run: ./generate_chart_changelog.sh - name: Build images - run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build + uses: nick-invision/retry@master + with: + timeout_minutes: 12 + max_attempts: 3 + retry_wait_seconds: 60 + command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build - name: Login Docker Hub run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" env: diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index e84318917..6459528d3 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -37,41 +37,54 @@ jobs: fail-fast: false matrix: include: - - k8s-version: 'v1.25.16' + - k8s-version: 'v1.26.15' test-strategy: job - cluster: 'kind' + cluster: 'minikube' helm-version: 'v3.10.3' test-existing-keda: true - - k8s-version: 'v1.26.15' + test-upgrade: true + - k8s-version: 'v1.27.13' test-strategy: deployment cluster: 'minikube' helm-version: 'v3.11.3' test-existing-keda: true - - k8s-version: 'v1.27.12' + test-upgrade: true + - k8s-version: 'v1.28.9' test-strategy: job_https cluster: 'minikube' helm-version: 'v3.12.3' test-existing-keda: true - - k8s-version: 'v1.28.8' + test-upgrade: true + - k8s-version: 'v1.29.4' test-strategy: job_hostname cluster: 'minikube' helm-version: 'v3.13.3' test-existing-keda: false - - k8s-version: 'v1.29.3' + test-upgrade: true + - k8s-version: 'v1.30.0' test-strategy: deployment_https cluster: 'minikube' - helm-version: 'v3.14.3' + helm-version: 'v3.14.4' test-existing-keda: false + test-upgrade: true env: CLUSTER: ${{ matrix.cluster }} KUBERNETES_VERSION: ${{ matrix.k8s-version }} - ARTIFACT_NAME: ${{ matrix.k8s-version }}-${{ matrix.test-strategy }} + ARTIFACT_NAME: "${{ matrix.k8s-version }}-${{ matrix.test-strategy }}" HELM_VERSION: ${{ matrix.helm-version }} TEST_EXISTING_KEDA: ${{ matrix.test-existing-keda }} + TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }} steps: - uses: actions/checkout@main - name: Output Docker info run: docker info + - name: Set up QEMU + uses: docker/setup-qemu-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + with: + platforms: linux/amd64,linux/arm64 + use: false - name: Set up Python uses: actions/setup-python@main with: @@ -89,10 +102,18 @@ jobs: TARGET_BRANCH: ${{ github.head_ref }} - name: Output branch name run: echo ${BRANCH} + - name: Set Selenium base version + if: contains(toJson(github.event.commits), '[deploy]') == false + run: | + make set_nightly_env + cat .env | xargs -I {} echo {} >> $GITHUB_ENV - name: Sets build date run: | echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV echo "IMAGE_REGISTRY=artifactory/selenium" >> $GITHUB_ENV + echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV + env: + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} - name: Setup Kubernetes environment uses: nick-invision/retry@master with: @@ -105,7 +126,12 @@ jobs: echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV - name: Build Docker images - run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build + uses: nick-invision/retry@master + with: + timeout_minutes: 12 + max_attempts: 3 + retry_wait_seconds: 60 + command: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build - name: Setup Kubernetes cluster uses: nick-invision/retry@master with: @@ -133,6 +159,10 @@ jobs: max_attempts: 3 command: | NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} make chart_test_autoscaling_${{ matrix.test-strategy }} + - name: Test chart upgrade + if: (matrix.test-upgrade == true) + run: | + NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} SET_MAX_REPLICAS=10 TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART} make chart_test_autoscaling_${{ matrix.test-strategy }} - name: Cleanup Kubernetes cluster if: always() run: CLUSTER=${CLUSTER} make chart_cluster_cleanup @@ -140,7 +170,7 @@ jobs: if: always() uses: actions/upload-artifact@main with: - name: ${{ env.ARTIFACT_NAME }}_${{ env.CHART_FILE_NAME }} + name: "${{ env.ARTIFACT_NAME }}_${{ env.CHART_FILE_NAME }}" path: ${{ env.CHART_PACKAGE_PATH }} - name: Upload chart test artifacts if: always() diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 61574c38c..28cc79eb4 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -15,6 +15,13 @@ jobs: with: persist-credentials: false fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + with: + platforms: linux/amd64,linux/arm64 + use: false - name: Output Docker info run: docker info - name: Sets build date @@ -23,8 +30,10 @@ jobs: run: | echo "PRERELEASE=true" >> $GITHUB_ENV echo "NAME=${NAMESPACE}" >> $GITHUB_ENV + echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV env: NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} - name: Build base image to get Grid version run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base_nightly - name: Get Grid version @@ -45,7 +54,12 @@ jobs: - name: Remove local Docker tag run: docker rmi ${{ env.NAME }}/base:local-${BUILD_DATE} - name: Build images - run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build + uses: nick-invision/retry@master + with: + timeout_minutes: 12 + max_attempts: 3 + retry_wait_seconds: 60 + command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build - name: Login Docker Hub run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" env: diff --git a/.github/workflows/test-video.yml b/.github/workflows/test-video.yml index e35100eb4..664d80c9d 100644 --- a/.github/workflows/test-video.yml +++ b/.github/workflows/test-video.yml @@ -39,6 +39,13 @@ jobs: test-strategy: [test_video, test_parallel, test_node_docker] steps: - uses: actions/checkout@main + - name: Set up QEMU + uses: docker/setup-qemu-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + with: + platforms: linux/amd64,linux/arm64 + use: false - name: Output Docker info run: docker info - name: Set up Python @@ -58,14 +65,28 @@ jobs: TARGET_BRANCH: ${{ github.head_ref }} - name: Output branch name run: echo ${BRANCH} + - name: Set Selenium base version + if: contains(toJson(github.event.commits), '[deploy]') == false + run: | + make set_nightly_env + cat .env | xargs -I {} echo {} >> $GITHUB_ENV - name: Sets build date - run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: Pre-build to reduce logs in test phase run: | - VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make hub - VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chrome - VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make firefox - VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make edge + echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV + echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV + env: + AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }} + - name: Pre-build to reduce logs in test phase + uses: nick-invision/retry@master + with: + timeout_minutes: 12 + max_attempts: 3 + retry_wait_seconds: 60 + command: | + VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make hub + VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chrome + VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make firefox + VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make edge - name: Set test parameters if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') run: | diff --git a/.github/workflows/update-dev-beta-browser-images.yml b/.github/workflows/update-dev-beta-browser-images.yml index b640b51a2..74cbaef31 100644 --- a/.github/workflows/update-dev-beta-browser-images.yml +++ b/.github/workflows/update-dev-beta-browser-images.yml @@ -23,10 +23,19 @@ jobs: steps: - uses: actions/checkout@main + - name: Set up QEMU + uses: docker/setup-qemu-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + with: + platforms: linux/amd64,linux/arm64 + use: false - name: Setup environment variables run: | export SELENIUM_VERSION=$(grep BASE_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) + export BINDING_VERSION=$(grep BINDING_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) echo "SELENIUM_VERSION="$SELENIUM_VERSION >> $GITHUB_ENV + echo "BINDING_VERSION="$BINDING_VERSION >> $GITHUB_ENV export BUILD_DATE=$(date '+%Y%m%d') echo "BUILD_DATE="$BUILD_DATE >> $GITHUB_ENV export BROWSER_CAPS=`node -p "process.argv[1][0].toUpperCase() + process.argv[1].toString().substring(1)" $BROWSER` diff --git a/Base/Dockerfile b/Base/Dockerfile index 887c97f9c..2b6fd85b9 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -1,10 +1,10 @@ -#FROM ubuntu:jammy FROM debian:bookworm LABEL authors="Selenium " # Arguments to define the version of dependencies to download ARG VERSION ARG RELEASE=selenium-${VERSION} +ARG AUTHORS=SeleniumHQ # Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl) ARG OPENTELEMETRY_VERSION=1.36.0 ARG GRPC_VERSION=1.62.2 @@ -15,27 +15,27 @@ ARG SEL_GROUP=${SEL_USER} ARG SEL_PASSWD=secret ARG UID=1200 ARG GID=1201 - -USER root -#================================================ -# Customize sources for apt-get -#================================================ -#RUN echo "deb http://archive.ubuntu.com/ubuntu jammy main universe\n" > /etc/apt/sources.list \ -# && echo "deb http://archive.ubuntu.com/ubuntu jammy-updates main universe\n" >> /etc/apt/sources.list \ -# && echo "deb http://security.ubuntu.com/ubuntu jammy-security main universe\n" >> /etc/apt/sources.list +ARG TZ="UTC" +ARG JRE_VERSION=17 ARG TARGETARCH ARG TARGETVARIANT -# No interactive frontend during docker build +USER root + ENV DEBIAN_FRONTEND=noninteractive \ - DEBCONF_NONINTERACTIVE_SEEN=true -RUN echo "VERSION is $VERSION" && echo "RELEASE is $RELEASE" + # No interactive frontend during docker build + DEBCONF_NONINTERACTIVE_SEEN=true \ + SEL_USER=${SEL_USER} \ + SEL_UID=${UID} \ + SEL_GID=${GID} \ + HOME=/home/${SEL_USER} \ + TZ=${TZ} \ + SEL_DOWNLOAD_DIR=${HOME}/Downloads #======================== # Miscellaneous packages # Includes minimal runtime used for executing non GUI Java programs #======================== -ARG JRE_VERSION=17 RUN apt-get -qqy update \ && apt-get upgrade -yq \ && apt-get -qqy --no-install-recommends install \ @@ -52,45 +52,29 @@ RUN apt-get -qqy update \ gnupg2 \ libnss3-tools \ && mkdir -p /etc/apt/keyrings \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 843C48A565F8F04B \ + && apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 843C48A565F8F04B || apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 843C48A565F8F04B \ && wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc >dev/null \ && echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list >dev/null \ && apt-get -qqy update \ && apt-get -qqy --no-install-recommends install temurin-${JRE_VERSION}-jre -y \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#=================== - -RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \ + && if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \ export ARCH=armhf ; \ else \ - export ARCH=$TARGETARCH ; \ + export ARCH=${TARGETARCH} ; \ fi \ - && sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/temurin-${JRE_VERSION}-jre-$ARCH/conf/security/java.security - - + && sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/temurin-${JRE_VERSION}-jre-${ARCH}/conf/security/java.security \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ #=================== # Timezone settings # Possible alternative: https://github.com/docker/docker/issues/3359#issuecomment-32150214 #=================== -ENV TZ "UTC" -RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \ + && ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ - cat /etc/timezone - -#====================================== -# Configure environement -#====================================== -ENV SEL_USER=${SEL_USER} -ENV SEL_UID=${UID} -ENV SEL_GID=${GID} -ENV HOME=/home/${SEL_USER} -ENV SEL_DOWNLOAD_DIR=${HOME}/Downloads - + cat /etc/timezone \ #======================================== -# Add normal user and group with passwordless sudo +# Add normal user and group without password sudo #======================================== -RUN groupadd ${SEL_GROUP} \ + && groupadd ${SEL_GROUP} \ --gid ${SEL_GID} \ && useradd ${SEL_USER} \ --create-home \ @@ -99,80 +83,67 @@ RUN groupadd ${SEL_GROUP} \ --uid ${SEL_UID} \ && usermod -a -G sudo ${SEL_USER} \ && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \ - && echo "${SEL_USER}:${SEL_PASSWD}" | chpasswd - -#====================================== -# Add Grid check script -#====================================== -COPY --chown="${SEL_UID}:${SEL_GID}" check-grid.sh entry_point.sh /opt/bin/ - -#====================================== -# Add Supervisor configuration file -#====================================== -COPY supervisord.conf /etc - + && echo "${SEL_USER}:${SEL_PASSWD}" | chpasswd \ #========== # Selenium & relaxing permissions for OpenShift and other non-sudo environments #========== -RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor ${SEL_DOWNLOAD_DIR} \ + && mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor ${SEL_DOWNLOAD_DIR} \ ${HOME}/.mozilla ${HOME}/.vnc $HOME/.pki/nssdb \ + # NSSDB initialization with an empty password + && certutil -d sql:$HOME/.pki/nssdb -N --empty-password \ && touch /opt/selenium/config.toml \ && chown -R ${SEL_USER}:${SEL_GROUP} /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \ && chmod -R 775 /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \ - && wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/${RELEASE}/selenium-server-${VERSION}.jar \ + && wget --no-verbose https://github.com/${AUTHORS}/selenium/releases/download/${RELEASE}/selenium-server-${VERSION}.jar \ -O /opt/selenium/selenium-server.jar \ && echo "${SEL_PASSWD}" > /opt/selenium/initialPasswd \ && chgrp -R 0 /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ && chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ && setfacl -Rm u:${SEL_USER}:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ - && setfacl -Rm g:${SEL_GROUP}:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor - + && setfacl -Rm g:${SEL_GROUP}:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ #===== -# Download observability related jaegar jars and make them available in a separate directory +# Download observability related OpenTelemetry jars and make them available in a separate directory # so that the container can skip downloading them everytime it comes up -#===== -#RUN curl -fLo /tmp/cs https://github.com/coursier/launchers/raw/master/coursier \ -RUN if [ `arch` = "aarch64" ] || [ `arch` = "x86_64" ]; then \ - curl -fL https://github.com/coursier/launchers/raw/master/cs-`arch`-pc-linux.gz | gzip -d > /tmp/cs \ - && chmod +x /tmp/cs \ - && mkdir -p /external_jars \ - && chmod -R 775 /external_jars ; \ - fi +#===== \ + && if [ `arch` = "aarch64" ] || [ `arch` = "x86_64" ]; then \ + curl -fL https://github.com/coursier/launchers/raw/master/cs-`arch`-pc-linux.gz | gzip -d > /tmp/cs \ + && chmod +x /tmp/cs \ + && mkdir -p /external_jars \ + && chmod -R 775 /external_jars ; \ + fi \ + && if [ -f "/tmp/cs" ]; then \ + /tmp/cs fetch --classpath --cache /external_jars \ + io.opentelemetry:opentelemetry-exporter-otlp:${OPENTELEMETRY_VERSION} \ + io.grpc:grpc-netty:${GRPC_VERSION} > /external_jars/.classpath.txt ; \ + fi \ + && chmod 664 /external_jars/.classpath.txt \ + && rm -fr /root/.cache/* \ + # (Note that .bashrc is only executed in interactive bash shells.) + && echo 'if [[ $(ulimit -n) -gt 200000 ]]; then echo "WARNING: Very high value reported by \"ulimit -n\". Consider passing \"--ulimit nofile=32768\" to \"docker run\"."; fi' >> ${HOME}/.bashrc -RUN if [ -f "/tmp/cs" ]; then \ - /tmp/cs fetch --classpath --cache /external_jars \ - io.opentelemetry:opentelemetry-exporter-otlp:${OPENTELEMETRY_VERSION} \ - io.grpc:grpc-netty:${GRPC_VERSION} > /external_jars/.classpath.txt; \ - fi +#====================================== +# Add Grid check script +#====================================== +COPY --chown="${SEL_UID}:${SEL_GID}" check-grid.sh entry_point.sh /opt/bin/ -RUN if [ -f "/tmp/cs" ]; then chmod 664 /external_jars/.classpath.txt ; fi -RUN rm -fr /root/.cache/* +#====================================== +# Add Supervisor configuration file +#====================================== +COPY supervisord.conf /etc #=================================================== # Run the following commands as non-privileged user #=================================================== USER ${SEL_UID}:${SEL_GID} -#========== -# NSSDB initialization with an empty password -#========== -RUN certutil -d sql:$HOME/.pki/nssdb -N --empty-password - -# Boolean value, maps "--bind-host" -ENV SE_BIND_HOST false -# Boolean value, maps "--reject-unsupported-caps" -ENV SE_REJECT_UNSUPPORTED_CAPS false - -ENV SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED true -ENV SE_OTEL_TRACES_EXPORTER "otlp" - -# A too high maximum number of file descriptors (with the default value -# inherited from the docker host) can cause issues with some of our tools: -# - sanitizers hanging: https://github.com/google/sanitizers/issues/1662 -# - valgrind crashing: https://stackoverflow.com/a/75293014 -# This is not be a problem on our CI hosts, but developers who run the image -# on their machines may run into this (e.g., on Arch Linux), so warn them. -# (Note that .bashrc is only executed in interactive bash shells.) -RUN echo 'if [[ $(ulimit -n) -gt 200000 ]]; then echo "WARNING: Very high value reported by \"ulimit -n\". Consider passing \"--ulimit nofile=32768\" to \"docker run\"."; fi' >> ${HOME}/.bashrc +#====================================== +# Configure environement +#====================================== + # Boolean value, maps "--bind-host" +ENV SE_BIND_HOST=false \ + # Boolean value, maps "--reject-unsupported-caps" + SE_REJECT_UNSUPPORTED_CAPS=false \ + SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED=true \ + SE_OTEL_TRACES_EXPORTER="otlp" CMD ["/opt/bin/entry_point.sh"] diff --git a/Makefile b/Makefile index 09544f510..fc08444b9 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ NAME := $(or $(NAME),$(NAME),selenium) CURRENT_DATE := $(shell date '+%Y%m%d') BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE)) -BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.19.0) -BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.19.1) +BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.20.0) +BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.20.0) +BINDING_VERSION := $(or $(BINDING_VERSION),$(BINDING_VERSION),4.20.0) BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nightly) -BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.20.0-SNAPSHOT) -VERSION := $(or $(VERSION),$(VERSION),4.19.1) +BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.21.0-SNAPSHOT) +VERSION := $(or $(VERSION),$(VERSION),4.20.0) TAG_VERSION := $(VERSION)-$(BUILD_DATE) CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),1.0.0-nightly) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) @@ -16,9 +17,9 @@ BUILD_ARGS := $(BUILD_ARGS) MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION))) MINOR := $(word 2,$(subst ., ,$(TAG_VERSION))) MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(TAG_VERSION))) -FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6.1) +FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-7.0) FFMPEG_BASED_NAME := $(or $(FFMPEG_BASED_NAME),$(FFMPEG_BASED_NAME),ndviet) -FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),6.1-ubuntu2204) +FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),7.0-ubuntu2204) PLATFORMS := $(or $(PLATFORMS),$(PLATFORMS),linux/arm64) all: hub \ @@ -37,6 +38,15 @@ all: hub \ standalone_docker \ video +set_nightly_env: + echo BASE_VERSION=$(BASE_VERSION_NIGHTLY) > .env ; \ + echo BASE_RELEASE=$(BASE_RELEASE_NIGHTLY) >> .env ; + +docker_buildx_setup: + sudo apt-get install --upgrade docker-buildx-plugin + docker buildx version + docker buildx use default + build_nightly: BASE_VERSION=$(BASE_VERSION_NIGHTLY) BASE_RELEASE=$(BASE_RELEASE_NIGHTLY) make build @@ -45,95 +55,134 @@ build: all ci: build test base: - cd ./Base && docker build $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) -t $(NAME)/base:$(TAG_VERSION) . + cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --load --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) --build-arg AUTHORS=$(AUTHORS) --load -t $(NAME)/base:$(TAG_VERSION) . base_nightly: - cd ./Base && docker build $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION_NIGHTLY) --build-arg RELEASE=$(BASE_RELEASE_NIGHTLY) -t $(NAME)/base:$(TAG_VERSION) . + cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION_NIGHTLY) --build-arg RELEASE=$(BASE_RELEASE_NIGHTLY) --build-arg AUTHORS=$(AUTHORS) --load -t $(NAME)/base:$(TAG_VERSION) . hub: base - cd ./Hub && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) . + cd ./Hub && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/hub:$(TAG_VERSION) . distributor: base - cd ./Distributor && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) . + cd ./Distributor && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/distributor:$(TAG_VERSION) . router: base - cd ./Router && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/router:$(TAG_VERSION) . + cd ./Router && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/router:$(TAG_VERSION) . sessions: base - cd ./Sessions && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) . + cd ./Sessions && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/sessions:$(TAG_VERSION) . sessionqueue: base - cd ./SessionQueue && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) . + cd ./SessionQueue && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/session-queue:$(TAG_VERSION) . event_bus: base - cd ./EventBus && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) . + cd ./EventBus && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/event-bus:$(TAG_VERSION) . node_base: base - cd ./NodeBase && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) . + cd ./NodeBase && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/node-base:$(TAG_VERSION) . chrome: node_base - cd ./NodeChrome && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chrome:$(TAG_VERSION) . + cd ./NodeChrome && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/node-chrome:$(TAG_VERSION) . chrome_dev: - cd ./NodeChrome && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg CHROME_VERSION=google-chrome-unstable -t $(NAME)/node-chrome:dev . + cd ./NodeChrome && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg CHROME_VERSION=google-chrome-unstable --load -t $(NAME)/node-chrome:dev . chrome_beta: - cd ./NodeChrome && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg CHROME_VERSION=google-chrome-beta -t $(NAME)/node-chrome:beta . + cd ./NodeChrome && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg CHROME_VERSION=google-chrome-beta --load -t $(NAME)/node-chrome:beta . edge: node_base - cd ./NodeEdge && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-edge:$(TAG_VERSION) . + cd ./NodeEdge && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/node-edge:$(TAG_VERSION) . edge_dev: - cd ./NodeEdge && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg EDGE_VERSION=microsoft-edge-dev -t $(NAME)/node-edge:dev . + cd ./NodeEdge && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg EDGE_VERSION=microsoft-edge-dev --load -t $(NAME)/node-edge:dev . edge_beta: - cd ./NodeEdge && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg EDGE_VERSION=microsoft-edge-beta -t $(NAME)/node-edge:beta . + cd ./NodeEdge && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg EDGE_VERSION=microsoft-edge-beta --load -t $(NAME)/node-edge:beta . firefox: node_base - cd ./NodeFirefox && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) . + cd ./NodeFirefox && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/node-firefox:$(TAG_VERSION) . firefox_dev: - cd ./NodeFirefox && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg FIREFOX_VERSION=nightly-latest -t $(NAME)/node-firefox:dev . + cd ./NodeFirefox && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load --build-arg FIREFOX_VERSION=nightly-latest -t $(NAME)/node-firefox:dev . firefox_beta: - cd ./NodeFirefox && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg FIREFOX_VERSION=beta-latest -t $(NAME)/node-firefox:beta . + cd ./NodeFirefox && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load --build-arg FIREFOX_VERSION=beta-latest -t $(NAME)/node-firefox:beta . docker: base - cd ./NodeDocker && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) . + cd ./NodeDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/node-docker:$(TAG_VERSION) . standalone_docker: docker - cd ./StandaloneDocker && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) . + cd ./StandaloneDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --load -t $(NAME)/standalone-docker:$(TAG_VERSION) . standalone_firefox: firefox - cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox --load -t $(NAME)/standalone-firefox:$(TAG_VERSION) . standalone_firefox_dev: firefox_dev - cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:dev . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-firefox --load -t $(NAME)/standalone-firefox:dev . standalone_firefox_beta: firefox_beta - cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:beta . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-firefox --load -t $(NAME)/standalone-firefox:beta . standalone_chrome: chrome - cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:$(TAG_VERSION) . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome --load -t $(NAME)/standalone-chrome:$(TAG_VERSION) . standalone_chrome_dev: chrome_dev - cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:dev . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-chrome --load -t $(NAME)/standalone-chrome:dev . standalone_chrome_beta: chrome_beta - cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:beta . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:beta . standalone_edge: edge - cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -t $(NAME)/standalone-edge:$(TAG_VERSION) . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge --load -t $(NAME)/standalone-edge:$(TAG_VERSION) . standalone_edge_dev: edge_dev - cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-edge -t $(NAME)/standalone-edge:dev . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-edge --load -t $(NAME)/standalone-edge:dev . standalone_edge_beta: edge_beta - cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-edge -t $(NAME)/standalone-edge:beta . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-edge --load -t $(NAME)/standalone-edge:beta . video: - cd ./Video && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(FFMPEG_BASED_NAME) --build-arg BASED_TAG=$(FFMPEG_BASED_TAG) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) . - + cd ./Video && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(FFMPEG_BASED_NAME) --build-arg BASED_TAG=$(FFMPEG_BASED_TAG) --load -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) . + +count_image_layers: + docker history $(NAME)/base:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/hub:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/distributor:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/router:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/sessions:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/session-queue:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/event-bus:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/node-base:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/node-chrome:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/node-edge:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/node-firefox:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/node-docker:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/standalone-chrome:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/standalone-edge:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/standalone-firefox:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/standalone-docker:$(TAG_VERSION) -q | wc -l + docker history $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) -q | wc -l + +chrome_upgrade_version: + cd ./NodeChrome && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) --load -t $(NAME)/node-chrome:$(TAG_VERSION) . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome --load -t $(NAME)/standalone-chrome:$(TAG_VERSION) . + docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version + docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) google-chrome --version + docker run --rm $(NAME)/standalone-chrome:$(TAG_VERSION) chromedriver --version + +firefox_upgrade_version: + cd ./NodeFirefox && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) --load -t $(NAME)/node-firefox:$(TAG_VERSION) . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox --load -t $(NAME)/standalone-firefox:$(TAG_VERSION) . + docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version + docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) firefox --version + docker run --rm $(NAME)/standalone-firefox:$(TAG_VERSION) geckodriver --version + +edge_upgrade_version: + cd ./NodeEdge && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(VERSION) --build-arg AUTHORS=$(AUTHORS) --load -t $(NAME)/node-edge:$(TAG_VERSION) . + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge --load -t $(NAME)/standalone-edge:$(TAG_VERSION) . + docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) /opt/selenium/selenium-server.jar info --version + docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) microsoft-edge --version + docker run --rm $(NAME)/standalone-edge:$(TAG_VERSION) msedgedriver --version # Register linux/arm64 and linux/arm/v7 architectures for building with BuildKit # docker run --rm --privileged aptman/qus -s -- -p # for actions @@ -489,22 +538,22 @@ test: test_chrome \ test_chrome: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeChrome + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeChrome test_chrome_standalone: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneChrome + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneChrome test_edge: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeEdge + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeEdge test_edge_standalone: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneEdge + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneEdge test_firefox: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeFirefox + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeFirefox test_firefox_standalone: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneFirefox + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneFirefox # Test multi-arch container images test_multi_arch: test_chromium_multi \ @@ -514,18 +563,19 @@ test_multi_arch: test_chromium_multi \ test_chromium_multi: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeChromium + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeChromium test_chromium_standalone_multi: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneChromium + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneChromium test_firefox_multi: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeFirefox + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeFirefox test_firefox_standalone_multi: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneFirefox + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneFirefox test_parallel: hub chrome firefox edge + sudo rm -rf ./tests/tests for node in DeploymentAutoscaling JobAutoscaling ; do \ cd ./tests || true ; \ echo TAG=$(TAG_VERSION) > .env ; \ @@ -535,20 +585,23 @@ test_parallel: hub chrome firefox edge echo REQUEST_TIMEOUT=$(or $(REQUEST_TIMEOUT), 300) >> .env ; \ echo NODE=$$node >> .env ; \ echo UID=$$(id -u) >> .env ; \ - docker-compose -f docker-compose-v3-test-parallel.yml up --no-log-prefix --exit-code-from tests --build ; \ + echo BINDING_VERSION=$(BINDING_VERSION) >> .env ; \ + 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 - rm -rf ./tests/videos; mkdir -p ./tests/videos + # Running a few tests with docker compose to generate the videos + sudo rm -rf ./tests/tests + sudo rm -rf ./tests/videos; mkdir -p ./tests/videos for node in NodeChrome NodeFirefox NodeEdge ; do \ cd ./tests || true ; \ echo VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) > .env ; \ echo TAG=$(TAG_VERSION) >> .env ; \ echo NODE=$$node >> .env ; \ echo UID=$$(id -u) >> .env ; \ + echo BINDING_VERSION=$(BINDING_VERSION) >> .env ; \ if [ $$node = "NodeChrome" ] ; then \ echo BROWSER=chrome >> .env ; \ echo VIDEO_FILE_NAME=chrome_video.mp4 >> .env ; \ @@ -561,7 +614,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 @@ -569,23 +622,34 @@ test_video: video hub chrome firefox edge docker run -u $$(id -u) -v $$(pwd):$$(pwd) -w $$(pwd) $(FFMPEG_BASED_NAME)/ffmpeg:$(FFMPEG_BASED_TAG) -v error -i ./tests/videos/firefox_video.mp4 -f null - 2>error.log docker run -u $$(id -u) -v $$(pwd):$$(pwd) -w $$(pwd) $(FFMPEG_BASED_NAME)/ffmpeg:$(FFMPEG_BASED_TAG) -v error -i ./tests/videos/edge_video.mp4 -f null - 2>error.log -test_node_docker: docker hub chrome firefox edge - rm -rf ./tests/videos; mkdir -p ./tests/videos - for node in StandaloneChrome StandaloneFirefox StandaloneEdge ; do \ +test_node_docker: hub standalone_docker standalone_chrome standalone_firefox standalone_edge video + sudo rm -rf ./tests/tests + sudo rm -rf ./tests/videos; mkdir -p ./tests/videos/Downloads + sudo chmod -R 777 ./tests/videos + for node in DeploymentAutoscaling JobAutoscaling ; do \ cd tests || true ; \ + DOWNLOADS_DIR="./videos/Downloads" ; \ + sudo rm -rf $$DOWNLOADS_DIR/* ; \ echo NAMESPACE=$(NAME) > .env ; \ echo TAG=$(TAG_VERSION) >> .env ; \ echo VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) >> .env ; \ echo TEST_DRAIN_AFTER_SESSION_COUNT=$(or $(TEST_DRAIN_AFTER_SESSION_COUNT), 0) >> .env ; \ echo TEST_PARALLEL_HARDENING=$(or $(TEST_PARALLEL_HARDENING), "false") >> .env ; \ echo LOG_LEVEL=$(or $(LOG_LEVEL), "INFO") >> .env ; \ - echo REQUEST_TIMEOUT=$(or $(REQUEST_TIMEOUT), 30) >> .env ; \ + echo REQUEST_TIMEOUT=$(or $(REQUEST_TIMEOUT), 300) >> .env ; \ + echo SELENIUM_ENABLE_MANAGED_DOWNLOADS=$(or $(SELENIUM_ENABLE_MANAGED_DOWNLOADS), "false") >> .env ; \ echo NODE=$$node >> .env ; \ echo UID=$$(id -u) >> .env ; \ + echo BINDING_VERSION=$(BINDING_VERSION) >> .env ; \ + echo HOST_IP=$$(hostname -I | awk '{print $$1}') >> .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 ; \ + if [ -d "$$DOWNLOADS_DIR" ] && [ $$(ls -1q $$DOWNLOADS_DIR | wc -l) -eq 0 ]; then \ + echo "Mounted downloads directory is empty. Downloaded files could not be retrieved!" ; \ + exit 1 ; \ + fi ; \ done test_custom_ca_cert: @@ -610,42 +674,42 @@ chart_test_template: ./tests/charts/bootstrap.sh chart_test_chrome: - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh NodeChrome chart_test_firefox: - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh NodeFirefox chart_test_edge: - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh NodeEdge chart_test_autoscaling_deployment_https: CHART_FULL_DISTRIBUTED_MODE=true CHART_ENABLE_INGRESS_HOSTNAME=true CHART_ENABLE_BASIC_AUTH=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 \ SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 \ - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh DeploymentAutoscaling chart_test_autoscaling_deployment: CHART_ENABLE_TRACING=true SELENIUM_GRID_TEST_HEADLESS=true SELENIUM_GRID_HOST=$$(hostname -i) RELEASE_NAME=selenium \ SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 \ - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh DeploymentAutoscaling chart_test_autoscaling_job_https: SELENIUM_GRID_TEST_HEADLESS=true SELENIUM_GRID_PROTOCOL=https CHART_ENABLE_BASIC_AUTH=true RELEASE_NAME=selenium SELENIUM_GRID_PORT=443 SUB_PATH=/ \ - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh JobAutoscaling chart_test_autoscaling_job_hostname: CHART_ENABLE_TRACING=true CHART_ENABLE_INGRESS_HOSTNAME=true CHART_ENABLE_BASIC_AUTH=true \ - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh JobAutoscaling chart_test_autoscaling_job: CHART_ENABLE_TRACING=true CHART_FULL_DISTRIBUTED_MODE=true CHART_ENABLE_INGRESS_HOSTNAME=true SELENIUM_GRID_HOST=selenium-grid.local RELEASE_NAME=selenium SUB_PATH=/ \ - VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \ ./tests/charts/make/chart_test.sh JobAutoscaling .PHONY: \ diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index 89b0877c0..6b49273af 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -12,97 +12,97 @@ ARG NOVNC_VERSION="master" ARG WEBSOCKIFY_SOURCE="heads" # Inputs: master, "v0.11.0" ARG WEBSOCKIFY_VERSION="master" +ARG LANG_WHICH=en +ARG LANG_WHERE=US +ARG ENCODING=UTF-8 +ARG TARGETARCH USER root +#============================== +# Locale and encoding settings +#============================== +ENV LANG_WHICH=${LANG_WHICH} \ + LANG_WHERE=${LANG_WHERE} \ + ENCODING=${ENCODING} \ + LANGUAGE=${LANG_WHICH}_${LANG_WHERE}.${ENCODING} \ + LANG=${LANGUAGE} \ +#============================================ +# Shared cleanup script environment variables +#============================================ + SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=false \ + SE_BROWSER_LEFTOVERS_INTERVAL_SECS=3600 \ + SE_BROWSER_LEFTOVERS_PROCESSES_SECS=7200 \ + SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=1 \ +#======================== +# Selenium Configuration +#======================== + # Drain the Node after N sessions (a value higher than zero enables the feature) + SE_DRAIN_AFTER_SESSION_COUNT=0 \ + SE_NODE_MAX_SESSIONS=1 \ + SE_NODE_SESSION_TIMEOUT=300 \ + SE_NODE_OVERRIDE_MAX_SESSIONS=false \ + SE_NODE_HEARTBEAT_PERIOD=30 \ + SE_OTEL_SERVICE_NAME="selenium-node" \ + # Setting Selenium Manager to work offline + SE_OFFLINE=true \ +#============================ +# Some configuration options +#============================ + SE_SCREEN_WIDTH=1360 \ + SE_SCREEN_HEIGHT=1020 \ + SE_SCREEN_DEPTH=24 \ + SE_SCREEN_DPI=96 \ + SE_START_XVFB=true \ + SE_START_VNC=true \ + SE_START_NO_VNC=true \ + SE_NO_VNC_PORT=7900 \ + SE_VNC_PORT=5900 \ + DISPLAY=:99.0 \ + DISPLAY_NUM=99 \ + # Path to the Configfile + CONFIG_FILE=/opt/selenium/config.toml \ + GENERATE_CONFIG=true \ + # Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 + DBUS_SESSION_BUS_ADDRESS=/dev/null + +RUN apt-get update -qqy \ + && apt-get -qqy --no-install-recommends install \ #============== # Xvfb #============== -RUN apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install \ xvfb \ xauth \ pulseaudio \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#============================== -# Locale and encoding settings -#============================== -ENV LANG_WHICH en -ENV LANG_WHERE US -ENV ENCODING UTF-8 -ENV LANGUAGE ${LANG_WHICH}_${LANG_WHERE}.${ENCODING} -ENV LANG ${LANGUAGE} -# Layer size: small: ~9 MB -# Layer size: small: ~9 MB MB (with --no-install-recommends) -RUN apt-get -qqy update \ - && apt-get -qqy --no-install-recommends install \ - #language-pack-en \ - tzdata \ - locales \ - && locale-gen ${LANGUAGE} \ - && dpkg-reconfigure --frontend noninteractive locales \ - && apt-get -qyy autoremove \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get -qyy clean - #===== # VNC #===== -RUN apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install \ - x11vnc x11-utils \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - + x11vnc x11-utils \ #========= -# fluxbox -# A fast, lightweight and responsive window manager +# Fluxbox (a fast, lightweight and responsive window manager) #========= -RUN apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install \ fluxbox eterm hsetroot feh \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#================ -# Font libraries -#================ -# libfontconfig ~1 MB -# libfreetype6 ~1 MB -# xfonts-cyrillic ~2 MB -# xfonts-scalable ~2 MB -# fonts-liberation ~3 MB -# fonts-ipafont-gothic ~13 MB -# fonts-wqy-zenhei ~17 MB -# fonts-tlwg-loma-otf ~300 KB -# fonts-ubuntu ~5 MB -# Ubuntu Font Family, sans-serif typeface hinted for clarity -# Removed packages: -# xfonts-100dpi ~6 MB -# xfonts-75dpi ~6 MB -# fonts-noto-color-emoji ~10 MB -# Regarding fonts-liberation see: -# https://github.com/SeleniumHQ/docker-selenium/issues/383#issuecomment-278367069 -# Layer size: small: 50.3 MB (with --no-install-recommends) -# Layer size: small: 50.3 MB -RUN apt-get -qqy update \ - && apt-get -qqy --no-install-recommends install \ +#============================== +# Locale and encoding settings +#============================== + locales \ libfontconfig \ libfreetype6 \ - #xfonts-cyrillic \ xfonts-scalable \ fonts-liberation \ fonts-ipafont-gothic \ fonts-wqy-zenhei \ fonts-tlwg-loma-otf \ - #fonts-ubuntu \ fonts-noto-color-emoji \ + && locale-gen ${LANGUAGE} \ + && dpkg-reconfigure --frontend noninteractive locales \ + && apt-get -qyy autoremove \ && rm -rf /var/lib/apt/lists/* \ - && apt-get -qyy clean - + && apt-get -qyy clean \ ######################################## # noVNC exposes VNC through a web page # ######################################## -RUN wget -nv -O noVNC.zip \ + && wget -nv -O noVNC.zip \ "https://github.com/novnc/noVNC/archive/refs/${NOVNC_SOURCE}/${NOVNC_VERSION}.zip" \ && unzip -x noVNC.zip \ && mv noVNC-${NOVNC_VERSION} /opt/bin/noVNC \ @@ -113,110 +113,40 @@ RUN wget -nv -O noVNC.zip \ && unzip -x websockify.zip \ && rm websockify.zip \ && mv websockify-${WEBSOCKIFY_VERSION} /opt/bin/noVNC/utils/websockify \ - && rm -rf /opt/bin/noVNC/utils/websockify/docker /opt/bin/noVNC/utils/websockify/tests - -#========================================================================================================================================= -# Run this command for executable file permissions for /dev/shm when this is a "child" container running in Docker Desktop and WSL2 distro -#========================================================================================================================================= -RUN chmod +x /dev/shm - + && rm -rf /opt/bin/noVNC/utils/websockify/docker /opt/bin/noVNC/utils/websockify/tests \ +#======================================================================== +# Run this command for executable file permissions for /dev/shm when # +# this is a "child" container running in Docker Desktop and WSL2 distro # +#======================================================================== + && chmod +x /dev/shm \ # Creating base directory for Xvfb -RUN mkdir -p /tmp/.X11-unix - + && mkdir -p /tmp/.X11-unix \ #============================== # Generating the VNC password using initial password in Base image # Changing ownership to ${SEL_USER}, so the service can be started #============================== - -RUN mkdir -p ${HOME}/.vnc \ - && x11vnc -storepasswd $(cat /opt/selenium/initialPasswd) ${HOME}/.vnc/passwd \ - && chown -R "${SEL_USER}:${SEL_GROUP}" ${HOME}/.vnc - -#========== -# Relaxing permissions for OpenShift and other non-sudo environments -#========== -RUN chmod -R 775 ${HOME} /tmp/.X11-unix \ + && x11vnc -storepasswd $(cat /opt/selenium/initialPasswd) ${HOME}/.vnc/passwd \ + && chown -R "${SEL_USER}:${SEL_GROUP}" ${HOME}/.vnc \ + && chmod -R 775 ${HOME} /tmp/.X11-unix \ && chgrp -R 0 ${HOME} /tmp/.X11-unix \ && chmod -R g=u ${HOME} /tmp/.X11-unix -#============================================ -# Shared cleanup script environment variables -#============================================ -ENV SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP false -ENV SE_BROWSER_LEFTOVERS_INTERVAL_SECS 3600 -ENV SE_BROWSER_LEFTOVERS_PROCESSES_SECS 7200 -ENV SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS 1 - -#=================================================== -# Run the following commands as non-privileged user -#=================================================== - -USER ${SEL_UID} - -#============================== -# Scripts to run Selenium Node and XVFB -#============================== +# Copying configuration script generator COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-node.sh \ start-xvfb.sh \ - /opt/bin/ - -#============================== -# Supervisor configuration file -#============================== -COPY selenium.conf /etc/supervisor/conf.d/ - -#============================== -# Scripts to run fluxbox, x11vnc and noVNC -#============================== -COPY --chown="${SEL_UID}:${SEL_GID}" start-vnc.sh \ + start-vnc.sh \ start-novnc.sh \ - /opt/bin/ + generate_config /opt/bin/ -#============================== # Selenium Grid logo as wallpaper for Fluxbox -#============================== COPY selenium_grid_logo.png /usr/share/images/fluxbox/ubuntu-light.png -#============================ -# Some configuration options -#============================ -ENV SE_SCREEN_WIDTH 1360 -ENV SE_SCREEN_HEIGHT 1020 -ENV SE_SCREEN_DEPTH 24 -ENV SE_SCREEN_DPI 96 -ENV SE_START_XVFB true -ENV SE_START_VNC true -ENV SE_START_NO_VNC true -ENV SE_NO_VNC_PORT 7900 -ENV SE_VNC_PORT 5900 -ENV DISPLAY :99.0 -ENV DISPLAY_NUM 99 -# Path to the Configfile -ENV CONFIG_FILE=/opt/selenium/config.toml -ENV GENERATE_CONFIG true -# Drain the Node after N sessions. -# A value higher than zero enables the feature -ENV SE_DRAIN_AFTER_SESSION_COUNT 0 -# Setting Selenium Manager to work offline -ENV SE_OFFLINE true - -#======================== -# Selenium Configuration -#======================== -# As integer, maps to "max-concurrent-sessions" -ENV SE_NODE_MAX_SESSIONS 1 -# As integer, maps to "session-timeout" in seconds -ENV SE_NODE_SESSION_TIMEOUT 300 -# As boolean, maps to "override-max-sessions" -ENV SE_NODE_OVERRIDE_MAX_SESSIONS false -# As integer, maps to "--heartbeat-period" in seconds -ENV SE_NODE_HEARTBEAT_PERIOD 30 - -# Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 -ENV DBUS_SESSION_BUS_ADDRESS=/dev/null -ENV SE_OTEL_SERVICE_NAME "selenium-node" +# Supervisor configuration file +COPY selenium.conf /etc/supervisor/conf.d/ -# Copying configuration script generator -COPY --chown="${SEL_UID}:${SEL_GID}" generate_config /opt/bin/generate_config +#==================================================== +# Run the following commands as non-privileged user # +#==================================================== +USER ${SEL_UID} EXPOSE 5900 diff --git a/NodeBase/start-novnc.sh b/NodeBase/start-novnc.sh index c3cb4efa6..4fc8d9e48 100755 --- a/NodeBase/start-novnc.sh +++ b/NodeBase/start-novnc.sh @@ -7,12 +7,14 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then if [ "${START_NO_VNC:-$SE_START_NO_VNC}" = true ] ; then # Guard against unreasonably high nofile limits. See https://github.com/SeleniumHQ/docker-selenium/issues/2045 - ULIMIT=${SE_VNC_ULIMIT:-100000} - if [[ ${ULIMIT} -ge 100000 ]]; then - echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${ULIMIT}." - ulimit -Sv ${ULIMIT} + # Try to set a new limit if the current limit is too high, or the user explicitly specified a custom limit + TOO_HIGH_ULIMIT=100000 + if [[ $(ulimit -n) -gt $TOO_HIGH_ULIMIT || ! -z "${SE_VNC_ULIMIT}" ]]; then + NEW_ULIMIT=${SE_VNC_ULIMIT:-${TOO_HIGH_ULIMIT}} + echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${NEW_ULIMIT}." + ulimit -n ${NEW_ULIMIT} if [ $? -eq 0 ]; then - echo "Successfully update the open file descriptor limit." + echo "Successfully updated the open file descriptor limit." else echo "The open file descriptor limit could not be updated." fi diff --git a/NodeBase/start-vnc.sh b/NodeBase/start-vnc.sh index c4419b0a1..ae96bd38f 100755 --- a/NodeBase/start-vnc.sh +++ b/NodeBase/start-vnc.sh @@ -45,12 +45,14 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then done # Guard against unreasonably high nofile limits. See https://github.com/SeleniumHQ/docker-selenium/issues/2045 - ULIMIT=${SE_VNC_ULIMIT:-100000} - if [[ ${ULIMIT} -ge 100000 ]]; then - echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${ULIMIT}." - ulimit -Sv ${ULIMIT} + # Try to set a new limit if the current limit is too high, or the user explicitly specified a custom limit + TOO_HIGH_ULIMIT=100000 + if [[ $(ulimit -n) -gt $TOO_HIGH_ULIMIT || ! -z "${SE_VNC_ULIMIT}" ]]; then + NEW_ULIMIT=${SE_VNC_ULIMIT:-${TOO_HIGH_ULIMIT}} + echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${NEW_ULIMIT}." + ulimit -n ${NEW_ULIMIT} if [ $? -eq 0 ]; then - echo "Successfully update the open file descriptor limit." + echo "Successfully updated the open file descriptor limit." else echo "The open file descriptor limit could not be updated." fi diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index 432265f91..0414a2c07 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -15,11 +15,19 @@ USER root # google-chrome-unstable #============================================ ARG CHROME_VERSION="google-chrome-stable" +ARG TARGETARCH RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | tee /etc/apt/trusted.gpg.d/google.gpg >/dev/null \ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ && apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install \ - ${CHROME_VERSION:-google-chrome-stable} \ + && if echo "${CHROME_VERSION}" | grep -qE "google-chrome-stable[_|=][0-9]*"; \ + then \ + CHROME_VERSION=$(echo "$CHROME_VERSION" | tr '=' '_') \ + && wget -qO google-chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}_${TARGETARCH}.deb" \ + && apt-get -qqy --no-install-recommends install --allow-downgrades ./google-chrome.deb \ + && rm -rf google-chrome.deb ; \ + else \ + apt-get -qqy --no-install-recommends install ${CHROME_VERSION} ; \ + fi \ && rm /etc/apt/sources.list.d/google-chrome.list \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* diff --git a/NodeDocker/config.toml b/NodeDocker/config.toml index e7539c058..ca033ec13 100644 --- a/NodeDocker/config.toml +++ b/NodeDocker/config.toml @@ -2,9 +2,9 @@ # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.19.0-20240328", '{"browserName": "firefox", "platformName": "linux"}', - "selenium/standalone-chrome:4.19.0-20240328", '{"browserName": "chrome", "platformName": "linux"}', - "selenium/standalone-edge:4.19.0-20240328", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' + "selenium/standalone-firefox:4.20.0-20240425", '{"browserName": "firefox", "platformName": "linux"}', + "selenium/standalone-chrome:4.20.0-20240425", '{"browserName": "chrome", "platformName": "linux"}', + "selenium/standalone-edge:4.20.0-20240425", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] # URL for connecting to the docker daemon @@ -14,7 +14,7 @@ configs = [ # socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20240328" +video-image = "selenium/video:ffmpeg-7.0-20240425" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values diff --git a/NodeEdge/Dockerfile b/NodeEdge/Dockerfile index 4f6ddeb0f..fd47d072b 100644 --- a/NodeEdge/Dockerfile +++ b/NodeEdge/Dockerfile @@ -13,10 +13,19 @@ USER root # e.g. microsoft-edge-beta=88.0.692.0-1 #============================================ ARG EDGE_VERSION="microsoft-edge-stable" +ARG TARGETARCH RUN wget -q -O - https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg >/dev/null \ && echo "deb https://packages.microsoft.com/repos/edge stable main" >> /etc/apt/sources.list.d/microsoft-edge.list \ && apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install ${EDGE_VERSION} \ + && if echo "${EDGE_VERSION}" | grep -qE "microsoft-edge-stable[_|=][0-9]*"; \ + then \ + EDGE_VERSION=$(echo "$EDGE_VERSION" | tr '=' '_') \ + && wget -qO microsoft-edge.deb "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/${EDGE_VERSION}_${TARGETARCH}.deb" \ + && apt-get -qqy --no-install-recommends install --allow-downgrades ./microsoft-edge.deb \ + && rm -rf microsoft-edge.deb ; \ + else \ + apt-get -qqy --no-install-recommends install ${EDGE_VERSION} ; \ + fi \ && rm /etc/apt/sources.list.d/microsoft-edge.list \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* diff --git a/README.md b/README.md index 3fd5b19dc..88f656070 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ The project is made possible by volunteer contributors who have put in thousands and made the source code freely available under the [Apache License 2.0](LICENSE.md). These Docker images come with a handful of tags to simplify its usage, have a look at them in one of -our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.19.0-20240328). +our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.20.0-20240425). To get notifications of new releases, add yourself as a "Releases only" watcher. @@ -148,6 +148,8 @@ Talk to us at https://www.selenium.dev/support/ * [Stopping the Node/Standalone after N sessions have been executed](#stopping-the-nodestandalone-after-n-sessions-have-been-executed) * [Automatic browser leftovers cleanup](#automatic-browser-leftovers-cleanup) * [Building the images](#building-the-images) +* [Build the images with specific versions](#build-the-images-with-specific-versions) +* [Upgrade browser version in the images](#upgrade-browser-version-in-the-images) * [Waiting for the Grid to be ready](#waiting-for-the-grid-to-be-ready) * [Adding a HEALTHCHECK to the Grid](#adding-a-healthcheck-to-the-grid) * [Using a bash script to wait for the Grid](#using-a-bash-script-to-wait-for-the-grid) @@ -163,6 +165,7 @@ Talk to us at https://www.selenium.dev/support/ * [Headless](#headless) * [Mounting volumes to retrieve downloaded files](#mounting-volumes-to-retrieve-downloaded-files) * [Mounting volumes to retrieve video files](#mounting-volumes-to-retrieve-video-files) +* [Stargazers over time](#stargazers-over-time) ## Quick start @@ -170,7 +173,7 @@ Talk to us at https://www.selenium.dev/support/ 1. Start a Docker container with Firefox ```bash -docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.19.0-20240328 +docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.20.0-20240425 ``` 2. Point your WebDriver tests to http://localhost:4444 @@ -267,9 +270,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: @@ -313,9 +316,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: @@ -365,17 +368,17 @@ For more information on the Dev and Beta channel container images, see the blog ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.19.0-20240328 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.20.0-20240425 ``` ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png) Chrome ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.19.0-20240328 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.20.0-20240425 ``` ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png) Edge ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.19.0-20240328 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.20.0-20240425 ``` _Note: Only one Standalone container can run on port_ `4444` _at the same time._ @@ -394,44 +397,44 @@ A Docker [network](https://docs.docker.com/engine/reference/commandline/network_ ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.19.0-20240328 + selenium/node-edge:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.19.0-20240328 + selenium/node-firefox:4.20.0-20240425 ``` ##### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-edge:4.19.0-20240328 + selenium/node-edge:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-firefox:4.19.0-20240328 + selenium/node-firefox:4.20.0-20240425 ``` When you are done using the Grid, and the containers have exited, the network can be removed with the following command: @@ -448,7 +451,7 @@ configured to expose different ports. ##### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.20.0-20240425 ``` ##### Node Chrome - Machine/VM 2 @@ -462,7 +465,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 ``` ###### Windows PowerShell @@ -474,7 +477,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 ``` @@ -489,7 +492,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-edge:4.19.0-20240328 + selenium/node-edge:4.20.0-20240425 ``` ###### Windows PowerShell @@ -501,7 +504,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-edge:4.19.0-20240328 + selenium/node-edge:4.20.0-20240425 ``` ##### Node Firefox - Machine/VM 4 @@ -515,7 +518,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-firefox:4.19.0-20240328 + selenium/node-firefox:4.20.0-20240425 ``` ###### Windows PowerShell @@ -527,7 +530,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-firefox:4.19.0-20240328 + selenium/node-firefox:4.20.0-20240425 ``` ##### Node Chrome - Machine/VM 4 @@ -542,7 +545,7 @@ $ docker run -d -p 5556:5556 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ -e SE_NODE_PORT=5556 \ - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 ``` ###### Windows PowerShell @@ -555,7 +558,7 @@ $ docker run -d -p 5556:5556 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` -e SE_NODE_PORT=5556 ` - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 ``` #### Docker Compose @@ -568,7 +571,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) @@ -578,21 +581,28 @@ ___ ### 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) +#### Distributor configuration + +| Environment variable | Option | Type | Default value | Description | +|------------------------------|-----------------------------|---------|---------------|--------------------------------------------------------------------------------------------------------------| +| `SE_REJECT_UNSUPPORTED_CAPS` | `--reject-unsupported-caps` | boolean | `false` | Allow the Distributor to reject a request immediately if the Grid does not support the requested capability. | +| `SE_HEALTHCHECK_INTERVAL` | `--healthcheck-interval` | int | `120` | This ensures the server can ping all the Nodes successfully after an interval. | + ___ ## Video recording -Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20240328` +Tests execution can be recorded by using the `selenium/video:ffmpeg-7.0-20240425` Docker image. One container is needed per each container where a browser is running. This means if you are 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 @@ -613,8 +623,8 @@ This example shows how to start the containers manually: ``` bash $ docker network create grid -$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.19.0-20240328 -$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20240328 +$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.20.0-20240425 +$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-7.0-20240425 # Run your tests $ docker stop video && docker rm video $ docker stop selenium && docker rm selenium @@ -688,11 +698,13 @@ You can save this file locally and name it, for example, `config.toml`. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.19.0-20240328", '{"browserName": "firefox"}', - "selenium/standalone-chrome:4.19.0-20240328", '{"browserName": "chrome"}', - "selenium/standalone-edge:4.19.0-20240328", '{"browserName": "MicrosoftEdge"}' + "selenium/standalone-firefox:4.20.0-20240425", '{"browserName": "firefox"}', + "selenium/standalone-chrome:4.20.0-20240425", '{"browserName": "chrome"}', + "selenium/standalone-edge:4.20.0-20240425", '{"browserName": "MicrosoftEdge"}' ] +host-config-keys = ["Dns", "DnsOptions", "DnsSearch", "ExtraHosts", "Binds"] + # URL for connecting to the docker daemon # Most simple approach, leave it as http://127.0.0.1:2375, and mount /var/run/docker.sock. # 127.0.0.1 is used because internally the container uses socat when /var/run/docker.sock is mounted @@ -703,7 +715,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20240328" +video-image = "selenium/video:ffmpeg-7.0-20240425" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -712,6 +724,10 @@ video-image = "selenium/video:ffmpeg-6.1-20240328" #port = ``` +With the optional config key `host-config-keys` under section [docker] in a config.toml file (or CLI option --docker-host-config-keys). Users can specify a list of docker host configuration keys that should be passed to browser containers. + +Valid key names for Docker host config can be found in the Docker API [documentation](https://docs.docker.com/engine/api/latest/#tag/Container/operation/ContainerCreate) or via the command `docker inspect` the node-docker container. + ### Execution with Hub & Node roles This can be expanded to a full Grid deployment, all components deployed individually. The overall @@ -722,28 +738,28 @@ virtual machines. ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.19.0-20240328 + selenium/node-docker:4.20.0-20240425 ``` #### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.19.0-20240328 + selenium/node-docker:4.20.0-20240425 ``` To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`. @@ -764,7 +780,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.19.0-20240328 + selenium/standalone-docker:4.20.0-20240425 ``` #### Windows PowerShell @@ -774,7 +790,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.19.0-20240328 + selenium/standalone-docker:4.20.0-20240425 ``` ### Using Dynamic Grid in different machines/VMs @@ -782,7 +798,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` #### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.20.0-20240425 ``` #### Node Chrome - Machine/VM 2 @@ -797,7 +813,7 @@ $ docker run -d -p 5555:5555 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.19.0-20240328 + selenium/node-docker:4.20.0-20240425 ``` #### Windows PowerShell @@ -810,7 +826,7 @@ $ docker run -d -p 5555:5555 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.19.0-20240328 + selenium/node-docker:4.20.0-20240425 ``` Complete the `[server]` section in the `config.toml` file. @@ -819,9 +835,9 @@ Complete the `[server]` section in the `config.toml` file. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.19.0-20240328", "{\"browserName\": \"firefox\"}", - "selenium/standalone-chrome:4.19.0-20240328", "{\"browserName\": \"chrome\"}", - "selenium/standalone-edge:4.19.0-20240328", "{\"browserName\": \"MicrosoftEdge\"}" + "selenium/standalone-firefox:4.20.0-20240425", "{\"browserName\": \"firefox\"}", + "selenium/standalone-chrome:4.20.0-20240425", "{\"browserName\": \"chrome\"}", + "selenium/standalone-edge:4.20.0-20240425", "{\"browserName\": \"MicrosoftEdge\"}" ] # URL for connecting to the docker daemon @@ -834,7 +850,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20240328" +video-image = "selenium/video:ffmpeg-7.0-20240425" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -868,7 +884,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.19.0-20240328 + selenium/standalone-docker:4.20.0-20240425 ``` #### Windows PowerShell @@ -879,7 +895,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.19.0-20240328 + selenium/standalone-docker:4.20.0-20240425 ``` @@ -917,7 +933,7 @@ ___ You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node. ``` bash -$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.20.0-20240425 ``` ### SE_JAVA_OPTS Java Environment Options @@ -925,7 +941,7 @@ $ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub s You can pass `SE_JAVA_OPTS` environment variable to the Java process. ``` bash -$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.19.0-20240328 +$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.20.0-20240425 ``` ### Node configuration options @@ -947,7 +963,7 @@ $ docker run -d \ -e SE_EVENT_BUS_HOST= \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ - --shm-size="2g" selenium/node-chrome:4.19.0-20240328 + --shm-size="2g" selenium/node-chrome:4.20.0-20240425 ``` ### Setting Sub Path @@ -966,7 +982,7 @@ These settings can be adjusted by specifying `SE_SCREEN_WIDTH`, `SE_SCREEN_HEIGH environmental variables when starting the container. ``` bash -docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.19.0-20240328 +docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.20.0-20240425 ``` ### Grid Url and Session Timeout @@ -1016,7 +1032,7 @@ To avoid starting the server you can set the `SE_START_XVFB` environment variabl ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.19.0-20240328 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.20.0-20240425 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). @@ -1029,7 +1045,7 @@ pod and then scale a new one after N sessions. Set the environment variable `SE_ a value higher than zero to enable this behaviour. ``` bash -$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.19.0-20240328 +$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.20.0-20240425 ``` With the previous command, the Standalone container will shut down after 5 sessions have been executed. @@ -1054,7 +1070,7 @@ not set `SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP` to `true` (leave the default value `SE_BROWSER_LEFTOVERS_PROCESSES_SECS` to set a value higher than your expected long-running browser processes. ``` bash -$ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true --shm-size="2g" selenium/node-chrome:4.19.0-20240328 +$ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true --shm-size="2g" selenium/node-chrome:4.20.0-20240425 ``` With the previous command, the cleanup will be enabled with the default timings. @@ -1064,7 +1080,7 @@ $ docker run -e SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true \ -e SE_BROWSER_LEFTOVERS_INTERVAL_SECS=7200 \ -e SE_BROWSER_LEFTOVERS_PROCESSES_SECS=3600 \ -e SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=2 \ ---shm-size="2g" selenium/node-chrome:4.19.0-20240328 +--shm-size="2g" selenium/node-chrome:4.20.0-20240425 ``` With the previous command, the cleanup will be enabled, but will run every 2 hours (instead of 1), will kill browsers @@ -1104,6 +1120,58 @@ $ BUILD_ARGS="--build-arg SEL_USER=yourseluser --build-arg SEL_PASSWD=welcome" m ``` ___ +# Build the images with specific versions + +Based on the latest Dockerfile (by cloning the repo and from the project directory root), you can build the images with a specific combination of Selenium Grid, and browser versions. + +For example, you would like to build `node-chrome` and `standalone-chrome` images with the Grid based version `4.17.0`, Chrome browser versions `119`, `120`, `123` respectively. + +```bash +$ ./tests/build-backward-compatible/bootstrap.sh 4.17.0 119,120,123 chrome +``` + +In generic, the script takes the following arguments: +- `$1` (mandatory): Selenium Grid version. Details are fetching from matrix [file](tests/build-backward-compatible/selenium-matrix.yml) +- `$2` (mandatory): Browser major version, multiple values separated by comma. Details are fetching from matrix [file](tests/build-backward-compatible/cdp-matrix.yml) +- `$3` (optional): browser name. If not provided, it will iterate over all the browsers (`chrome`, `edge`, `firefox`) +- `$4` (optional): Push image to registry. By default, it is `false`. If you want to push the image to the registry, set it to `true` (required Docker login to your namespace done before running the script). + +To set your namespace for the images, you can set the environment variable `NAME` before running the script. For example: + +```bash +$ export NAME=artifactory.yourcompany.com/selenium +$ ./tests/build-backward-compatible/bootstrap.sh 4.17.0 119,120,123 chrome +``` + +After running the script, you will see list images with a full tag to pin specific Grid and browser version following [Tagging Conventions](https://github.com/SeleniumHQ/docker-selenium/wiki/Tagging-Convention) + +--- + +## Upgrade browser version in the images + +Selenium server, browser and driver are pre-installed in the image. In case you would like to remain on the same Selenium version and just upgrade the browser and its driver to the latest. You can follow below steps + +Clone the repo and from the project directory root you can upgrade by running: + +```bash +$ VERSION=$EXPECTED_SELENIUM_VERSION make chrome_upgrade_version +``` +For example: `VERSION=4.16.1 make chrome_upgrade_version` + +The new image has tag `$VERSION_YYYYMMDD` where `YYYYMMDD` is the current date. + +```bash +$ VERSION=$SELENIUM_VERSION make firefox_upgrade_version +``` + +```bash +$ VERSION=$SELENIUM_VERSION make edge_upgrade_version +``` + +You can refer to detail commands in the [Makefile](Makefile) file. + +--- + ## Waiting for the Grid to be ready It is a good practice to check first if the Grid is up and ready to receive requests, this can be done by checking the `/wd/hub/status` endpoint. @@ -1168,22 +1236,22 @@ $ docker network create grid $ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub \ --health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \ --health-interval=15s --health-timeout=30s --health-retries=5 \ - selenium/hub:4.19.0-20240328 + selenium/hub:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.19.0-20240328 + selenium/node-edge:4.20.0-20240425 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.19.0-20240328 + selenium/node-firefox:4.20.0-20240425 ``` **Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick. @@ -1300,7 +1368,7 @@ RUN mkdir -p -m755 /seluser/.pki/nssdb \ && chown -R 1200:1201 /seluser # Start from Selenium image and add relevant files from build image -FROM selenium/node-chrome:4.19.0-20240328 +FROM selenium/node-chrome:4.20.0-20240425 USER root COPY --from=build /seluser/ /home/seluser/ USER seluser @@ -1315,7 +1383,7 @@ RUN mkdir -p "/distribution" "/certs" && \ echo '{ "policies": { "Certificates": { "Install": ["/opt/firefox-latest/YOUR_CA.pem"] }} }' >"/distribution/policies.json" # Start from Selenium image and add relevant files from build image -FROM selenium/node-firefox:4.19.0-20240328 +FROM selenium/node-firefox:4.20.0-20240425 USER root COPY --from=build /certs /opt/firefox-latest COPY --from=build /distribution /opt/firefox-latest/distribution @@ -1338,9 +1406,9 @@ You can override it with the `SE_VNC_PORT` environment variable in case you want Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.19.0-20240328 -$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.19.0-20240328 -$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.19.0-20240328 +$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.20.0-20240425 +$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.20.0-20240425 +$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.20.0-20240425 ``` Then, you would use in your VNC client: @@ -1368,9 +1436,9 @@ You can also override it with the `SE_NO_VNC_PORT` environment variable in case Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.19.0-20240328 -$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.19.0-20240328 -$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.19.0-20240328 +$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.20.0-20240425 +$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.20.0-20240425 +$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.20.0-20240425 ``` Then, you would use in your browser: @@ -1395,7 +1463,7 @@ In order to enable tracing in the Selenium Grid container, the following command ```bash docker network create grid docker run -d -p 16686:16686 -p 4317:4317 --net grid --name jaeger jaegertracing/all-in-one:1.54 -docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.19.0-20240328 +docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.20.0-20240425 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ @@ -1403,7 +1471,7 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.19.0-20240328 + selenium/node-chrome:4.20.0-20240425 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ @@ -1411,7 +1479,7 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.19.0-20240328 + selenium/node-edge:4.20.0-20240425 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ @@ -1419,10 +1487,10 @@ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.19.0-20240328 + selenium/node-firefox:4.20.0-20240425 ``` -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) @@ -1479,7 +1547,7 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/files:/home/seluser/Downloads \ - selenium/standalone-chrome:4.19.0-20240328 + selenium/standalone-chrome:4.20.0-20240425 ``` That will mount the host `/home/ubuntu/files` directory @@ -1513,3 +1581,6 @@ Similar to mount volumes to retrieve downloaded files. For video files, you migh mkdir /tmp/videos chown 1200:1201 /tmp/videos ``` + +## Stargazers over time +[![Stargazers over time](https://starchart.cc/SeleniumHQ/docker-selenium.svg?variant=adaptive)](https://starchart.cc/SeleniumHQ/docker-selenium) diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index b74ed9397..1175926ab 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,3 +1,42 @@ +## :heavy_check_mark: selenium-grid-0.30.0 + +- Chart is using image tag 4.20.0-20240425 +- Chart is tested on Kubernetes versions: v1.26.15, v1.27.13, v1.28.9, v1.29.4, v1.30.0, +- Chart is tested on Helm versions: v3.10.3, v3.11.3, v3.12.3, v3.13.3, v3.14.4, + +### Fixed +- [`a83f0d6a`](http://github.com/seleniumhq/docker-selenium/commit/a83f0d6ab9d9337835ced36ceda4a44554d8a12c) - fix(chart): job to patch scaledobject stuck in deleting (#2222) :: Viet Nguyen Duc +- [`be0fe120`](http://github.com/seleniumhq/docker-selenium/commit/be0fe1207bb81a2fcf20bda6d2e50c7a14de4059) - fix(chart): remove hook post-upgrade, add test for chart upgrade capability :: Viet Nguyen Duc +- [`bd50206b`](http://github.com/seleniumhq/docker-selenium/commit/bd50206b1f92f237b054abaf312f0661a8ce2fa6) - fix(chart): node probe ignore proxy in sending request :: Viet Nguyen Duc + +### Changed +- [`f39a9da8`](http://github.com/seleniumhq/docker-selenium/commit/f39a9da86f635b21d6dff0572e7713dc80c20d69) - [docs] pre-update for release docs generation :: Viet Nguyen Duc +- [`df742c98`](http://github.com/seleniumhq/docker-selenium/commit/df742c982f97a6552d11585c7fc7e9f4446073cb) - chore(deps): update helm release jaeger to v3 (#2213) :: renovate[bot] +- [`311b6382`](http://github.com/seleniumhq/docker-selenium/commit/311b63829cf652cad0f32fff2061cb45a7cd46d0) - chore(deps): update helm release kube-prometheus-stack to v58.1.2 (#2208) :: renovate[bot] +- [`ab3f8b85`](http://github.com/seleniumhq/docker-selenium/commit/ab3f8b8546f30da7ae88a308f63bc014718b6355) - chore(deps): update helm release kube-prometheus-stack to v58.1.1 (#2206) :: renovate[bot] +- [`70ed587d`](http://github.com/seleniumhq/docker-selenium/commit/70ed587dd3b99dd2633b23d313da7ac0a9ec12c9) - chore(deps): update helm release kube-prometheus-stack to v58.1.0 (#2205) :: renovate[bot] +- [`a3912b29`](http://github.com/seleniumhq/docker-selenium/commit/a3912b295e359601710bbf86018692194e3d9fbb) - chore(deps): update helm release kube-prometheus-stack to v58.0.1 (#2203) :: renovate[bot] +- [`12eb550a`](http://github.com/seleniumhq/docker-selenium/commit/12eb550a45559742fe161e949ffc34722261c3b9) - test: update CI test node-docker :: Viet Nguyen Duc +- [`033f77c0`](http://github.com/seleniumhq/docker-selenium/commit/033f77c02dde9d61d1a4d44be7526ef689244606) - chore(deps): update helm release jaeger to v2.1.0 (#2198) :: renovate[bot] +- [`2eab3722`](http://github.com/seleniumhq/docker-selenium/commit/2eab37227e01a9693ea604e08dcb3a4587525b5d) - chore(deps): update helm release kube-prometheus-stack to v58 (#2194) :: renovate[bot] +- [`25fdfee9`](http://github.com/seleniumhq/docker-selenium/commit/25fdfee9ddc79a19bee21d6e6da0492926c9b517) - chore(deps): update helm release kube-prometheus-stack to v57.2.1 (#2193) :: renovate[bot] +- [`74619b4c`](http://github.com/seleniumhq/docker-selenium/commit/74619b4c72700e52511f6e312b28a798cb04ac49) - chore(deps): update helm release kube-prometheus-stack to v57 (#2190) :: renovate[bot] +- [`ea556767`](http://github.com/seleniumhq/docker-selenium/commit/ea556767789a94124754172bd5c4dbc92ced17b0) - chore(deps): update helm release jaeger to v2 (#2189) :: renovate[bot] +- [`2ed16c21`](http://github.com/seleniumhq/docker-selenium/commit/2ed16c21425b44215960207d8a2b717a64e98e8a) - chore(deps): update helm release kube-prometheus-stack to v56.21.4 (#2187) :: renovate[bot] +- [`97781912`](http://github.com/seleniumhq/docker-selenium/commit/97781912a48b8262ae516fe62dfd05becdc70a71) - chore(deps): update helm release ingress-nginx to v4.10.0 (#2186) :: renovate[bot] +- [`06d8c18d`](http://github.com/seleniumhq/docker-selenium/commit/06d8c18de4c1bd703b41535190f27e767eee1bb4) - chore(deps): update helm release keda to v2.13.2 (#2184) :: renovate[bot] +- [`ce75e223`](http://github.com/seleniumhq/docker-selenium/commit/ce75e223c5cc306f0b7b0886a2ad2e4c0f74bc4b) - chore(deps): update helm release jaeger to v1.0.2 (#2183) :: renovate[bot] + +## :heavy_check_mark: selenium-grid-0.29.1 + +- Chart is using image tag 4.19.1-20240402 +- Chart is tested on Kubernetes versions: v1.25.16, v1.26.15, v1.27.12, v1.28.8, v1.29.3, +- Chart is tested on Helm versions: v3.10.3, v3.11.3, v3.12.3, v3.13.3, v3.14.3, + +### Fixed +- [`ca7155fa`](http://github.com/seleniumhq/docker-selenium/commit/ca7155faf587577d1e69d6d96c7cc5312b7a16ab) - fix(chart): node preStop - refresh node status in loop :: Viet Nguyen Duc +- [`6a6d1e1f`](http://github.com/seleniumhq/docker-selenium/commit/6a6d1e1f188a6992431925474ad16bb0ef688e52) - fix(chart: Use empty strings as defaults for some empty values (#2176) :: Maxim Manuylov + ## :heavy_check_mark: selenium-grid-0.29.0 - Chart is using image tag 4.19.0-20240328 diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 60c639dfb..b6330f679 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,24 +2,24 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.29.0 -appVersion: 4.19.0-20240328 +version: 0.30.0 +appVersion: 4.20.0-20240425 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts - version: 2.13.0 + version: 2.14.0 name: keda condition: autoscaling.enabled - repository: https://kubernetes.github.io/ingress-nginx - version: 4.9.0 + version: 4.10.0 name: ingress-nginx condition: ingress-nginx.enabled - repository: https://jaegertracing.github.io/helm-charts - version: 1.0.0 + version: 3.0.0 name: jaeger condition: tracing.enabled - repository: https://prometheus-community.github.io/helm-charts - version: 56.15.0 + version: 58.1.2 name: kube-prometheus-stack condition: monitoring.enabled alias: prometheus-stack diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 81e21accb..18a782ed1 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -303,9 +303,9 @@ For now, global configuration supported is: |-------------------------------------------------|-----------------------|-------------------------------------------| | `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s | | `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | -| `global.seleniumGrid.imageTag` | `4.19.0-20240328` | Image tag for all selenium components | -| `global.seleniumGrid.nodesImageTag` | `4.19.0-20240328` | Image tag for browser's nodes | -| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20240328` | Image tag for browser's video recorder | +| `global.seleniumGrid.imageTag` | `4.20.0-20240425` | Image tag for all selenium components | +| `global.seleniumGrid.nodesImageTag` | `4.20.0-20240425` | Image tag for browser's nodes | +| `global.seleniumGrid.videoImageTag` | `ffmpeg-7.0-20240425` | Image tag for browser's video recorder | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | @@ -717,7 +717,7 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. | | `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `chromeNode.imageName` | `node-chrome` | Image of chrome nodes | -| `chromeNode.imageTag` | `4.19.0-20240328` | Image of chrome nodes | +| `chromeNode.imageTag` | `4.20.0-20240425` | Image of chrome nodes | | `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `chromeNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | @@ -760,7 +760,7 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. | | `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `firefoxNode.imageName` | `node-firefox` | Image of firefox nodes | -| `firefoxNode.imageTag` | `4.19.0-20240328` | Image of firefox nodes | +| `firefoxNode.imageTag` | `4.20.0-20240425` | Image of firefox nodes | | `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `firefoxNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | @@ -803,7 +803,7 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. | | `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `edgeNode.imageName` | `node-edge` | Image of edge nodes | -| `edgeNode.imageTag` | `4.19.0-20240328` | Image of edge nodes | +| `edgeNode.imageTag` | `4.20.0-20240425` | Image of edge nodes | | `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `edgeNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | @@ -844,7 +844,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.enabled` | `false` | Enable video recorder for node | | `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `videoRecorder.imageName` | `video` | Selenium video recorder image name | -| `videoRecorder.imageTag` | `ffmpeg-6.1-20240328` | Image tag of video recorder | +| `videoRecorder.imageTag` | `ffmpeg-7.0-20240425` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `videoRecorder.uploader.enabled` | `false` | Enable the uploader for videos | | `videoRecorder.uploader.destinationPrefix` | `` | Destination for uploading video file. It is following `rclone` config | diff --git a/charts/selenium-grid/configs/node/nodePreStop.sh b/charts/selenium-grid/configs/node/nodePreStop.sh index 43c04e0ee..3e18215b4 100644 --- a/charts/selenium-grid/configs/node/nodePreStop.sh +++ b/charts/selenium-grid/configs/node/nodePreStop.sh @@ -49,7 +49,7 @@ function get_grid_url() { SE_SUB_PATH="" fi grid_url=${SE_SERVER_PROTOCOL}://${SE_BASIC_AUTH}${SE_HUB_HOST:-$SE_ROUTER_HOST}:${SE_HUB_PORT:-$SE_ROUTER_PORT}${SE_SUB_PATH} - grid_url_checks=$(curl -m ${max_time} -s -o /dev/null -w "%{http_code}" ${grid_url}) + grid_url_checks=$(curl --noproxy "*" -m ${max_time} -s -o /dev/null -w "%{http_code}" ${grid_url}) if [ "${grid_url_checks}" = "401" ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Host requires Basic Auth. Please add the credentials to the SE_BASIC_AUTH variable (e.g: user:password). preStop ignores to send drain request to upstream." grid_url="" @@ -62,7 +62,7 @@ function get_grid_url() { function signal_distributor_to_drain_node() { if [ "${DISTRIBUTED_MODE}" = true ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Signaling Distributor to drain node" - curl -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://${SE_DISTRIBUTOR_HOST}:${SE_DISTRIBUTOR_PORT}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}" + curl --noproxy "*" -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://${SE_DISTRIBUTOR_HOST}:${SE_DISTRIBUTOR_PORT}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}" fi } @@ -71,17 +71,17 @@ function signal_hub_to_drain_node() { get_grid_url if [ -n "${grid_url}" ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Signaling Hub to drain node" - curl -m ${max_time} -k -X POST ${grid_url}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}" + curl --noproxy "*" -m ${max_time} -k -X POST ${grid_url}/se/grid/distributor/node/${NODE_ID}/drain --header "${HEADERS}" fi fi } function signal_node_to_drain() { echo "$(date +%FT%T%Z) [${probe_name}] - Signaling Node to drain itself" - curl -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}" + curl --noproxy "*" -m ${max_time} -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}" } -if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status > ${tmp_node_file}; then +if curl --noproxy "*" -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status > ${tmp_node_file}; then NODE_ID=$(jq -r '.value.node.nodeId' ${tmp_node_file} || "") if [ -n "${NODE_ID}" ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Current Node ID is: ${NODE_ID}" @@ -93,7 +93,7 @@ if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/st # Wait for the current session to be finished if any while true; do # Attempt the cURL request and capture the exit status - endpoint_http_code=$(curl --retry ${retry_time} -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file} -w "%{http_code}") + endpoint_http_code=$(curl --noproxy "*" --retry ${retry_time} -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file} -w "%{http_code}") endpoint_status=$? echo "$(date +%FT%T%Z) [${probe_name}] - Fetch the Node status via cURL with exit status: ${endpoint_status}, HTTP code: ${endpoint_http_code}" diff --git a/charts/selenium-grid/configs/node/nodeProbe.sh b/charts/selenium-grid/configs/node/nodeProbe.sh index 466f428ef..9af6814be 100644 --- a/charts/selenium-grid/configs/node/nodeProbe.sh +++ b/charts/selenium-grid/configs/node/nodeProbe.sh @@ -35,7 +35,7 @@ function get_grid_url() { SE_SUB_PATH="" fi grid_url=${SE_SERVER_PROTOCOL}://${SE_BASIC_AUTH}${SE_HUB_HOST:-$SE_ROUTER_HOST}:${SE_HUB_PORT:-$SE_ROUTER_PORT}${SE_SUB_PATH} - grid_url_checks=$(curl -m ${max_time} -skf -o /dev/null -w "%{http_code}" ${grid_url}) + grid_url_checks=$(curl --noproxy "*" -m ${max_time} -skf -o /dev/null -w "%{http_code}" ${grid_url}) if [ "${grid_url_checks}" = "401" ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Host requires Basic Auth. Please add the credentials to the SE_BASIC_AUTH variable (e.g: user:password)." help_message @@ -48,7 +48,7 @@ function get_grid_url() { fi } -if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file}; then +if curl --noproxy "*" -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file}; then NODE_ID=$(jq -r '.value.node.nodeId' ${tmp_node_file} || "") NODE_STATUS=$(jq -r '.value.node.availability' ${tmp_node_file} || "") if [ -n "${NODE_ID}" ]; then @@ -60,7 +60,7 @@ if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/st get_grid_url - curl -m ${max_time} -sfk "${grid_url}/status" -o ${tmp_grid_file} + curl --noproxy "*" -m ${max_time} -sfk "${grid_url}/status" -o ${tmp_grid_file} GRID_NODE_ID=$(jq -e ".value.nodes[].id|select(. == \"${NODE_ID}\")" ${tmp_grid_file} | tr -d '"' || "") if [ -n "${GRID_NODE_ID}" ]; then echo "$(date +%FT%T%Z) [${probe_name}] - Grid responds a matched Node ID: ${GRID_NODE_ID}" diff --git a/charts/selenium-grid/templates/_nameHelpers.tpl b/charts/selenium-grid/templates/_nameHelpers.tpl index e5370aeed..75bc1a847 100644 --- a/charts/selenium-grid/templates/_nameHelpers.tpl +++ b/charts/selenium-grid/templates/_nameHelpers.tpl @@ -39,6 +39,13 @@ app.kubernetes.io/component: {{ printf "selenium-grid-%s" .Chart.AppVersion }} helm.sh/chart: {{ include "seleniumGrid.chart" . }} {{- end -}} +{{/* +Autoscaling labels +*/}} +{{- define "seleniumGrid.autoscalingLabels" -}} +component.autoscaling: "true" +{{- end -}} + {{- define "seleniumGrid.component.name" -}} {{- $component := index . 0 }} {{- $root := index . 1 }} @@ -181,3 +188,24 @@ Server ConfigMap fullname {{- define "seleniumGrid.server.configmap.fullname" -}} {{- tpl (default (include "seleniumGrid.component.name" (list "selenium-server-config" $)) .Values.serverConfigMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Patch scaledObjects finalizers job fullname +*/}} +{{- define "seleniumGrid.keda.patchObjectsJob.fullname" -}} +{{- printf "%s-%s" .Release.Name "patch-scaledobjects-finalizers" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Patch scaled objects RoleBinding fullname +*/}} +{{- define "seleniumGrid.keda.roleBinding.fullname" -}} +{{- printf "%s-%s" .Release.Name "patch-keda-rb" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Patch scaled objects Role fullname +*/}} +{{- define "seleniumGrid.keda.role.fullname" -}} +{{- printf "%s-%s" .Release.Name "patch-keda-role" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/charts/selenium-grid/templates/chrome-node-hpa.yaml b/charts/selenium-grid/templates/chrome-node-hpa.yaml index 36d6c3f43..8dbf85ec4 100644 --- a/charts/selenium-grid/templates/chrome-node-hpa.yaml +++ b/charts/selenium-grid/templates/chrome-node-hpa.yaml @@ -5,13 +5,13 @@ metadata: name: {{ template "seleniumGrid.chromeNode.fullname" . }} namespace: {{ .Release.Namespace }} annotations: - helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: deploymentName: {{ template "seleniumGrid.chromeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} {{- with .Values.chromeNode.labels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml b/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml index 5654cd5a0..c858908ce 100644 --- a/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml +++ b/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml @@ -12,6 +12,7 @@ metadata: app: {{ template "seleniumGrid.chromeNode.fullname" . }} app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} {{- with .Values.chromeNode.labels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/edge-node-hpa.yaml b/charts/selenium-grid/templates/edge-node-hpa.yaml index 604b89156..513440d63 100644 --- a/charts/selenium-grid/templates/edge-node-hpa.yaml +++ b/charts/selenium-grid/templates/edge-node-hpa.yaml @@ -5,13 +5,13 @@ metadata: name: {{ template "seleniumGrid.edgeNode.fullname" . }} namespace: {{ .Release.Namespace }} annotations: - helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: deploymentName: {{ template "seleniumGrid.edgeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} {{- with .Values.edgeNode.labels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/edge-node-scaledjob.yaml b/charts/selenium-grid/templates/edge-node-scaledjob.yaml index 4a0e4fc51..e9cce337a 100644 --- a/charts/selenium-grid/templates/edge-node-scaledjob.yaml +++ b/charts/selenium-grid/templates/edge-node-scaledjob.yaml @@ -12,6 +12,7 @@ metadata: app: {{ template "seleniumGrid.edgeNode.fullname" . }} app.kubernetes.io/name: {{ template "seleniumGrid.edgeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} {{- with .Values.edgeNode.labels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/firefox-node-hpa.yaml b/charts/selenium-grid/templates/firefox-node-hpa.yaml index 490e16949..0d4d907ef 100644 --- a/charts/selenium-grid/templates/firefox-node-hpa.yaml +++ b/charts/selenium-grid/templates/firefox-node-hpa.yaml @@ -5,13 +5,13 @@ metadata: name: {{ template "seleniumGrid.firefoxNode.fullname" . }} namespace: {{ .Release.Namespace }} annotations: - helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: deploymentName: {{ template "seleniumGrid.firefoxNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} {{- with .Values.firefoxNode.labels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/firefox-node-scaledjob.yaml b/charts/selenium-grid/templates/firefox-node-scaledjob.yaml index 732ec8c9b..d65bf0b69 100644 --- a/charts/selenium-grid/templates/firefox-node-scaledjob.yaml +++ b/charts/selenium-grid/templates/firefox-node-scaledjob.yaml @@ -12,6 +12,7 @@ metadata: app: {{ template "seleniumGrid.firefoxNode.fullname" . }} app.kubernetes.io/name: {{ template "seleniumGrid.firefoxNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} {{- with .Values.firefoxNode.labels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml b/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml new file mode 100644 index 000000000..d1c21a96f --- /dev/null +++ b/charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml @@ -0,0 +1,35 @@ +{{- if eq (include "seleniumGrid.useKEDA" $) "true" }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }} + namespace: {{ .Release.Namespace }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded + "helm.sh/resource-policy": delete + {{- with $.Values.autoscaling.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + deploymentName: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }} + {{- include "seleniumGrid.commonLabels" $ | nindent 4 }} + {{- with $.Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + template: + metadata: + name: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }} + spec: + activeDeadlineSeconds: 120 + serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" $ }} + serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" $ }} + containers: + - name: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }} + image: {{ $.Values.global.seleniumGrid.kubectlImage }} + command: + - "bin/bash" + - "-c" + - "kubectl get ScaledObjects,ScaledJobs -n {{ .Release.Namespace }} -l component.autoscaling=true -o=json | jq '.metadata.finalizers = null' | kubectl apply -f -" + restartPolicy: Never +{{- end }} diff --git a/charts/selenium-grid/templates/patch-keda/patch-keda-rb.yaml b/charts/selenium-grid/templates/patch-keda/patch-keda-rb.yaml new file mode 100644 index 000000000..6e80973b4 --- /dev/null +++ b/charts/selenium-grid/templates/patch-keda/patch-keda-rb.yaml @@ -0,0 +1,20 @@ +{{- if eq (include "seleniumGrid.useKEDA" $) "true" }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ template "seleniumGrid.keda.roleBinding.fullname" $ }} + namespace: {{ .Release.Namespace }} + labels: + deploymentName: {{ template "seleniumGrid.keda.roleBinding.fullname" $ }} + {{- include "seleniumGrid.commonLabels" $ | nindent 4 }} + {{- with $.Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +subjects: + - kind: ServiceAccount + name: {{ template "seleniumGrid.serviceAccount.fullname" $ }} +roleRef: + kind: Role + name: {{ template "seleniumGrid.keda.role.fullname" $ }} + apiGroup: rbac.authorization.k8s.io +{{- end }} diff --git a/charts/selenium-grid/templates/patch-keda/patch-keda-role.yaml b/charts/selenium-grid/templates/patch-keda/patch-keda-role.yaml new file mode 100644 index 000000000..6a841421a --- /dev/null +++ b/charts/selenium-grid/templates/patch-keda/patch-keda-role.yaml @@ -0,0 +1,37 @@ +{{- if eq (include "seleniumGrid.useKEDA" $) "true" }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ template "seleniumGrid.keda.role.fullname" $ }} + namespace: {{ .Release.Namespace }} + labels: + deploymentName: {{ template "seleniumGrid.keda.role.fullname" $ }} + {{- include "seleniumGrid.commonLabels" $ | nindent 4 }} + {{- with $.Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +rules: + - apiGroups: + - keda.sh + resources: + - scaledjobs + - scaledjobs/finalizers + - scaledjobs/status + verbs: + - '*' + - apiGroups: + - keda.sh + resources: + - scaledobjects + - scaledobjects/finalizers + - scaledobjects/status + verbs: + - '*' + - apiGroups: + - keda.sh + resources: + - triggerauthentications + - triggerauthentications/status + verbs: + - '*' +{{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 36fe1c67f..4dd94c3bc 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -7,11 +7,13 @@ global: # Image registry for all selenium components imageRegistry: selenium # Image tag for all selenium components - imageTag: 4.19.0-20240328 + imageTag: 4.20.0-20240425 # Image tag for browser's nodes - nodesImageTag: 4.19.0-20240328 + nodesImageTag: 4.20.0-20240425 # Image tag for browser's video recorder - videoImageTag: ffmpeg-6.1-20240328 + videoImageTag: ffmpeg-7.0-20240425 + # kubectl image is used to execute kubectl commands in utility jobs + kubectlImage: bitnami/kubectl:latest # Pull secret for all components, can be overridden individually imagePullSecret: "" # Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging @@ -200,7 +202,7 @@ components: # Router image name imageName: router # Router image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -264,7 +266,7 @@ components: # Distributor image name imageName: distributor # Distributor image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -299,7 +301,7 @@ components: # Event Bus image name imageName: event-bus # Event Bus image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -338,7 +340,7 @@ components: # Session Map image name imageName: sessions # Session Map image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -369,7 +371,7 @@ components: # Session Queue image name imageName: session-queue # Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -421,7 +423,7 @@ hub: # Selenium Hub image name imageName: hub # Selenium Hub image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -546,7 +548,7 @@ autoscaling: scalingType: job # Annotations for KEDA resources: ScaledObject and ScaledJob annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install,post-upgrade,post-rollback,pre-delete # Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) scaledOptions: minReplicaCount: 0 @@ -598,7 +600,7 @@ chromeNode: # Image of chrome nodes imageName: node-chrome # Image of chrome nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -759,7 +761,7 @@ firefoxNode: # Image of firefox nodes imageName: node-firefox # Image of firefox nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -918,7 +920,7 @@ edgeNode: # Image of edge nodes imageName: node-edge # Image of edge nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.19.0-20240328 + # imageTag: 4.20.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -1066,7 +1068,7 @@ videoRecorder: # Image of video recorder imageName: video # Image of video recorder - # imageTag: ffmpeg-6.1-20240328 + # imageTag: ffmpeg-7.0-20240425 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -1185,7 +1187,7 @@ customLabels: {} # Configuration for dependency chart keda keda: additionalAnnotations: - "helm.sh/hook": pre-install + "helm.sh/hook": pre-install,pre-upgrade,pre-rollback,post-delete http: timeout: 60000 webhooks: @@ -1208,7 +1210,7 @@ jaeger: - name: QUERY_BASE_PATH value: *jaegerBasePath storage: - type: none + type: badger agent: enabled: false collector: @@ -1221,19 +1223,19 @@ prometheus-stack: defaultRules: create: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install,post-upgrade,post-rollback,pre-delete alertmanager: enabled: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install,post-upgrade,post-rollback,pre-delete grafana: enabled: true adminPassword: admin forceDeployDatasources: true forceDeployDashboards: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install,post-upgrade,post-rollback,pre-delete prometheus: enabled: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install,post-upgrade,post-rollback,pre-delete diff --git a/docker-compose-v2-tracing.yml b/docker-compose-v2-tracing.yml index df655b953..e7f4b7c69 100644 --- a/docker-compose-v2-tracing.yml +++ b/docker-compose-v2-tracing.yml @@ -1,15 +1,15 @@ -# 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: - image: jaegertracing/all-in-one:1.54 + image: jaegertracing/all-in-one:1.56 ports: - "16686:16686" - "4317:4317" chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -39,7 +39,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -54,7 +54,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v2.yml b/docker-compose-v2.yml index 96c0d72b0..f0ac07135 100644 --- a/docker-compose-v2.yml +++ b/docker-compose-v2.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -16,7 +16,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -28,7 +28,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -40,7 +40,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-basicauth.yml b/docker-compose-v3-basicauth.yml index 965d3076c..be371214d 100644 --- a/docker-compose-v3-basicauth.yml +++ b/docker-compose-v3-basicauth.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-beta-channel.yml b/docker-compose-v3-beta-channel.yml index 677ee3686..a9ff9d31a 100644 --- a/docker-compose-v3-beta-channel.yml +++ b/docker-compose-v3-beta-channel.yml @@ -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: diff --git a/docker-compose-v3-dev-channel.yml b/docker-compose-v3-dev-channel.yml index 1a4bc292f..3cab04ea5 100644 --- a/docker-compose-v3-dev-channel.yml +++ b/docker-compose-v3-dev-channel.yml @@ -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: diff --git a/docker-compose-v3-dev.yml b/docker-compose-v3-dev.yml index 8332bae42..5ebc85f6d 100644 --- a/docker-compose-v3-dev.yml +++ b/docker-compose-v3-dev.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -16,7 +16,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -40,7 +40,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-dynamic-grid.yml b/docker-compose-v3-dynamic-grid.yml index 9d897de83..e364c9c58 100644 --- a/docker-compose-v3-dynamic-grid.yml +++ b/docker-compose-v3-dynamic-grid.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/node-docker:4.19.0-20240328 + image: selenium/node-docker:4.20.0-20240425 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/bin/config.toml @@ -17,7 +17,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-full-grid-dev.yml b/docker-compose-v3-full-grid-dev.yml index 6ca964277..56d050169 100644 --- a/docker-compose-v3-full-grid-dev.yml +++ b/docker-compose-v3-full-grid-dev.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/event-bus:4.19.0-20240328 + image: selenium/event-bus:4.20.0-20240425 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-event-bus @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.19.0-20240328 + image: selenium/sessions:4.20.0-20240425 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-sessions @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.19.0-20240328 + image: selenium/session-queue:4.20.0-20240425 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-session-queue @@ -36,7 +36,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.19.0-20240328 + image: selenium/distributor:4.20.0-20240425 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-distributor @@ -56,7 +56,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.19.0-20240328 + image: selenium/router:4.20.0-20240425 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-router @@ -75,7 +75,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -87,7 +87,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -99,7 +99,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml index 81e5b2585..51310a8ab 100644 --- a/docker-compose-v3-full-grid-swarm.yml +++ b/docker-compose-v3-full-grid-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-full-grid-tracing.yml b/docker-compose-v3-full-grid-tracing.yml index 1727aef56..728017c10 100644 --- a/docker-compose-v3-full-grid-tracing.yml +++ b/docker-compose-v3-full-grid-tracing.yml @@ -1,15 +1,15 @@ -# 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: - image: jaegertracing/all-in-one:1.54 + image: jaegertracing/all-in-one:1.56 ports: - "16686:16686" - "4317:4317" selenium-event-bus: - image: selenium/event-bus:4.19.0-20240328 + image: selenium/event-bus:4.20.0-20240425 container_name: selenium-event-bus ports: - "4442:4442" @@ -22,7 +22,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-sessions: - image: selenium/sessions:4.19.0-20240328 + image: selenium/sessions:4.20.0-20240425 container_name: selenium-sessions ports: - "5556:5556" @@ -36,7 +36,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-session-queue: - image: selenium/session-queue:4.19.0-20240328 + image: selenium/session-queue:4.20.0-20240425 container_name: selenium-session-queue ports: - "5559:5559" @@ -45,7 +45,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-distributor: - image: selenium/distributor:4.19.0-20240328 + image: selenium/distributor:4.20.0-20240425 container_name: selenium-distributor ports: - "5553:5553" @@ -65,7 +65,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-router: - image: selenium/router:4.19.0-20240328 + image: selenium/router:4.20.0-20240425 container_name: selenium-router ports: - "4444:4444" @@ -84,7 +84,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-event-bus @@ -96,7 +96,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-event-bus @@ -108,7 +108,7 @@ services: - SE_OTEL_TRACES_EXPORTER=otlp - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid.yml b/docker-compose-v3-full-grid.yml index 272ebddd5..9af8dd5ca 100644 --- a/docker-compose-v3-full-grid.yml +++ b/docker-compose-v3-full-grid.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/event-bus:4.19.0-20240328 + image: selenium/event-bus:4.20.0-20240425 container_name: selenium-event-bus ports: - "4442:4442" @@ -12,7 +12,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.19.0-20240328 + image: selenium/sessions:4.20.0-20240425 container_name: selenium-sessions ports: - "5556:5556" @@ -24,13 +24,13 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.19.0-20240328 + image: selenium/session-queue:4.20.0-20240425 container_name: selenium-session-queue ports: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.19.0-20240328 + image: selenium/distributor:4.20.0-20240425 container_name: selenium-distributor ports: - "5553:5553" @@ -48,7 +48,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.19.0-20240328 + image: selenium/router:4.20.0-20240425 container_name: selenium-router ports: - "4444:4444" @@ -65,7 +65,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-event-bus @@ -75,7 +75,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-event-bus @@ -85,11 +85,11 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-event-bus environment: - SE_EVENT_BUS_HOST=selenium-event-bus - SE_EVENT_BUS_PUBLISH_PORT=4442 - - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ No newline at end of file + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 diff --git a/docker-compose-v3-swarm.yml b/docker-compose-v3-swarm.yml index 81e5b2585..51310a8ab 100644 --- a/docker-compose-v3-swarm.yml +++ b/docker-compose-v3-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-tracing.yml b/docker-compose-v3-tracing.yml index d4096acab..e9fa1f12a 100644 --- a/docker-compose-v3-tracing.yml +++ b/docker-compose-v3-tracing.yml @@ -1,15 +1,15 @@ -# 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: - image: jaegertracing/all-in-one:1.54 + image: jaegertracing/all-in-one:1.56 ports: - "16686:16686" - "4317:4317" chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -22,7 +22,7 @@ services: - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -35,7 +35,7 @@ services: - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -48,7 +48,7 @@ services: - SE_OTEL_EXPORTER_ENDPOINT=http://jaeger:4317 selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video-upload.yml b/docker-compose-v3-video-upload.yml index f95e750f7..6cd7b0a57 100644 --- a/docker-compose-v3-video-upload.yml +++ b/docker-compose-v3-video-upload.yml @@ -1,11 +1,11 @@ -# 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: chrome: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -15,7 +15,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -25,7 +25,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -35,7 +35,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 chrome_video: - image: selenium/video:ffmpeg-6.1-20240328 + image: selenium/video:ffmpeg-7.0-20240425 depends_on: - chrome environment: @@ -56,7 +56,7 @@ services: - RCLONE_CONFIG_S3_NO_CHECK_BUCKET=true edge_video: - image: selenium/video:ffmpeg-6.1-20240328 + image: selenium/video:ffmpeg-7.0-20240425 depends_on: - edge environment: @@ -77,7 +77,7 @@ services: - RCLONE_CONFIG_S3_NO_CHECK_BUCKET=true firefox_video: - image: selenium/video:ffmpeg-6.1-20240328 + image: selenium/video:ffmpeg-7.0-20240425 depends_on: - firefox environment: @@ -98,7 +98,7 @@ services: - RCLONE_CONFIG_S3_NO_CHECK_BUCKET=true selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video.yml b/docker-compose-v3-video.yml index b99378d12..d29ce871a 100644 --- a/docker-compose-v3-video.yml +++ b/docker-compose-v3-video.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 chrome_video: - image: selenium/video:ffmpeg-6.1-20240328 + image: selenium/video:ffmpeg-7.0-20240425 volumes: - /tmp/videos:/videos depends_on: @@ -44,7 +44,7 @@ services: - FILE_NAME=chrome_video.mp4 edge_video: - image: selenium/video:ffmpeg-6.1-20240328 + image: selenium/video:ffmpeg-7.0-20240425 volumes: - /tmp/videos:/videos depends_on: @@ -54,7 +54,7 @@ services: - FILE_NAME=edge_video.mp4 firefox_video: - image: selenium/video:ffmpeg-6.1-20240328 + image: selenium/video:ffmpeg-7.0-20240425 volumes: - /tmp/videos:/videos depends_on: @@ -64,7 +64,7 @@ services: - FILE_NAME=firefox_video.mp4 selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3.yml b/docker-compose-v3.yml index 7e7734da5..d02017f3b 100644 --- a/docker-compose-v3.yml +++ b/docker-compose-v3.yml @@ -1,10 +1,10 @@ -# 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: - image: selenium/node-chrome:4.19.0-20240328 + image: selenium/node-chrome:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.19.0-20240328 + image: selenium/node-edge:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.19.0-20240328 + image: selenium/node-firefox:4.20.0-20240425 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.19.0-20240328 + image: selenium/hub:4.20.0-20240425 container_name: selenium-hub ports: - "4442:4442" diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..5db72dd6a --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} diff --git a/tag_and_push_browser_images.sh b/tag_and_push_browser_images.sh index 2f14e15e9..e58689f9d 100755 --- a/tag_and_push_browser_images.sh +++ b/tag_and_push_browser_images.sh @@ -57,6 +57,8 @@ chrome) do docker tag ${NAMESPACE}/node-chrome:${TAG_VERSION} ${NAMESPACE}/node-chrome:${chrome_tag} docker tag ${NAMESPACE}/standalone-chrome:${TAG_VERSION} ${NAMESPACE}/standalone-chrome:${chrome_tag} + echo "Tagged ${NAMESPACE}/node-chrome:${chrome_tag}" + echo "Tagged ${NAMESPACE}/standalone-chrome:${chrome_tag}" if [ "${PUSH_IMAGE}" = true ]; then docker push ${NAMESPACE}/node-chrome:${chrome_tag} docker push ${NAMESPACE}/standalone-chrome:${chrome_tag} @@ -101,6 +103,8 @@ edge) do docker tag ${NAMESPACE}/node-edge:${TAG_VERSION} ${NAMESPACE}/node-edge:${edge_tag} docker tag ${NAMESPACE}/standalone-edge:${TAG_VERSION} ${NAMESPACE}/standalone-edge:${edge_tag} + echo "Tagged ${NAMESPACE}/node-edge:${edge_tag}" + echo "Tagged ${NAMESPACE}/standalone-edge:${edge_tag}" if [ "${PUSH_IMAGE}" = true ]; then docker push ${NAMESPACE}/node-edge:${edge_tag} docker push ${NAMESPACE}/standalone-edge:${edge_tag} @@ -144,6 +148,8 @@ firefox) do docker tag ${NAMESPACE}/node-firefox:${TAG_VERSION} ${NAMESPACE}/node-firefox:${firefox_tag} docker tag ${NAMESPACE}/standalone-firefox:${TAG_VERSION} ${NAMESPACE}/standalone-firefox:${firefox_tag} + echo "Tagged ${NAMESPACE}/node-firefox:${firefox_tag}" + echo "Tagged ${NAMESPACE}/standalone-firefox:${firefox_tag}" if [ "${PUSH_IMAGE}" = true ]; then docker push ${NAMESPACE}/node-firefox:${firefox_tag} docker push ${NAMESPACE}/standalone-firefox:${firefox_tag} diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 7d431d1ea..a292d1860 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -17,6 +17,7 @@ SELENIUM_GRID_USERNAME = os.environ.get('SELENIUM_GRID_USERNAME', '') SELENIUM_GRID_PASSWORD = os.environ.get('SELENIUM_GRID_PASSWORD', '') SELENIUM_GRID_TEST_HEADLESS = os.environ.get('SELENIUM_GRID_TEST_HEADLESS', 'false').lower() == 'true' +SELENIUM_ENABLE_MANAGED_DOWNLOADS = os.environ.get('SELENIUM_ENABLE_MANAGED_DOWNLOADS', 'true').lower() == 'true' WEB_DRIVER_WAIT_TIMEOUT = int(os.environ.get('WEB_DRIVER_WAIT_TIMEOUT', 60)) TEST_PARALLEL_HARDENING = os.environ.get('TEST_PARALLEL_HARDENING', 'false').lower() == 'true' @@ -90,6 +91,9 @@ def test_download_file(self): ) driver.execute_script("arguments[0].scrollIntoView();", file_link) file_link.click() + if not SELENIUM_ENABLE_MANAGED_DOWNLOADS: + time.sleep(4) + return wait.until( lambda d: str(d.get_downloadable_files()[0]).endswith(file_name) ) @@ -108,7 +112,7 @@ class ChromeTests(SeleniumGenericTests): def setUp(self): try: options = ChromeOptions() - options.enable_downloads = True + options.enable_downloads = SELENIUM_ENABLE_MANAGED_DOWNLOADS options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') options.set_capability('se:recordVideo', True) if SELENIUM_GRID_TEST_HEADLESS: @@ -129,7 +133,7 @@ class EdgeTests(SeleniumGenericTests): def setUp(self): try: options = EdgeOptions() - options.enable_downloads = True + options.enable_downloads = SELENIUM_ENABLE_MANAGED_DOWNLOADS options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') options.set_capability('se:recordVideo', True) if SELENIUM_GRID_TEST_HEADLESS: @@ -154,7 +158,7 @@ def setUp(self): profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "*/*") options = FirefoxOptions() options.profile = profile - options.enable_downloads = True + options.enable_downloads = SELENIUM_ENABLE_MANAGED_DOWNLOADS options.set_capability('se:recordVideo', True) if SELENIUM_GRID_TEST_HEADLESS: options.add_argument('-headless') diff --git a/tests/bootstrap.sh b/tests/bootstrap.sh index 3391e0828..b412e885c 100755 --- a/tests/bootstrap.sh +++ b/tests/bootstrap.sh @@ -7,7 +7,7 @@ if [ "${CI:-false}" = "false" ]; then source docker-selenium-tests/bin/activate fi -python -m pip install selenium==4.19.0 \ +python -m pip install selenium==${BINDING_VERSION} \ docker===7.0.0 \ chardet \ | grep -v 'Requirement already satisfied' diff --git a/tests/build-backward-compatible/bootstrap.sh b/tests/build-backward-compatible/bootstrap.sh new file mode 100755 index 000000000..1a65eb5b2 --- /dev/null +++ b/tests/build-backward-compatible/bootstrap.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +cd tests || true + +if [ "${CI:-false}" = "false" ]; then + pip3 install virtualenv | grep -v 'Requirement already satisfied' + virtualenv docker-selenium-tests + source docker-selenium-tests/bin/activate +fi + +python -m pip install pyyaml==6.0.1 \ + | grep -v 'Requirement already satisfied' + +cd .. + +SELENIUM_VERSION=$1 +CDP_VERSIONS=$2 +BROWSER=${3:-"all"} +PUSH_IMAGE=${4:-"false"} + +IFS=',' read -ra VERSION_LIST <<< "$CDP_VERSIONS" + +for CDP_VERSION in "${VERSION_LIST[@]}"; do + python tests/build-backward-compatible/builder.py ${SELENIUM_VERSION} ${CDP_VERSION} + export $(cat .env | xargs) + if [ "${BROWSER}" = "all" ] || [ "${BROWSER}" = "firefox" ]; then + if [ -n "${FIREFOX_VERSION}" ]; then + BUILD_ARGS="--build-arg FIREFOX_VERSION=${FIREFOX_VERSION}" + BUILD_ARGS="${BUILD_ARGS}" make standalone_firefox + else + echo "Firefox version not found in matrix for input ${CDP_VERSION}" + exit 1 + fi + fi + if [ "${BROWSER}" = "all" ] || [ "${BROWSER}" = "edge" ]; then + if [ -n "${EDGE_VERSION}" ]; then + BUILD_ARGS="--build-arg EDGE_VERSION=${EDGE_VERSION}" + BUILD_ARGS="${BUILD_ARGS}" make standalone_edge + else + echo "Edge version not found in matrix for input ${CDP_VERSION}" + exit 1 + fi + fi + if [ "${BROWSER}" = "all" ] || [ "${BROWSER}" = "chrome" ]; then + if [ -n "${CHROME_VERSION}" ]; then + BUILD_ARGS="--build-arg CHROME_VERSION=${CHROME_VERSION}" + BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome + else + echo "Chrome version not found in matrix for input ${CDP_VERSION}" + exit 1 + fi + fi + if [ "${BROWSER}" = "all" ] || [ "${BROWSER}" = "firefox" ]; then + TAG_LOG_OUTPUT="$TAG_LOG_OUTPUT $(PUSH_IMAGE=${PUSH_IMAGE} make tag_and_push_firefox_images)" + fi + if [ "${BROWSER}" = "all" ] || [ "${BROWSER}" = "edge" ]; then + TAG_LOG_OUTPUT="$TAG_LOG_OUTPUT $(PUSH_IMAGE=${PUSH_IMAGE} make tag_and_push_edge_images)" + fi + if [ "${BROWSER}" = "all" ] || [ "${BROWSER}" = "chrome" ]; then + TAG_LOG_OUTPUT="$TAG_LOG_OUTPUT $(PUSH_IMAGE=${PUSH_IMAGE} make tag_and_push_chrome_images)" + fi +done + +readarray -t LOG_LINES <<< "$TAG_LOG_OUTPUT" +for line in "${LOG_LINES[@]}"; do + echo "$line" +done diff --git a/tests/build-backward-compatible/builder.py b/tests/build-backward-compatible/builder.py new file mode 100755 index 000000000..7778c4459 --- /dev/null +++ b/tests/build-backward-compatible/builder.py @@ -0,0 +1,48 @@ +import yaml +import sys +import logging + +logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s") +logger = logging.getLogger(__name__) + +def load_template(yaml_file): + try: + with open(yaml_file, 'r') as file: + documents = yaml.safe_load(file) + return documents + except yaml.YAMLError as error: + logger.debug("Error in configuration file: ", error) + +def recursive_merge(dict1, dict2): + for key in dict2: + if key in dict1 and isinstance(dict1[key], dict) and isinstance(dict2[key], dict): + recursive_merge(dict1[key], dict2[key]) + else: + dict1[key] = dict2[key] + +if __name__ == '__main__': + # Load matrix configuration + selenium_matrix = load_template('tests/build-backward-compatible/selenium-matrix.yml') + cdp_matrix = load_template('tests/build-backward-compatible/cdp-matrix.yml') + # Merge configurations into single matrix + recursive_merge(selenium_matrix, cdp_matrix) + matrix = selenium_matrix["matrix"] + # Get versions from arguments + selenium_version = sys.argv[1] + cdp_version = int(sys.argv[2]) + # Create .env with component versions + BASE_RELEASE = matrix["selenium"][selenium_version]["BASE_RELEASE"] + BASE_VERSION = matrix["selenium"][selenium_version]["BASE_VERSION"] + VERSION = matrix["selenium"][selenium_version]["VERSION"] + BINDING_VERSION = matrix["selenium"][selenium_version]["BINDING_VERSION"] + FIREFOX_VERSION = matrix["CDP"][cdp_version]["FIREFOX_VERSION"] + EDGE_VERSION = matrix["CDP"][cdp_version]["EDGE_VERSION"] + CHROME_VERSION = matrix["CDP"][cdp_version]["CHROME_VERSION"] + with open('.env', 'w') as f: + f.write(f"BASE_RELEASE={BASE_RELEASE}\n") + f.write(f"BASE_VERSION={BASE_VERSION}\n") + f.write(f"VERSION={VERSION}\n") + f.write(f"BINDING_VERSION={BINDING_VERSION}\n") + f.write(f"FIREFOX_VERSION={FIREFOX_VERSION}\n") + f.write(f"EDGE_VERSION={EDGE_VERSION}\n") + f.write(f"CHROME_VERSION={CHROME_VERSION}") diff --git a/tests/build-backward-compatible/cdp-matrix.yml b/tests/build-backward-compatible/cdp-matrix.yml new file mode 100644 index 000000000..ea96289d7 --- /dev/null +++ b/tests/build-backward-compatible/cdp-matrix.yml @@ -0,0 +1,58 @@ +matrix: + # List of versions get from + # Edge: https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable + # Chrome: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable + # Firefox: https://download-installer.cdn.mozilla.net/pub/firefox/releases + CDP: + 124: + EDGE_VERSION: 'microsoft-edge-stable=124.0.2478.51-1' + CHROME_VERSION: 'google-chrome-stable=124.0.6367.60-1' + FIREFOX_VERSION: '124.0.2' + 123: + EDGE_VERSION: 'microsoft-edge-stable=123.0.2420.97-1' + CHROME_VERSION: 'google-chrome-stable=123.0.6312.122-1' + FIREFOX_VERSION: '123.0.1' + 122: + EDGE_VERSION: 'microsoft-edge-stable=122.0.2365.92-1' + CHROME_VERSION: 'google-chrome-stable=122.0.6261.128-1' + FIREFOX_VERSION: '122.0.1' + 121: + EDGE_VERSION: 'microsoft-edge-stable=121.0.2277.98-1' + CHROME_VERSION: 'google-chrome-stable=121.0.6167.184-1' + FIREFOX_VERSION: '121.0.1' + 120: + EDGE_VERSION: 'microsoft-edge-stable=120.0.2210.91-1' + CHROME_VERSION: 'google-chrome-stable=120.0.6099.224-1' + FIREFOX_VERSION: '120.0.1' + 119: + EDGE_VERSION: 'microsoft-edge-stable=119.0.2151.97-1' + CHROME_VERSION: 'google-chrome-stable=119.0.6045.199-1' + FIREFOX_VERSION: '119.0.1' + 118: + EDGE_VERSION: 'microsoft-edge-stable=118.0.2088.76-1' + CHROME_VERSION: 'google-chrome-stable=118.0.5993.117-1' + FIREFOX_VERSION: '118.0.2' + 117: + EDGE_VERSION: 'microsoft-edge-stable=117.0.2045.55-1' + CHROME_VERSION: 'google-chrome-stable=117.0.5938.149-1' + FIREFOX_VERSION: '117.0.1' + 116: + EDGE_VERSION: 'microsoft-edge-stable=116.0.1938.81-1' + CHROME_VERSION: 'google-chrome-stable=116.0.5845.187-1' + FIREFOX_VERSION: '116.0.3' + 115: + EDGE_VERSION: 'microsoft-edge-stable=115.0.1901.203-1' + CHROME_VERSION: 'google-chrome-stable=115.0.5790.170-1' + FIREFOX_VERSION: '115.0.3' + 114: + EDGE_VERSION: 'microsoft-edge-stable=114.0.1823.82-1' + CHROME_VERSION: 'google-chrome-stable=114.0.5735.198-1' + FIREFOX_VERSION: '114.0.2' + 113: + EDGE_VERSION: 'microsoft-edge-stable=113.0.1774.57-1' + CHROME_VERSION: 'google-chrome-stable=113.0.5672.126-1' + FIREFOX_VERSION: '113.0.2' + 112: + EDGE_VERSION: 'microsoft-edge-stable=112.0.1722.64-1' + CHROME_VERSION: 'google-chrome-stable=112.0.5615.165-1' + FIREFOX_VERSION: '112.0.2' diff --git a/tests/build-backward-compatible/selenium-matrix.yml b/tests/build-backward-compatible/selenium-matrix.yml new file mode 100644 index 000000000..41b215e89 --- /dev/null +++ b/tests/build-backward-compatible/selenium-matrix.yml @@ -0,0 +1,157 @@ +matrix: + # List CDP versions get from release notes https://www.selenium.dev/categories/releases/ + # https://github.com/SeleniumHQ/selenium/releases + selenium: + nightly: + BASE_RELEASE: nightly + BASE_VERSION: 4.21.0-SNAPSHOT + VERSION: 4.21.0-SNAPSHOT + BINDING_VERSION: nightly + CDP: + - 124 + - 123 + - 122 + 4.20.0: + BASE_RELEASE: selenium-4.20.0 + BASE_VERSION: 4.20.0 + VERSION: 4.20.0 + BINDING_VERSION: 4.20.0 + CDP: + - 124 + - 123 + - 122 + 4.19.1: + BASE_RELEASE: selenium-4.19.0 + BASE_VERSION: 4.19.1 + VERSION: 4.19.1 + BINDING_VERSION: 4.19.0 + CDP: + - 123 + - 122 + - 121 + 4.19.0: + BASE_RELEASE: selenium-4.19.0 + BASE_VERSION: 4.19.0 + VERSION: 4.19.0 + BINDING_VERSION: 4.19.0 + CDP: + - 123 + - 122 + - 121 + 4.18.1: + BASE_RELEASE: selenium-4.18.0 + BASE_VERSION: 4.18.1 + VERSION: 4.18.1 + BINDING_VERSION: 4.18.1 + CDP: + - 122 + - 121 + - 120 + 4.18.0: + BASE_RELEASE: selenium-4.18.0 + BASE_VERSION: 4.18.0 + VERSION: 4.18.0 + BINDING_VERSION: 4.18.0 + CDP: + - 122 + - 121 + - 120 + 4.17.0: + BASE_RELEASE: selenium-4.17.0 + BASE_VERSION: 4.17.0 + VERSION: 4.17.0 + BINDING_VERSION: 4.17.2 + CDP: + - 121 + - 120 + - 119 + 4.16.1: + BASE_RELEASE: selenium-4.16.0 + BASE_VERSION: 4.16.1 + VERSION: 4.16.1 + BINDING_VERSION: 4.16.0 + CDP: + - 120 + - 119 + - 118 + 4.16.0: + BASE_RELEASE: selenium-4.16.0 + BASE_VERSION: 4.16.0 + VERSION: 4.16.0 + BINDING_VERSION: 4.16.0 + CDP: + - 120 + - 119 + - 118 + 4.15.0: + BASE_RELEASE: selenium-4.15.0 + BASE_VERSION: 4.15.0 + VERSION: 4.15.0 + BINDING_VERSION: 4.15.2 + CDP: + - 119 + - 118 + - 117 + 4.14.1: + BASE_RELEASE: selenium-4.14.0 + BASE_VERSION: 4.14.1 + VERSION: 4.14.1 + BINDING_VERSION: 4.14.0 + CDP: + - 118 + - 117 + - 116 + 4.14.0: + BASE_RELEASE: selenium-4.14.0 + BASE_VERSION: 4.14.0 + VERSION: 4.14.0 + BINDING_VERSION: 4.14.0 + CDP: + - 118 + - 117 + - 116 + 4.13.0: + BASE_RELEASE: selenium-4.13.0 + BASE_VERSION: 4.13.0 + VERSION: 4.13.0 + BINDING_VERSION: 4.13.0 + CDP: + - 117 + - 116 + - 115 + 4.12.1: + BASE_RELEASE: selenium-4.12.0 + BASE_VERSION: 4.12.1 + VERSION: 4.12.1 + BINDING_VERSION: 4.12.0 + CDP: + - 116 + - 115 + - 114 + 4.12.0: + BASE_RELEASE: selenium-4.12.0 + BASE_VERSION: 4.12.0 + VERSION: 4.12.0 + BINDING_VERSION: 4.12.0 + CDP: + - 116 + - 115 + - 114 + 4.11.0: + BASE_RELEASE: selenium-4.11.0 + BASE_VERSION: 4.11.0 + VERSION: 4.11.0 + BINDING_VERSION: 4.11.2 + CDP: + - 115 + - 114 + - 113 + 4.10.0: + BASE_RELEASE: selenium-4.10.0 + BASE_VERSION: 4.10.0 + VERSION: 4.10.0 + BINDING_VERSION: 4.10.0 + CDP: + - 114 + - 113 + - 112 diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 1a6db4cf2..c9e9be8e4 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -35,6 +35,7 @@ BASIC_AUTH_USERNAME=${BASIC_AUTH_USERNAME:-"sysAdminUser"} BASIC_AUTH_PASSWORD=${BASIC_AUTH_PASSWORD:-"myStrongPassword"} LOG_LEVEL=${LOG_LEVEL:-"INFO"} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA:-"true"} +TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART:-"false"} cleanup() { # Get the list of pods @@ -96,19 +97,19 @@ HELM_COMMAND_SET_IMAGES=" \ --set global.seleniumGrid.logLevel=${LOG_LEVEL} \ " -if [ "${TEST_EXISTING_KEDA}" = "true" ]; then +if [ "${SELENIUM_GRID_AUTOSCALING}" = "true" ] && [ "${TEST_EXISTING_KEDA}" = "true" ]; then HELM_COMMAND_SET_IMAGES="${HELM_COMMAND_SET_IMAGES} \ --set autoscaling.enabled=false \ --set autoscaling.enableWithExistingKEDA=true \ " -else +elif [ "${SELENIUM_GRID_AUTOSCALING}" = "true" ] && [ "${TEST_EXISTING_KEDA}" = "true" ]; then HELM_COMMAND_SET_IMAGES="${HELM_COMMAND_SET_IMAGES} \ --set autoscaling.enabled=true \ --set autoscaling.enableWithExistingKEDA=false \ " fi -if [ -n "${SET_MAX_REPLICAS}" ]; then +if [ "${SELENIUM_GRID_AUTOSCALING}" = "true" ] && [ -n "${SET_MAX_REPLICAS}" ]; then HELM_COMMAND_SET_IMAGES="${HELM_COMMAND_SET_IMAGES} \ --set autoscaling.scaledOptions.maxReplicaCount=${SET_MAX_REPLICAS} \ " @@ -150,7 +151,6 @@ fi if [ "${SELENIUM_GRID_AUTOSCALING}" = "true" ]; then HELM_COMMAND_SET_AUTOSCALING=" \ - --set autoscaling.enableWithExistingKEDA=${SELENIUM_GRID_AUTOSCALING} \ --set autoscaling.scaledOptions.minReplicaCount=${SELENIUM_GRID_AUTOSCALING_MIN_REPLICA} \ " fi @@ -195,6 +195,11 @@ helm upgrade --install ${HELM_COMMAND_ARGS} kubectl get pods -A +if [ "${TEST_UPGRADE_CHART}" = "true" ]; then + echo "Focus on verify chart upgrade, skip Selenium tests" + exit 0 +fi + echo "Run Tests" export CHART_CERT_PATH=$(readlink -f ${CHART_CERT_PATH}) export SELENIUM_GRID_PROTOCOL=${SELENIUM_GRID_PROTOCOL} diff --git a/tests/config.toml b/tests/config.toml index b99fed254..3efc90c3e 100755 --- a/tests/config.toml +++ b/tests/config.toml @@ -1,11 +1,17 @@ [docker] - configs = [ "${NAMESPACE}/standalone-firefox:${TAG}", '{"browserName": "firefox", "platformName": "linux"}', "${NAMESPACE}/standalone-chrome:${TAG}", '{"browserName": "chrome", "platformName": "linux"}', "${NAMESPACE}/standalone-edge:${TAG}", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] +host-config-keys = ["Dns", "DnsOptions", "DnsSearch", "ExtraHosts", "Binds"] + url = "http://127.0.0.1:2375" video-image = "${NAMESPACE}/video:${VIDEO_TAG}" + +[node] +enable-managed-downloads = "${SELENIUM_ENABLE_MANAGED_DOWNLOADS}" +override-max-sessions = true +max-sessions = 3 diff --git a/tests/docker-compose-v3-test-node-docker.yaml b/tests/docker-compose-v3-test-node-docker.yaml index b2e8d80c6..6728e4439 100644 --- a/tests/docker-compose-v3-test-node-docker.yaml +++ b/tests/docker-compose-v3-test-node-docker.yaml @@ -2,21 +2,30 @@ version: "3" services: node-docker: image: ${NAMESPACE}/node-docker:${TAG} + user: root volumes: - ./videos:/opt/selenium/assets - ./videos/config.toml:/opt/bin/config.toml - /var/run/docker.sock:/var/run/docker.sock + - ./videos/Downloads:/home/seluser/Downloads + dns: + - 8.8.8.8 + - 8.8.4.4 + dns_search: selenium-grid.local + extra_hosts: + - "prod.domain.com:${HOST_IP}" depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 - - SE_NODE_ENABLE_MANAGED_DOWNLOADS=true - - SE_LOG_LEVEL=FINE + - SE_NODE_ENABLE_MANAGED_DOWNLOADS=${SELENIUM_ENABLE_MANAGED_DOWNLOADS} + - SE_LOG_LEVEL=${LOG_LEVEL} selenium-hub: image: ${NAMESPACE}/hub:${TAG} + user: ${UID} container_name: selenium-hub environment: - SE_LOG_LEVEL=${LOG_LEVEL} @@ -36,4 +45,6 @@ services: environment: - RUN_IN_DOCKER_COMPOSE=true - SELENIUM_GRID_HOST=selenium-hub + - BINDING_VERSION=${BINDING_VERSION} + - SELENIUM_ENABLE_MANAGED_DOWNLOADS=${SELENIUM_ENABLE_MANAGED_DOWNLOADS} command: ["./bootstrap.sh", "${NODE}"] diff --git a/tests/docker-compose-v3-test-parallel.yml b/tests/docker-compose-v3-test-parallel.yml index 72417d0e6..5de09f7d0 100644 --- a/tests/docker-compose-v3-test-parallel.yml +++ b/tests/docker-compose-v3-test-parallel.yml @@ -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: @@ -77,4 +77,5 @@ services: - RUN_IN_DOCKER_COMPOSE=true - SELENIUM_GRID_HOST=selenium-hub - TEST_PARALLEL_HARDENING=${TEST_PARALLEL_HARDENING} + - BINDING_VERSION=${BINDING_VERSION} command: ["./bootstrap.sh", "${NODE}"] diff --git a/tests/docker-compose-v3-test-video.yml b/tests/docker-compose-v3-test-video.yml index 308bbcfce..ade2a3628 100644 --- a/tests/docker-compose-v3-test-video.yml +++ b/tests/docker-compose-v3-test-video.yml @@ -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: @@ -47,4 +47,5 @@ services: environment: - RUN_IN_DOCKER_COMPOSE=true - SELENIUM_GRID_HOST=selenium-hub + - BINDING_VERSION=${BINDING_VERSION} command: ["./bootstrap.sh", "${NODE}"] diff --git a/tests/test.py b/tests/test.py index 5ef93f4f7..160404752 100644 --- a/tests/test.py +++ b/tests/test.py @@ -193,7 +193,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: @@ -248,7 +248,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...")