SIENTIAPDE-1445

SIENTIAPDE-1445 Add PI Web API configuration to .env.example and enhance worker setup

- Introduced new environment variables for PI Web API configuration in .env.example.
- Updated prepare_worker.py to utilize a camelCase to kebab-case conversion function for queue naming.
- Enhanced logging in prepare_worker to provide better insights during worker preparation.
- Adjusted execution counts in tests.ipynb for improved notebook state management.
This commit is contained in:
vitor-aignosi
2025-12-17 17:02:06 -03:00
parent 034e0b2520
commit e61cb38b5b
4 changed files with 69 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "9d16b24a",
"metadata": {},
"outputs": [],
@@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "5e344fb0",
"metadata": {},
"outputs": [],
@@ -103,12 +103,22 @@
"outputs": [],
"source": [
"from temporalio import client\n",
"import datetime\n",
"\n",
"temporal_client = await client.Client.connect(\n",
" target_host=\"localhost:7233\",\n",
" namespace=\"scouter\"\n",
")\n",
")\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "45712d7a",
"metadata": {},
"outputs": [],
"source": [
"\n",
"import datetime\n",
"\n",
"now = datetime.datetime.now()\n",
"\n",
@@ -124,6 +134,31 @@
")\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "d065d0de",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pi-web-api-scouter\n"
]
}
],
"source": [
"import re\n",
"def camel_to_kebab(text: str) -> str:\n",
" \"\"\"Convert camelCase or PascalCase to kebab-case.\"\"\"\n",
" text = re.sub('(.)([A-Z][a-z]+)', r'\\1-\\2', text)\n",
" text = re.sub('([a-z0-9])([A-Z])', r'\\1-\\2', text)\n",
" return text.lower()\n",
"\n",
"print(camel_to_kebab('PiWebApiScouter'))\n"
]
}
],
"metadata": {
@@ -133,7 +168,15 @@
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.14"
}
},