From a71ea8811aee946384e265fc3a9e30eb76b27244 Mon Sep 17 00:00:00 2001 From: Fried Hoeben Date: Sat, 9 Dec 2023 21:08:56 +0100 Subject: [PATCH 1/3] allow build on arm64 --- .github/workflows/build-test.yml | 17 +++- .github/workflows/deploy.yml | 99 ------------------- .github/workflows/helm-chart-release.yml | 29 ------ .github/workflows/helm-chart-test.yml | 76 -------------- .github/workflows/label-commenter.yml | 18 ---- .github/workflows/lock.yml | 25 ----- .github/workflows/test-video.yml | 53 ---------- .github/workflows/update-chart-changelog.yaml | 31 ------ .../update-dev-beta-browser-images.yml | 86 ---------------- Base/Dockerfile | 20 ++-- Makefile | 79 +++++++-------- NodeChrome/Dockerfile | 60 ++++------- NodeChrome/chromium.pref | 14 +++ NodeChrome/wrap_chrome_binary | 2 +- NodeFirefox/Dockerfile | 39 +++++--- NodeFirefox/firefox.pref | 7 ++ generate_release_notes.sh | 2 +- tag_and_push_browser_images.sh | 24 ++--- tests/test.py | 2 + 19 files changed, 148 insertions(+), 535 deletions(-) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/helm-chart-release.yml delete mode 100644 .github/workflows/helm-chart-test.yml delete mode 100644 .github/workflows/label-commenter.yml delete mode 100644 .github/workflows/lock.yml delete mode 100644 .github/workflows/test-video.yml delete mode 100644 .github/workflows/update-chart-changelog.yaml delete mode 100644 .github/workflows/update-dev-beta-browser-images.yml create mode 100644 NodeChrome/chromium.pref create mode 100644 NodeFirefox/firefox.pref diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b40db3af6..2bde6de08 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -11,11 +11,24 @@ jobs: build-and-test: name: Build & test Docker images with random user runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 strategy: + fail-fast: false matrix: use-random-user: [false, true] + platform: [linux/amd64, linux/arm64] steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host - name: Output Docker info run: docker info - name: Set up Python @@ -38,13 +51,13 @@ jobs: - name: Sets build date run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV - name: Build Docker images - run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build + run: NAME=localhost:5000/selenium BUILD_ARGS="--platform ${{ matrix.platform }} --push" VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build - name: Test Docker images uses: nick-invision/retry@v2.9.0 with: timeout_minutes: 20 max_attempts: 3 command: | - USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test + USE_RANDOM_USER_ID=${USE_RANDOM_USER} SKIP_BUILD=true NAME=localhost:5000/selenium VERSION=${BRANCH} PLATFORM=${{ matrix.platform }} BUILD_DATE=${BUILD_DATE} make test env: USE_RANDOM_USER: ${{ matrix.use-random-user }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index de0ac5db9..000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Deploys - -on: - push: - branches: - - trunk - -jobs: - deploy: - # Only continue if the commit message has '[deploy]' in it - if: contains(toJson(github.event.commits), '[deploy]') == true - name: Deploy Docker images - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - persist-credentials: false - fetch-depth: 0 - - name: Output Docker info - run: docker info - - name: Sets build date - run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: Sets prerelease to false by default - run: echo "PRERELEASE=false" >> $GITHUB_ENV - - name: Build base image to get Grid version - run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base - - name: Get Grid version - # sed used to remove last comma of Selenium version output - run: echo "GRID_VERSION=$(docker run --rm selenium/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV - - name: Is it a prerelease? - run: echo "GRID_VERSION=${GRID_VERSION}-prerelease" >> $GITHUB_ENV && echo "PRERELEASE=true" >> $GITHUB_ENV - if: contains(toJson(github.event.commits), '[prerelease]') == true - - name: Display Grid version - run: echo ${GRID_VERSION} - - name: Remove local Docker tag - run: docker rmi selenium/base:local-${BUILD_DATE} - - name: Sets env var for the next tag - run: echo "NEXT_TAG=${GRID_VERSION}-${BUILD_DATE}" >> $GITHUB_ENV - - name: Get latest tag - run: echo "LATEST_TAG=$(git tag --sort=-version:refname | grep "^[^selenium]" | head -n 1)" >> $GITHUB_ENV - - name: Display latest tag - run: echo ${LATEST_TAG} - - name: Update tag in docs and files - run: ./update_tag_in_docs_and_files.sh ${LATEST_TAG} ${NEXT_TAG} - - name: Build images - run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build - - name: Login Docker Hub - run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - env: - DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} - DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} - - name: Deploy new images - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 - with: - timeout_minutes: 20 - max_attempts: 3 - command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release - - name: Tag images as latest - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 - with: - timeout_minutes: 20 - max_attempts: 3 - command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_latest - - name: Deploy latest tag - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 - with: - timeout_minutes: 20 - max_attempts: 3 - command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_latest - - name: Tag browser images - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 - with: - timeout_minutes: 20 - max_attempts: 3 - command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images - - name: Commit files - run: | - git config --local user.email "selenium-ci@users.noreply.github.com" - git config --local user.name "Selenium CI Bot" - git commit -m "Update tag in docs and files" -a - - name: Push changes - uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master - with: - github_token: ${{ secrets.SELENIUM_CI_TOKEN }} - branch: trunk - - name: Create release notes (release_notes.md) - run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} - release_name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} - body_path: release_notes.md - draft: false - prerelease: ${{ env.PRERELEASE }} diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml deleted file mode 100644 index 252ca1840..000000000 --- a/.github/workflows/helm-chart-release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Release Charts - -on: - push: - branches: - - trunk - paths: - - 'charts/selenium-grid/Chart.yaml' - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml deleted file mode 100644 index 7c34c5eb9..000000000 --- a/.github/workflows/helm-chart-test.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Lint and Test Helm Charts - -on: - push: - pull_request: - workflow_dispatch: - -permissions: - contents: read - -jobs: - build-and-test: - name: Test Helm charts - runs-on: ubuntu-latest - strategy: - matrix: - test-strategy: [chart_test, chart_test_parallel_autoscaling] - steps: - - uses: actions/checkout@v4 - - name: Output Docker info - run: docker info - - name: Set up Python - uses: actions/setup-python@v5.0.0 - with: - python-version: '3.11' - check-latest: true - - name: Get branch name (only for push to branch) - if: github.event_name == 'push' - run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV - env: - PUSH_BRANCH: ${{ github.ref }} - - name: Get target branch name (only for PRs) - if: github.event_name == 'pull_request' - run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV - env: - TARGET_BRANCH: ${{ github.head_ref }} - - name: Output branch name - run: echo ${BRANCH} - - name: Sets build date - run: | - echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV - echo "IMAGE_REGISTRY=artifactory/selenium" >> $GITHUB_ENV - - name: Setup Kubernetes environment - run: make chart_setup_env - - name: Build Docker images - run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build - - name: Build and lint charts - run: | - BUILD_DATE=${BUILD_DATE} make chart_build - echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV - echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV - - name: Setup Kubernetes cluster - run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup - - name: Test Selenium Grid on Kubernetes - uses: nick-invision/retry@v2.9.0 - with: - timeout_minutes: 30 - max_attempts: 3 - command: | - NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make ${{ matrix.test-strategy }} - - name: Cleanup Kubernetes cluster - if: always() - run: make chart_cluster_cleanup - - name: Upload Helm chart package - if: always() - uses: actions/upload-artifact@v3 - with: - name: ${{ env.CHART_FILE_NAME }} - path: ${{ env.CHART_PACKAGE_PATH }} - - name: Upload Helm chart template rendered - if: always() - uses: actions/upload-artifact@v3 - with: - name: chart_template_rendered.yaml - path: ./tests/tests/output_deployment.yaml - if-no-files-found: ignore diff --git a/.github/workflows/label-commenter.yml b/.github/workflows/label-commenter.yml deleted file mode 100644 index bf2e02b25..000000000 --- a/.github/workflows/label-commenter.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Configuration for Label Commenter - https://github.com/peaceiris/actions-label-commenter -name: Label Commenter - -on: - issues: - types: [ labeled ] - -permissions: - contents: read - issues: write - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Label Commenter - uses: peaceiris/actions-label-commenter@v1 diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index 7abaecd80..000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Configuration for Lock Threads - https://github.com/dessant/lock-threads -name: 'Lock Issues' - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -permissions: - issues: write - pull-requests: write - -jobs: - action: - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v5 - with: - process-only: 'issues' - issue-inactive-days: '30' - issue-lock-reason: '' - issue-comment: > - This issue has been automatically locked since there - has not been any recent activity after it was closed. - Please open a new issue for related bugs. diff --git a/.github/workflows/test-video.yml b/.github/workflows/test-video.yml deleted file mode 100644 index 65b2241f2..000000000 --- a/.github/workflows/test-video.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Test video files - -on: - push: - pull_request: - -permissions: - contents: read - -jobs: - build-and-test: - name: Test video recorded through Docker Selenium - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Output Docker info - run: docker info - - name: Set up Python - uses: actions/setup-python@v5.0.0 - with: - python-version: '3.11' - check-latest: true - - name: Get branch name (only for push to branch) - if: github.event_name == 'push' - run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV - env: - PUSH_BRANCH: ${{ github.ref }} - - name: Get target branch name (only for PRs) - if: github.event_name == 'pull_request' - run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV - env: - TARGET_BRANCH: ${{ github.head_ref }} - - name: Output branch name - run: echo ${BRANCH} - - name: Sets build date - run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: Run Docker Compose to record video - run: USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_video - - name: Upload recorded Chrome video - uses: actions/upload-artifact@v3 - with: - name: chrome_video - path: ./tests/videos/chrome_video.mp4 - - name: Upload recorded Edge video - uses: actions/upload-artifact@v3 - with: - name: edge_video - path: ./tests/videos/edge_video.mp4 - - name: Upload recorded Firefox video - uses: actions/upload-artifact@v3 - with: - name: firefox_video - path: ./tests/videos/firefox_video.mp4 diff --git a/.github/workflows/update-chart-changelog.yaml b/.github/workflows/update-chart-changelog.yaml deleted file mode 100644 index 9a57e0b4f..000000000 --- a/.github/workflows/update-chart-changelog.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Update Chart CHANGELOG - -on: - page_build: - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - fetch-depth: 0 - - - name: Update chart CHANGELOG - run: ./generate_chart_changelog.sh - - - name: Commit files - run: | - git config --local user.email "selenium-ci@users.noreply.github.com" - git config --local user.name "Selenium CI Bot" - git commit -m "Update chart CHANGELOG [skip ci]" -a - - - name: Push changes - uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master - with: - github_token: ${{ secrets.SELENIUM_CI_TOKEN }} - branch: trunk diff --git a/.github/workflows/update-dev-beta-browser-images.yml b/.github/workflows/update-dev-beta-browser-images.yml deleted file mode 100644 index 6349a71a0..000000000 --- a/.github/workflows/update-dev-beta-browser-images.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Update Dev/Beta Browser Images - -on: - workflow_dispatch: - schedule: - # Trigger build every 2 days - - cron: '0 2 */2 * *' - -jobs: - - deploy: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - browser: [chrome,firefox,edge] - channel: [dev,beta] - env: - NAME: selenium - BROWSER: ${{ matrix.browser }} - CHANNEL: ${{ matrix.channel }} - - steps: - - uses: actions/checkout@v4 - - name: Setup environment variables - run: | - export SELENIUM_VERSION=$(grep selenium-server Base/Dockerfile | sed 's/.*-\([^-]*\)\.jar \\/\1/' | head -n 1) - echo "SELENIUM_VERSION="$SELENIUM_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` - echo "BROWSER_CAPS="$BROWSER_CAPS >> $GITHUB_ENV - export CHANNEL_CAPS=`node -p "process.argv[1][0].toUpperCase() + process.argv[1].toString().substring(1)" $CHANNEL` - echo "CHANNEL_CAPS="$CHANNEL_CAPS >> $GITHUB_ENV - echo "BROWSER is $BROWSER" - echo "CHANNEL is $CHANNEL" - echo "SELENIUM_VERSION is $SELENIUM_VERSION" - echo "BUILD_DATE is $BUILD_DATE" - - - name: Pull hub and node-base and tag them for faster building and testing - run: | - docker pull $NAME/hub:latest - docker pull $NAME/node-base:latest - docker tag $NAME/hub:latest $NAME/hub:$CHANNEL - docker tag $NAME/node-base:latest $NAME/node-base:$CHANNEL - docker tag $NAME/hub:latest $NAME/hub:"$SELENIUM_VERSION"-"$BUILD_DATE" - docker tag $NAME/node-base:latest $NAME/node-base:"$SELENIUM_VERSION"-"$BUILD_DATE" - - - name: Build the Dev/Beta Docker container images - run: | - echo VERSION=$SELENIUM_VERSION make "$BROWSER"_"$CHANNEL" standalone_"$BROWSER"_"$CHANNEL" - VERSION=$SELENIUM_VERSION make "$BROWSER"_"$CHANNEL" standalone_"$BROWSER"_"$CHANNEL" - - - name: Test the Dev/Beta Docker container images - run: | - export SKIP_BUILD=true - export NAMESPACE=$NAME - VERSION=$CHANNEL ./tests/bootstrap.sh Node$BROWSER_CAPS - VERSION=$CHANNEL ./tests/bootstrap.sh Standalone$BROWSER_CAPS - - - name: Login Docker Hub - run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - env: - DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} - DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} - - - name: Deploy Dev/Beta Docker container images - run: | - docker push $NAME/node-$BROWSER:$CHANNEL - docker push $NAME/standalone-$BROWSER:$CHANNEL - if [ "$BROWSER" = "firefox" ]; then - export DRIVER_VERSION_COMMAND="/usr/bin/geckodriver --version | head -n 1" - export BROWSER_VERSION_COMMAND="firefox -version" - elif [ "$BROWSER" = "chrome" ]; then - export DRIVER_VERSION_COMMAND="/usr/bin/chromedriver -version" - export BROWSER_VERSION_COMMAND="google-chrome -version" - elif [ "$BROWSER" = "edge" ]; then - export DRIVER_VERSION_COMMAND="/usr/bin/msedgedriver -version" - export BROWSER_VERSION_COMMAND="microsoft-edge -version" - fi - echo "Push to Docker Hub completed" - echo "$BROWSER_CAPS $CHANNEL_CAPS browser version:" - docker run --rm $NAME/standalone-$BROWSER:$CHANNEL bash -c "$BROWSER_VERSION_COMMAND" - echo "$BROWSER_CAPS $CHANNEL_CAPS WebDriver version:" - docker run --rm $NAME/standalone-$BROWSER:$CHANNEL bash -c "$DRIVER_VERSION_COMMAND" diff --git a/Base/Dockerfile b/Base/Dockerfile index 7122d9772..4734128e5 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -1,14 +1,10 @@ FROM ubuntu:jammy-20231004 LABEL authors="Selenium " +ARG TARGETARCH +ARG TARGETVARIANT ARG VERSION ARG RELEASE=selenium-${VERSION} -#================================================ -# 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 # No interactive frontend during docker build ENV DEBIAN_FRONTEND=noninteractive \ @@ -33,8 +29,16 @@ RUN apt-get -qqy update \ curl \ supervisor \ gnupg2 \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ - && sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-amd64/conf/security/java.security + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +#=================== + +RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \ + export ARCH=armhf ; \ + else \ + export ARCH=$TARGETARCH ; \ + fi \ + && sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-$ARCH/conf/security/java.security #=================== # Timezone settings diff --git a/Makefile b/Makefile index 5df2eb27e..d5ef9cfeb 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,8 @@ MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(TAG_VERSION))) FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6.1) FFMPEG_BASED_NAME := $(or $(FFMPEG_BASED_NAME),$(FFMPEG_BASED_NAME),ndviet) FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),6.1-ubuntu2204) +SKIP_BUILD := $(SKIP_BUILD) +PLATFORM := $(PLATFORM) all: hub \ distributor \ @@ -24,11 +26,9 @@ all: hub \ sessionqueue \ event_bus \ chrome \ - edge \ firefox \ docker \ standalone_chrome \ - standalone_edge \ standalone_firefox \ standalone_docker \ video @@ -39,91 +39,91 @@ 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 $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg CHROME_VERSION=google-chrome-unstable -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg CHROME_VERSION=google-chrome-beta -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg EDGE_VERSION=microsoft-edge-dev -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg EDGE_VERSION=microsoft-edge-beta -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -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 $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-firefox -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 $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-firefox -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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -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 $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-chrome -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 $(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 $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -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 $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=dev --build-arg BASE=node-edge -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 $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-edge -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 $(BUILD_ARGS) --build-arg NAMESPACE=$(FFMPEG_BASED_NAME) --build-arg BASED_TAG=$(FFMPEG_BASED_TAG) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) . # https://github.com/SeleniumHQ/docker-selenium/issues/992 @@ -313,28 +313,25 @@ release: tag_major_minor test: test_chrome \ test_firefox \ test_chrome_standalone \ - test_firefox_standalone \ - test_edge \ - test_edge_standalone - + test_firefox_standalone test_chrome: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeChrome + PLATFORM=$(PLATFORM) SKIP_BUILD=$(SKIP_BUILD) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeChrome test_chrome_standalone: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneChrome + PLATFORM=$(PLATFORM) SKIP_BUILD=$(SKIP_BUILD) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneChrome test_edge: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeEdge + PLATFORM=$(PLATFORM) SKIP_BUILD=$(SKIP_BUILD) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeEdge test_edge_standalone: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneEdge + PLATFORM=$(PLATFORM) SKIP_BUILD=$(SKIP_BUILD) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneEdge test_firefox: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeFirefox + PLATFORM=$(PLATFORM) SKIP_BUILD=$(SKIP_BUILD) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh NodeFirefox test_firefox_standalone: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneFirefox + PLATFORM=$(PLATFORM) SKIP_BUILD=$(SKIP_BUILD) VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/bootstrap.sh StandaloneFirefox # 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. diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index dfcc5bd61..48b3de411 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -7,20 +7,24 @@ LABEL authors=${AUTHORS} USER root #============================================ -# Google Chrome -#============================================ -# can specify versions by CHROME_VERSION; -# e.g. google-chrome-stable -# google-chrome-beta -# google-chrome-unstable -#============================================ -ARG CHROME_VERSION="google-chrome-stable" -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 install \ - ${CHROME_VERSION:-google-chrome-stable} \ - && rm /etc/apt/sources.list.d/google-chrome.list \ +# Chromium and chromedriver from Debian +#============================================ +ARG DEBIAN_VERSION=bullseye +RUN echo "deb [signed-by=/usr/share/keyrings/debian-${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian ${DEBIAN_VERSION} main" > /etc/apt/sources.list.d/debian.list \ + && echo "deb [signed-by=/usr/share/keyrings/debian-${DEBIAN_VERSION}-updates.gpg] http://deb.debian.org/debian ${DEBIAN_VERSION}-updates main" >> /etc/apt/sources.list.d/debian.list \ + && echo "deb [signed-by=/usr/share/keyrings/debian-security-${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian-security ${DEBIAN_VERSION}-security main contrib non-free" >> /etc/apt/sources.list.d/debian.list \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A \ + && apt-key export 386FA1D9 | sudo gpg --dearmour -o /usr/share/keyrings/debian-${DEBIAN_VERSION}.gpg \ + && apt-key export 2643E131 | sudo gpg --dearmour -o /usr/share/keyrings/debian-${DEBIAN_VERSION}-updates.gpg \ + && apt-key export E562B32A | sudo gpg --dearmour -o /usr/share/keyrings/debian-security-${DEBIAN_VERSION}.gpg + +COPY chromium.pref /etc/apt/preferences.d/chromium.pref + +RUN apt-get update -qqy \ + && apt-get -qqy install chromium chromium-driver \ + && rm /etc/apt/sources.list.d/debian.list \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* #================================= @@ -31,33 +35,9 @@ RUN /opt/bin/wrap_chrome_binary USER 1200 -#============================================ -# Chrome webdriver -#============================================ -# can specify versions by CHROME_DRIVER_VERSION -# Latest released version will be used by default -#============================================ -ARG CHROME_DRIVER_VERSION -RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \ - then CHROME_DRIVER_URL=https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip ; \ - else echo "Geting ChromeDriver latest version from https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_" \ - && CHROME_MAJOR_VERSION=$(google-chrome --version | sed -E "s/.* ([0-9]+)(\.[0-9]+){3}.*/\1/") \ - && CHROME_DRIVER_VERSION=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_MAJOR_VERSION} | sed 's/\r$//') \ - && CHROME_DRIVER_URL=https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip ; \ - fi \ - && echo "Using ChromeDriver from: "$CHROME_DRIVER_URL \ - && echo "Using ChromeDriver version: "$CHROME_DRIVER_VERSION \ - && wget --no-verbose -O /tmp/chromedriver_linux64.zip $CHROME_DRIVER_URL \ - && rm -rf /opt/selenium/chromedriver \ - && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ - && rm /tmp/chromedriver_linux64.zip \ - && mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && sudo ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver - #============================================ # Dumping Browser information for config #============================================ RUN echo "chrome" > /opt/selenium/browser_name -RUN google-chrome --version | awk '{print $3}' > /opt/selenium/browser_version -RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/google-chrome\"}" > /opt/selenium/browser_binary_location +RUN chromium --version | awk '{print $2}' > /opt/selenium/browser_version +RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/chromium\"}" > /opt/selenium/browser_binary_location diff --git a/NodeChrome/chromium.pref b/NodeChrome/chromium.pref new file mode 100644 index 000000000..33fb9ace5 --- /dev/null +++ b/NodeChrome/chromium.pref @@ -0,0 +1,14 @@ +# Note: 2 blank lines are required between entries +Package: * +Pin: release a=eoan +Pin-Priority: 500 + +Package: * +Pin: origin "deb.debian.org" +Pin-Priority: 300 + +# Pattern includes 'chromium', 'chromium-browser' and similarly +# named dependencies: +Package: chromium* +Pin: origin "deb.debian.org" +Pin-Priority: 700 diff --git a/NodeChrome/wrap_chrome_binary b/NodeChrome/wrap_chrome_binary index 58df2c406..0cf5c2533 100755 --- a/NodeChrome/wrap_chrome_binary +++ b/NodeChrome/wrap_chrome_binary @@ -1,6 +1,6 @@ #!/bin/bash -WRAPPER_PATH=$(readlink -f /usr/bin/google-chrome) +WRAPPER_PATH=$(readlink -f /usr/bin/chromium) BASE_PATH="$WRAPPER_PATH-base" mv "$WRAPPER_PATH" "$BASE_PATH" diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile index e79f641be..22d94afe6 100644 --- a/NodeFirefox/Dockerfile +++ b/NodeFirefox/Dockerfile @@ -4,23 +4,20 @@ ARG AUTHORS FROM ${NAMESPACE}/node-base:${VERSION} LABEL authors=${AUTHORS} +ARG TARGETARCH +ARG TARGETVARIANT + USER root #========= # Firefox #========= -ARG FIREFOX_VERSION=latest -RUN FIREFOX_DOWNLOAD_URL=$(if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "beta-latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ]; then echo "https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION-ssl&os=linux64&lang=en-US"; else echo "https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2"; fi) \ - && apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install libavcodec-extra \ - libgtk-3-dev libdbus-glib-1-dev \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ - && wget --no-verbose -O /tmp/firefox.tar.bz2 $FIREFOX_DOWNLOAD_URL \ - && rm -rf /opt/firefox \ - && tar -C /opt -xjf /tmp/firefox.tar.bz2 \ - && rm /tmp/firefox.tar.bz2 \ - && mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \ - && ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox +RUN apt-get -qqy update \ + && apt-get -qqy install libavcodec-extra software-properties-common \ + && add-apt-repository ppa:mozillateam/ppa \ + && apt-get -qqy update \ + && apt-get -qqy install -t 'o=LP-PPA-mozillateam' firefox \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* #============ # GeckoDriver @@ -28,7 +25,23 @@ RUN FIREFOX_DOWNLOAD_URL=$(if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERS ARG GECKODRIVER_VERSION=latest RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.33.0"; else echo $GECKODRIVER_VERSION; fi) \ && echo "Using GeckoDriver version: "$GK_VERSION \ - && wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz \ + && if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \ + ARCH=armhf ; \ + else \ + ARCH=$TARGETARCH ; \ + fi \ + && if [ -z "$ARCH" ]; then \ + echo "*** BUILD ERROR: \$TARGETARCH must be arm64, amd64, or arm with \$TARGETVARIANT set to v7... exiting..." ; \ + exit 1 ; \ + fi \ + && if [ "$ARCH" = "arm64" ]; then \ + GK_DOWNLOAD_URL="https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux-aarch64.tar.gz" ; \ + elif [ "$ARCH" = "armhf" ]; then \ + GK_DOWNLOAD_URL="https://github.com/jamesmortensen/geckodriver-arm-binaries/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux-armv7l.tar.gz" ; \ + else \ + GK_DOWNLOAD_URL="https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz" ; \ + fi \ + && wget --no-verbose -O /tmp/geckodriver.tar.gz $GK_DOWNLOAD_URL \ && rm -rf /opt/geckodriver \ && tar -C /opt -zxf /tmp/geckodriver.tar.gz \ && rm /tmp/geckodriver.tar.gz \ diff --git a/NodeFirefox/firefox.pref b/NodeFirefox/firefox.pref new file mode 100644 index 000000000..29084e48a --- /dev/null +++ b/NodeFirefox/firefox.pref @@ -0,0 +1,7 @@ +Package: firefox +Pin: version 1:1snap* +Pin-Priority: -1 + +Package: firefox-locale-* +Pin: version 1:1snap* +Pin-Priority: -1 diff --git a/generate_release_notes.sh b/generate_release_notes.sh index c2f4e40ae..888aabb3e 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -11,7 +11,7 @@ echo "" >> release_notes.md echo "### Changelog" > release_notes.md git --no-pager log "${LATEST_TAG}...${HEAD_BRANCH}" --pretty=format:"* [\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" --reverse >> release_notes.md -CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') +CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromium --version | awk '{print $2}') EDGE_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}') CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}') EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') diff --git a/tag_and_push_browser_images.sh b/tag_and_push_browser_images.sh index aa2744e66..20a266324 100755 --- a/tag_and_push_browser_images.sh +++ b/tag_and_push_browser_images.sh @@ -20,7 +20,7 @@ echo "Tagging images for browser ${BROWSER}, version ${VERSION}, build date ${BU case "${BROWSER}" in chrome) - CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') + CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromium --version | awk '{print $2}') echo "Chrome version -> "${CHROME_VERSION} CHROME_SHORT_VERSION="$(short_version ${CHROME_VERSION})" echo "Short Chrome version -> "${CHROME_SHORT_VERSION} @@ -35,21 +35,21 @@ chrome) # Browser version and browser driver version plus build date ${CHROME_VERSION}-chromedriver-${CHROMEDRIVER_VERSION}-${BUILD_DATE} # Browser version and browser driver version - ${CHROME_VERSION}-chromedriver-${CHROMEDRIVER_VERSION} + ${CHROME_VERSION}-chromedriver-${CHROMEDRIVER_VERSION} # Browser version and build date ${CHROME_VERSION}-${BUILD_DATE} # Browser version - ${CHROME_VERSION} + ${CHROME_VERSION} ## Short versions ${CHROME_SHORT_VERSION}-chromedriver-${CHROMEDRIVER_SHORT_VERSION}-grid-${TAG_VERSION} # Browser version and browser driver version plus build date ${CHROME_SHORT_VERSION}-chromedriver-${CHROMEDRIVER_SHORT_VERSION}-${BUILD_DATE} # Browser version and browser driver version - ${CHROME_SHORT_VERSION}-chromedriver-${CHROMEDRIVER_SHORT_VERSION} + ${CHROME_SHORT_VERSION}-chromedriver-${CHROMEDRIVER_SHORT_VERSION} # Browser version and build date ${CHROME_SHORT_VERSION}-${BUILD_DATE} # Browser version - ${CHROME_SHORT_VERSION} + ${CHROME_SHORT_VERSION} ) for chrome_tag in "${CHROME_TAGS[@]}" @@ -83,17 +83,17 @@ edge) # Browser version and build date ${EDGE_VERSION}-${BUILD_DATE} # Browser version - ${EDGE_VERSION} + ${EDGE_VERSION} ## Short versions ${EDGE_SHORT_VERSION}-edgedriver-${EDGEDRIVER_SHORT_VERSION}-grid-${TAG_VERSION} # Browser version and browser driver version plus build date ${EDGE_SHORT_VERSION}-edgedriver-${EDGEDRIVER_SHORT_VERSION}-${BUILD_DATE} # Browser version and browser driver version - ${EDGE_SHORT_VERSION}-edgedriver-${EDGEDRIVER_SHORT_VERSION} + ${EDGE_SHORT_VERSION}-edgedriver-${EDGEDRIVER_SHORT_VERSION} # Browser version and build date ${EDGE_SHORT_VERSION}-${BUILD_DATE} # Browser version - ${EDGE_SHORT_VERSION} + ${EDGE_SHORT_VERSION} ) for edge_tag in "${EDGE_TAGS[@]}" @@ -122,21 +122,21 @@ firefox) # Browser version and browser driver version plus build date ${FIREFOX_VERSION}-geckodriver-${GECKODRIVER_VERSION}-${BUILD_DATE} # Browser version and browser driver version - ${FIREFOX_VERSION}-geckodriver-${GECKODRIVER_VERSION} + ${FIREFOX_VERSION}-geckodriver-${GECKODRIVER_VERSION} # Browser version and build date ${FIREFOX_VERSION}-${BUILD_DATE} # Browser version - ${FIREFOX_VERSION} + ${FIREFOX_VERSION} ## Short versions ${FIREFOX_SHORT_VERSION}-geckodriver-${GECKODRIVER_SHORT_VERSION}-grid-${TAG_VERSION} # Browser version and browser driver version plus build date ${FIREFOX_SHORT_VERSION}-geckodriver-${GECKODRIVER_SHORT_VERSION}-${BUILD_DATE} # Browser version and browser driver version - ${FIREFOX_SHORT_VERSION}-geckodriver-${GECKODRIVER_SHORT_VERSION} + ${FIREFOX_SHORT_VERSION}-geckodriver-${GECKODRIVER_SHORT_VERSION} # Browser version and build date ${FIREFOX_SHORT_VERSION}-${BUILD_DATE} # Browser version - ${FIREFOX_SHORT_VERSION} + ${FIREFOX_SHORT_VERSION} ) for firefox_tag in "${FIREFOX_TAGS[@]}" diff --git a/tests/test.py b/tests/test.py index b8b462c2b..841283ed0 100644 --- a/tests/test.py +++ b/tests/test.py @@ -20,6 +20,7 @@ https_proxy = os.environ.get('https_proxy', '') no_proxy = os.environ.get('no_proxy', '') SKIP_BUILD = os.environ.get('SKIP_BUILD', False) +PLATFORM = os.environ.get('PLATFORM') try: client = docker.from_env() @@ -145,6 +146,7 @@ def launch_container(container, **kwargs): detach=True, environment=environment, shm_size="2G", + platform=PLATFORM, **kwargs).short_id logger.info("%s up and running" % container) return container_id From 6594053333c8c2bc235dd90d981e60f52bbe9484 Mon Sep 17 00:00:00 2001 From: Fried Hoeben Date: Sat, 16 Dec 2023 14:18:36 +0100 Subject: [PATCH 2/3] cleanup debian package add --- NodeChrome/Dockerfile | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index 48b3de411..32797f8a5 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -9,23 +9,32 @@ USER root #============================================ # Chromium and chromedriver from Debian #============================================ -ARG DEBIAN_VERSION=bullseye -RUN echo "deb [signed-by=/usr/share/keyrings/debian-${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian ${DEBIAN_VERSION} main" > /etc/apt/sources.list.d/debian.list \ - && echo "deb [signed-by=/usr/share/keyrings/debian-${DEBIAN_VERSION}-updates.gpg] http://deb.debian.org/debian ${DEBIAN_VERSION}-updates main" >> /etc/apt/sources.list.d/debian.list \ - && echo "deb [signed-by=/usr/share/keyrings/debian-security-${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian-security ${DEBIAN_VERSION}-security main contrib non-free" >> /etc/apt/sources.list.d/debian.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A \ - && apt-key export 386FA1D9 | sudo gpg --dearmour -o /usr/share/keyrings/debian-${DEBIAN_VERSION}.gpg \ - && apt-key export 2643E131 | sudo gpg --dearmour -o /usr/share/keyrings/debian-${DEBIAN_VERSION}-updates.gpg \ - && apt-key export E562B32A | sudo gpg --dearmour -o /usr/share/keyrings/debian-security-${DEBIAN_VERSION}.gpg - COPY chromium.pref /etc/apt/preferences.d/chromium.pref -RUN apt-get update -qqy \ +ARG DEBIAN_VERSION=bullseye +ARG REPO_FILE=/etc/apt/sources.list.d/debian.list +ARG KEY_SERVER=keyserver.ubuntu.com +ARG DEBIAN_KEY_LOCATION=/usr/share/keyrings/debian +RUN mkdir /home/seluser/.gnupg && mkdir -p ${DEBIAN_KEY_LOCATION} \ + && gpg --no-default-keyring --keyring ${DEBIAN_KEY_LOCATION}/${DEBIAN_VERSION}.gpg \ + --keyserver ${KEY_SERVER} \ + --recv-keys 0E98404D386FA1D9 \ + && echo "deb [signed-by=${DEBIAN_KEY_LOCATION}/${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian ${DEBIAN_VERSION} main" \ + > ${REPO_FILE} \ + && gpg --no-default-keyring --keyring ${DEBIAN_KEY_LOCATION}/${DEBIAN_VERSION}-updates.gpg \ + --keyserver ${KEY_SERVER} \ + --recv-keys 6ED0E7B82643E131 \ + && echo "deb [signed-by=${DEBIAN_KEY_LOCATION}/${DEBIAN_VERSION}-updates.gpg] http://deb.debian.org/debian ${DEBIAN_VERSION}-updates main" \ + >> ${REPO_FILE} \ + && gpg --no-default-keyring --keyring ${DEBIAN_KEY_LOCATION}/security-${DEBIAN_VERSION}.gpg \ + --keyserver ${KEY_SERVER} \ + --recv-keys 112695A0E562B32A \ + && echo "deb [signed-by=${DEBIAN_KEY_LOCATION}/security-${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian-security ${DEBIAN_VERSION}-security main contrib non-free" \ + >> ${REPO_FILE} \ + && apt-get update -qqy \ && apt-get -qqy install chromium chromium-driver \ - && rm /etc/apt/sources.list.d/debian.list \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* + && rm ${REPO_FILE} \ + && rm -rf ${DEBIAN_KEY_LOCATION}/ /var/lib/apt/lists/* /var/cache/apt/* #================================= # Chrome Launch Script Wrapper From 1639a0df7816c6d3f2471f1fbca07a26ce2f85f7 Mon Sep 17 00:00:00 2001 From: Fried Hoeben Date: Sat, 16 Dec 2023 14:37:57 +0100 Subject: [PATCH 3/3] specific versions for firefox, chromium and chromium-driver download --- NodeChrome/Dockerfile | 5 ++++- NodeFirefox/Dockerfile | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index 32797f8a5..6c478d3aa 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -8,6 +8,7 @@ USER root #============================================ # Chromium and chromedriver from Debian +# Available versions at: https://packages.debian.org/search?keywords=chromium #============================================ COPY chromium.pref /etc/apt/preferences.d/chromium.pref @@ -15,6 +16,8 @@ ARG DEBIAN_VERSION=bullseye ARG REPO_FILE=/etc/apt/sources.list.d/debian.list ARG KEY_SERVER=keyserver.ubuntu.com ARG DEBIAN_KEY_LOCATION=/usr/share/keyrings/debian +ARG CHROMIUM_VERSION=120.0.6099.109-1~deb11u1 +ARG CHROMEDIVER_VERSION=${CHROMIUM_VERSION} RUN mkdir /home/seluser/.gnupg && mkdir -p ${DEBIAN_KEY_LOCATION} \ && gpg --no-default-keyring --keyring ${DEBIAN_KEY_LOCATION}/${DEBIAN_VERSION}.gpg \ --keyserver ${KEY_SERVER} \ @@ -32,7 +35,7 @@ RUN mkdir /home/seluser/.gnupg && mkdir -p ${DEBIAN_KEY_LOCATION} \ && echo "deb [signed-by=${DEBIAN_KEY_LOCATION}/security-${DEBIAN_VERSION}.gpg] http://deb.debian.org/debian-security ${DEBIAN_VERSION}-security main contrib non-free" \ >> ${REPO_FILE} \ && apt-get update -qqy \ - && apt-get -qqy install chromium chromium-driver \ + && apt-get -qqy install chromium=${CHROMIUM_VERSION} chromium-driver=${CHROMEDIVER_VERSION} \ && rm ${REPO_FILE} \ && rm -rf ${DEBIAN_KEY_LOCATION}/ /var/lib/apt/lists/* /var/cache/apt/* diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile index 22d94afe6..bd0d0676b 100644 --- a/NodeFirefox/Dockerfile +++ b/NodeFirefox/Dockerfile @@ -11,12 +11,14 @@ USER root #========= # Firefox +# Available versions at https://launchpad.net/~mozillateam/+archive/ubuntu/ppa #========= +ARG FIREFOX_VERSION=121.0+build1-0ubuntu0.22.04.1~mt1 RUN apt-get -qqy update \ && apt-get -qqy install libavcodec-extra software-properties-common \ && add-apt-repository ppa:mozillateam/ppa \ && apt-get -qqy update \ - && apt-get -qqy install -t 'o=LP-PPA-mozillateam' firefox \ + && apt-get -qqy install -t 'o=LP-PPA-mozillateam' firefox=${FIREFOX_VERSION} \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* #============