Skip to content

Commit ee377ba

Browse files
authored
Merge branch 'main' into dataclasses
2 parents a6cc05a + 2274f53 commit ee377ba

File tree

769 files changed

+94904
-79486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

769 files changed

+94904
-79486
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240

241241
/src/quota/ @kairu-ms @ZengTaoxu
242242

243-
/src/containerapp/ @ruslany @sanchitmehta @ebencarek @JennyLawrance @howang-ms @vinisoto @chinadragon0515 @vturecek @torosent @pagariyaalok @Juliehzl @jijohn14
243+
/src/containerapp/ @ruslany @sanchitmehta @ebencarek @JennyLawrance @howang-ms @vinisoto @chinadragon0515 @vturecek @torosent @pagariyaalok @Juliehzl @jijohn14 @Greedygre @ShichaoQiu @bowen5
244244

245245
/src/scvmm/ @nascarsayan @hsurana06
246246

scripts/ci/avail-ext-doc/update_extension_list.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ def get_extensions():
4242
exts = sorted(exts, key=lambda c: parse_version(c['metadata']['version']), reverse=True)
4343

4444
# some extension modules may not include 'HISTORY.rst'
45-
project_url = exts[0]['metadata']['extensions']['python.details']['project_urls']['Home']
45+
# setup.py
46+
if 'project_urls' in exts[0]['metadata']['extensions']['python.details']:
47+
project_url = exts[0]['metadata']['extensions']['python.details']['project_urls']['Home']
48+
# pyproject.toml
49+
elif 'project_url' in exts[0]['metadata']:
50+
project_url = exts[0]['metadata']['project_url'].replace('homepage,', '').strip()
51+
print(f"Warning: extension {exts[0]['metadata']['name']} has migrated to pyproject.toml.")
52+
else:
53+
project_url = ''
54+
print(f"Warning: No project_url found for extension {exts[0]['metadata']['name']}")
4655
history_tmp = project_url + '/HISTORY.rst'
4756
history = project_url if str(requests.get(history_tmp).status_code) == '404' else history_tmp
4857
if exts[0]['metadata'].get('azext.isPreview'):

scripts/ci/azdev_linter_style.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,27 @@ def azdev_on_external_extension(index_json, azdev_type):
179179
with open(index_json, 'r') as fd:
180180
current_extensions = json.loads(fd.read()).get("extensions")
181181

182+
def entry_equals_ignore_url(entry1, entry2):
183+
"""Compare two entries ignoring downloadUrl field"""
184+
entry1_copy = entry1.copy()
185+
entry2_copy = entry2.copy()
186+
entry1_copy.pop('downloadUrl', None)
187+
entry2_copy.pop('downloadUrl', None)
188+
return entry1_copy == entry2_copy
189+
182190
for name in current_extensions:
183-
modified_entries = [entry for entry in current_extensions[name] if entry not in public_extensions.get(name, [])]
191+
public_entries = public_extensions.get(name, [])
192+
193+
# Find modified entries by comparing without downloadUrl
194+
modified_entries = []
195+
for entry in current_extensions[name]:
196+
is_modified = True
197+
for public_entry in public_entries:
198+
if entry_equals_ignore_url(entry, public_entry):
199+
is_modified = False
200+
break
201+
if is_modified:
202+
modified_entries.append(entry)
184203

185204
if not modified_entries:
186205
continue
@@ -204,7 +223,7 @@ def azdev_on_external_extension(index_json, azdev_type):
204223
# azdev test support external extension
205224
# azdev_extension.style()
206225

207-
logger.info('Checking service name for external extensions')
226+
logger.info('Checking service name for external extensions: %s', name)
208227
service_name.check()
209228

210229
az_extension.remove()
@@ -245,7 +264,7 @@ def azdev_on_internal_extension(modified_files, azdev_type):
245264
logger.error(statement_msg)
246265
exit(1)
247266

248-
logger.info('Checking service name for internal extensions')
267+
logger.info('Checking service name for internal extensions: %s', name)
249268
service_name.check()
250269

251270
azdev_extension.remove()

src/aks-agent/HISTORY.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
15+
1.0.0b11
16+
++++++++
17+
* Fix(agent-init): replace max_tokens with max_completion_tokens for connection check of Azure OpenAI service.
18+
19+
1.0.0b10
20+
++++++++
21+
* Pin supabase==2.8.0 to avoid "ModuleNotFoundError: No module named 'supabase_auth.http_clients'"
22+
23+
1.0.0b9
24+
+++++++
25+
* agent-init: replace model name with deployment name for Azure OpenAI service.
26+
* agent-init: remove importing holmesgpt to resolve the latency issue.
27+
28+
1.0.0b8
29+
+++++++
30+
* Error handling: dont raise traceback for init prompt and holmesgpt interaction.
31+
* Improve aks agent-init user experience
32+
* Improve the user holmesgpt interaction error handling
1433
* Fix stdin reading hang in CI/CD pipelines by using select with timeout for non-interactive mode.
1534
* Update pytest marker registration and fix datetime.utcnow() deprecation warning in tests.
1635
* Improve test framework with real-time stderr output visibility and subprocess timeout.

src/aks-agent/README.rst

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,98 @@ For more details about supported model providers and required
3737
variables, see: https://docs.litellm.ai/docs/providers
3838

3939

40+
LLM Configuration Explained
41+
---------------------------
42+
43+
The AKS Agent uses YAML configuration files to define LLM connections. Each configuration contains a provider specification and the required environment variables for that provider.
44+
45+
Configuration Structure
46+
^^^^^^^^^^^^^^^^^^^^^^^^
47+
48+
.. code-block:: yaml
49+
50+
llms:
51+
- provider: azure
52+
MODEL_NAME: gpt-4.1
53+
AZURE_API_KEY: *******
54+
AZURE_API_BASE: https://{azure-openai-service}.openai.azure.com/
55+
AZURE_API_VERSION: 2025-04-01-preview
56+
57+
Field Explanations
58+
^^^^^^^^^^^^^^^^^^
59+
60+
**provider**
61+
The LiteLLM provider route that determines which LLM service to use. This follows the LiteLLM provider specification from https://docs.litellm.ai/docs/providers.
62+
63+
Common values:
64+
65+
* ``azure`` - Azure OpenAI Service
66+
* ``openai`` - OpenAI API and OpenAI-compatible APIs (e.g., local models, other services)
67+
* ``anthropic`` - Anthropic Claude
68+
* ``gemini`` - Google's Gemini
69+
* ``openai_compatible`` - OpenAI-compatible APIs (e.g., local models, other services)
70+
71+
**MODEL_NAME**
72+
The specific model or deployment name to use. This varies by provider:
73+
74+
* For Azure OpenAI: Your deployment name (e.g., ``gpt-4.1``, ``gpt-35-turbo``)
75+
* For OpenAI: Model name (e.g., ``gpt-4``, ``gpt-3.5-turbo``)
76+
* For other providers: Check the specific model names in LiteLLM documentation
77+
78+
**Environment Variables by Provider**
79+
80+
The remaining fields are environment variables required by each provider. These correspond to the authentication and configuration requirements of each LLM service:
81+
82+
**Azure OpenAI (provider: azure)**
83+
* ``AZURE_API_KEY`` - Your Azure OpenAI API key
84+
* ``AZURE_API_BASE`` - Your Azure OpenAI endpoint URL (e.g., https://your-resource.openai.azure.com/)
85+
* ``AZURE_API_VERSION`` - API version (e.g., 2024-02-01, 2025-04-01-preview)
86+
87+
**OpenAI (provider: openai)**
88+
* ``OPENAI_API_KEY`` - Your OpenAI API key (starts with sk-)
89+
90+
**Gemini (provider: gemini)**
91+
* ``GOOGLE_API_KEY`` - Your Google Cloud API key
92+
* ``GOOGLE_API_ENDPOINT`` - Base URL for the Gemini API endpoint
93+
94+
**Anthropic (provider: anthropic)**
95+
* ``ANTHROPIC_API_KEY`` - Your Anthropic API key
96+
97+
**OpenAI Compatible (provider: openai_compatible)**
98+
* ``OPENAI_API_BASE`` - Base URL for the API endpoint
99+
* ``OPENAI_API_KEY`` - API key (if required by the service)
100+
101+
Multiple Model Configuration
102+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103+
104+
You can configure multiple models in a single file:
105+
106+
.. code-block:: yaml
107+
108+
llms:
109+
- provider: azure
110+
MODEL_NAME: gpt-4
111+
AZURE_API_KEY: your-azure-key
112+
AZURE_API_BASE: https://your-azure-endpoint.openai.azure.com/
113+
AZURE_API_VERSION: 2024-02-01
114+
- provider: openai
115+
MODEL_NAME: gpt-4
116+
OPENAI_API_KEY: your-openai-key
117+
- provider: anthropic
118+
MODEL_NAME: claude-3-sonnet-20240229
119+
ANTHROPIC_API_KEY: your-anthropic-key
120+
121+
When using ``--model``, specify the provider and model as ``provider/model_name`` (e.g., ``azure/gpt-4``, ``openai/gpt-4``).
122+
123+
Security Note
124+
^^^^^^^^^^^^^
125+
126+
API keys and credentials in configuration files should be kept secure. Consider using:
127+
128+
* Restricted file permissions (``chmod 600 config.yaml``)
129+
* Environment variable substitution where supported
130+
* Separate configuration files for different environments (dev/prod)
131+
40132
Quick start and examples
41133
=========================
42134

src/aks-agent/azext_aks_agent/__init__.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@
44
# --------------------------------------------------------------------------------------------
55

66

7-
from azure.cli.core import AzCommandsLoader
7+
import os
88

99
# pylint: disable=unused-import
1010
import azext_aks_agent._help
11+
from azext_aks_agent._consts import (
12+
CONST_AGENT_CONFIG_PATH_DIR_ENV_KEY,
13+
CONST_AGENT_NAME,
14+
CONST_AGENT_NAME_ENV_KEY,
15+
CONST_DISABLE_PROMETHEUS_TOOLSET_ENV_KEY,
16+
CONST_PRIVACY_NOTICE_BANNER,
17+
CONST_PRIVACY_NOTICE_BANNER_ENV_KEY,
18+
)
19+
from azure.cli.core import AzCommandsLoader
20+
from azure.cli.core.api import get_config_dir
1121

1222

1323
class ContainerServiceCommandsLoader(AzCommandsLoader):
@@ -34,3 +44,14 @@ def load_arguments(self, command):
3444

3545

3646
COMMAND_LOADER_CLS = ContainerServiceCommandsLoader
47+
48+
49+
# NOTE(mainred): holmesgpt leverages the environment variables to customize its behavior.
50+
def customize_holmesgpt():
51+
os.environ[CONST_DISABLE_PROMETHEUS_TOOLSET_ENV_KEY] = "true"
52+
os.environ[CONST_AGENT_CONFIG_PATH_DIR_ENV_KEY] = get_config_dir()
53+
os.environ[CONST_AGENT_NAME_ENV_KEY] = CONST_AGENT_NAME
54+
os.environ[CONST_PRIVACY_NOTICE_BANNER_ENV_KEY] = CONST_PRIVACY_NOTICE_BANNER
55+
56+
57+
customize_holmesgpt()

src/aks-agent/azext_aks_agent/_consts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@
2929
CONST_MCP_MIN_VERSION = "0.0.10"
3030
CONST_MCP_GITHUB_REPO = "Azure/aks-mcp"
3131
CONST_MCP_BINARY_DIR = "bin"
32+
33+
# Color constants for terminal output
34+
HELP_COLOR = "cyan" # same as AI_COLOR for now
35+
ERROR_COLOR = "red"

src/aks-agent/azext_aks_agent/_help.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from knack.help_files import helps
1010

11-
1211
helps[
1312
"aks agent"
1413
] = """
@@ -78,10 +77,11 @@
7877
Here is an example of config file:
7978
```json
8079
llms:
81-
- provider: "azure"
82-
MODEL_NAME: "gpt-4.1"
83-
AZURE_API_BASE: "https://<your-base-url>"
84-
AZURE_API_KEY: "<your-api-key>"
80+
- provider: azure
81+
MODEL_NAME: gpt-4.1
82+
AZURE_API_KEY: *******
83+
AZURE_API_BASE: https://{azure-openai-service-name}.openai.azure.com/
84+
AZURE_API_VERSION: 2025-04-01-preview
8585
# define a list of mcp servers, mcp server can be defined
8686
mcp_servers:
8787
aks_mcp:

0 commit comments

Comments
 (0)