Skip to content

Commit 17aae7f

Browse files
authored
Merge pull request #39 from tssurya/cyclonus
Import cyclonus
2 parents 823a0d1 + 7624559 commit 17aae7f

File tree

169 files changed

+20678
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+20678
-0
lines changed

cmd/cyclonus/.github/workflows/go.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Go
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.18
19+
20+
- name: Build
21+
run: go build -v ./cmd/cyclonus/main.go
22+
23+
- name: Format
24+
run: go fmt ./cmd/... ./pkg/...
25+
26+
- name: Vet
27+
run: go vet -v ./cmd/... ./pkg/...
28+
29+
- name: Test
30+
run: go test -v ./pkg/...
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Kind Antrea Cyclonus
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
cyclonus_args:
6+
description: "args to pass on to Cyclonus"
7+
required: false
8+
default: "generate --include conflict --job-timeout-seconds 2 --server-protocol=tcp,udp"
9+
# schedule:
10+
# See https://crontab.guru/#0_0_*_*_0:
11+
# At 00:00 on Sunday.
12+
# - cron: '0 0 * * 0'
13+
14+
jobs:
15+
test-kind-antrea:
16+
name: Run Cyclonus on KinD/Antrea
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: 1.18
24+
- name: Run Cyclonus
25+
working-directory: hack/kind
26+
run: CNI=antrea RUN_FROM_SOURCE=true FROM_SOURCE_ARGS="${{ github.event.inputs.cyclonus_args }}" ./run-cyclonus.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Kind Calico Cyclonus
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
cyclonus_args:
6+
description: "args to pass on to Cyclonus"
7+
required: false
8+
default: "generate --include conflict --job-timeout-seconds 2"
9+
# schedule:
10+
# At 01:00 on Sunday.
11+
# - cron: '0 1 * * 0'
12+
13+
jobs:
14+
test-kind-calico:
15+
name: Run Cyclonus on KinD/Calico
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.18
23+
- name: Run Cyclonus
24+
working-directory: hack/kind
25+
run: CNI=calico RUN_FROM_SOURCE=true FROM_SOURCE_ARGS="${{ github.event.inputs.cyclonus_args }}" ./run-cyclonus.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Kind Cilium Cyclonus
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
cyclonus_args:
6+
description: "args to pass on to Cyclonus"
7+
required: false
8+
default: "generate --include conflict --job-timeout-seconds 2 --server-protocol=tcp,udp --ignore-loopback=true"
9+
# schedule:
10+
# At 03:00 on Sunday.
11+
# - cron: '0 3 * * 0'
12+
13+
jobs:
14+
test-kind-cilium:
15+
name: Run Cyclonus on KinD/Cilium
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.18
23+
- name: Run Cyclonus
24+
working-directory: hack/kind
25+
run: CNI=cilium RUN_FROM_SOURCE=true FROM_SOURCE_ARGS="${{ github.event.inputs.cyclonus_args }}" ./run-cyclonus.sh
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Kind CNI From Job
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
cni:
6+
description: "name of CNI to use"
7+
required: true
8+
9+
jobs:
10+
test-kind-calico:
11+
name: Run Cyclonus on KinD
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Run Cyclonus
17+
working-directory: hack/kind
18+
run: CNI=${{ github.event.inputs.cni }} RUN_FROM_SOURCE=false ./run-cyclonus.sh
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Kind CNI From Source
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
cni:
6+
description: "name of CNI to use"
7+
required: true
8+
cyclonus_args:
9+
description: "args to pass on to Cyclonus"
10+
required: false
11+
default: "generate include --conflict --job-timeout-seconds 2"
12+
13+
jobs:
14+
test-kind-calico:
15+
name: Run Cyclonus on KinD
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: 1.18
24+
25+
- name: Run Cyclonus
26+
working-directory: hack/kind
27+
run: CNI=${{ github.event.inputs.cni }} RUN_FROM_SOURCE=true FROM_SOURCE_ARGS="${{ github.event.inputs.cyclonus_args }}" ./run-cyclonus.sh
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Kind Ovn Cyclonus
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
cyclonus_args:
6+
description: "args to pass on to Cyclonus"
7+
required: false
8+
default: "generate --include conflict --job-timeout-seconds 2 --exclude=named-port,multi-peer,upstream-e2e,example --ignore-loopback=true"
9+
# schedule:
10+
# See https://crontab.guru/#0_2_*_*_0:
11+
# At 02:00 on Sunday.
12+
# - cron: '0 2 * * 0'
13+
14+
jobs:
15+
test-kind-ovn-kubernetes:
16+
name: Run Cyclonus on KinD/Ovn
17+
timeout-minutes: 250
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Go
22+
uses: actions/setup-go@v2
23+
with:
24+
go-version: 1.18
25+
- name: Run Cyclonus
26+
working-directory: hack/kind
27+
run: CNI=ovn-kubernetes RUN_FROM_SOURCE=true FROM_SOURCE_ARGS="${{ github.event.inputs.cyclonus_args }}" ./run-cyclonus.sh

cmd/cyclonus/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ignore/
2+
3+
.idea/
4+
5+
dist/

cmd/cyclonus/.goreleaser.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
project_name: cyclonus
2+
release:
3+
github:
4+
owner: mattfenwick
5+
name: Cyclonus
6+
builds:
7+
- id: cyclonus
8+
goos:
9+
- linux
10+
- windows
11+
- darwin
12+
goarch:
13+
- amd64
14+
env:
15+
- CGO_ENABLED=0
16+
main: cmd/cyclonus/main.go
17+
ldflags: -s -w
18+
-X github.com/mattfenwick/cyclonus/pkg/cli.version={{.Version}}
19+
-X github.com/mattfenwick/cyclonus/pkg/cli.gitSHA={{.Commit}}
20+
-X github.com/mattfenwick/cyclonus/pkg/cli.buildTime={{.Date}}
21+
-extldflags "-static"
22+
flags: -tags netgo -installsuffix netgo
23+
binary: "cyclonus"
24+
hooks: {}
25+
dockers:
26+
-
27+
goos: linux
28+
goarch: amd64
29+
goarm: ''
30+
ids:
31+
- cyclonus
32+
image_templates:
33+
- "mfenwick100/cyclonus:latest"
34+
- "mfenwick100/cyclonus:{{ .Tag }}"
35+
skip_push: false
36+
dockerfile: cmd/cyclonus/Dockerfile
37+
# build_flag_templates:
38+
# - "--label=org.opencontainers.image.created={{.Date}}"
39+
# - "--label=org.opencontainers.image.title={{.ProjectName}}"
40+
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
41+
# - "--label=org.opencontainers.image.version={{.Version}}"
42+
# - "--pull"
43+
# - "--platform=linux/arm64"
44+
archives:
45+
- id: cyclonus
46+
builds:
47+
- cyclonus
48+
format: tar.gz
49+
format_overrides:
50+
- goos: windows
51+
format: zip
52+
wrap_in_directory: true
53+
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
54+
files:
55+
- LICENCE*
56+
- README*
57+
- CHANGELOG*
58+
checksum:
59+
name_template: "cyclonus_{{ .RawVersion }}_checksums.txt"
60+
algorithm: sha256

cmd/cyclonus/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Matt Fenwick
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)