From edfcf68cf9b29bc6f4d1789b8b5e1d3309b3cf5a Mon Sep 17 00:00:00 2001 From: gmega Date: Wed, 11 Dec 2024 15:43:52 -0300 Subject: [PATCH] set deluge node id explicitly --- analysis/collect-logs.sh | 15 +++++++++++++-- benchmarks/cli.py | 5 ++--- docker-compose.local.yaml | 3 +++ k8s/deluge-statefulset.yaml | 1 + k8s/testrunner-job.yaml | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/analysis/collect-logs.sh b/analysis/collect-logs.sh index 3fb9150..7fbd99f 100755 --- a/analysis/collect-logs.sh +++ b/analysis/collect-logs.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash set -e -kubectl logs --prefix -n codex-benchmarks -l app=deluge-nodes --tail=-1 > "${1}.log" -grep '\[M' "${1}.log" | tr -s ' ' | cut -d ' ' -f1,7 | sed 's/ /,/' | grep -v 'metric' > "${1}.csv" \ No newline at end of file +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# TODO build auto naming for experiment folders based on metadata +mkdir -p "${1}" + +echo "Collect" +kubectl logs --prefix -n codex-benchmarks -l "app in (deluge-nodes,testrunner)" --tail=-1 > "${1}/raw-logs.log" + +echo "Parse" +python -m benchmarks.cli logs "${1}/raw-logs.log" "${1}/parsed" \ No newline at end of file diff --git a/benchmarks/cli.py b/benchmarks/cli.py index 98f02c6..8bb8b56 100644 --- a/benchmarks/cli.py +++ b/benchmarks/cli.py @@ -1,14 +1,13 @@ import argparse import sys from pathlib import Path -from typing import Dict, Iterable +from typing import Dict -from mypy.memprofile import defaultdict from pydantic_core import ValidationError from benchmarks.core.config import ConfigParser, ExperimentBuilder from benchmarks.core.experiments.experiments import Experiment -from benchmarks.core.logging import basic_log_parser, LogEntry, LogSplitter +from benchmarks.core.logging import basic_log_parser, LogSplitter from benchmarks.deluge.config import DelugeExperimentConfig from benchmarks.deluge.logging import DelugeTorrentDownload diff --git a/docker-compose.local.yaml b/docker-compose.local.yaml index c8f0cdf..a43e873 100644 --- a/docker-compose.local.yaml +++ b/docker-compose.local.yaml @@ -13,6 +13,7 @@ services: - DELUGE_RPC_PORT=6890 - DELUGE_LISTEN_PORTS=6891,6892 - DELUGE_LOG_LEVEL=${DELUGE_LOG_LEVEL:-info} + - DELUGE_NODE_ID=deluge-1 volumes: - ./volume/deluge-1:/var/lib/deluge - ./volume/deluge-1/downloads:/var/lib/deluge/downloads @@ -27,6 +28,7 @@ services: - DELUGE_RPC_PORT=6893 - DELUGE_LISTEN_PORTS=6894,6895 - DELUGE_LOG_LEVEL=${DELUGE_LOG_LEVEL:-info} + - DELUGE_NODE_ID=deluge-2 volumes: - ./volume/deluge-2:/var/lib/deluge - ./volume/deluge-2/downloads:/var/lib/deluge/downloads @@ -41,6 +43,7 @@ services: - DELUGE_RPC_PORT=6896 - DELUGE_LISTEN_PORTS=6897,6898 - DELUGE_LOG_LEVEL=${DELUGE_LOG_LEVEL:-info} + - DELUGE_NODE_ID=deluge-3 volumes: - ./volume/deluge-3:/var/lib/deluge - ./volume/deluge-3/downloads:/var/lib/deluge/downloads diff --git a/k8s/deluge-statefulset.yaml b/k8s/deluge-statefulset.yaml index 9923454..005021d 100644 --- a/k8s/deluge-statefulset.yaml +++ b/k8s/deluge-statefulset.yaml @@ -38,6 +38,7 @@ spec: command: [ "/bin/bash", "--login", "-c" ] args: - | + export DELUGE_NODE_ID=${CLIENT_POD_NAME} # Sadly we can't mount a subpath, so need add the correct prefix # into all of the config directories. export DELUGE_CONFIG_DIR=/var/lib/deluge/${CLIENT_POD_NAME} diff --git a/k8s/testrunner-job.yaml b/k8s/testrunner-job.yaml index 1fd66eb..a3bc22f 100644 --- a/k8s/testrunner-job.yaml +++ b/k8s/testrunner-job.yaml @@ -26,7 +26,7 @@ spec: - name: REPETITIONS value: "10" - name: SEEDER_SETS - value: "2" + value: "5" - name: FILE_SIZE value: "104857600" - name: TRACKER_ANNOUNCE_URL