mirror of
https://github.com/logos-storage/logos-storage-local-harness.git
synced 2026-01-07 16:03:08 +00:00
feat: add k-node experiment
This commit is contained in:
parent
7df3990968
commit
4888977aab
12
dashboard/grafana/dashboards/dashboards/dashboards.yml
Normal file
12
dashboard/grafana/dashboards/dashboards/dashboards.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
providers:
|
||||||
|
- name: 'default'
|
||||||
|
orgId: 1
|
||||||
|
folder: ''
|
||||||
|
type: file
|
||||||
|
disableDeletion: false
|
||||||
|
updateIntervalSeconds: 10
|
||||||
|
allowUiUpdates: true
|
||||||
|
options:
|
||||||
|
path: /var/lib/grafana/dashboards
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
datasources:
|
||||||
|
- name: Prometheus
|
||||||
|
type: prometheus
|
||||||
|
access: proxy
|
||||||
|
url: http://prometheus:9090
|
||||||
|
isDefault: true
|
||||||
|
editable: true
|
||||||
50
experiments/k-node.sh
Executable file
50
experiments/k-node.sh
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# k-nodes runs a Codex network with k nodes in which a file is uploaded to
|
||||||
|
# node zero and then the remainder k - 1 nodes download it concurrently.
|
||||||
|
#
|
||||||
|
# Outputs download times to a log file.
|
||||||
|
#
|
||||||
|
# Usage: k-node.sh <node_count> <repetitions> <output_log> <file_sizes...>
|
||||||
|
#
|
||||||
|
# Example: k-node.sh 5 10 ./k-node-5-10.csv 100 200 500
|
||||||
|
set -e -o pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
|
||||||
|
source "${SCRIPT_DIR}/../src/clh"
|
||||||
|
|
||||||
|
node_count="${1:-2}"
|
||||||
|
repetitions="${2:-1}"
|
||||||
|
output_log="${3:-"${OUTPUTS}/k-node-$(date +%s)-${RANDOM}.csv"}"
|
||||||
|
shift 3
|
||||||
|
file_sizes=("$@")
|
||||||
|
|
||||||
|
exp_start "k-node"
|
||||||
|
|
||||||
|
# TODO: procmon management should be moved into
|
||||||
|
# experiment lifecycle management.
|
||||||
|
trap pm_stop EXIT INT TERM
|
||||||
|
pm_start
|
||||||
|
|
||||||
|
cdx_launch_network "${node_count}"
|
||||||
|
|
||||||
|
for i in $(seq 1 "${repetitions}"); do
|
||||||
|
for file_size in "${file_sizes[@]}"; do
|
||||||
|
file_name=$(cdx_generate_file "${file_size}")
|
||||||
|
cid=$(cdx_upload_file "0" "${file_name}")
|
||||||
|
|
||||||
|
cdx_log_timings_start "${output_log}" "${file_size},${i},${cid}"
|
||||||
|
|
||||||
|
handles=()
|
||||||
|
for j in $(seq 1 "${node_count}"); do
|
||||||
|
cdx_download_file_async "$j" "$cid"
|
||||||
|
# shellcheck disable=SC2128
|
||||||
|
handles+=("$result")
|
||||||
|
done
|
||||||
|
|
||||||
|
await_all "${handles[@]}"
|
||||||
|
|
||||||
|
cdx_log_timings_end
|
||||||
|
done
|
||||||
|
done
|
||||||
@ -144,7 +144,7 @@ cdx_launch_node() {
|
|||||||
cmd_array=()
|
cmd_array=()
|
||||||
IFS=' ' read -r -a cmd_array <<<"$codex_cmd"
|
IFS=' ' read -r -a cmd_array <<<"$codex_cmd"
|
||||||
|
|
||||||
pm_async "${cmd_array[@]}" -%- "codex" "${node_index}"
|
pm_async "bash" "-c" "exec ${cmd_array[*]} &> /dev/null" -%- "codex" "${node_index}"
|
||||||
_cdx_pids[$node_index]=$!
|
_cdx_pids[$node_index]=$!
|
||||||
|
|
||||||
cdx_ensure_ready "$node_index"
|
cdx_ensure_ready "$node_index"
|
||||||
|
|||||||
@ -43,7 +43,7 @@ pm_start() {
|
|||||||
export _pm_output
|
export _pm_output
|
||||||
(
|
(
|
||||||
_pm_pid=${BASHPID}
|
_pm_pid=${BASHPID}
|
||||||
echoerr "[procmon] started with PID $_pm_pid"
|
echoerr "[procmon] enter monitoring loop"
|
||||||
while true; do
|
while true; do
|
||||||
pm_known_pids
|
pm_known_pids
|
||||||
for pid in "${result[@]}"; do
|
for pid in "${result[@]}"; do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user