Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
run: |
export IMAGE_TAG=$(git log -1 --format='%h' | awk '{print $0}')
export VERSION=$(cat ./deploy/all-in-one.yaml| grep -w "image" | awk -F ":" '{print $NF}' | awk 'FNR == 1')
export BUILDPLATFORM=$(uname -m)
sed -i "s/${VERSION}/${IMAGE_TAG}/g" ./deploy/all-in-one.yaml
eval $(minikube docker-env)
make docker-build
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: smoke
on:
pull_request:
branches:
- main
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read-
jobs:
smoke:
name: smoke
if: |
true
runs-on: ubuntu-latest
env:
VANUS_GATEWAY: 192.168.49.2:30001
BUILDPLATFORM: linux/amd64

steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Environmental preparation
run: |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start
curl -LO https://dl.k8s.io/release/v1.24.0/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

- name: Deploy Vanus
run: |
export IMAGE_TAG=$(git log -1 --format='%h' | awk '{print $0}')
export VERSION=$(cat ./deploy/all-in-one.yaml| grep -w "image" | awk -F ":" '{print $NF}' | awk 'FNR == 1')
export BUILDPLATFORM=$(uname -m)
sed -i "s/${VERSION}/${IMAGE_TAG}/g" ./deploy/all-in-one.yaml
eval $(minikube docker-env)
make docker-build
kubectl apply -f ./deploy/all-in-one.yaml
kubectl apply -f ./test/yaml/display.yml
kubectl apply -f ./test/yaml/etcd-srv.yml
make build-cmd
chmod ug+x ./bin/vsctl
sudo mv ./bin/vsctl /usr/local/bin/vsctl
sleep 60s && for i in $(seq 1 20); do kubectl get pod -n vanus --no-headers | grep -v Run || break;sleep 5s;done
echo "Post Deploy Vanus"
kubectl get pod -n vanus
minikube service list
vsctl cluster controller topology

- name: Exec smoke
run: |
make build-smoke
./bin/smoke

- name: Check smoke
run: |
vsctl eventbus list
vsctl event get eventbus-base --offset 0 --number 5
vsctl event get eventbus-filter --offset 0 --number 5
vsctl eventbus create --name "quick-start"
vsctl event put quick-start --data-format plain --body "Hello Vanus" --id "1" --source "quick-start"
echo sleep1s
sleep 1s
vsctl event get quick-start --offset 0 --number 1
echo sleep1s
sleep 1s
vsctl event get quick-start --offset 0 --number 1
kubectl get pod -n vanus | grep quick-display | awk '{print $1}' | xargs kubectl logs -n vanus | grep -n "total" | wc -l
echo sleep5s
sleep 5s
kubectl get pod -n vanus | grep quick-display | awk '{print $1}' | xargs kubectl logs -n vanus | grep -n "total" | wc -l
echo sleep5s
sleep 5s
kubectl get pod -n vanus | grep quick-display | awk '{print $1}' | xargs kubectl logs -n vanus | grep -n "total" | wc -l
[[ $(kubectl get pod -n vanus | grep quick-display | awk '{print $1}' | xargs kubectl logs -n vanus | grep -n "total" | wc -l) -eq 4 ]] && echo "success" || echo "failed"

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ build-gw-util:
build-e2e:
go build -o bin/e2e test/e2e/quick-start/main.go

build-smoke:
go build -o bin/smoke test/smoke/main.go

build-destruct:
go build -o bin/destruct test/e2e/destruct/main.go

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Vanus
test

[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/linkall-labs/vanus/blob/main/LICENSE)
[![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/)
Expand Down
2 changes: 1 addition & 1 deletion build/images/controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.18 as builder
FROM --platform=amd64 golang:1.18 as builder
WORKDIR /workspace

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion build/images/gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.18 as builder
FROM --platform=amd64 golang:1.18 as builder
WORKDIR /workspace

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion build/images/store/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.18 as builder
FROM --platform=amd64 golang:1.18 as builder
WORKDIR /workspace

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion build/images/trigger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.18 as builder
FROM --platform=amd64 golang:1.18 as builder
WORKDIR /workspace

COPY . .
Expand Down
Loading