Skip to content

Commit

Permalink
More formatting fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Alvin Baptiste <[email protected]>
  • Loading branch information
abaptiste committed Nov 4, 2020
1 parent 5129766 commit 35a26a0
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 69 deletions.
19 changes: 10 additions & 9 deletions salvo/BUILD
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
licenses(["notice"])
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

licenses(["notice"]) # Apache 2

py_binary(
name = "salvo",
srcs = [ "salvo.py" ],
srcs_version = "PY3",
deps = [
":api",
":lib",
],
name = "salvo",
srcs = ["salvo.py"],
srcs_version = "PY3",
deps = [
":api",
":lib",
],
)

py_library(
Expand All @@ -25,4 +27,3 @@ py_library(
"//src/lib:helper_library",
],
)

4 changes: 2 additions & 2 deletions salvo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a framework that abstracts executing multiple benchmarks of the Envoy Pr

## Example Control Documents

The control document defines the data needed to excute a benchmark. At the moment, the fully dockerized benchmark is the only one supported. This benchmark discoveres user supplied tests for execution and uses docker images to run the tests. In the exampple below, the user supplied tests files are located in `/home/ubuntu/nighthawk_tests` and are mapped to a volume in the docker container.
The control document defines the data needed to excute a benchmark. At the moment, the fully dockerized benchmark is the only one supported. This benchmark discoveres user supplied tests for execution and uses docker images to run the tests. In the exampple below, the user supplied tests files are located in `/home/ubuntu/nighthawk_tests` and are mapped to a volume in the docker container.

To run the benchmark, create a file with the following example contents:

Expand Down Expand Up @@ -46,7 +46,7 @@ images:
envoyImage: "envoyproxy/envoy-dev:f61b096f6a2dd3a9c74b9a9369a6ea398dbe1f0f"
```
In both examples, the envoy image being tested is a specific hash. This hash can be replaced with "latest" to test the most recently created image against the previous image built from the prior Envoys master commit.
In both examples, the envoy image being tested is a specific hash. This hash can be replaced with "latest" to test the most recently created image against the previous image built from the prior Envoys master commit.
## Building Salvo
Expand Down
1 change: 0 additions & 1 deletion salvo/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ local_repository(
name = "salvo_build_config",
path = ".",
)

78 changes: 41 additions & 37 deletions salvo/src/lib/BUILD
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
load("@rules_python//python:defs.bzl", "py_library", "py_test")

licenses(["notice"]) # Apache 2

py_library(
name = "api",
visibility = ["//visibility:public"],
deps = [
"//src/lib/api:schema_proto",
]
name = "api",
visibility = ["//visibility:public"],
deps = [
"//src/lib/api:schema_proto",
],
)

py_library(
name = "docker_lib",
visibility = ["//visibility:public"],
data = [
'docker_image.py',
'docker_volume.py',
],
name = "docker_lib",
data = [
"docker_image.py",
"docker_volume.py",
],
visibility = ["//visibility:public"],
)

py_library(
name = "job_control_lib",
visibility = ["//visibility:public"],
data = [
'job_control_loader.py',
],
name = "job_control_lib",
data = [
"job_control_loader.py",
],
visibility = ["//visibility:public"],
)

py_library(
name = "shell_lib",
visibility = ["//visibility:public"],
data = [
'cmd_exec.py',
],
name = "shell_lib",
data = [
"cmd_exec.py",
],
visibility = ["//visibility:public"],
)

py_test(
name = "test_docker_image",
visibility = ["//visibility:public"],
srcs = [ "test_docker_image.py" ],
srcs_version = "PY3",
deps = [
"//:api",
"docker_lib",
],
name = "test_docker_image",
srcs = ["test_docker_image.py"],
srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
"docker_lib",
"//:api",
],
)

py_test(
name = "test_job_control_loader",
visibility = ["//visibility:public"],
srcs = [ "test_job_control_loader.py" ],
srcs_version = "PY3",
deps = [
"//:api",
"job_control_lib",
],
name = "test_job_control_loader",
srcs = ["test_job_control_loader.py"],
srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
"job_control_lib",
"//:api",
],
)
11 changes: 8 additions & 3 deletions salvo/src/lib/api/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")

licenses(["notice"]) # Apache 2

py_proto_library(
name = "schema_proto",
srcs = glob(['*.proto'], allow_empty=False),
visibility = ["//visibility:public"],
name = "schema_proto",
srcs = glob(
["*.proto"],
allow_empty = False,
),
visibility = ["//visibility:public"],
)
4 changes: 1 addition & 3 deletions salvo/src/lib/api/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import "src/lib/api/image.proto";
import "src/lib/api/source.proto";
import "src/lib/api/env.proto";


// This message type defines the schema for the consumed data file
// controlling the benchmark being executed. In it a user will
// controlling the benchmark being executed. In it a user will
// define whether the benchmark uses images only, builds images
// from source, and whether the benchark executes locally or remotely.
message JobControl {
Expand All @@ -31,4 +30,3 @@ message JobControl {
// Define the environment variables needed for the test
EnvironmentVars environment = 8;
}

8 changes: 3 additions & 5 deletions salvo/src/lib/api/docker_volume.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@ syntax = "proto3";

package salvo;

// This message defines the properties for a given mount. It is used
// This message defines the properties for a given mount. It is used
// to generate the dictionary specifying volumes for the Python Docker
// SDK
message VolumeProperties {
// Defines a list of properties governing the mount in the container
string bind = 1;

// Define whether the mount point is read-write or read-only
string mode = 2;
}

// This message defines the volume structure consumed by the command
// to run a docker image.
// to run a docker image.
message Volume {
// Specify a map of volumes and their mount points for use in a container
map<string, VolumeProperties> volumes = 1;
}


3 changes: 1 addition & 2 deletions salvo/src/lib/api/env.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ message EnvironmentVars {

// Controls whether envoy is placed between the nighthawk client and server
string envoy_path = 4;

// Specify the output directory for nighthawk artifacts
string output_dir = 5;

Expand All @@ -23,4 +23,3 @@ message EnvironmentVars {
// Additional environment variables that may be needed for operation
map<string, string> variables = 7;
}

3 changes: 1 addition & 2 deletions salvo/src/lib/api/image.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package salvo;
// Capture all docker images required for the benchmark. This object is examined
// first before evaluating the state of specified source locations
message DockerImages {
// Determines whether required docker are used if they already exist. The
// Determines whether required docker are used if they already exist. The
// benchmark image and binary image must be specified. If this is set to false
// there must be a specified source location from which we build the image

Expand All @@ -23,4 +23,3 @@ message DockerImages {
// Specifies the envoy image from which Envoy is injected
string envoy_image = 4;
}

10 changes: 5 additions & 5 deletions salvo/src/lib/api/source.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ message SourceRepository {

// Specify the location of the source repository on disk. If specified
// this location is used to determine the origin url, branch, and commit
// hash. If not specified, the remaining fields must be populated
// hash. If not specified, the remaining fields must be populated
string location = 3;

// Specify the remote location of the repository. This is ignored if
// Specify the remote location of the repository. This is ignored if
// the source location is specified.
string url = 4;

// Specify the local working branch.This is ignored if the source
// Specify the local working branch.This is ignored if the source
// location is specified.
string branch = 5;

// Specify a commit hash if applicable. If not identified we will
// determine this from the source tree. We will also use this field
// Specify a commit hash if applicable. If not identified we will
// determine this from the source tree. We will also use this field
// to identify the corresponding NightHawk or Envoy image used for
// the benchmark
string hash = 6;
Expand Down

0 comments on commit 35a26a0

Please sign in to comment.