Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build][test]: Release docker images for aarch64 platform #2266

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
509 changes: 161 additions & 348 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ body:
attributes:
label: Selenium Grid chart version (chart version)
description: What version of Selenium Grid chart are you using?
placeholder: 0.29.1?
placeholder: 0.30.0?
validations:
required: false
59 changes: 0 additions & 59 deletions .github/workflows/build-test-multi-arch.yml

This file was deleted.

68 changes: 1 addition & 67 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ on:
paths-ignore:
- '**.md'

permissions:
contents: read
permissions: write-all

jobs:
docker-test:
Expand All @@ -29,68 +28,3 @@ jobs:
uses: ./.github/workflows/helm-chart-test.yml
with:
release: ${{ inputs.release == 'true' }}

build-and-test:
name: Build & test Docker images with random user
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
use-random-user: [false, true]
steps:
- uses: actions/checkout@main
- name: Set up QEMU
uses: docker/setup-qemu-action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
with:
platforms: linux/amd64,linux/arm64
use: false
- name: Output Docker info
run: docker info
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.11'
check-latest: true
- name: Get branch name (only for push to branch)
if: github.event_name == 'push'
run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV
env:
PUSH_BRANCH: ${{ github.ref }}
- name: Get target branch name (only for PRs)
if: github.event_name == 'pull_request'
run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV
env:
TARGET_BRANCH: ${{ github.head_ref }}
- name: Output branch name
run: echo ${BRANCH}
- name: Set Selenium base version
if: inputs.release != 'true'
run: |
make set_build_nightly
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
- name: Sets build date
run: |
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV
env:
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
- name: Build Docker images
uses: nick-invision/retry@master
with:
timeout_minutes: 12
max_attempts: 3
retry_wait_seconds: 60
command: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
- name: Count image layers
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make count_image_layers
- name: Test Docker images
uses: nick-invision/retry@master
with:
timeout_minutes: 20
max_attempts: 3
command: |
USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test
env:
USE_RANDOM_USER: ${{ matrix.use-random-user }}
30 changes: 18 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ on:
required: false
type: boolean
default: false
skip-test:
description: 'Skip the tests'
required: false
type: boolean
default: false
push:
branches:
- trunk

jobs:
build-test:
if: contains(toJson(github.event.commits), '[deploy]') == true || github.event_name == 'workflow_dispatch'
if: contains(toJson(github.event.commits), '[deploy]') == true || (github.event_name == 'workflow_dispatch' && github.event.inputs.skip-test == 'false')
uses: ./.github/workflows/build-test.yml
with:
release: ${{ github.event.inputs.release == 'true' }}

deploy:
needs:
- build-test
if: contains(toJson(github.event.commits), '[deploy]') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')
if: contains(toJson(github.event.commits), '[deploy]') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true' && !failure() && !cancelled())
name: Deploy Docker images
runs-on: ubuntu-latest
permissions: write-all
Expand All @@ -32,19 +37,22 @@ jobs:
with:
persist-credentials: false
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
- name: Set up containerd image store feature
uses: nick-invision/retry@master
with:
platforms: linux/amd64,linux/arm64
use: false
timeout_minutes: 10
max_attempts: 3
command: |
make chart_setup_env
make set_containerd_image_store
- name: Output Docker info
run: docker info
- name: Sets build date
run: |
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
echo "NAME=${NAMESPACE}" >> $GITHUB_ENV
make set_build_multiarch
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
env:
NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
Expand All @@ -60,8 +68,6 @@ jobs:
if: contains(toJson(github.event.commits), '[prerelease]') == true
- name: Display Grid version
run: echo ${GRID_VERSION}
- name: Remove local Docker tag
run: docker rmi ${NAME}/base:local-${BUILD_DATE}
- name: Sets env var for the next tag
run: echo "NEXT_TAG=${GRID_VERSION}-${BUILD_DATE}" >> $GITHUB_ENV
- name: Get latest tag
Expand All @@ -75,10 +81,10 @@ jobs:
- name: Build images
uses: nick-invision/retry@master
with:
timeout_minutes: 12
timeout_minutes: 45
max_attempts: 3
retry_wait_seconds: 60
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
- name: Login Docker Hub
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
Expand Down
51 changes: 42 additions & 9 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,45 @@ jobs:
fail-fast: false
matrix:
include:
- test-strategy: test
use-random-user: true
test-video: false
build-all: true
- test-strategy: test
use-random-user: false
test-video: false
build-all: true
- test-strategy: test_video
use-random-user: false
test-video: true
build-all: false
- test-strategy: test_video_dynamic_name
use-random-user: false
test-video: true
build-all: false
- test-strategy: test_node_docker
use-random-user: false
test-video: true
build-all: false
- test-strategy: test_parallel
use-random-user: false
test-video: false
build-all: false
- test-strategy: test_node_relay
use-random-user: false
test-video: false
build-all: false
steps:
- uses: actions/checkout@main
- name: Set up QEMU
uses: docker/setup-qemu-action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
- name: Checkout code
uses: actions/checkout@main
- name: Set up containerd image store feature
uses: nick-invision/retry@master
with:
platforms: linux/amd64,linux/arm64
use: false
timeout_minutes: 10
max_attempts: 3
command: |
make chart_setup_env
make set_containerd_image_store
- name: Output Docker info
run: docker info
- name: Set up Python
Expand Down Expand Up @@ -89,10 +109,20 @@ jobs:
echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV
env:
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
- name: Build Docker images
uses: nick-invision/retry@master
if: matrix.build-all == true
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 60
command: |
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
- name: Pre-build to reduce logs in test phase
uses: nick-invision/retry@master
if: matrix.build-all != true
with:
timeout_minutes: 12
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 60
command: |
Expand All @@ -111,10 +141,13 @@ jobs:
TEST_PARALLEL_HARDENING: ${{ github.event.inputs.parallel-hardening || 'true' }}
REQUEST_TIMEOUT: ${{ github.event.inputs.request-timeout || '400' }}
- name: Run Docker Compose to ${{ matrix.test-strategy }}
run: USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make ${{ matrix.test-strategy }}
run: USE_RANDOM_USER_ID=${{ matrix.use-random-user }} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make ${{ matrix.test-strategy }}
- name: Upload recorded video
if: matrix.test-video == true
uses: actions/upload-artifact@main
with:
name: "${{ matrix.test-strategy }}_artifacts"
path: ./tests/videos/
- name: Clean up Docker
if: always()
run: docker system prune -af
Loading
Loading