From 4bc9bc3e0b4c5ba9ed2724466fe62ab19a1e7028 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 14:51:23 +0700 Subject: [PATCH] build(chart): Chart built on top of Nightly images (#2089) build(chart): Chart built on top of Nightly images Signed-off-by: Viet Nguyen Duc --- .github/workflows/nightly.yaml | 26 ++++++++++++++++++++++---- Makefile | 4 ++++ README.md | 9 +++++++++ charts/selenium-grid/README.md | 9 +++++++++ generate_release_notes.sh | 2 +- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 37bf11004..968b65e38 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -61,21 +61,39 @@ jobs: timeout_minutes: 20 max_attempts: 3 command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_nightly - - name: Sets env var for the next tag - run: echo "NEXT_TAG=nightly" >> $GITHUB_ENV - name: Get current latest tag - run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + run: echo "LATEST_TAG=$(git describe --tags --abbrev=0 --exclude=nightly --exclude=selenium-grid*)" >> $GITHUB_ENV - name: Display latest tag run: echo ${LATEST_TAG} + - name: Sets env var for nightly tag + run: | + echo "NEXT_TAG=nightly" >> $GITHUB_ENV + echo "FILTER_IMAGE_TAG=nightly" >> $GITHUB_ENV - name: Create release notes (release_notes.md) run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} + + - name: Set up Python + uses: actions/setup-python@v5.0.0 + with: + python-version: '3.11' + check-latest: true + - name: Update tag in docs and files + run: ./update_tag_in_docs_and_files.sh ${LATEST_TAG} ${NEXT_TAG} + - name: Setup environment to build chart + run: make chart_setup_env + - name: Build and lint charts + run: | + make chart_build_nightly + echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV + echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV + - name: Create Nightly Release id: create_release uses: ncipollo/release-action@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - #artifacts: + artifacts: "${{ env.CHART_PACKAGE_PATH }}" replacesArtifacts: true bodyFile: "release_notes.md" generateReleaseNotes: true diff --git a/Makefile b/Makefile index b0dd7c237..6bd98fb51 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nig BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.17.0-SNAPSHOT) VERSION := $(or $(VERSION),$(VERSION),$(BASE_VERSION)) TAG_VERSION := $(VERSION)-$(BUILD_DATE) +CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),1.0.0-nightly) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ) PUSH_IMAGE := $(or $(PUSH_IMAGE),$(PUSH_IMAGE),false) @@ -417,6 +418,9 @@ chart_cluster_setup: chart_cluster_cleanup: ./tests/charts/make/chart_cluster_cleanup.sh +chart_build_nightly: + VERSION=$(CHART_VERSION_NIGHTLY) ./tests/charts/make/chart_build.sh + chart_build: VERSION=$(TAG_VERSION) ./tests/charts/make/chart_build.sh diff --git a/README.md b/README.md index 44fe851b6..926e8cfbb 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Talk to us at https://www.selenium.dev/support/ * [Quick start](#quick-start) * [Experimental Mult-Arch aarch64/armhf/amd64 Images](#experimental-mult-arch-aarch64armhfamd64-images) +* [Nightly Images](#nightly-images) * [Dev and Beta Channel Browser Images](#dev-and-beta-channel-browser-images) + [Dev and Beta Standalone Mode](#dev-and-beta-standalone-mode) + [Dev and Beta on the Grid](#dev-and-beta-on-the-grid) @@ -106,6 +107,14 @@ in _this_ repository (SeleniumHQ/docker-selenium) instead of the experimental on ___ +## Nightly Images + +Nightly images are built on top of the [Nightly](https://github.com/SeleniumHQ/selenium/releases/tag/nightly) build on the upstream project [Selenium](https://github.com/SeleniumHQ/selenium) with the latest changes on main branch in this repository. The image tag is `nightly`. This is not recommended to use images in production. It is only for testing purpose. + +```bash +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:nightly +``` + ## Dev and Beta Channel Browser Images To run tests or otherwise work with pre-release browsers, Google, Mozilla, and Microsoft maintain a Dev and Beta release channel for those who need to see what's soon to be released to the general population. diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index ae3a4c00d..30d0ccdfd 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -8,6 +8,7 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Contents](#contents) * [Introduction](#introduction) * [Installing the chart](#installing-the-chart) + * [Installing the Nightly chart](#installing-the-nightly-chart) * [Enable Selenium Grid Autoscaling](#enable-selenium-grid-autoscaling) * [Settings common for both `job` and `deployment` scalingType](#settings-common-for-both-job-and-deployment-scalingtype) * [Settings when scalingType with `deployment`](#settings-when-scalingtype-with-deployment-) @@ -67,6 +68,14 @@ helm install selenium-grid --set ingress.hostname=selenium-grid.k8s.local docker # Notes: In case you want to set hostname is selenium-grid.local. You need to add the IP and hostname to the local host file in `/etc/hosts` ``` +### Installing the Nightly chart + +Nightly chart is built from the latest main branch of this repository with using Nightly images. It is not recommended to use this chart in production. It is only for testing purpose. The procedure to install the Nightly chart is the same as the above, only different on the version, it is `1.0.0-nightly` + +```bash +helm install selenium-grid docker-selenium/selenium-grid --version 1.0.0-nightly +``` + ## Enable Selenium Grid Autoscaling Selenium Grid has the ability to autoscaling browser nodes up/down based on the pending requests in the diff --git a/generate_release_notes.sh b/generate_release_notes.sh index d76c2912c..85f15cc55 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -38,7 +38,7 @@ echo "
" >> release_notes.md echo "Click to see published Docker images" >> release_notes.md echo "" >> release_notes.md echo '```' >> release_notes.md -docker images --filter=reference=${NAMESPACE}'/*:*' --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md +docker images --filter=reference=${NAMESPACE}'/*:'${FILTER_IMAGE_TAG:-"*"} --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md echo '```' >> release_notes.md echo "" >> release_notes.md echo "
" >> release_notes.md