[#2] Deep rebranding

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Alexey Vanin 2022-12-29 17:52:55 +03:00 committed by Alex Vanin
parent 88b2129b54
commit 171327cdda
21 changed files with 81 additions and 84 deletions

View file

@ -3,8 +3,8 @@
First, thank you for contributing! We love and encourage pull requests from
everyone. Please follow the guidelines:
- Check the open [issues](https://github.com/nspcc-dev/xk6-neofs/issues) and
[pull requests](https://github.com/nspcc-dev/xk6-neofs/pulls) for existing
- Check the open [issues](https://github.com/TrueCloudLab/xk6-frostfs/issues) and
[pull requests](https://github.com/TrueCloudLab/xk6-frostfs/pulls) for existing
discussions.
- Open an issue first, to discuss a new feature or enhancement.
@ -23,23 +23,23 @@ everyone. Please follow the guidelines:
## Development Workflow
Start by forking the `xk6-neofs` repository, make changes in a branch and then
Start by forking the `xk6-frostfs` repository, make changes in a branch and then
send a pull request. We encourage pull requests to discuss code changes. Here
are the steps in details:
### Set up your GitHub Repository
Fork [xk6-neofs upstream](https://github.com/nspcc-dev/xk6-neofs/fork) source
Fork [xk6-frostfs upstream](https://github.com/TrueCloudLab/xk6-frostfs/fork) source
repository to your own personal repository. Copy the URL of your fork (you will
need it for the `git clone` command below).
```sh
$ git clone https://github.com/nspcc-dev/xk6-neofs
$ git clone https://github.com/TrueCloudLab/xk6-frostfs
```
### Set up git remote as ``upstream``
```sh
$ cd xk6-neofs
$ git remote add upstream https://github.com/nspcc-dev/xk6-neofs
$ cd xk6-frostfs
$ git remote add upstream https://github.com/TrueCloudLab/xk6-frostfs
$ git fetch upstream
$ git merge upstream/master
...
@ -106,7 +106,7 @@ contributors".
To sign your work, just add a line like this at the end of your commit message:
```
Signed-off-by: Samii Sakisaka <samii@nspcc.ru>
Signed-off-by: Samii Sakisaka <samii@eve-no-jikan.co.jp>
```
This can easily be done with the `--signoff` option to `git commit`.

View file

@ -1,14 +1,11 @@
<p align="center">
<img src="./.github/logo.svg" width="500px" alt="NeoFS">
</p>
<p align="center">
<a href="https://go.k6.io/k6">k6</a> extension to test and benchmark <a href="https://fs.neo.org">NeoFS</a> related protocols.
<a href="https://go.k6.io/k6">k6</a> extension to test and benchmark FrostFS related protocols.
</p>
---
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
# xk6-neofs
# xk6-frostfs
# Build
@ -24,13 +21,13 @@ go install go.k6.io/xk6/cmd/xk6@latest
2. Clone this repository
```shell
git clone github.com/nspcc-dev/xk6-neofs
cd xk6-neofs
git clone github.com/TrueCloudLab/xk6-frostfs
cd xk6-frostfs
```
3. Build the binary:
```shell
xk6 build --with github.com/nspcc-dev/xk6-neofs=.
xk6 build --with github.com/TrueCloudLab/xk6-frostfs=.
```
4. Run k6:
@ -43,12 +40,12 @@ xk6 build --with github.com/nspcc-dev/xk6-neofs=.
## Native
Create native client with `connect` method. Arguments:
- neofs storage node endpoint
- frostfs storage node endpoint
- hex encoded private key (empty value produces random key)
```js
import native from 'k6/x/neofs/native';
const neofs_cli = native.connect("s01.neofs.devenv:8080", "")
import native from 'k6/x/frostfs/native';
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "")
```
### Methods
@ -62,8 +59,8 @@ const neofs_cli = native.connect("s01.neofs.devenv:8080", "")
boolean flag, `object_id` string, and `error` string.
- `get(container_id, object_id)`. Returns dictionary with `success` boolean
flag, and `error` string.
- `onsite(container_id, payload)`. Returns NeoFS object instance with prepared
headers. Invoke `put(headers)` method on this object to upload it into NeoFS.
- `onsite(container_id, payload)`. Returns FrostFS object instance with prepared
headers. Invoke `put(headers)` method on this object to upload it into FrostFS.
It returns dictionary with `success` boolean flag, `object_id` string and
`error` string.
@ -75,14 +72,14 @@ Create s3 client with `connect` method. Arguments:
Credentials are taken from default AWS configuration files and ENVs.
```js
import s3 from 'k6/x/neofs/s3';
const s3_cli = s3.connect("http://s3.neofs.devenv:8080")
import s3 from 'k6/x/frostfs/s3';
const s3_cli = s3.connect("http://s3.frostfs.devenv:8080")
```
You can also provide additional options:
```js
import s3 from 'k6/x/neofs/s3';
const s3_cli = s3.connect("http://s3.neofs.devenv:8080", {'no_verify_ssl': 'true', 'timeout': '60s'})
import s3 from 'k6/x/frostfs/s3';
const s3_cli = s3.connect("http://s3.frostfs.devenv:8080", {'no_verify_ssl': 'true', 'timeout': '60s'})
```
* `no_verify_ss` - Bool. If `true` - skip verifying the s3 certificate chain and host name (useful if s3 uses self-signed certificates)

View file

@ -1,9 +1,9 @@
import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
import {fail} from "k6";
import native from 'k6/x/neofs/native';
import native from 'k6/x/frostfs/native';
const payload = open('../go.sum', 'b');
const neofs_cli = native.connect("s01.neofs.devenv:8080", "1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb")
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb")
export const options = {
stages: [
@ -19,7 +19,7 @@ export function setup() {
name_global_scope: 'false'
}
const res = neofs_cli.putContainer(params)
const res = frostfs_cli.putContainer(params)
if (!res.success) {
fail(res.error)
}
@ -31,9 +31,9 @@ export default function (data) {
let headers = {
'unique_header': uuidv4()
}
let resp = neofs_cli.put(data.container_id, headers, payload)
let resp = frostfs_cli.put(data.container_id, headers, payload)
if (resp.success) {
neofs_cli.get(data.container_id, resp.object_id)
frostfs_cli.get(data.container_id, resp.object_id)
} else {
console.log(resp.error)
}

View file

@ -1,10 +1,10 @@
import { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
import native from 'k6/x/neofs/native';
import native from 'k6/x/frostfs/native';
const payload = open('../go.sum', 'b');
const container = "AjSxSNNXbJUDPqqKYm1VbFVDGCakbpUNH8aGjPmGAH3B"
const neofs_cli = native.connect("s01.neofs.devenv:8080", "")
const neofs_obj = neofs_cli.onsite(container, payload)
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "")
const frostfs_obj = frostfs_cli.onsite(container, payload)
export const options = {
stages: [
@ -16,9 +16,9 @@ export default function () {
let headers = {
'unique_header': uuidv4()
}
let resp = neofs_obj.put(headers)
let resp = frostfs_obj.put(headers)
if (resp.success) {
neofs_cli.get(container, resp.object_id)
frostfs_cli.get(container, resp.object_id)
} else {
console.log(resp.error)
}

View file

@ -1,10 +1,10 @@
import {uuidv4} from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
import {fail} from 'k6'
import s3 from 'k6/x/neofs/s3';
import s3 from 'k6/x/frostfs/s3';
const payload = open('../go.sum', 'b');
const bucket = "cats"
const s3_cli = s3.connect("https://s3.neofs.devenv:8080", {'no_verify_ssl': 'true'})
const s3_cli = s3.connect("https://s3.frostfs.devenv:8080", {'no_verify_ssl': 'true'})
export const options = {
stages: [

View file

@ -1,4 +1,4 @@
package xk6_neofs
package xk6_frostfs
import (
_ "github.com/TrueCloudLab/xk6-frostfs/internal/datagen"
@ -13,9 +13,9 @@ const (
)
func init() {
modules.Register("k6/x/neofs", &NeoFS{Version: version})
modules.Register("k6/x/frostfs", &FrostFS{Version: version})
}
type NeoFS struct {
type FrostFS struct {
Version string
}

View file

@ -5,7 +5,7 @@ import (
)
// RootModule is the global module object type. It is instantiated once per test
// run and will be used to create k6/x/neofs/registry module instances for each VU.
// run and will be used to create k6/x/frostfs/registry module instances for each VU.
type RootModule struct{}
// Datagen represents an instance of the module for every VU.
@ -20,7 +20,7 @@ var (
)
func init() {
modules.Register("k6/x/neofs/datagen", new(RootModule))
modules.Register("k6/x/frostfs/datagen", new(RootModule))
}
// NewModuleInstance implements the modules.Module interface and returns

View file

@ -352,7 +352,7 @@ func (c *Client) Onsite(containerID string, payload goja.ArrayBuffer) PreparedOb
// not sure if load test needs object transformation
// with parent-child relation; if needs, then replace
// this code with the usage of object transformer from
// neofs-loader or distribution.
// frostfs-loader or distribution.
msg := fmt.Sprintf("payload size %d is bigger than network limit %d", ln, maxObjectSize)
panic(msg)
}

View file

@ -6,7 +6,7 @@ import (
"time"
"github.com/TrueCloudLab/frostfs-sdk-go/client"
neofsecdsa "github.com/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa"
frostfsecdsa "github.com/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa"
"github.com/TrueCloudLab/frostfs-sdk-go/session"
"github.com/google/uuid"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
@ -15,7 +15,7 @@ import (
)
// RootModule is the global module object type. It is instantiated once per test
// run and will be used to create k6/x/neofs/native module instances for each VU.
// run and will be used to create k6/x/frostfs/native module instances for each VU.
type RootModule struct{}
// Native represents an instance of the module for every VU.
@ -35,7 +35,7 @@ var (
)
func init() {
modules.Register("k6/x/neofs/native", new(RootModule))
modules.Register("k6/x/frostfs/native", new(RootModule))
}
// NewModuleInstance implements the modules.Module interface and returns
@ -97,7 +97,7 @@ func (n *Native) Connect(endpoint, hexPrivateKey string, dialTimeout, streamTime
return nil, fmt.Errorf("session token: %w", err)
}
var key neofsecdsa.PublicKey
var key frostfsecdsa.PublicKey
err = key.Decode(sessionResp.PublicKey())
if err != nil {
return nil, fmt.Errorf("invalid public session key: %w", err)
@ -111,21 +111,21 @@ func (n *Native) Connect(endpoint, hexPrivateKey string, dialTimeout, streamTime
// register metrics
registry := metrics.NewRegistry()
objPutTotal, _ = registry.NewMetric("neofs_obj_put_total", metrics.Counter)
objPutFails, _ = registry.NewMetric("neofs_obj_put_fails", metrics.Counter)
objPutDuration, _ = registry.NewMetric("neofs_obj_put_duration", metrics.Trend, metrics.Time)
objPutTotal, _ = registry.NewMetric("frostfs_obj_put_total", metrics.Counter)
objPutFails, _ = registry.NewMetric("frostfs_obj_put_fails", metrics.Counter)
objPutDuration, _ = registry.NewMetric("frostfs_obj_put_duration", metrics.Trend, metrics.Time)
objGetTotal, _ = registry.NewMetric("neofs_obj_get_total", metrics.Counter)
objGetFails, _ = registry.NewMetric("neofs_obj_get_fails", metrics.Counter)
objGetDuration, _ = registry.NewMetric("neofs_obj_get_duration", metrics.Trend, metrics.Time)
objGetTotal, _ = registry.NewMetric("frostfs_obj_get_total", metrics.Counter)
objGetFails, _ = registry.NewMetric("frostfs_obj_get_fails", metrics.Counter)
objGetDuration, _ = registry.NewMetric("frostfs_obj_get_duration", metrics.Trend, metrics.Time)
objDeleteTotal, _ = registry.NewMetric("neofs_obj_delete_total", metrics.Counter)
objDeleteFails, _ = registry.NewMetric("neofs_obj_delete_fails", metrics.Counter)
objDeleteDuration, _ = registry.NewMetric("neofs_obj_delete_duration", metrics.Trend, metrics.Time)
objDeleteTotal, _ = registry.NewMetric("frostfs_obj_delete_total", metrics.Counter)
objDeleteFails, _ = registry.NewMetric("frostfs_obj_delete_fails", metrics.Counter)
objDeleteDuration, _ = registry.NewMetric("frostfs_obj_delete_duration", metrics.Trend, metrics.Time)
cnrPutTotal, _ = registry.NewMetric("neofs_cnr_put_total", metrics.Counter)
cnrPutFails, _ = registry.NewMetric("neofs_cnr_put_fails", metrics.Counter)
cnrPutDuration, _ = registry.NewMetric("neofs_cnr_put_duration", metrics.Trend, metrics.Time)
cnrPutTotal, _ = registry.NewMetric("frostfs_cnr_put_total", metrics.Counter)
cnrPutFails, _ = registry.NewMetric("frostfs_cnr_put_fails", metrics.Counter)
cnrPutDuration, _ = registry.NewMetric("frostfs_cnr_put_duration", metrics.Trend, metrics.Time)
return &Client{
vu: n.vu,

View file

@ -24,7 +24,7 @@ const (
const bucketName = "_object"
// ObjectInfo represents information about neoFS object that has been created
// ObjectInfo represents information about FrostFS object that has been created
// via gRPC/HTTP/S3 API.
type ObjectInfo struct {
Id uint64 // Identifier in bolt DB

View file

@ -10,7 +10,7 @@ import (
)
// RootModule is the global module object type. It is instantiated once per test
// run and will be used to create k6/x/neofs/registry module instances for each VU.
// run and will be used to create k6/x/frostfs/registry module instances for each VU.
type RootModule struct {
// Stores object registry by path of database file. We should have only single instance
// of registry per each file
@ -38,7 +38,7 @@ func init() {
registries: make(map[string]*ObjRegistry),
selectors: make(map[string]*ObjSelector),
}
modules.Register("k6/x/neofs/registry", rootModule)
modules.Register("k6/x/frostfs/registry", rootModule)
}
// NewModuleInstance implements the modules.Module interface and returns

View file

@ -15,7 +15,7 @@ import (
)
// RootModule is the global module object type. It is instantiated once per test
// run and will be used to create k6/x/neofs/s3 module instances for each VU.
// run and will be used to create k6/x/frostfs/s3 module instances for each VU.
type RootModule struct{}
// S3 represents an instance of the module for every VU.
@ -35,7 +35,7 @@ var (
)
func init() {
modules.Register("k6/x/neofs/s3", new(RootModule))
modules.Register("k6/x/frostfs/s3", new(RootModule))
}
// NewModuleInstance implements the modules.Module interface and returns

View file

@ -1,6 +1,6 @@
import datagen from 'k6/x/neofs/datagen';
import native from 'k6/x/neofs/native';
import registry from 'k6/x/neofs/registry';
import datagen from 'k6/x/frostfs/datagen';
import native from 'k6/x/frostfs/native';
import registry from 'k6/x/frostfs/registry';
import { SharedArray } from 'k6/data';
import { sleep } from 'k6';

View file

@ -1,5 +1,5 @@
import datagen from 'k6/x/neofs/datagen';
import registry from 'k6/x/neofs/registry';
import datagen from 'k6/x/frostfs/datagen';
import registry from 'k6/x/frostfs/registry';
import http from 'k6/http';
import { SharedArray } from 'k6/data';
import { sleep } from 'k6';

View file

@ -3,7 +3,7 @@
import argparse
import json
from helpers.neofs_cli import get_object
from helpers.frostfs_cli import get_object
parser = argparse.ArgumentParser()
parser.add_argument('--endpoint', help='Node address')

View file

@ -8,7 +8,7 @@ from collections import Counter
from concurrent.futures import ProcessPoolExecutor
from helpers.cmd import ProgressBar
from helpers.neofs_cli import search_object_by_id
from helpers.frostfs_cli import search_object_by_id
parser = argparse.ArgumentParser()
parser.add_argument('--endpoints', help='Node address')

View file

@ -4,7 +4,7 @@ from helpers.cmd import execute_cmd
def create_container(endpoint, policy, wallet_file, wallet_config):
cmd_line = f"neofs-cli --rpc-endpoint {endpoint} container create --wallet {wallet_file} --config {wallet_config} " \
cmd_line = f"frostfs-cli --rpc-endpoint {endpoint} container create --wallet {wallet_file} --config {wallet_config} " \
f" --policy '{policy}' --basic-acl public-read-write --await"
output, success = execute_cmd(cmd_line)
@ -29,7 +29,7 @@ def create_container(endpoint, policy, wallet_file, wallet_config):
def upload_object(container, payload_filepath, endpoint, wallet_file, wallet_config):
object_name = ""
cmd_line = f"neofs-cli --rpc-endpoint {endpoint} object put --file {payload_filepath} --wallet {wallet_file} --config {wallet_config} " \
cmd_line = f"frostfs-cli --rpc-endpoint {endpoint} object put --file {payload_filepath} --wallet {wallet_file} --config {wallet_config} " \
f"--cid {container} --no-progress"
output, success = execute_cmd(cmd_line)
@ -50,7 +50,7 @@ def upload_object(container, payload_filepath, endpoint, wallet_file, wallet_con
def get_object(cid, oid, endpoint, out_filepath, wallet_file, wallet_config):
cmd_line = f"neofs-cli object get -r {endpoint} --cid {cid} --oid {oid} --wallet {wallet_file} --config {wallet_config} " \
cmd_line = f"frostfs-cli object get -r {endpoint} --cid {cid} --oid {oid} --wallet {wallet_file} --config {wallet_config} " \
f"--file {out_filepath}"
output, success = execute_cmd(cmd_line)
@ -64,7 +64,7 @@ def get_object(cid, oid, endpoint, out_filepath, wallet_file, wallet_config):
def search_object_by_id(cid, oid, endpoint, wallet_file, wallet_config, ttl=2):
cmd_line = f"neofs-cli object search --ttl {ttl} -r {endpoint} --cid {cid} --oid {oid} --wallet {wallet_file} --config {wallet_config} "
cmd_line = f"frostfs-cli object search --ttl {ttl} -r {endpoint} --cid {cid} --oid {oid} --wallet {wallet_file} --config {wallet_config} "
output, success = execute_cmd(cmd_line)

View file

@ -8,7 +8,7 @@ from argparse import Namespace
from concurrent.futures import ProcessPoolExecutor
from helpers.cmd import random_payload
from helpers.neofs_cli import create_container, upload_object
from helpers.frostfs_cli import create_container, upload_object
parser = argparse.ArgumentParser()
parser.add_argument('--size', help='Upload objects size in kb')

View file

@ -35,7 +35,7 @@ $ ./k6 run -e DURATION=60 -e WRITE_OBJ_SIZE=8192 -e READERS=20 -e WRITERS=20 -e
```
Options (in addition to the common options):
* `GRPC_ENDPOINTS` - GRPC endpoints of neoFS in format `host:port`. To specify multiple endpoints separate them by comma.
* `GRPC_ENDPOINTS` - GRPC endpoints of FrostFS storage in format `host:port`. To specify multiple endpoints separate them by comma.
* `DELETERS` - number of VUs performing delete operations (using deleters requires that options `DELETE_AGE` and `REGISTRY_FILE` are specified as well).
* `DELETE_AGE` - age of object in seconds before which it can not be deleted. This parameter can be used to control how many objects we have in the system under load.
* `SLEEP_DELETE` - time interval (in seconds) between deleting VU iterations.
@ -63,7 +63,7 @@ Options (in addition to the common options):
1. Create s3 credentials:
```shell
$ neofs-s3-authmate issue-secret --wallet wallet.json --peer host1:8080 --gate-public-key 03d33a2cc7b8daaa5a3df3fccf065f7cf1fc6a3279efc161fcec512dcc0c1b2277 --gate-public-key 03ff0ad212e10683234442530bfd71d0bb18c3fbd6459aba768eacf158b0c359a2 --gate-public-key 033ae03ff30ed3b6665af69955562cfc0eae18d50e798ab31f054ee22e32fee993 --gate-public-key 02127c7498de0765d2461577c9d4f13f916eefd1884896183e6de0d9a85d17f2fb --bearer-rules rules.json --container-placement-policy "REP 1 IN X CBF 1 SELECT 1 FROM * AS X" --container-policy ./scenarios/files/policy.json
$ frostfs-s3-authmate issue-secret --wallet wallet.json --peer host1:8080 --gate-public-key 03d33a2cc7b8daaa5a3df3fccf065f7cf1fc6a3279efc161fcec512dcc0c1b2277 --gate-public-key 03ff0ad212e10683234442530bfd71d0bb18c3fbd6459aba768eacf158b0c359a2 --gate-public-key 033ae03ff30ed3b6665af69955562cfc0eae18d50e798ab31f054ee22e32fee993 --gate-public-key 02127c7498de0765d2461577c9d4f13f916eefd1884896183e6de0d9a85d17f2fb --bearer-rules rules.json --container-placement-policy "REP 1 IN X CBF 1 SELECT 1 FROM * AS X" --container-policy ./scenarios/files/policy.json
Enter password for wallet.json >
{

View file

@ -1,6 +1,6 @@
import datagen from 'k6/x/neofs/datagen';
import registry from 'k6/x/neofs/registry';
import s3 from 'k6/x/neofs/s3';
import datagen from 'k6/x/frostfs/datagen';
import registry from 'k6/x/frostfs/registry';
import s3 from 'k6/x/frostfs/s3';
import { SharedArray } from 'k6/data';
import { sleep } from 'k6';

View file

@ -1,6 +1,6 @@
import native from 'k6/x/neofs/native';
import registry from 'k6/x/neofs/registry';
import s3 from 'k6/x/neofs/s3';
import native from 'k6/x/frostfs/native';
import registry from 'k6/x/frostfs/registry';
import s3 from 'k6/x/frostfs/s3';
import { sleep } from 'k6';
import { Counter } from 'k6/metrics';