You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for contributing to the Docker-Selenium project! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Now, the fork seleniumhq-community/docker-seleniarm was merged.
From image tag based 4.21.0 onwards, the architectures supported by this project as below.
Architecture
Available
x86_64 (aka amd64)
✅
aarch64 (aka arm64/armv8)
✅
armhf (aka arm32/armv7l)
❌
Build the multi-arch images locally
Recommend to enable the experimental feature containerd image store in Docker Engine. containerd understands multiplatform images, where a single image tag can refer to different variants covering a range of OS and hardware architectures.
It simplifies the process of building, storing, and distributing images across different platforms.
A single command in project to enable that feature
make set_containerd_image_store
To build all the images for multiplatform, run the following command:
PLATFORMS=linux/amd64,linux/arm64 make build
To build the images for a specific platform, run the following command:
PLATFORMS=linux/arm64 make build
By default, without specifying the PLATFORMS variable, the images are built for the linux/amd64 platform.
Browser images in multi-arch
Google does not build Chrome (google-chrome) for Linux/ARM platforms. Hence, the Chrome (node and standalone) images are only available for AMD64.
Similarly, Microsoft does not build Edge (microsoft-edge) for Linux/ARM platforms.
Instead, the open source Chromium browser is used, which is built for Linux/ARM. The Chromium (node and standalone) images are available in multi-arch.
Mozilla Firefox now is available for Linux/ARM64 via Nightly channel.
The Firefox version in ARM64 will be different with the AMD64 until the stable release is available. The Firefox (node and standalone) images are available in multi-arch.
Multi-arch images are tested on CircleCI with resource class Linux/ARM64. See the status below.
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
5, due to the extensive changes across multiple files and scripts, including modifications to Dockerfiles, shell scripts, and CI configuration files. The PR introduces support for ARM64 architecture, which involves complex changes in the build and deployment processes. Reviewing these changes requires a deep understanding of multi-architecture builds, Kubernetes configurations, and CI/CD workflows.
🧪 Relevant tests
Yes
⚡ Possible issues
Compatibility Issues: The changes introduce ARM64 support, which might not be fully compatible with all dependencies and tools used in the project. Thorough testing on ARM64 environments is required to ensure compatibility.
CI Configuration Complexity: The modifications to CI workflows are significant and might introduce errors in the build and test processes. The complexity of multi-architecture support could lead to maintenance challenges.
Script Modifications: The changes in shell scripts involve critical deployment and build steps. Any errors here could lead to failed deployments or builds. Reviewing these for syntax and logical errors is crucial.
🔒 Security concerns
No specific security concerns identified in the PR changes. However, ensuring that no sensitive data is exposed in logs or error messages during the build and deployment processes is recommended.
Add the current user to the docker group instead of setting permissive permissions on the Docker socket
Instead of using sudo chmod 666 /var/run/docker.sock, consider adding the current user to the docker group to avoid potential security risks associated with setting such permissive permissions.
Why: This suggestion correctly identifies a significant security risk with setting the Docker socket permissions to 666 and offers a safer alternative by adding the user to the Docker group.
9
Possible issue
Ensure that required environment variables are defined before using them
To avoid potential issues with uninitialized variables, ensure that NAMESPACE and TAG_VERSION are defined before using them in the script.
+if [ -z "${NAMESPACE}" ] || [ -z "${TAG_VERSION}" ]; then+ echo "NAMESPACE or TAG_VERSION is not set"+ exit 1+fi
CHROMIUM_VERSION=$(docker run --rm ${NAMESPACE}/node-chromium:${TAG_VERSION} chromium --version | awk '{print $2}')
echo "Chromium version -> "${CHROMIUM_VERSION}
Suggestion importance[1-10]: 8
Why: This suggestion correctly identifies a potential issue with uninitialized variables which could lead to runtime errors. It's a crucial fix for robustness.
8
Add a check for the skip-test input in the deploy job's if condition
Consider adding a check for the skip-test input in the deploy job's if condition to ensure that tests are not skipped unintentionally during deployment.
Why: The suggestion correctly identifies a potential issue where the deployment could proceed even if tests were intended to be skipped, which is crucial for maintaining deployment integrity.
8
Add a check to ensure Docker is installed before running Docker commands
Add a check to ensure that the docker command is available before attempting to run Docker commands, to provide a clearer error message if Docker is not installed.
+if ! command -v docker &> /dev/null; then+ echo "Docker could not be found, please install Docker."+ exit 1+fi
GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}')
Suggestion importance[1-10]: 7
Why: Adding a check for Docker installation before executing Docker commands is a practical improvement that enhances the robustness of the script by preventing unclear errors when Docker is not installed.
7
Provide default values for environment variables to avoid potential issues
To avoid potential issues with uninitialized environment variables, provide default values for BASE_VERSION and BASE_RELEASE.
Why: Providing default values for environment variables is a good defensive programming practice, especially to ensure the script behaves predictably when environment variables are missing.
7
Readability
Rephrase a sentence to improve readability
The line "From image tag based 4.21.0 onwards, the architectures supported by this project as below." is missing a verb and could be clearer. Consider rephrasing it to improve readability.
-From image tag based `4.21.0` onwards, the architectures supported by this project as below.+Starting from image tag `4.21.0`, the architectures supported by this project are listed below.
Suggestion importance[1-10]: 8
Why: The suggestion correctly identifies a grammatical error and improves the clarity of the sentence, which is crucial for documentation readability.
8
Best practice
Use mktemp to create a temporary directory for downloading and extracting files
Use mktemp to create a temporary directory for downloading and extracting files to avoid potential conflicts and ensure a clean environment.
Why: Using mktemp for creating a temporary directory is a best practice that avoids potential conflicts and ensures a clean environment. This is a valuable suggestion for improving the script's safety and reliability.
7
Use a case statement for platform-specific logic to improve readability
To improve readability and maintainability, consider using a case statement instead of multiple if statements for platform-specific logic.
Why: Converting if statements to a case statement for handling platform-specific logic is a good practice for readability, but it's not a critical issue.
5
Rename the skip-test input to skip_tests for consistency with YAML naming conventions
Consider renaming the skip-test input to skip_tests to maintain consistency with typical YAML naming conventions.
-- name: Set up containerd image store feature+- name: Enable containerd image store for multi-arch support
Suggestion importance[1-10]: 7
Why: The suggestion enhances the descriptiveness of the step name, improving understanding of the workflow's purpose, which aids in maintainability and clarity.
7
Add a placeholder to indicate that the platform variable can be replaced
The command to build images for a specific platform should include a placeholder for the platform variable to make it clear that it can be replaced with any desired platform.
Why: The suggestion to use a variable for the Docker GPG key URL is valid for maintainability and simplifies future updates. It's a good practice but not critical.
6
Enhancement
Use pgrep to directly get process IDs of Chromium processes
To avoid potential issues with ps command output, use pgrep to directly get the process IDs of Chromium processes.
Why: The suggestion improves the reliability of the script by using pgrep instead of a complex pipeline, enhancing maintainability and reducing error risk.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Part of #1847
Now, the fork seleniumhq-community/docker-seleniarm was merged.
From image tag based
4.21.0
onwards, the architectures supported by this project as below.Build the multi-arch images locally
Recommend to enable the experimental feature containerd image store in Docker Engine.
containerd
understands multiplatform images, where a single image tag can refer to different variants covering a range of OS and hardware architectures.It simplifies the process of building, storing, and distributing images across different platforms.
A single command in project to enable that feature
To build all the images for multiplatform, run the following command:
To build the images for a specific platform, run the following command:
By default, without specifying the
PLATFORMS
variable, the images are built for thelinux/amd64
platform.Browser images in multi-arch
Google does not build Chrome (
google-chrome
) for Linux/ARM platforms. Hence, the Chrome (node and standalone) images are only available for AMD64.Similarly, Microsoft does not build Edge (
microsoft-edge
) for Linux/ARM platforms.Instead, the open source Chromium browser is used, which is built for Linux/ARM. The Chromium (node and standalone) images are available in multi-arch.
The Firefox version in ARM64 will be different with the AMD64 until the stable release is available. The Firefox (node and standalone) images are available in multi-arch.
Multi-arch images are tested on CircleCI with resource class Linux/ARM64. See the status below.
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
chart_setup_env.sh
.generate_release_notes.sh
.tag_and_push_browser_images.sh
.NodeChromium/chrome-cleanup.sh
.chart_test.sh
.tests/SeleniumTests/__init__.py
.tests/test.py
.Changes walkthrough 📝
11 files
chart_setup_env.sh
Unified Docker and dependencies setup for AMD64 and ARM64.
tests/charts/make/chart_setup_env.sh
ARM64.
generate_release_notes.sh
Enhanced release notes generation with ARM64 support.
generate_release_notes.sh
tag_and_push_browser_images.sh
Added tagging and pushing for Chromium images.
tag_and_push_browser_images.sh
bootstrap.sh
Updated scripts to use Python 3.
tests/charts/bootstrap.sh
python
topython3
for script execution.chrome-cleanup.sh
Added Chrome cleanup script.
NodeChromium/chrome-cleanup.sh
bootstrap.sh
Updated scripts to use Python 3.
tests/build-backward-compatible/bootstrap.sh
python
topython3
for script execution.bootstrap.sh
Updated scripts to use Python 3.
tests/bootstrap.sh
python
topython3
for script execution.chart_build.sh
Enhanced chart build script for CI environments.
tests/charts/make/chart_build.sh
yamale
andyamllint
for CI environments.python
topython3
for script execution.chart_cluster_setup.sh
Added Helm repository setup for KEDA core.
tests/charts/make/chart_cluster_setup.sh
test.py
Enhanced test script with platform detection and Docker network
improvements.
tests/test.py
Makefile
Enhanced Makefile for multi-platform builds and Chromium support.
Makefile
builds.
3 files
chart_test.sh
Enhanced chart tests for multi-platform support.
tests/charts/make/chart_test.sh
__init__.py
Enhanced Selenium tests for multi-platform support.
tests/SeleniumTests/init.py
config.yml
Enhanced CircleCI configuration for ARM64 and multi-platform support.
.circleci/config.yml