From 0c4d89f17b092203e3a7710610b531f6d04a92ab Mon Sep 17 00:00:00 2001 From: Abiola Akinnubi Date: Tue, 3 Jun 2025 06:11:05 -0700 Subject: [PATCH] Added back code missed used to merge issues. --- lib/test_utils.py | 6 +++--- start_server.sh | 2 +- utils/endpoint_util.py | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/test_utils.py b/lib/test_utils.py index 3002dce..791b7dd 100644 --- a/lib/test_utils.py +++ b/lib/test_utils.py @@ -9,7 +9,7 @@ from enum import Enum from collections import Counter from dataclasses import dataclass, field, asdict from urllib.parse import urljoin - +from utils.endpoint_util import Endpoint import requests from lib.data_types import AuthData, ApiPayload @@ -79,7 +79,7 @@ class ClientState: def make_call(self): self.status = ClientStatus.FetchEndpoint - endpoint_api_key = AuthData.get_endpoint_api_key( + endpoint_api_key = Endpoint.get_endpoint_api_key( endpoint_name=self.endpoint_group_name, account_api_key=self.api_key, ) @@ -233,7 +233,7 @@ def run_test( print_thread = threading.Thread(target=print_state, args=(clients, num_requests)) print_thread.daemon = True # makes threads get killed on program exit print_thread.start() - endpoint_api_key = AuthData.get_endpoint_api_key( + endpoint_api_key = Endpoint.get_endpoint_api_key( endpoint_name=endpoint_group_name, account_api_key=api_key, ) diff --git a/start_server.sh b/start_server.sh index bde4314..57a96e8 100755 --- a/start_server.sh +++ b/start_server.sh @@ -8,7 +8,7 @@ SERVER_DIR="$WORKSPACE_DIR/vast-pyworker" ENV_PATH="$WORKSPACE_DIR/worker-env" DEBUG_LOG="$WORKSPACE_DIR/debug.log" PYWORKER_LOG="$WORKSPACE_DIR/pyworker.log" -MODEL_LOG="$WORKSPACE_DIR/model.log" + REPORT_ADDR="${REPORT_ADDR:-https://run.vast.ai}" USE_SSL="${USE_SSL:-true}" WORKER_PORT="${WORKER_PORT:-3000}" diff --git a/utils/endpoint_util.py b/utils/endpoint_util.py index 4886dd9..d0d3226 100644 --- a/utils/endpoint_util.py +++ b/utils/endpoint_util.py @@ -1,8 +1,14 @@ -from logging import log + +import logging from typing import Any, Dict, Optional import requests - +logging.basicConfig( + level=logging.DEBUG, + format="%(asctime)s[%(levelname)-5s] %(message)s", + datefmt="%Y-%m-%d %H:%M:%S", +) +log = logging.getLogger(__file__) class Endpoint: """