Skip to content

Commit

Permalink
More development. #1410
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeit-internet2 committed Mar 6, 2024
1 parent 7acbba3 commit d7806bf
Show file tree
Hide file tree
Showing 18 changed files with 465 additions and 43 deletions.
28 changes: 28 additions & 0 deletions pscheduler-archiver-bitbucket/testbed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"tasks": {
"pscheduler-archiver-bitbucket-basic": {
"_meta": {
"display-name": "Bitbucket Archiver - Basic"
},
"group": "list",
"schedule": "PT1H",
"test": "pscheduler-archiver-bitbucket-basic"
}
},
"tests": {
"pscheduler-archiver-bitbucket-basic": {
"type": "noop",
"spec": {
"host": "{% address[0] %}"
}
}
},
"archives": {
"pscheduler-archiver-bitbucket": {
"label": "Bitbucket Archiver",
"archiver": "bitbucket",
"data": {
}
}
}
}
33 changes: 33 additions & 0 deletions pscheduler-archiver-failer/testbed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"tasks": {
"pscheduler-archiver-failer-basic": {
"_meta": {
"display-name": "Failer Archiver - Basic"
},
"group": "list",
"schedule": "PT1H",
"test": "pscheduler-archiver-failer-basic"
}
},
"tests": {
"pscheduler-archiver-failer-basic": {
"type": "noop",
"spec": {
"host": "{% address[0] %}"
}
}
},
"archives": {
"pscheduler-archiver-failer": {
"label": "Failer Archiver - Expect some failures",
"archiver": "failer",
"data": {
"schema": 2,
"delay": "PT0S",
"fail": 0.5,
"retry": 0.5,
"badly": 0.5
}
}
}
}
35 changes: 35 additions & 0 deletions pscheduler-archiver-syslog/testbed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"tasks": {
"pscheduler-archiver-syslog-basic": {
"_meta": {
"display-name": "Syslog Archiver - Basic"
},
"group": "list",
"schedule": "PT1H",
"test": "pscheduler-archiver-syslog-basic"
}
},
"tests": {
"pscheduler-archiver-syslog-basic": {
"type": "noop",
"spec": {
"host": "{% address[0] %}"
}
}
},
"archives": {
"pscheduler-archiver-syslog": {
"label": "Syslog Archiver",
"archiver": "syslog",
"data": {
"ident": "pscheduler-archiver-syslog",
"facility": "local4",
"priority": "info"
},
"transform": {
"script": "\"Syslog Archiver: \\(.test.type) with \\(.tool.name)\"",
"output-raw": true
}
}
}
}
42 changes: 42 additions & 0 deletions pscheduler-tool-iperf3/testbed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"tasks": {
"pscheduler-tool-iperf3-tcp": {
"_meta": {
"display-name": "Throughput - Iperf3 TCP"
},
"group": "mesh",
"schedule": "PT4H",
"test": "pscheduler-tool-iperf3-tcp",
"tools": [ "iperf3" ]
},
"pscheduler-tool-iperf3-udp": {
"_meta": {
"display-name": "Throughput - Iperf3 UDP"
},
"group": "mesh",
"schedule": "PT4H",
"test": "pscheduler-tool-iperf3-udp",
"tools": [ "iperf3" ]
}

},
"tests": {
"pscheduler-tool-iperf3-tcp": {
"type": "throughput",
"spec": {
"source": "{% address[0] %}",
"dest": "{% address[1] %}",
"duration": "PT20S"
}
},
"pscheduler-tool-iperf3-udp": {
"type": "throughput",
"spec": {
"udp": true,
"source": "{% address[0] %}",
"dest": "{% address[1] %}",
"duration": "PT20S"
}
}
}
}
22 changes: 22 additions & 0 deletions pscheduler-tool-ping/testbed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"tasks": {
"pscheduler-tool-ping-basic": {
"_meta": {
"display-name": "RTT - Ping"
},
"group": "mesh",
"schedule": "PT5M",
"test": "pscheduler-tool-ping-basic",
"tools": [ "ping" ]
}
},
"tests": {
"pscheduler-tool-ping-basic": {
"type": "rtt",
"spec": {
"source": "{% address[0] %}",
"dest": "{% address[1] %}"
}
}
}
}
22 changes: 22 additions & 0 deletions pscheduler-tool-traceroute/testbed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"tasks": {
"pscheduler-tool-traceroute-basic": {
"_meta": {
"display-name": "RTT - Traceroute"
},
"group": "mesh",
"schedule": "PT5M",
"test": "pscheduler-tool-traceroute-basic",
"tools": [ "traceroute" ]
}
},
"tests": {
"pscheduler-tool-traceroute-basic": {
"type": "trace",
"spec": {
"source": "{% address[0] %}",
"dest": "{% address[1] %}"
}
}
}
}
15 changes: 10 additions & 5 deletions testbed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,34 @@ PRODUCT := testbed.json
# Each subdirectory's Makefile produces a file called "output.json"
SUBDIRS := \
skeleton \
members \
plugins \
schedules


default: build

$(PRODUCT): Makefile
@for SUBDIR in $(SUBDIRS) ; \

$(PRODUCT)::
@set -e && for SUBDIR in $(SUBDIRS) ; \
do \
printf "\n#\n# Building $$SUBDIR\n#\n\n" ; \
$(MAKE) -C "$${SUBDIR}" ; \
done
printf "\n#\n# Merging results\n#\n\n"
jq -s add $(SUBDIRS:%=%/output.json) > "$@"
./bin/merge-json $(SUBDIRS:%=%/output.json) \
| ./bin/finish \
> "$@"
TO_CLEAN += $(PRODUCT)


build: $(PRODUCT)


clean:
@for SUBDIR in $(SUBDIRS) ; \
@set -e && for SUBDIR in $(SUBDIRS) ; \
do \
$(MAKE) -C "$${SUBDIR}" "$@" ; \
done
rm -rf $(TO_CLEAN) *~
rm -rf $(TO_CLEAN)
find . -name '*~' | xargs rm -rf
133 changes: 96 additions & 37 deletions testbed/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,112 @@
# pScheduler Test Bed Configuration

Scattered throughout the sources for the pScheduler plugins are files named `psconfig-testbed`.


## Building the Configuration

# Tes
* Install the prerequisites:
* Red Hat: `dnf -y install make python3`
* Debian: `apt-get -y install make python3`

* Run `make`

* Find the ready-to-use mesh in `testbed.json`.


## Configuration Files


`skeleton/output.json` - Contains a skeletal version of a pSConfig
file and includes globally-significant data such as the administrator
information. All other configuration is built atop this one.

`members/members` - Lists the hosts that will be part of the test bed.
Each entry consists of a FQDN and a label that will be translated into
an `address` entry in the finished pSConfig file. The address entries
will be merged into groups as described below.

`schedules/intervals` - Lists the ISO 8601 durations that will be made
available as standard entries in the `schedules` section of the
pSConfig file.


## Plugin Configuration Files

Each plugin may, optionally, contribute tests and tasks to the
configuration by placing a file named `testbed.json` in its top-level
directory (e.g., `pscheduler-tool-iperf2/testbed.json`). Note that
only directories for known plugin types (`archiver` , `context` ,
`test` or `tool`) will be probed for these files.

Inside the file


Identifiers for tests and tasks must be unique to avoid colliding with
those in other plugins. The recommended convention is to use the full
name of the plugin package as a prefix, (e.g.,
`pscheduler-tool-iperf3-udp`).




Construction of the final `testbed.json`

* Each measurement will be sent to all of the archivers listed in the
`archives` section.

A suitable sample for each type may be found in these plugins:

* Test: `pscheduler-test-idle/testbed.json`
* Tool: `pscheduler-tool-iperf3/testbed.json`
* Archiver: `pscheduler-archiver-syslog/testbed.json`
* Context: `TODO:`

```
{
"_meta": {
},
"addresses": {},
"archives": {
},
"groups": {
},
"schedules": {
"PT5M" {
"repeat": "PT5M",
"slip": "PT2M30S",
"sliprand": true
}
},
"tasks": {
"pscheduler-tool-iperf-tcp": {
"_meta": {
"display-name": "Throughput - Iperf3 TCP"
},
"schedule": "PT4H",
"test": "pscheduler-tool-iperf3-tcp",
"tools": [ "iperf3" ]
},
"pscheduler-tool-iperf3-udp": {
"_meta": {
"display-name": "Throughput - Iperf3 UDP"
},
"schedule": "PT4H",
"test": "pscheduler-tool-iperf3-udp",
"tools": [ "iperf3" ]
}
},
"tests": {
"pscheduler-tool-iperf3-tcp": {
"type": "throughput",
"spec": {
"source": "{% address[0] %}",
"dest": "{% address[1] %}",
"duration": "PT20S"
}
},
"pscheduler-tool-iperf3-udp": {
"type": "throughput",
"spec": {
"udp": true,
"source": "{% address[0] %}",
"dest": "{% address[1] %}",
"duration": "PT20S"
}
}
}
}
```

## Naming
Anything added by a plugin package should be prefixed with its name,
e.g. `pscheduler-tool-iperf3-udp`.
## Schedules
Standard schedules are available
* `PT30S`
* `PT1M`
* `PT5M`
* `PT10M`
* `PT15M`
* `PT30M`
* `PT1H`
* `PT4H`
* `PT6H`
* `PT12H`
* `P1D`

A plugin may define its own schedules
## Development Notes

Everything in this directory is designed to work on a minimal system
with no perfSONAR components intstalled. Ergo, it is preferable to
write a Python script to process the data rather than using jq.
Loading

0 comments on commit d7806bf

Please sign in to comment.