Skip to content

add bandwidth limit #10934

add bandwidth limit

add bandwidth limit #10934

Workflow file for this run

name: Main CI WorkFlow
on:
push:
branches:
- master
tags:
paths-ignore:
- '**.md'
- 'docs/**'
- '**/OWNERS'
- '**/MAINTAINERS'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
- '**/OWNERS'
- '**/MAINTAINERS'
env:
CONTAINER_RUN_OPTIONS: " "
GINKGO_VERSION: "v2.9.5"
jobs:
lint:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Verify vendor, licenses, do lint
env:
GOPATH: /home/runner/work/${{ github.repository }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
sudo apt-get install -y jq
- name: Run verify test
run: make verify
working-directory: ./src/github.com/${{ github.repository }}
- name: Run lint test
run: make lint
working-directory: ./src/github.com/${{ github.repository }}
image-prepare:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Prepare kubeedge/build-tools image
steps:
- name: Pull kubeedge/build-tools image
run: |
docker pull kubeedge/build-tools:1.22.9-ke1
mkdir -p /home/runner/build-tools/
docker save kubeedge/build-tools:1.22.9-ke1 > /home/runner/build-tools/build-tools.tar
- name: Temporarily save kubeedge/build-tools image
uses: actions/upload-artifact@v4
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
build:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Multiple build
needs: image-prepare
steps:
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v4
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
- run: make
- run: make smallbuild
- run: make crossbuild
- run: make crossbuild ARM_VERSION=GOARM7
- run: make crossbuild WHAT=cloudcore ARM_VERSION=GOARM8
- run: make crossbuild WHAT=edgecore OS=GOOSwindows BUILD_WITH_CONTAINER=false
- run: make crossbuild WHAT=keadm OS=GOOSwindows BUILD_WITH_CONTAINER=false
basic_test:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Unit test, integration test edge
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: make test PROFILE=y
- name: Upload coverage to Codecov
# Prevent running from the forked repository that doesn't need to upload coverage.
# In addition, running on the forked repository would fail as missing the necessary secret.
if: ${{ github.repository == 'kubeedge/kubeedge' }}
uses: codecov/codecov-action@v4
with:
# Even though token upload token is not required for public repos,
# but adding a token might increase successful uploads as per:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
token: ${{secrets.CODECOV_UPLOAD_TOKEN}}
files: ./coverage.out
flags: unittests
fail_ci_if_error: true
verbose: true
- name: enable cri config in containerd service
run: |
containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service
- run: make integrationtest
e2e_test:
runs-on: ubuntu-22.04
strategy:
matrix:
cases:
- protocol: WebSocket
version: v1.30.0
- protocol: WebSocket
version: v1.29.0
- protocol: WebSocket
version: v1.28.0
- protocol: QUIC
version: v1.30.0
- protocol: QUIC
version: v1.29.0
- protocol: QUIC
version: v1.28.0
timeout-minutes: 60
name: E2e test
needs: image-prepare
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://dl.k8s.io/release/v1.30.7/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: cleanup images
run: docker system prune -a -f
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v4
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
- name: enable cri config in containerd service
run: |
containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service
# for QUIC protocol, we will use docker as edgecore container runtime
# for WebSocket protocol, we will use containerd as edgecore container runtime
# just for covering both docker and CRI runtime e2e cases
- run: |
export PROTOCOL=${{ matrix.cases.protocol }}
export KIND_IMAGE=kindest/node:${{ matrix.cases.version }}
export CONTAINER_RUNTIME="containerd"
make e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.cases.version }}-${{ matrix.cases.protocol }}-e2e-test-logs
path: |
/tmp/cloudcore.log
/tmp/edgecore.log
keadm_deprecated_e2e_test:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Keadm deprecated e2e test
needs: image-prepare
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://dl.k8s.io/release/v1.30.7/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: cleanup images
run: docker system prune -a -f
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v4
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
- name: enable cri config in containerd service
run: |
containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service
- run: make keadm_deprecated_e2e
keadm_e2e_test:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Keadm e2e test
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://dl.k8s.io/release/v1.30.7/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.4.0
- name: enable cri config in containerd service
run: |
containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service
- name: cleanup images
run: docker system prune -a -f
- run: make keadm_e2e
docker_build:
runs-on: ubuntu-22.04
timeout-minutes: 40
name: Multiple docker image build
steps:
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: cleanup images
run: docker system prune -a -f
- name: make image
run: |
export DOCKER_BUILD_AND_SYSTEM_PRUNE="true"
make image
container_runtime_test:
runs-on: ubuntu-22.04
strategy:
matrix:
container-runtime: [ 'isulad', 'cri-o', 'docker' ]
name: container runtime e2e test
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/[email protected]
curl -LO https://dl.k8s.io/release/v1.30.7/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run e2e
run: make e2e
env:
CONTAINER_RUNTIME: ${{ matrix.container-runtime }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.container-runtime }}-e2e-test-logs
path: |
/tmp/cloudcore.log
/tmp/edgecore.log
conformance_e2e_test:
runs-on: ubuntu-22.04
timeout-minutes: 60
name: conformance e2e test
needs: image-prepare
env:
GO111MODULE: on
strategy:
matrix:
cases:
- conformance-type: "conformance"
result-name: "conformance-test-results"
- conformance-type: "nodeconformance"
result-name: "nodeconformance-test-results"
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
run: |
go install sigs.k8s.io/[email protected]
curl -LO https://dl.k8s.io/release/v1.30.7/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve saved kubeedge/build-tools image
uses: actions/download-artifact@v4
with:
name: build-tools-docker-artifact
path: /home/runner/build-tools
- name: Docker load kubeedge/build-tools image
run: |
docker load < /home/runner/build-tools/build-tools.tar
rm -rf /home/runner/build-tools/build-tools.tar
- name: Enable cri config in containerd service
run: |
containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Run conformance e2e
run: |
export KIND_IMAGE=kindest/node:v1.30.0
export CONFORMANCE_TYPE=${{ matrix.cases.conformance-type }}
make conformance_e2e
- name: Upload conformance e2e test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.cases.result-name }}
path: /tmp/results/