Skip to content

Commit

Permalink
Merging the fork [docker-seleniarm] into docker-selenium (#2257)
Browse files Browse the repository at this point in the history
* add CircleCI status badge

* Update README

* Adding the code to add all of the browser tags and update the latest tag

* 4.1.4

* Bumping grid to 4.1.4 and updating Firefox to v99.0-1

* [deploy] 4.1.4 and Firefox 99.0-1 with browser tags and update latest tag

* Updated README and [deploy] grid 4.1.4 and Firefox 99.0

* Attempts to tag multi-arch images by modifying the manifest

* Added the functionality to add browser versions to the Docker Hub tags. Also, updated the 'latest' tag.

* Allow passing an environment variable GRID_STATUS_MAX_ATTEMPTS to override the default 3 attempts to a differen value. Useful for testing under emulation where things are slower.

* Updated Firefox to 100.0.2-1

* [deploy] Firefox 100.0.2-1 and Selenium 4.2.1

* Fixing bug in variable name causing browser tagging with browser version and webdriver and selenium versions to fail.

* Fixed merge conflict from earlier

* [deploy] 4.2.2 seleniarm images

* Automating the process of modifying the selenium grid tag since I keep forgetting to do it when deploying.

* run the deploy workflow without deploying

* Using  instead of backticks

* Cleanup config.yml

* Debugging why it deployed as 4.1.0...

* test [deploy]

* test [deploy] and outputting some debug info

* test [deploy] and outputting some debug info

* test [deploy] is BRANCH a reserved keyword?

* test [deploy] is BRANCH a reserved keyword?

* More tests [deploy]

* debug [deploy]

* debug [deploy]

* Clean up and [deploy] test

* test [deploy] to test account to check tags

* Resolved issue with BRANCH environment variable not being set properly so it can be reused from step to step.

* [deploy] 4.3.0

* [deploy] 4.3.0 again since it failed

* small addition to readme to confirm graviton compatibility

* [deploy] 4.3.0 updates

* [deploy] 4.4.0

* [deploy] update

* update Firefox version

* [deploy] 4.4.0 with Firefox 104.0-1

* Update Makefile

* Add node and standalone docker build

* Fix tabs. Also, replace hard-coded platforms with variable, since we build and test separately but then build and deploy together.

* Bump Firefox to 105.0.1-1

* [deploy] Selenium 4.5.0 and Firefox 105.0.1-1

* Fix race condition when launching websockify.

Summary of issue #18: noVNC's launch.sh invokes `ps`. Without it, it exits
prematurely, thus ruining websockify's stdout and stderr file descriptors.
Depending on how fast websockify starts up, this may or may not prevent it from
working.

* CircleCI: prevent '/' characters in Docker tags.

This fixes #21.

* [deploy] fixes for #18 and #21

* Removing obsolete and not supported shell scripts. Updating docs with the supported method for building the ARM images locally.

* README.md formatting change

* Removed retag-latest-images-as-today obsolete script.

* Renamed NodeFirefox/Dockerfile.arm64 to NodeFirefox/Dockerfile.multi-arch to reflect the nature of building for multiple architectures, not just arm64. Updated Makefile with new Dockerfile,multi-arch name. Removed obsolete generation and build scripts, outdated experimental Ubuntu Dockerfile, and updated documentation to move how to start containers towards the top.

* Make more clear Chrome isn't build for ARM 'on Linux'

* Bump geckodriver to 0.32.0. Replace jamesmortensen/geckodriver-arm-binaries with official mozilla/geckodriver repo for arm64. Fixes #22

* [deploy] with upstream changes and official Mozilla geckodriver arm64 v0.32.0

* [deploy] 4.5.2 with Java 11 HTTP client

* [deploy] 4.5.3

* [deploy] merge from upstream and deploy 4.6.0

* Modified the telemetry installation commands so that the coursiers launcher pulled the binary based on arch, and only for the supported ones arm64 and x86_64

* [deploy] 4.6.0

* Update Firefox to v107

* [deploy] 4.7.0

* [deploy] 4.7.1

* Publish plain version numbers (e.g.: 4.6.0, 4.6, 4)

* [deploy] using the native coursier binaries, since the JAR version takes too long and causes the build to exceed the timeout

* [deploy] with jaegar observability jars only for aarch64 since it causes the deployment to timeout for other architectures.

* Upgrade to Firefox 108.0-2 for all architectures

* Test [deploy]. Add the grid components to the deploy step, and split up building images into different, parallel jobs to reduce build time.

* Test [deploy]. Add the grid components to the deploy step, and split up building images into different, parallel jobs to reduce build time.

* [deploy] fix job names

* test [deploy] debug some broken build processes.

* [deploy] Avoid make and run all build commands brom build-and-push.sh

* [deploy] 4.7.2 with Firefox 108

* [deploy] testing using an exit code in case a command in the script fails

* [deploy]

* Change bash to sh

* [deploy] test

* [deploy] testing to see why building base behaves differently with make vs running via a script

* [deploy] re-register binfmt and qemu for each runner

* [deploy] testing tagging and release notes job after fixing env var dereferencing

* [deploy] testing tagging and release notes job after fixing env var dereferencing

* [deploy] try using one of the parameters passed in declaratively instead.

* [deploy] try with the job name and also log it for the base job as well

* [deploy] using the make targets parameter.

* [deploy] using the make targets parameter.

* [deploy] test

* [deploy] test

* test [deploy] Added scripts and logic to add the Major_minor tags to the non-browser images, and added logic to add all of the tags to the release notes.

* Changed file permissions so shell script can be executed.

* Test [deploy] Remove comment

* Test [deploy] Adding NAMESPACE variable to the docker-pull-related-tags script.

* Test [deploy] and retag the images with related tags instead of excessive pulling.

* Test [deploy]. Rename docker-pull-related-tags to docker-add-related-tags. Clean up the names of the steps in the release notes generation step. Reorder the MAJOR, MAJOR-MINOR, and VERSION tags for the browser images so the order in Docker Hub matches their upstream siblings. Temporarily disable building images to focus on the release notes generation step.

* Test [deploy] forgot a tag

* Test [deploy] need to set build date to date of prev deployed images in order to test the final job

* test [deploy] removed commented test code

* Test [deploy] to see the full flow.

* test [deploy] after merge from trunk and upstream

* Test [deploy]

* Test [deploy]

* Fix ordering of the grid images

* Change everything back to the production 'seleniarm' Docker credentials and namespace.

* [deploy] 4.8.0 with upgrade Firefox to 109 and full grid.

* If we're getting release notes, pull from docker anonymously

* [deploy] with 0.32.1 geckodriver

* [deploy] Need to be logged into Docker Hub in order to push tags but not for release notes portion.

* [deploy] 4.8.0 with latest noVNC and websockify

* Upgrade to Firefox 109 and geckodriver 0.32.2

* [deploy] 4.8.1 and geckodriver 0.32.2

* [deploy] with updates to use buildx imagetools instead of docker manifest to add tags to multi-arch images

* [deploy] with 'chomium' typo fix.

* [deploy] updates from upstream

* Updated multi-arch Firefox to 111.0.1-1.

* [deploy] 4.8.2

* [deploy] 4.8.2 with Firefox rollback to v109.

* [deploy] 4.8.2

* [deploy] 4.8.3. Updated build-and-push.sh script to use default Selenium version from the Base/Dockerfile so environment variable is only needed if we want the tag version to be something else.

* Update Firefox to v112.0-1

* [deploy] 4.9.0

* Adding some delays between building images that are dependent on each other to avoid 'failed to solve' errors

* For build errors, we'll retry them 5 times before giving up

* Updating the README docs to reflect the state of building the grid components.

* [deploy] 4.9.1

* debian:latest is now bookworm, and openjdk-11-jre-headless is missing. So we pin to debian:bullseye

* Bump Firefox to 114.0-1 and geckodriver to 0.33.0

* [deploy] Selenium 4.10, Firefox 114,0-1 geckodriver 0.33.0

* Update CircleCI config to deploy grid from trunk

* Updated Firefox to 116.0-2

* Downgrade Selenium to 4.10 with updated browsers and drivers

* [deploy] updated browsers with Selenium 4.10.0

* Merge from upstream to add Selenium Manager SE_OFFLINE environment variable. Upgrade to Selenium 4.11.0

* update python selenium module to latest. Update Firefox

* [deploy] latest browsers for Selenium 4.10.0

* [deploy] 4.10.0 redeploy

* Fix build scripts so the RELEASE variable is used.

* Fix Makefile - add BASE_RELEASE and BASE_VERSION to the base_multi action

* Adding locale to Chromium dockerfile.

* Handle usrmerge issues https://wiki.debian.org/UsrMerge

* Just install usrmerge

* Try chromium without usrmerge. Upgrade Firefox to 120

* Add usrmerge to NodeChromium after setting sources. Split Firefox install into 2 runs for easier debugging

* [deploy] test with debian bookworm update - was missing the browser_version and browser_binary_location from upstream. Java package openjdk no longer available in bookworm so replaced with temurin

Co-authored-by: Fried Hoeben <github@hsac.nl>

* [deploy] test

* [deploy] test from tmp

* [deploy] fixed tests

* Fixed tests by waiting for downloadable files to exist in array, fixes Chromium tests.

Co-authored-by: Fried Hoeben <github@hsac.nl>

* Prepare release for 4.16.1

* [deploy] 4.16.1

* test(chart) against build multi

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* Sync update from upstream

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* Adding script used to build the multi-arch images, but locally using only one architecture.

* Fixed issue where xauth not found, preventing xvfb from starting.

* CI chart tests against amd64 only

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* Skip NodeChromium in Dockerfile scan

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* [deploy] v4.17.0

* [build] Update deploy workflow

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* [deploy] v4.17.0

* [deploy] v4.17.0

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* [deploy] 4.17.0 - Fix bug in auto-retry logic where if build fails 5 times it needs to also return exit 1 to not let CI think it succeeded.

* Sync with upstream

* [deploy] 4.18.0

* [deploy] tag image name 4.18.0

* Release v4.18.1 [deploy]

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* [deploy] fix broken link to download Firefox v124

Update Dockerfile.multi-arch

* update: Debian repo is used in NodeChromium

Fixed seleniumhq-community#69

* Temporary disable arch linux/arm/v7 due to NodeFirefox build failed [deploy]

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* .circleci fetch selenium version from Makefile

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* Add back platform linux/arm/v7

This reverts commit d16ae9e.

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

* Update .circleci [deploy]

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>

---------

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
Co-authored-by: James Mortensen <jmort253@gmail.com>
Co-authored-by: Peter Triesz <peter.triesz@tui.com>
Co-authored-by: Xavier G <xavier@kindwolf.org>
Co-authored-by: DJ Gregor <dj@opennms.org>
Co-authored-by: Fried Hoeben <github@hsac.nl>
  • Loading branch information
6 people committed May 21, 2024
1 parent d6936ac commit 4f4e716
Show file tree
Hide file tree
Showing 22 changed files with 1,562 additions and 23 deletions.
405 changes: 405 additions & 0 deletions .circleci/config.yml

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions .github/workflows/build-test-multi-arch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build & test multi-arch

on:
# push:
# branches:
# - multi-arch-tests
# - qemu-user-static
# pull_request:
# branches:
# - trunk
workflow_dispatch:

jobs:
build-and-test-multi-arch:
# Skip job based on the commit message, only works in push to branches for now
if: contains(toJson(github.event.commits), '[skip ci]') == false
name: Build & test multi-arch
runs-on: ubuntu-20.04
strategy:
matrix:
use-random-user: [false, true]
arch: [amd64, arm64]
fail-fast: false

steps:
- uses: actions/checkout@v1
- name: Output Docker info
run: docker info
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- 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: Build Docker images
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} make build_multi
if: matrix.arch == 'arm64' && matrix.use-random-user == 'false'
- name: Test Docker images
run: |
docker run -d --platform linux/${ARCH} --rm -it -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-firefox:${BRANCH}-${BUILD_DATE}
USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} SKIP_BUILD=true make test_firefox_standalone_multi
#USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} ARCH=${ARCH} SKIP_BUILD=true make test_chromium_standalone_multi
env:
USE_RANDOM_USER: ${{ matrix.use-random-user }}
ARCH: ${{ matrix.arch }}
if: matrix.arch == 'arm64' && matrix.use-random-user == 'false'

7 changes: 1 addition & 6 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
# Miscellaneous packages
# Includes minimal runtime used for executing non GUI Java programs
#========================
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
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 ; \
fi \
&& apt-get -qqy update \
RUN apt-get -qqy update \
&& apt-get upgrade -yq \
&& apt-get -qqy --no-install-recommends install \
acl \
Expand Down
142 changes: 142 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,77 @@ edge_upgrade_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
qemu_user_static:
docker run --rm --privileged aptman/qus -- -r ; \
docker run --rm --privileged aptman/qus -s -- -p

# Build multi-arch images
all_multi: base_multi \
hub_multi \
chromium_multi \
firefox_multi \
docker_multi \
standalone_chromium_multi \
standalone_firefox_multi \
standalone_docker_multi \
distributor_multi \
router_multi \
sessions_multi \
sessionqueue_multi \
event_bus_multi \
video_multi

build_multi: all_multi

ci_multi: build_multi test_multi_arch

base_multi: qemu_user_static
cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) -t $(NAME)/base:$(TAG_VERSION) .

hub_multi: base_multi
cd ./Hub && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) .

distributor_multi:
cd ./Distributor && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) .

router_multi:
cd ./Router && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/router:$(TAG_VERSION) .

sessions_multi:
cd ./Sessions && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) .

sessionqueue_multi:
cd ./SessionQueue && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) .

event_bus_multi: base_multi
cd ./EventBus && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) .

node_base_multi: base_multi
cd ./NodeBase && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) .

chromium_multi: node_base_multi
cd ./NodeChromium && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chromium:$(TAG_VERSION) .

firefox_multi: node_base_multi
cd ./NodeFirefox && docker buildx build -f Dockerfile.multi-arch --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) .

docker_multi: base_multi
cd ./NodeDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) .

standalone_firefox_multi: firefox_multi
cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) .

standalone_chromium_multi: chromium_multi
cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chromium -t $(NAME)/standalone-chromium:$(TAG_VERSION) .

standalone_docker_multi: docker_multi
cd ./StandaloneDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) .

video_multi:
cd ./Video && docker buildx build --platform $(PLATFORMS) $(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
# Additional tags for browser images
tag_and_push_browser_images: tag_and_push_chrome_images tag_and_push_firefox_images tag_and_push_edge_images
Expand Down Expand Up @@ -217,6 +288,58 @@ tag_latest:
docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:latest
docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:latest

# Additional tags for browser images
tag_and_push_multi_arch_browser_images: tag_and_push_multi_arch_chromium_images tag_and_push_multi_arch_firefox_images

tag_and_push_multi_arch_chromium_images:
./tag_and_push_multi-arch_browser_images.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) chromium

tag_and_push_multi_arch_firefox_images:
./tag_and_push_multi-arch_browser_images.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) firefox

tag_major_minor_multi_arch:
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) base
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) hub
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) node-base
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) node-docker
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) standalone-docker
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) sessions
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) session-queue
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) event-bus
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) router
./tag_and_push_multi-arch_major_minor.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) distributor

tag_multi_arch_latest:
docker buildx imagetools create -t ${NAMESPACE}/base:latest ${NAMESPACE}/base:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/hub:latest ${NAMESPACE}/hub:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/node-base:latest ${NAMESPACE}/node-base:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/node-chromium:latest ${NAMESPACE}/node-chromium:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/node-firefox:latest ${NAMESPACE}/node-firefox:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/standalone-chromium:latest ${NAMESPACE}/standalone-chromium:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/standalone-firefox:latest ${NAMESPACE}/standalone-firefox:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/node-docker:latest ${NAMESPACE}/node-docker:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/standalone-docker:latest ${NAMESPACE}/standalone-docker:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/sessions:latest ${NAMESPACE}/sessions:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/session-queue:latest ${NAMESPACE}/session-queue:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/event-bus:latest ${NAMESPACE}/event-bus:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/router:latest ${NAMESPACE}/router:${TAG_VERSION}
docker buildx imagetools create -t ${NAMESPACE}/distributor:latest ${NAMESPACE}/distributor:${TAG_VERSION}

# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) base latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) hub latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-base latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-chromium latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-firefox latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) standalone-chromium latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) standalone-firefox latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) node-docker latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) standalone-docker latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) sessions latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) session-queue latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) event-bus latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) router latest
# ./tag-and-push-multi-arch-image.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) distributor latest

release_latest:
docker push $(NAME)/base:latest
docker push $(NAME)/hub:latest
Expand Down Expand Up @@ -433,6 +556,25 @@ test_firefox:
test_firefox_standalone:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneFirefox

# Test multi-arch container images
test_multi_arch: test_chromium_multi \
test_firefox_multi \
test_chromium_standalone_multi \
test_firefox_standalone_multi


test_chromium_multi:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeChromium

test_chromium_standalone_multi:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh StandaloneChromium

test_firefox_multi:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) ./tests/bootstrap.sh NodeFirefox

test_firefox_standalone_multi:
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 \
Expand Down
6 changes: 0 additions & 6 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ RUN apt-get update -qqy \
fonts-noto-color-emoji \
&& locale-gen ${LANGUAGE} \
&& dpkg-reconfigure --frontend noninteractive locales \
&& if [ "${TARGETARCH}" = "amd64" ]; then \
apt-get -qqy --no-install-recommends install \
language-pack-en \
xfonts-cyrillic \
fonts-ubuntu ; \
fi \
&& apt-get -qyy autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -qyy clean \
Expand Down
47 changes: 47 additions & 0 deletions NodeChromium/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
LABEL authors=${AUTHORS}

USER root

#ENV LANGUAGE=en_US.UTF-8
#ENV LC_ALL=en_US.UTF-8
#ENV LANG=en_US.UTF-8

# Deal with the usr merge issues in Debian
#RUN apt install usrmerge

# Install Chromium
# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 \
&& apt-get update -qqy \
# && apt-get -qqy install chromium=89.0.4389.82-1 \
# && apt-get -qqy install chromium=90.0.4430.212-1 \
# && apt-get -qqy install chromium=93.0.4577.82-1 \
# && apt-get -qqy install chromium=97.0.4692.71-0.1 \
# && apt-get -qqy install chromium=98.0.4758.102-1+b1 \
&& apt-get -qqy install chromium \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

Check notice on line 27 in NodeChromium/Dockerfile

View workflow job for this annotation

GitHub Actions / Scan Dockerfile vulnerabilities

DS029

Artifact: NodeChromium/Dockerfile

Check notice on line 27 in NodeChromium/Dockerfile

View workflow job for this annotation

GitHub Actions / Scan Dockerfile vulnerabilities

DS029

Artifact: NodeChromium/Dockerfile

#=================================
# Chromium Launch Script Wrapper
#=================================
COPY wrap_chromium_binary /opt/bin/wrap_chromium_binary
RUN /opt/bin/wrap_chromium_binary

#============================================
# Chromium webdriver
#============================================
RUN apt-get update -qqy \
&& apt-get -qqy install chromium-driver \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

Check notice on line 40 in NodeChromium/Dockerfile

View workflow job for this annotation

GitHub Actions / Scan Dockerfile vulnerabilities

DS029

Artifact: NodeChromium/Dockerfile

Check notice on line 40 in NodeChromium/Dockerfile

View workflow job for this annotation

GitHub Actions / Scan Dockerfile vulnerabilities

DS029

Artifact: NodeChromium/Dockerfile

RUN echo "chrome" > /opt/selenium/browser_name
RUN chromium --version | awk '{print $2}' > /opt/selenium/browser_version
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/chromium\"}" > /opt/selenium/browser_binary_location

USER 1200

12 changes: 12 additions & 0 deletions NodeChromium/wrap_chromium_binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

WRAPPER_PATH=$(readlink -f /usr/bin/chromium)
BASE_PATH="$WRAPPER_PATH-base"
mv "$WRAPPER_PATH" "$BASE_PATH"

cat > "$WRAPPER_PATH" <<_EOF
#!/bin/bash
# Note: exec -a below is a bashism.
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
_EOF
chmod +x "$WRAPPER_PATH"
69 changes: 69 additions & 0 deletions NodeFirefox/Dockerfile.multi-arch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
LABEL authors=${AUTHORS}

ARG TARGETARCH
ARG TARGETVARIANT

ARG GECKODRIVER_VERSION=0.34.0

USER root

# Deal with the usr merge issues in Debian
#RUN apt install usrmerge

#=========
# Firefox
#=========
#RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
# && apt-get update -qqy \
# && apt-get -qqy install firefox-esr libavcodec-extra \
# && apt-get -qqy install firefox libavcodec-extra \
# && rm -rf /var/lib/apt/lists/* /var/cache/apt/*

# Pulling Firefox from Debian Snapshots so we can control which version we use as latest
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 \
&& apt-get update -qqy \
&& apt-get install libavcodec-extra firefox -y \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

Check notice on line 31 in NodeFirefox/Dockerfile.multi-arch

View workflow job for this annotation

GitHub Actions / Scan Dockerfile vulnerabilities

DS029

Artifact: NodeFirefox/Dockerfile.multi-arch

Check notice on line 31 in NodeFirefox/Dockerfile.multi-arch

View workflow job for this annotation

GitHub Actions / Scan Dockerfile vulnerabilities

DS029

Artifact: NodeFirefox/Dockerfile.multi-arch

#=============
# geckodriver
#=============
RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \
export ARCH=armhf ; \
else \
export 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 \
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux-aarch64.tar.gz ; \
elif [ "$ARCH" = "armhf" ]; then \
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/jamesmortensen/geckodriver-arm-binaries/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux-armv7l.tar.gz ; \
else \
wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz ; \
fi ; \
tar -C /tmp -zxf /tmp/geckodriver.tar.gz ; \
rm /tmp/geckodriver.tar.gz ; \
mkdir -p /opt/geckodriver-bin ; \
mv /tmp/geckodriver /opt/geckodriver-bin/geckodriver ; \
echo "Symlinking geckodriver to /usr/local/bin/geckodriver and /usr/bin/geckodriver" ; \
ln -s /opt/geckodriver-bin/geckodriver /usr/local/bin/geckodriver ; \
chmod 755 /usr/local/bin/geckodriver ; \
ln -s /opt/geckodriver-bin/geckodriver /usr/bin/geckodriver ; \
chmod 755 /usr/bin/geckodriver

USER 1200

#============================================
# Dumping Browser name and version for config
#============================================
RUN echo "firefox" > /opt/selenium/browser_name
RUN firefox --version | awk '{print $3}' > /opt/selenium/browser_version
RUN echo "\"moz:firefoxOptions\": {\"binary\": \"/usr/bin/firefox\"}" > /opt/selenium/browser_binary_location
Loading

0 comments on commit 4f4e716

Please sign in to comment.