Skip to content

Commit

Permalink
Merge branch 'trunk' into py_client_config_new
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol authored May 10, 2024
2 parents 3bc1889 + 94f7247 commit d6f16e7
Show file tree
Hide file tree
Showing 1,281 changed files with 58,561 additions and 97,045 deletions.
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ dotnet/src/webdriver/obj
java/build/production
java/client/build
java/server/build
javascript/grid-ui/node_modules
javascript/node/selenium-webdriver/node_modules
node_modules
116 changes: 35 additions & 81 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
try-import .bazelrc.local
try-import .bazelrc.windows.local
try-import %workspace%/.bazelrc.local
try-import %workspace%/.bazelrc.windows.local

# Enable bzlmod but without lockfile for a moment.
# Lockfile is a problem to check in at the moment
# because of constant Git conflicts and platform-specific
# pieces.
# https://github.com/bazelbuild/bazel/issues/20369
# https://github.com/bazelbuild/bazel/issues/21491

common --enable_bzlmod --lockfile_mode=off

# Ensure Windows support is accurate.

Expand All @@ -25,13 +34,24 @@ build --javacopt="--release 11"
build --experimental_strict_java_deps=strict
build --explicit_java_test_deps

# Ensure builds are unpolluted by the user env
# Allow spaces in runfile paths
build --nobuild_runfile_links

build --incompatible_strict_action_env
# More JS magic
build --experimental_allow_unresolved_symlinks

# Except for the PATH environment variable
# Required for faster TS builds
build --@aspect_rules_ts//ts:skipLibCheck=always
fetch --@aspect_rules_ts//ts:skipLibCheck=always
query --@aspect_rules_ts//ts:skipLibCheck=always

build --action_env=PATH
build --@aspect_rules_ts//ts:default_to_tsc_transpiler
fetch --@aspect_rules_ts//ts:default_to_tsc_transpiler
query --@aspect_rules_ts//ts:default_to_tsc_transpiler

# Ensure builds are unpolluted by the user env

build --incompatible_strict_action_env

# For build stamping

Expand All @@ -53,19 +73,20 @@ test --test_env=DISPLAY
test --test_env=FIREFOX_NIGHTLY_BINARY
test --test_env=GITHUB_ACTIONS
test --test_env=MOZ_HEADLESS
test --test_env=PATH # Remove once browser pinning works
test --test_env=SELENIUM_BROWSER
test --test_env=TRAVIS
test --test_env=PYTHON_VERSION
test --test_env=SE_AVOID_STATS=true

# Remove once rules_ruby support proper $LOAD_PATH expansion.

test --test_env=RUBYOPT="-Irb/lib -w"

# JRuby/TruffleRuby: https://github.com/jruby/jruby/issues/5661
# Speed up JRuby startup.
# https://github.com/jruby/jruby/wiki/Improving-startup-time

build --action_env=HOME
test --test_env=HOME
build --action_env=JRUBY_OPTS="--dev"
test --test_env=JRUBY_OPTS="--dev"

# Expose necessary variables for Selenium-Manager.

Expand All @@ -76,78 +97,11 @@ test:windows --test_env=PROGRAMFILES(X86)="C:\\Program Files (x86)"
test --test_timeout=1800

test:node_debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
test:ruby_debug --test_output=streamed --test_env=RUBY_DEBUG_FORK_MODE=parent --run_under="@bundle//:bin/rdbg --nonstop --open --command"

# The RBE to use
build:remote --bes_results_url=https://gypsum.cluster.engflow.com/invocation
build:remote --bes_backend=grpcs://gypsum.cluster.engflow.com
build:remote --remote_executor=grpcs://gypsum.cluster.engflow.com
build:remote --remote_cache=grpcs://gypsum.cluster.engflow.com

# The number of cores available
build:remote -j 50

# Build Without The Bytes
build:remote --remote_download_outputs=minimal

build:remote --define=EXECUTOR=remote
build:remote --experimental_inmemory_dotd_files
build:remote --experimental_inmemory_jdeps_files
build:remote --remote_timeout=3600
build:remote --spawn_strategy=remote,local
#build:remote --nolegacy_important_outputs
build:remote --incompatible_strict_action_env=true

build:remote --crosstool_top=//common/remote-build/cc:toolchain
build:remote --extra_execution_platforms=//common/remote-build:platform
build:remote --extra_toolchains=//common/remote-build:cc-toolchain
build:remote --host_platform=//common/remote-build:platform
build:remote --platforms=//common/remote-build:platform

# The Docker images are running Linux
build:remote --cpu=k8
build:remote --host_cpu=k8

build:remote --disk_cache=

build:remote --incompatible_enable_cc_toolchain_resolution
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
test:remote --test_env=DISPLAY=:99.0
test:remote --test_tag_filters=-skip-remote,-remote

# Env vars we can hard code
build:remote --action_env=HOME=/home/dev
build:remote --action_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=HOME=/home/dev

# Make sure we sniff credentials properly
build:remote --credential_helper=%workspace%/scripts/credential-helper.sh

# Use pinned browsers when running remotely
build:remote --//common:pin_browsers

# The remote build machines are pretty small, and 50 threads may leave them
# thrashing, but our dev machines are a lot larger. Scale the workload so we
# make reasonable usage of everything, everywhere, all at once.
build:remote --local_cpu_resources='HOST_CPUS*10'
build:remote --local_ram_resources='HOST_RAM*4.0'

# A small hint that we're running our tests remotely
test:remote --test_env=REMOTE_BUILD=1

# Wait for up to 5 minutes for a test to pass
test:remote --test_timeout=600

# Extend the remote config for CI
build:remote-ci --config=remote
build:remote-ci --curses=no --color=yes --show_timestamps --show_progress_rate_limit=5
build:remote-ci --bes_upload_mode=wait_for_upload_complete

# Configuration changes suggested by EngFlow
build:remote --grpc_keepalive_time=30s
build:remote --nolegacy_important_outputs
test:ruby_debug --test_output=streamed --test_env=RUBY_DEBUG_FORK_MODE=parent --run_under="@bundle//bin:rdbg --nonstop --open --command"

build:release --config=remote
build:release --stamp
build:release --remote_download_outputs=toplevel

# RBE
import %workspace%/.bazelrc.remote
70 changes: 70 additions & 0 deletions .bazelrc.remote
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# The RBE to use
build:remote --bes_results_url=https://gypsum.cluster.engflow.com/invocation
build:remote --bes_backend=grpcs://gypsum.cluster.engflow.com
build:remote --remote_executor=grpcs://gypsum.cluster.engflow.com
build:remote --remote_cache=grpcs://gypsum.cluster.engflow.com

# The number of cores available
build:remote -j 50

# Build Without The Bytes
build:remote --remote_download_minimal

build:remote --define=EXECUTOR=remote
build:remote --experimental_inmemory_dotd_files
build:remote --experimental_inmemory_jdeps_files
build:remote --remote_timeout=3600
build:remote --spawn_strategy=remote,local
#build:remote --nolegacy_important_outputs
build:remote --incompatible_strict_action_env=true

build:remote --crosstool_top=//common/remote-build/cc:toolchain
build:remote --extra_execution_platforms=//common/remote-build:platform
build:remote --extra_toolchains=//common/remote-build:cc-toolchain
build:remote --host_platform=//common/remote-build:platform
build:remote --platforms=//common/remote-build:platform
build:remote --cxxopt=-std=c++14

# The Docker images are running Linux
build:remote --cpu=k8
build:remote --host_cpu=k8

build:remote --disk_cache=

build:remote --incompatible_enable_cc_toolchain_resolution
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
test:remote --test_env=DISPLAY=:99.0
test:remote --test_tag_filters=-skip-remote,-remote

# Env vars we can hard code
build:remote --action_env=HOME=/home/dev
build:remote --action_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=HOME=/home/dev

# Make sure we sniff credentials properly
build:remote --credential_helper=gypsum.cluster.engflow.com=%workspace%/scripts/credential-helper.sh

# Use pinned browsers when running remotely
build:remote --//common:pin_browsers

# The remote build machines are pretty small, and 50 threads may leave them
# thrashing, but our dev machines are a lot larger. Scale the workload so we
# make reasonable usage of everything, everywhere, all at once.
build:remote --local_resources=cpu='HOST_CPUS*10'
build:remote --local_resources=memory='HOST_RAM*4.0'

# A small hint that we're running our tests remotely
test:remote --test_env=REMOTE_BUILD=1

# Wait for up to 5 minutes for a test to pass
test:remote --test_timeout=600

# Extend the remote config for CI
build:remote-ci --config=remote
build:remote-ci --curses=no --color=yes --show_timestamps --show_progress_rate_limit=5
build:remote-ci --bes_upload_mode=wait_for_upload_complete

# Configuration changes suggested by EngFlow
build:remote --grpc_keepalive_time=30s
build:remote --nolegacy_important_outputs
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
7.1.1
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// https://containers.dev/implementors/json_reference/

{
"name": "selenium-devcontainer",
"build": {
"dockerfile": "../scripts/dev-image/Dockerfile"
},
"runArgs": ["--name", "selenium_devcontainer"]
}
62 changes: 56 additions & 6 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,31 @@ on:
required: false
type: string
default: ''
caching:
description: Toggle caching of Bazel
required: false
type: boolean
default: true
cache-key:
description: Bazel disk cache key
required: false
type: string
default: ''
dotnet-version:
description: Custom DotNet version to install
required: false
type: string
default: ''
java-version:
description: Custom Java version to install
required: false
type: string
default: ''
node-version:
description: Custom Node version to install
required: false
type: string
default: ''
ruby-version:
description: Custom Ruby version to use
required: false
Expand All @@ -46,15 +61,24 @@ on:
required: false
type: string
default: ''
artifact-name:
description: Name of artifact to upload
required: false
type: string
default: 'ignore-artifacts'

jobs:
bazel:
name: ${{ inputs.name }}
runs-on: ${{ inputs.os }}-latest
runs-on: ${{ inputs.os == 'macos' && 'macos-13' || format('{0}-latest', inputs.os) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEL_M2_USER: ${{ secrets.SEL_M2_USER }}
SEL_M2_PASS: ${{ secrets.SEL_M2_PASS }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SE_AVOID_STATS: true
steps:
- name: Checkout source tree
uses: actions/checkout@v4
Expand All @@ -74,26 +98,41 @@ jobs:
- name: Set Ruby version
if: inputs.ruby-version != ''
run: echo '${{ inputs.ruby-version }}' > rb/.ruby-version
- name: Setup DotNet
if: inputs.dotnet-version != ''
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Setup Java
if: inputs.java-version != ''
uses: actions/setup-java@v3
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
- name: Setup Bazel
uses: p0deje/[email protected]
- name: Setup Node
if: inputs.node-version != ''
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Setup Bazel with caching
if: inputs.caching
uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
bazelrc: common --color=yes
cache-version: 2
disk-cache: ${{ inputs.cache-key }}
external-cache: |
name: ${{ inputs.cache-key }}
manifest:
crates: rust/Cargo.Bazel.lock
npm: package-lock.json
pypi__pip: py/requirements_lock.txt
rules_ruby_dist: rb/ruby_version.bzl
rules_ruby~~ruby~ruby: ${{ inputs.os == 'windows' && 'false' || 'rb/.ruby-version' }}
repository-cache: true
- name: Setup Bazel without caching
if: inputs.caching == false
uses: bazel-contrib/[email protected]
with:
bazelrc: common --color=yes
- name: Setup Fluxbox and Xvfb
if: inputs.os == 'ubuntu' && inputs.browser != ''
run: |
Expand Down Expand Up @@ -139,3 +178,14 @@ jobs:
title: "Nightly"
prerelease: true
files: ${{ inputs.nightly-release-files }}
- name: Save changes
if: ${{ always() && inputs.artifact-name != 'ignore-artifacts' }}
run: |
git diff > changes.patch
- name: "Upload changes"
if: ${{ always() && inputs.artifact-name != 'ignore-artifacts' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: changes.patch
retention-days: 6
Loading

0 comments on commit d6f16e7

Please sign in to comment.