mirror of
https://github.com/project-zot/zot.git
synced 2024-12-30 22:34:13 -05:00
cluster: use zb source ips pool to distribute requests to cluster
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
parent
ca8b866c46
commit
ad08c08986
2 changed files with 70 additions and 17 deletions
26
.github/workflows/cluster.yaml
vendored
26
.github/workflows/cluster.yaml
vendored
|
@ -136,15 +136,35 @@ jobs:
|
|||
AWS_ACCESS_KEY_ID: minioadmin
|
||||
AWS_SECRET_ACCESS_KEY: minioadmin
|
||||
|
||||
- name: Run benchmark
|
||||
- name: Run benchmark with --src-cidr arg
|
||||
run: |
|
||||
make bench
|
||||
./bin/zot-linux-amd64 serve test/cluster/config-minio1.json &
|
||||
./bin/zot-linux-amd64 serve test/cluster/config-minio2.json &
|
||||
./bin/zot-linux-amd64 serve test/cluster/config-minio3.json &
|
||||
sleep 10
|
||||
# run zb
|
||||
bin/zb-linux-amd64 -c 10 -n 50 -o ci-cd http://localhost:8080
|
||||
# run zb with --src-cidr
|
||||
bin/zb-linux-amd64 -c 10 -n 50 -o ci-cd --src-cidr 127.0.0.0/8 http://localhost:8080
|
||||
|
||||
killall -r zot-*
|
||||
|
||||
# clean zot storage
|
||||
sudo rm -rf /tmp/data/zot-storage/zot
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: minioadmin
|
||||
AWS_SECRET_ACCESS_KEY: minioadmin
|
||||
|
||||
- name: Run benchmark with --src-ips arg
|
||||
run: |
|
||||
make bench
|
||||
./bin/zot-linux-amd64 serve test/cluster/config-minio1.json &
|
||||
./bin/zot-linux-amd64 serve test/cluster/config-minio2.json &
|
||||
./bin/zot-linux-amd64 serve test/cluster/config-minio3.json &
|
||||
sleep 10
|
||||
# run zb with --src-ips
|
||||
bin/zb-linux-amd64 -c 10 -n 50 -o ci-cd --src-ips 127.0.0.2,127.0.0.3,127.0.0.4,127.0.0.5,127.0.0.6,127.0.12.5,127.0.12.6 http://localhost:8080
|
||||
|
||||
killall -r zot-*
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: minioadmin
|
||||
AWS_SECRET_ACCESS_KEY: minioadmin
|
||||
|
|
|
@ -289,11 +289,21 @@ func normalizeProbabilityRange(pbty []float64) []float64 {
|
|||
|
||||
// test suites/funcs.
|
||||
|
||||
type testFunc func(workdir, url, repo string, requests int, config testConfig,
|
||||
statsCh chan statsRecord, client *resty.Client) error
|
||||
type testFunc func(
|
||||
workdir, url, repo string,
|
||||
requests int,
|
||||
config testConfig,
|
||||
statsCh chan statsRecord,
|
||||
client *resty.Client,
|
||||
) error
|
||||
|
||||
func GetCatalog(workdir, url, repo string, requests int, config testConfig,
|
||||
statsCh chan statsRecord, client *resty.Client) error {
|
||||
func GetCatalog(
|
||||
workdir, url, repo string,
|
||||
requests int,
|
||||
config testConfig,
|
||||
statsCh chan statsRecord,
|
||||
client *resty.Client,
|
||||
) error {
|
||||
for count := 0; count < requests; count++ {
|
||||
func() {
|
||||
start := time.Now()
|
||||
|
@ -338,8 +348,13 @@ func GetCatalog(workdir, url, repo string, requests int, config testConfig,
|
|||
return nil
|
||||
}
|
||||
|
||||
func PushMonolithStreamed(workdir, url, trepo string, requests int, config testConfig,
|
||||
statsCh chan statsRecord, client *resty.Client) error {
|
||||
func PushMonolithStreamed(
|
||||
workdir, url, trepo string,
|
||||
requests int,
|
||||
config testConfig,
|
||||
statsCh chan statsRecord,
|
||||
client *resty.Client,
|
||||
) error {
|
||||
var repos []string
|
||||
|
||||
if config.mixedSize {
|
||||
|
@ -360,8 +375,13 @@ func PushMonolithStreamed(workdir, url, trepo string, requests int, config testC
|
|||
return nil
|
||||
}
|
||||
|
||||
func PushChunkStreamed(workdir, url, trepo string, requests int, config testConfig,
|
||||
statsCh chan statsRecord, client *resty.Client) error {
|
||||
func PushChunkStreamed(
|
||||
workdir, url, trepo string,
|
||||
requests int,
|
||||
config testConfig,
|
||||
statsCh chan statsRecord,
|
||||
client *resty.Client,
|
||||
) error {
|
||||
var repos []string
|
||||
|
||||
if config.mixedSize {
|
||||
|
@ -382,8 +402,13 @@ func PushChunkStreamed(workdir, url, trepo string, requests int, config testConf
|
|||
return nil
|
||||
}
|
||||
|
||||
func Pull(workdir, url, trepo string, requests int,
|
||||
config testConfig, statsCh chan statsRecord, client *resty.Client) error {
|
||||
func Pull(
|
||||
workdir, url, trepo string,
|
||||
requests int,
|
||||
config testConfig,
|
||||
statsCh chan statsRecord,
|
||||
client *resty.Client,
|
||||
) error {
|
||||
var repos []string
|
||||
|
||||
var manifestHash map[string]string
|
||||
|
@ -453,8 +478,13 @@ func Pull(workdir, url, trepo string, requests int,
|
|||
return nil
|
||||
}
|
||||
|
||||
func MixedPullAndPush(workdir, url, trepo string, requests int,
|
||||
config testConfig, statsCh chan statsRecord, client *resty.Client) error {
|
||||
func MixedPullAndPush(
|
||||
workdir, url, trepo string,
|
||||
requests int,
|
||||
config testConfig,
|
||||
statsCh chan statsRecord,
|
||||
client *resty.Client,
|
||||
) error {
|
||||
var repos []string
|
||||
|
||||
statusRequests = make(map[string]int)
|
||||
|
@ -595,8 +625,11 @@ var testSuite = []testConfig{ // nolint:gochecknoglobals // used only in this te
|
|||
},
|
||||
}
|
||||
|
||||
func Perf(workdir, url, auth, repo string, concurrency int, requests int, outFmt string,
|
||||
srcIPs string, srcCIDR string) {
|
||||
func Perf(
|
||||
workdir, url, auth, repo string,
|
||||
concurrency int, requests int,
|
||||
outFmt string, srcIPs string, srcCIDR string,
|
||||
) {
|
||||
json := jsoniter.ConfigCompatibleWithStandardLibrary
|
||||
// logging
|
||||
log.SetFlags(0)
|
||||
|
|
Loading…
Reference in a new issue