Skip to content

Commit

Permalink
add a cni feature
Browse files Browse the repository at this point in the history
Signed-off-by: terassyi <iscale821@gmail.com>
  • Loading branch information
terassyi committed Mar 19, 2024
1 parent ed0b7ad commit b8d6bb2
Show file tree
Hide file tree
Showing 103 changed files with 7,779 additions and 720 deletions.
84 changes: 0 additions & 84 deletions .github/workflows/ci.yaml

This file was deleted.

153 changes: 153 additions & 0 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: e2e test
on:
pull_request:
paths-ignore:
- '.gitignore'
- '.dockerignore'
- 'LICENSE'
- '**.md'
push:
branches:
- main

env:
CARGO_TERM_COLOR: always
TAGS: dev
go-version: "1.22"

jobs:
build-image:
name: Build container image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and Export
uses: docker/build-push-action@v5
with:
context: .
tags: sart:dev
outputs: type=docker,dest=/tmp/sart.tar
- name: Upload container image
uses: actions/upload-artifact@v4
with:
name: sart
path: /tmp/sart.tar
bgp-e2e-test:
name: BGP End-to-End Test
needs: build-image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Download sart container image
uses: actions/download-artifact@v4
with:
name: sart
path: /tmp
- name: Load sart container image
run: |
docker load --input /tmp/sart.tar
docker image ls -a
- name: Setup Tools
working-directory: e2e
run: make setup
- name: Run E2E Test
working-directory: e2e
run: make bgp-e2e
kubernetes-e2e-test:
name: Kubernetes End-to-End Test
needs: build-image
strategy:
matrix:
# kindest node version
kubernetes-version: ["1.28.6", "1.29.2"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Download sart container image
uses: actions/download-artifact@v4
with:
name: sart
path: /tmp
- name: Load sartd container image
run: |
docker load --input /tmp/sart.tar
docker image ls -a
- name: Setup Tools
working-directory: e2e
run: |-
make setup
make -C ../ setup-grpc
- name: Start Kind Cluster
working-directory: e2e
run: make kubernetes KUBERNETES_VERSION=${{ matrix.kubernetes-version }}
- name: Generate Certificates
run: make certs
- name: Generate CRD
run: make crd
- name: Install sart
working-directory: e2e
run: make install-sart
- name: Run E2E Test
working-directory: e2e
run: make kubernetes-e2e
- name: Clean up Kind Cluster
working-directory: e2e
run: make kubernetes-down
if: always()
cni-e2e-test:
name: CNI End-to-End Test
needs: build-image
strategy:
matrix:
# kindest node version
kubernetes-version: ["1.28.6", "1.29.2"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Download sart container image
uses: actions/download-artifact@v4
with:
name: sart
path: /tmp
- name: Load sart container image
run: |
docker load --input /tmp/sart.tar
docker image ls -a
- name: Setup Tools
working-directory: e2e
run: |-
make setup
make -C ../ setup-grpc
- name: Start Kind Cluster
working-directory: e2e
run: make kubernetes MODE=cni COMPACT=true KUBERNETES_VERSION=${{ matrix.kubernetes-version }}
env:
MODE: cni
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
- name: Generate Certificates
run: make certs
- name: Generate CRD
run: make crd
- name: Install sart
working-directory: e2e
run: make install-sart MODE=cni
env:
MODE: cni
- name: Run E2E Test
working-directory: e2e
run: make cni-e2e
- name: Clean up Kind Cluster
working-directory: e2e
run: make kubernetes-down MODE=cni COMPACT=true
if: always()
32 changes: 32 additions & 0 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: unit test
on: [push]

env:
CARGO_TERM_COLOR: always

jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Build Dependencies
run: make setup-grpc
- name: Fmt
run: make fmt
- name: Run Unit Test
run: make unit-test
integration-test:
name: Integration Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Build Dependencies
run: make setup-grpc
- name: Generate CRD manifests
run: make crd
- name: Install Kubernetes Dependencies
run: |-
make -C e2e setup
- name: Run Integration Test
run: make integration-test
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*.pcaping
.vscode
*.bin
**/bin
/bin
/e2e/bin
*/*.pem
*/*.cert
*/*.key
Expand All @@ -14,7 +15,8 @@ sart.yaml

**/e2e.test
e2e/topology/.*.yaml.bak
e2e/topology/kubernetes-cni*.yaml
e2e/clab-sart

manifests/certs/*
manifests/base/certs/*
manifests/webhook/admission_webhook_patch.yaml
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUST_VERSION=1.74.1
ARG RUST_VERSION=1.76.0

# BUILDPLATFORM = linux/amd64

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ CARGO := cargo
IMAGE_VERSION := dev
PROJECT := github.com/terassyi/sart

KIND_VERSION := 0.20.0
KUBERNETES_VERSION := 1.28.0
KIND_VERSION := 0.22.0
KUBERNETES_VERSION := 1.29.2
KUSTOMIZE_VERSION := 5.2.1

BINDIR := $(abspath $(PWD)/bin)
Expand Down
Loading

0 comments on commit b8d6bb2

Please sign in to comment.