Skip to content

Commit 1d8a35c

Browse files
committed
test: run with multiple container runtime Docker versions
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 7b18a8f commit 1d8a35c

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

.github/workflows/helm-chart-test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,44 @@ jobs:
3838
test-strategy: disabled
3939
cluster: 'minikube'
4040
helm-version: 'v3.10.3'
41+
docker-version: '24.0.9'
4142
test-upgrade: true
4243
- k8s-version: 'v1.26.15'
4344
test-strategy: job
4445
cluster: 'minikube'
4546
helm-version: 'v3.11.3'
47+
docker-version: '24.0.9'
4648
test-upgrade: true
4749
- k8s-version: 'v1.27.16'
4850
test-strategy: deployment
4951
cluster: 'minikube'
5052
helm-version: 'v3.12.3'
53+
docker-version: '24.0.9'
5154
test-upgrade: true
5255
- k8s-version: 'v1.28.13'
5356
test-strategy: job_https
5457
cluster: 'minikube'
5558
helm-version: 'v3.13.3'
59+
docker-version: '25.0.5'
5660
test-upgrade: true
5761
- k8s-version: 'v1.29.8'
5862
test-strategy: job_hostname
5963
cluster: 'minikube'
6064
helm-version: 'v3.14.4'
65+
docker-version: '26.1.4'
6166
test-upgrade: true
6267
- k8s-version: 'v1.30.4'
6368
test-strategy: deployment_https
6469
cluster: 'minikube'
6570
helm-version: 'v3.15.4'
71+
docker-version: '27.2.0'
6672
test-upgrade: true
6773
env:
6874
CLUSTER: ${{ matrix.cluster }}
6975
KUBERNETES_VERSION: ${{ matrix.k8s-version }}
7076
ARTIFACT_NAME: "${{ matrix.k8s-version }}-${{ matrix.test-strategy }}"
7177
HELM_VERSION: ${{ matrix.helm-version }}
78+
DOCKER_VERSION: ${{ matrix.docker-version }}
7279
TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }}
7380
steps:
7481
- name: Free Disk Space (Ubuntu)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ all: hub \
4545
set_containerd_image_store:
4646
sudo mkdir -p /etc/docker
4747
sudo mv /etc/docker/daemon.json /etc/docker/daemon.json.bak || true
48-
echo "{\"features\":{\"containerd-snapshotter\": true}, \"experimental\": true}" | sudo tee /etc/docker/daemon.json
48+
echo "{\"features\":{\"containerd-snapshotter\": true, \"containerd\": true}, \"experimental\": true}" | sudo tee /etc/docker/daemon.json
4949
sudo systemctl restart docker
5050
sudo chmod 666 /var/run/docker.sock
5151
docker version -f '{{.Server.Experimental}}'

generate_chart_changelog.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ generate_changelog() {
3939
# Get the changes for each section (Added, Removed, Fixed, Changed)
4040
image_tag_changes=$(echo "Chart is using image tag $CHART_APP_VERSION" | sed -e 's/^/- /')
4141
k8s_versions_tested=$(echo "Chart is tested on Kubernetes versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "k8s-version: '\Kv.*(?=')" | tr '\n' ',' | sed s/,/,\ /g)" | sed -e 's/^/- /')
42+
docker_versions_tested=$(echo "Chart is tested on container runtime Docker versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "docker-version: '\Kv.*(?=')" | tr '\n' ',' | sed s/,/,\ /g)" | sed -e 's/^/- /')
4243
helm_versions_tested=$(echo "Chart is tested on Helm versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "helm-version: '\Kv.*(?=')" | tr '\n' ',' | sed s/,/,\ /g)" | sed -e 's/^/- /')
4344
added_changes=$(git log --pretty=format:"[\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "\- feat|\- add" | sed -e 's/^/- /')
4445
removed_changes=$(git log --pretty=format:"[\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "\- remove|\- deprecate|\- delete" | sed -e 's/^/- /')
@@ -53,6 +54,7 @@ generate_changelog() {
5354
echo "" >> "$temp_file"
5455
echo "$image_tag_changes" >> "$temp_file"
5556
echo "$k8s_versions_tested" >> "$temp_file"
57+
echo "$docker_versions_tested" >> "$temp_file"
5658
echo "$helm_versions_tested" >> "$temp_file"
5759
echo "" >> "$temp_file"
5860

generate_release_notes.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ BUILD_DATE=$4
77
NAMESPACE=${NAME:-selenium}
88
FFMPEG_TAG_VERSION=$(grep FFMPEG_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)
99
RCLONE_TAG_VERSION=$(grep RCLONE_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)
10+
AUTHORS=${AUTHORS:-"SeleniumHQ"}
1011

1112
TAG_VERSION=${GRID_VERSION}-${BUILD_DATE}
1213

1314
echo "" >> release_notes.md
1415
echo "### Changelog" > release_notes.md
1516
git --no-pager log "${LATEST_TAG}...${HEAD_BRANCH}" --pretty=format:"* [\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" --reverse >> release_notes.md
1617

18+
GRID_REVISION=$(docker run --entrypoint="" --rm ${NAMESPACE}/base:${TAG_VERSION} java -jar /opt/selenium/selenium-server.jar info --version | awk '{print $5}')
1719
CHROME_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}')
1820
EDGE_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}')
1921
CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}')
@@ -23,16 +25,22 @@ GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} g
2325
FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:${FFMPEG_TAG_VERSION}-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1)
2426
RCLONE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:${FFMPEG_TAG_VERSION}-${BUILD_DATE} rclone version | head -n 1 | awk '{print $2}' | tr -d 'v')
2527
JRE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/base:${TAG_VERSION} java --version | grep -oP '\b\d+\.\d+\.\d+\b' | head -1)
28+
OS_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/base:${TAG_VERSION} cat /etc/os-release | grep PRETTY_NAME | cut -d '"' -f 2)
2629
FIREFOX_ARM64_VERSION=$(docker run --rm --platform linux/arm64 ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}')
2730
CHROMIUM_VERSION=$(docker run --rm ${NAMESPACE}/node-chromium:${TAG_VERSION} chromium --version | awk '{print $2}')
2831
CHROMIUMDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chromium:${TAG_VERSION} chromedriver --version | awk '{print $2}')
29-
32+
if [[ "${GRID_VERSION}" == *"SNAPSHOT"* ]]; then
33+
GRID_RELEASE_TAG="nightly"
34+
else
35+
GRID_RELEASE_TAG="selenium-${GRID_VERSION}"
36+
fi
37+
LINK_GRID_DETAILS="[${GRID_VERSION}](https://github.com/${AUTHORS}/selenium/releases/tag/${GRID_RELEASE_TAG}) (rev [${GRID_REVISION}](https://github.com/${AUTHORS}/selenium/commit/${GRID_REVISION}))"
3038

3139
echo "" >> release_notes.md
3240
echo "### Released versions" >> release_notes.md
3341
echo "| Components | x86_64 (amd64) | aarch64 (arm64/armv8) |" >> release_notes.md
3442
echo "|:----------:|:--------------:|:---------------------:|" >> release_notes.md
35-
echo "| Selenium | ${GRID_VERSION} | ${GRID_VERSION} |" >> release_notes.md
43+
echo "| Selenium Grid | ${LINK_GRID_DETAILS} | ${LINK_GRID_DETAILS} |" >> release_notes.md
3644
echo "| Chromium | ${CHROMIUM_VERSION} | ${CHROMIUM_VERSION} |" >> release_notes.md
3745
echo "| Chrome | ${CHROME_VERSION} | x |" >> release_notes.md
3846
echo "| ChromeDriver | ${CHROMEDRIVER_VERSION} | ${CHROMIUMDRIVER_VERSION} |" >> release_notes.md
@@ -43,6 +51,7 @@ echo "| GeckoDriver | ${GECKODRIVER_VERSION} | ${GECKODRIVER_VERSION} |" >> rele
4351
echo "| ffmpeg | ${FFMPEG_VERSION} | ${FFMPEG_VERSION} |" >> release_notes.md
4452
echo "| rclone | ${RCLONE_VERSION} | ${RCLONE_VERSION} |" >> release_notes.md
4553
echo "| Java Runtime | ${JRE_VERSION} | ${JRE_VERSION} |" >> release_notes.md
54+
echo "| OS | ${OS_VERSION} | ${OS_VERSION} |" >> release_notes.md
4655

4756
echo "" >> release_notes.md
4857
echo "### Published Docker images on [Docker Hub](https://hub.docker.com/u/${NAMESPACE})" >> release_notes.md
@@ -57,4 +66,4 @@ echo "</details>" >> release_notes.md
5766

5867
echo "" >> release_notes.md
5968
chart_version=$(find . \( -type d -name .git -prune \) -o -type f -wholename '*/selenium-grid/Chart.yaml' -print0 | xargs -0 cat | grep ^version | cut -d ':' -f 2 | tr -d '[:space:]')
60-
echo "### Published Helm chart version [selenium-grid-${chart_version}](https://github.com/${AUTHORS:-"SeleniumHQ"}/docker-selenium/releases/tag/selenium-grid-${chart_version})" >> release_notes.md
69+
echo "### Published Helm chart version [selenium-grid-${chart_version}](https://github.com/${AUTHORS}/docker-selenium/releases/tag/selenium-grid-${chart_version})" >> release_notes.md

tests/charts/make/chart_setup_env.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
echo "Set ENV variables"
44
CLUSTER=${CLUSTER:-"minikube"}
5+
DOCKER_VERSION=${DOCKER_VERSION:-""}
6+
HELM_VERSION=${HELM_VERSION:-"latest"}
7+
KUBERNETES_VERSION=${KUBERNETES_VERSION:-$(curl -L -s https://dl.k8s.io/release/stable.txt)}
58

69
# Function to be executed on command failure
710
on_failure() {
@@ -24,7 +27,17 @@ echo \
2427
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
2528
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
2629
sudo apt-get update -qq || true
27-
sudo apt-get install -yq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin gcc-aarch64-linux-gnu qemu-user-static
30+
if [ -n "${DOCKER_VERSION}" ]; then
31+
if [[ "${DOCKER_VERSION}" == "20.10"* ]]; then
32+
DOCKER_VERSION="=5:${DOCKER_VERSION}~3-0~$(. /etc/os-release; echo "$ID")-$(. /etc/os-release; echo "$VERSION_CODENAME")"
33+
else
34+
DOCKER_VERSION="=5:${DOCKER_VERSION}-1~$(. /etc/os-release; echo "$ID").$(. /etc/os-release; echo "$VERSION_ID")~$(. /etc/os-release; echo "$VERSION_CODENAME")"
35+
fi
36+
echo "Installing package docker-ce${DOCKER_VERSION}"
37+
ALLOW_DOWNGRADE="--allow-downgrades"
38+
fi
39+
sudo apt-get install -yq ${ALLOW_DOWNGRADE} docker-ce${DOCKER_VERSION} docker-ce-cli${DOCKER_VERSION}
40+
sudo apt-get install -yq ${ALLOW_DOWNGRADE} containerd.io docker-buildx-plugin docker-compose-plugin gcc-aarch64-linux-gnu qemu-user-static
2841
sudo chmod 666 /var/run/docker.sock
2942
docker version
3043
docker buildx version
@@ -110,7 +123,7 @@ elif [ "${CLUSTER}" = "minikube" ]; then
110123
fi
111124

112125
echo "Installing kubectl for AMD64 / ARM64"
113-
curl -fsSL -o ./kubectl "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl"
126+
curl -fsSL -o ./kubectl "https://dl.k8s.io/release/${KUBERNETES_VERSION}/bin/linux/$(dpkg --print-architecture)/kubectl"
114127
chmod +x ./kubectl
115128
sudo cp -frp ./kubectl /usr/local/bin/kubectl
116129
sudo ln -sf /usr/local/bin/kubectl /usr/bin/kubectl
@@ -119,7 +132,6 @@ kubectl version --client
119132
echo "==============================="
120133

121134
echo "Installing Helm for AMD64 / ARM64"
122-
HELM_VERSION=${HELM_VERSION:-"latest"}
123135
if [ "${HELM_VERSION}" = "latest" ]; then
124136
HELM_VERSION=$(curl -s https://api.github.com/repos/helm/helm/releases/latest | grep tag_name | cut -d '"' -f 4)
125137
fi

0 commit comments

Comments
 (0)