From 736a0b8c549bec4585b0f79e356fa436f3554af9 Mon Sep 17 00:00:00 2001 From: Asia <92344512+AsiaCao@users.noreply.github.com> Date: Mon, 13 May 2024 12:14:22 -0700 Subject: [PATCH] Add runtime tag in CI job (#81) * Add runtime tag in CI job * Improve test robustness * Revert change * Use http body instead of header for runtime_tag --------- Co-authored-by: Yazhou Cao --- .github/workflows/ci_cd.yml | 2 ++ vision_agent/tools/tool_utils.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 56c31d19..75c64236 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -12,6 +12,8 @@ jobs: python-version: [3.9, 3.11] os: [ ubuntu-22.04, windows-2022, macos-12 ] runs-on: ${{ matrix.os }} + env: + RUNTIME_TAG: ci_job steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/vision_agent/tools/tool_utils.py b/vision_agent/tools/tool_utils.py index f0304653..b87689c4 100644 --- a/vision_agent/tools/tool_utils.py +++ b/vision_agent/tools/tool_utils.py @@ -14,14 +14,13 @@ def _send_inference_request( payload: Dict[str, Any], endpoint_name: str ) -> Dict[str, Any]: - # runtime_tag is used to differentiate different internal callers - runtime_tag = os.environ.get("RUNTIME_TAG", "") + if runtime_tag := os.environ.get("RUNTIME_TAG", ""): + payload["runtime_tag"] = runtime_tag res = requests.post( f"{_LND_API_URL}/model/{endpoint_name}", headers={ "Content-Type": "application/json", "apikey": _LND_API_KEY, - "runtime-tag": runtime_tag, }, json=payload, )