diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1e2f7fa54..959cc2dcf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -50,7 +50,7 @@ jobs: - docker-test - helm-chart-test if: failure() && ( github.run_attempt < 3 ) - runs-on: ubuntu-latest + runs-on: blacksmith-8vcpu-ubuntu-2204 steps: - name: Checkout code uses: actions/checkout@main diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ecb7fe70..c881a0d28 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,7 +45,7 @@ jobs: - build-test if: (contains(toJson(github.event.commits), '[deploy]') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')) && !failure() && !cancelled() name: Deploy and Release - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: write-all steps: - name: Free Disk Space (Ubuntu) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 935588482..2d1398fe3 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -29,7 +29,7 @@ permissions: jobs: build-and-test: name: Test Docker Selenium - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 strategy: fail-fast: false matrix: diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 9dc78cf37..02aed0052 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -42,7 +42,7 @@ jobs: needs: - helm-chart-test if: (!failure() && !cancelled()) - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: write-all env: NAME: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index f00b2b744..9cf7b423b 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -29,7 +29,7 @@ permissions: jobs: build-and-test: name: Test K8s - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 strategy: fail-fast: false matrix: diff --git a/.github/workflows/label-commenter.yml b/.github/workflows/label-commenter.yml index 9df715b63..357daf733 100644 --- a/.github/workflows/label-commenter.yml +++ b/.github/workflows/label-commenter.yml @@ -11,7 +11,7 @@ permissions: jobs: comment: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/checkout@main - name: Label Commenter diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 7abaecd80..0a84ef440 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -12,7 +12,7 @@ permissions: jobs: action: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: dessant/lock-threads@v5 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a1ae4cf54..8a71857ab 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,7 +23,7 @@ jobs: - build-test if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && !failure() && !cancelled() name: Deploy and Release Nightly - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 permissions: write-all steps: - name: Free Disk Space (Ubuntu) diff --git a/.github/workflows/rerun-failed.yml b/.github/workflows/rerun-failed.yml index 90cd9b5ef..a0ccc6ed5 100644 --- a/.github/workflows/rerun-failed.yml +++ b/.github/workflows/rerun-failed.yml @@ -23,7 +23,7 @@ env: jobs: rerun_workflow: name: Rerun ${{ github.event.inputs.runId }} - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - name: Checkout code uses: actions/checkout@main diff --git a/.github/workflows/scan-dockerfile.yml b/.github/workflows/scan-dockerfile.yml index 0d65fb6dc..b61535df3 100644 --- a/.github/workflows/scan-dockerfile.yml +++ b/.github/workflows/scan-dockerfile.yml @@ -17,7 +17,7 @@ jobs: build-and-scan: name: Scan Dockerfile vulnerabilities permissions: write-all - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 steps: - uses: actions/checkout@main - name: Set severity for PRs diff --git a/.github/workflows/update-dev-beta-browser-images.yml b/.github/workflows/update-dev-beta-browser-images.yml index dde9be0cc..adfee47c0 100644 --- a/.github/workflows/update-dev-beta-browser-images.yml +++ b/.github/workflows/update-dev-beta-browser-images.yml @@ -10,7 +10,7 @@ jobs: deploy: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2204 strategy: fail-fast: false matrix: diff --git a/Makefile b/Makefile index f1851ef3a..cd897e37a 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION), KEDA_TAG_VERSION := $(or $(KEDA_TAG_VERSION),$(KEDA_TAG_VERSION),2.16.0-selenium-grid) KEDA_BASED_NAME := $(or $(KEDA_BASED_NAME),$(KEDA_BASED_NAME),ndviet) KEDA_BASED_TAG := $(or $(KEDA_BASED_TAG),$(KEDA_BASED_TAG),2.16.0-selenium-grid) +LOCAL_HOSTNAME := $(shell hostname -I | awk '{for(i=1;i<=NF;i++) if ($$i ~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$$/) {print $$i; exit}}') all: hub \ distributor \ @@ -50,6 +51,7 @@ all: hub \ video check_dev_env: + echo $(LOCAL_HOSTNAME) ./tests/charts/make/chart_check_env.sh setup_dev_env: @@ -830,7 +832,7 @@ test_node_docker: hub standalone_docker standalone_chrome standalone_firefox sta echo UID=$$(id -u) >> .env ; \ echo BINDING_VERSION=$(BINDING_VERSION) >> .env ; \ echo BASE_VERSION=$(BASE_VERSION) >> .env ; \ - echo HOST_IP=$$(hostname -I | awk '{print $$1}') >> .env ; \ + echo HOST_IP=$(LOCAL_HOSTNAME) >> .env ; \ if [ "$(PLATFORMS)" = "linux/amd64" ]; then \ NODE_EDGE=edge ; \ NODE_CHROME=chrome ; \ @@ -910,7 +912,7 @@ chart_render_template: chart_test_autoscaling_disabled: PLATFORMS=$(PLATFORMS) TEST_CHROMIUM=true RELEASE_NAME=selenium SELENIUM_GRID_AUTOSCALING=false CHART_ENABLE_TRACING=true \ - SECURE_INGRESS_ONLY_GENERATE=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=443 EXTERNAL_UPLOADER_CONFIG=true \ + SECURE_INGRESS_ONLY_GENERATE=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$(LOCAL_HOSTNAME) SELENIUM_GRID_PORT=443 EXTERNAL_UPLOADER_CONFIG=true \ VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) BASE_VERSION=$(BASE_VERSION) \ TEMPLATE_OUTPUT_FILENAME="k8s_nodeChromium_enableTracing_secureIngress_generateCerts_ingressPublicIP_subPath.yaml" \ ./tests/charts/make/chart_test.sh NoAutoscaling @@ -925,7 +927,7 @@ chart_test_autoscaling_deployment_https: chart_test_autoscaling_deployment: PLATFORMS=$(PLATFORMS) TEST_EXISTING_KEDA=true RELEASE_NAME=selenium CHART_ENABLE_TRACING=true TEST_PATCHED_KEDA=false \ - SECURE_CONNECTION_SERVER=true SECURE_USE_EXTERNAL_CERT=true SERVICE_TYPE_NODEPORT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=31444 \ + SECURE_CONNECTION_SERVER=true SECURE_USE_EXTERNAL_CERT=true SERVICE_TYPE_NODEPORT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$(LOCAL_HOSTNAME) SELENIUM_GRID_PORT=31444 \ SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 SET_MAX_REPLICAS=3 TEST_DELAY_AFTER_TEST=2 SELENIUM_GRID_MONITORING=false \ VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) BASE_VERSION=$(BASE_VERSION) \ TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_enableTracing_secureServer_externalCerts_nodePort_autoScaling_scaledObject_existingKEDA_subPath.yaml" \ @@ -941,7 +943,7 @@ chart_test_autoscaling_job_https: chart_test_autoscaling_job_hostname: PLATFORMS=$(PLATFORMS) CHART_ENABLE_TRACING=true CHART_ENABLE_BASIC_AUTH=true BASIC_AUTH_EMBEDDED_URL=true TEST_PATCHED_KEDA=false \ - SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=443 \ + SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$(LOCAL_HOSTNAME) SELENIUM_GRID_PORT=443 \ VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) BASE_VERSION=$(BASE_VERSION) \ TEMPLATE_OUTPUT_FILENAME="k8s_enableTracing_basicAuth_secureIngress_externalCerts_ingressPublicIP_autoScaling_originKEDA_scaledJob_subPath.yaml" \ ./tests/charts/make/chart_test.sh JobAutoscaling @@ -956,7 +958,7 @@ chart_test_autoscaling_job: chart_test_autoscaling_playwright_connect_grid: PLATFORMS=$(PLATFORMS) CHART_ENABLE_TRACING=true CHART_ENABLE_BASIC_AUTH=true MATRIX_TESTS=CDPTests SCALING_STRATEGY=accurate \ BASIC_AUTH_USERNAME=docker-selenium BASIC_AUTH_PASSWORD=2NMI4jdBi6k7bENoeUfV25295VvzwAE9chM24a+2VL95uOHozo \ - SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=443 \ + SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$(LOCAL_HOSTNAME) SELENIUM_GRID_PORT=443 \ VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) BASE_VERSION=$(BASE_VERSION) \ TEMPLATE_OUTPUT_FILENAME="k8s_playwright_connect_grid_basicAuth_secureIngress_ingressPublicIP_autoScaling_patchKEDA.yaml" \ ./tests/charts/make/chart_test.sh JobAutoscaling diff --git a/NodeChromium/Dockerfile b/NodeChromium/Dockerfile index dbdd0edd2..0bba4f2dc 100644 --- a/NodeChromium/Dockerfile +++ b/NodeChromium/Dockerfile @@ -9,7 +9,7 @@ USER root # Install Chromium ARG CHROMIUM_VERSION="latest" ARG CHROMIUM_DEB_SITE="http://deb.debian.org/debian" -RUN echo "deb ${CHROMIUM_DEB_SITE}/ sid main" >> /etc/apt/sources.list \ +RUN echo "deb ${CHROMIUM_DEB_SITE}/ stable main" >> /etc/apt/sources.list \ && wget -qO- https://ftp-master.debian.org/keys/archive-key-12.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/debian-archive-keyring.gpg \ && wget -qO- https://ftp-master.debian.org/keys/archive-key-12-security.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/debian-archive-security-keyring.gpg \ && apt-get update -qqy \ diff --git a/charts/selenium-grid/certs/gen-cert-helper.sh b/charts/selenium-grid/certs/gen-cert-helper.sh index 91a6fc618..b843f6a51 100755 --- a/charts/selenium-grid/certs/gen-cert-helper.sh +++ b/charts/selenium-grid/certs/gen-cert-helper.sh @@ -30,7 +30,7 @@ SERVER_KEYSTORE=${SERVER_KEYSTORE:-server.jks} SERVER_KEYSTORE_PASSPWD=${SERVER_KEYSTORE_PASSPWD:-server.pass} BASE64_ONLY=${BASE64_ONLY:-0} if [ -n "${ADD_IP_ADDRESS}" ] && [ "${ADD_IP_ADDRESS}" = "hostname" ]; then - ADD_IP_ADDRESS=",IP:$(hostname -I | awk '{print $1}')" + ADD_IP_ADDRESS=",IP:$(hostname -I | awk '{for(i=1;i<=NF;i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) {printf "%s%s", sep, $i; sep=",IP:"}}')" else ADD_IP_ADDRESS=${ADD_IP_ADDRESS} fi diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index bab70edcf..6bde3a97e 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -59,6 +59,7 @@ TEST_PATCHED_KEDA=${TEST_PATCHED_KEDA:-"false"} BASIC_AUTH_EMBEDDED_URL=${BASIC_AUTH_EMBEDDED_URL:-"false"} SELENIUM_GRID_MONITORING=${SELENIUM_GRID_MONITORING:-"true"} TEST_EXISTING_PTS=${TEST_EXISTING_PTS:-"false"} +LOCAL_HOSTNAME=$(hostname -I | awk '{for(i=1;i<=NF;i++) if ($i ~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) {print $i; exit}}') cleanup() { # Get the list of pods @@ -191,16 +192,16 @@ fi if [ "${CHART_ENABLE_INGRESS_HOSTNAME}" = "true" ]; then if [[ ! $(cat /etc/hosts) == *"${HOSTNAME_ADDRESS}"* ]]; then - sudo -- sh -c -e "echo \"$(hostname -i) ${HOSTNAME_ADDRESS}\" >> /etc/hosts" + sudo -- sh -c -e "echo \"${LOCAL_HOSTNAME} ${HOSTNAME_ADDRESS}\" >> /etc/hosts" fi if [[ ! $(cat /etc/hosts) == *"alertmanager.${HOSTNAME_ADDRESS}"* ]]; then - sudo -- sh -c -e "echo \"$(hostname -i) alertmanager.${HOSTNAME_ADDRESS}\" >> /etc/hosts" + sudo -- sh -c -e "echo \"${LOCAL_HOSTNAME} alertmanager.${HOSTNAME_ADDRESS}\" >> /etc/hosts" fi if [[ ! $(cat /etc/hosts) == *"grafana.${HOSTNAME_ADDRESS}"* ]]; then - sudo -- sh -c -e "echo \"$(hostname -i) grafana.${HOSTNAME_ADDRESS}\" >> /etc/hosts" + sudo -- sh -c -e "echo \"${LOCAL_HOSTNAME} grafana.${HOSTNAME_ADDRESS}\" >> /etc/hosts" fi if [[ ! $(cat /etc/hosts) == *"pts.${HOSTNAME_ADDRESS}"* ]]; then - sudo -- sh -c -e "echo \"$(hostname -i) pts.${HOSTNAME_ADDRESS}\" >> /etc/hosts" + sudo -- sh -c -e "echo \"${LOCAL_HOSTNAME} pts.${HOSTNAME_ADDRESS}\" >> /etc/hosts" fi ping -c 2 ${HOSTNAME_ADDRESS} HELM_COMMAND_SET_IMAGES="${HELM_COMMAND_SET_IMAGES} \ @@ -250,7 +251,7 @@ if [ "${SECURE_INGRESS_ONLY_GENERATE}" = "true" ] && [ "${RENDER_HELM_TEMPLATE_O --set tls.ingress.generateTLS=true \ --set tls.ingress.defaultCN=${SELENIUM_GRID_HOST} \ --set tls.ingress.defaultSANList[0]=${SELENIUM_GRID_HOST} \ - --set tls.ingress.defaultIPList[0]=$(hostname -I | awk '{print $1}') \ + --set tls.ingress.defaultIPList[0]=${LOCAL_HOSTNAME} \ " fi