Skip to content

Commit 12eb037

Browse files
author
Christoph Butz
committed
Merge remote-tracking branch 'origin/main' into cbutz/aks-preview-otlp-grpc
# Conflicts: # src/aks-preview/HISTORY.rst
2 parents 19eb44d + 47e4964 commit 12eb037

326 files changed

Lines changed: 88976 additions & 44125 deletions

File tree

Some content is hidden

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

.azure-pipelines/templates/azdev_setup.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@ steps:
1111
python -m venv env
1212
chmod +x env/bin/activate
1313
source ./env/bin/activate
14-
# clone azure-cli
1514
git clone -q --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli
1615
python -m pip install -U pip
17-
# azdev 0.2.11b1 (decouples extension metadata from wheel==0.30.0) tho it is not on PyPI yet.
18-
# Pinned to a specific azure-cli-dev-tools commit (not @dev) for reproducible builds
19-
# until the pre-release is published; then switch this back to:
20-
# pip install --upgrade "azdev==0.2.11b1"
21-
pip install --upgrade "git+https://github.com/Azure/azure-cli-dev-tools.git@49390f30c6a822620d2fbdf88889c4445d22666f#egg=azdev"
16+
pip install --upgrade "azdev==0.2.12"
2217
azdev --version
2318
azdev setup -c $CLI_REPO_PATH -r $CLI_EXT_REPO_PATH --debug
2419
pip list -v

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This checklist is used to make sure that common guidelines for a pull request ar
99
### General Guidelines
1010

1111
- [ ] Have you run `azdev style <YOUR_EXT>` locally? (`pip install azdev` required)
12-
- [ ] Have you run `python scripts/ci/test_index.py -q` locally? (`azdev` required; see `.azure-pipelines/templates/azdev_setup.yml` for the install command until `azdev==0.2.11b1` is on PyPI)
12+
- [ ] Have you run `python scripts/ci/test_index.py -q` locally? (`pip install azdev` required)
1313
- [ ] My extension version conforms to the [Extension version schema](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)
1414

1515
For new extensions:

azure-pipelines.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ jobs:
8080
#!/usr/bin/env bash
8181
set -ev
8282
# test_index.py imports scripts/ci/util.py, which reads wheel metadata via azdev's
83-
# pkginfo-based metadata module (decoupled from wheel==0.30.0), so azdev must be
84-
# installed here. Install from the merged azure-cli-dev-tools source until azdev
85-
# 0.2.11b1 is published to PyPI, then switch this to: pip install --upgrade "azdev==0.2.11b1"
86-
pip install --upgrade "git+https://github.com/Azure/azure-cli-dev-tools.git@49390f30c6a822620d2fbdf88889c4445d22666f#egg=azdev"
83+
# pkginfo-based metadata module (decoupled from wheel==0.30.0), so azdev must be installed here.
84+
pip install --upgrade "azdev==0.2.12"
8785
pip install requests packaging setuptools
8886
export CI="ADO"
8987
python ./scripts/ci/test_index.py -v

linter_exclusions.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,3 +3670,11 @@ relationship dependency-of create:
36703670
relationship service-group-member create:
36713671
rule_exclusions:
36723672
- missing_command_example
3673+
3674+
cosmosdb sql softdeleted-database list:
3675+
rule_exclusions:
3676+
- no_ids_for_list_commands
3677+
3678+
cosmosdb sql softdeleted-container list:
3679+
rule_exclusions:
3680+
- no_ids_for_list_commands

scripts/ci/update_index.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ def main():
4343
ext_dir = tempfile.mkdtemp(dir=extensions_dir)
4444
whl_cache_dir = tempfile.mkdtemp()
4545
whl_cache = {}
46-
ext_file = get_whl_from_url(whl_path, extension_name, whl_cache_dir, whl_cache)
46+
# Download to the real wheel filename (ending in .whl): get_ext_metadata now
47+
# reads metadata via pkginfo, which requires a .whl-named file. Passing the
48+
# extension name (e.g. "ssh") produced an extension-less temp file that
49+
# pkginfo rejects with "Not a known wheel archive format".
50+
ext_file = get_whl_from_url(whl_path, whl_path.split('/')[-1], whl_cache_dir, whl_cache)
4751

4852
with open('./src/index.json', 'r') as infile:
4953
curr_index = json.loads(infile.read())

src/aks-preview/HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Pending
1616
++++++++
1717
* `az aks create` and `az aks update`: Add `--opentelemetry-metrics-port-grpc` and `--opentelemetry-logs-traces-port-grpc` (preview) to configure the gRPC ports for OpenTelemetry metrics and logs/traces collection, in addition to the existing HTTP/protobuf ports.
1818
* `az aks create` and `az aks update`: Rename the OpenTelemetry parameters, keeping the previous names as deprecated aliases: `--opentelemetry-metrics-port` -> `--opentelemetry-metrics-port-http`, `--opentelemetry-logs-port` -> `--opentelemetry-logs-traces-port-http`, `--enable-opentelemetry-logs` -> `--enable-opentelemetry-logs-traces`, `--disable-opentelemetry-logs` -> `--disable-opentelemetry-logs-traces`.
19+
* `az aks create`: Add `--enable-on-demand-monitor` to enable on-demand monitor for the cluster.
20+
* `az aks update`: Add `--enable-on-demand-monitor` and `--disable-on-demand-monitor` to manage on-demand monitor for the cluster.
1921

2022
21.0.0b7
2123
++++++++

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,12 @@ def load_arguments(self, _):
14011401
"backupVaultId, backupPolicyId, tags. backupVaultId and backupPolicyId are required "
14021402
"for Custom strategy. Only valid with --enable-backup.",
14031403
)
1404+
c.argument(
1405+
"enable_on_demand_monitor",
1406+
action="store_true",
1407+
is_preview=True,
1408+
help="Enable on-demand monitor for the cluster.",
1409+
)
14041410
# prepared image specification
14051411
c.argument(
14061412
'prepared_image_specification_id',
@@ -2118,6 +2124,18 @@ def load_arguments(self, _):
21182124
is_preview=True,
21192125
help="Enable continuous control plane and addon monitor for the cluster.",
21202126
)
2127+
c.argument(
2128+
"enable_on_demand_monitor",
2129+
action="store_true",
2130+
is_preview=True,
2131+
help="Enable on-demand monitor for the cluster.",
2132+
)
2133+
c.argument(
2134+
"disable_on_demand_monitor",
2135+
action="store_true",
2136+
is_preview=True,
2137+
help="Disable on-demand monitor for the cluster.",
2138+
)
21212139
c.argument(
21222140
"disable_continuous_control_plane_and_addon_monitor",
21232141
action="store_true",

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,7 @@ def aks_create(
14511451
enable_backup=False,
14521452
backup_strategy=None,
14531453
backup_configuration_file=None,
1454+
enable_on_demand_monitor=False,
14541455
# prepared image specification
14551456
prepared_image_specification_id=None,
14561457
):
@@ -1719,6 +1720,8 @@ def aks_update(
17191720
disable_application_load_balancer=False,
17201721
# health monitor
17211722
enable_continuous_control_plane_and_addon_monitor=False,
1723+
enable_on_demand_monitor=False,
1724+
disable_on_demand_monitor=False,
17221725
disable_continuous_control_plane_and_addon_monitor=False,
17231726
# backup (delegates to the dataprotection extension)
17241727
enable_backup=False,

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4234,6 +4234,20 @@ def get_enable_continuous_control_plane_and_addon_monitor(self) -> bool:
42344234
"""
42354235
return self.raw_param.get("enable_continuous_control_plane_and_addon_monitor")
42364236

4237+
def get_enable_on_demand_monitor(self) -> bool:
4238+
"""Obtain the value of enable_on_demand_monitor.
4239+
4240+
:return: bool
4241+
"""
4242+
return self.raw_param.get("enable_on_demand_monitor")
4243+
4244+
def get_disable_on_demand_monitor(self) -> bool:
4245+
"""Obtain the value of disable_on_demand_monitor.
4246+
4247+
:return: bool
4248+
"""
4249+
return self.raw_param.get("disable_on_demand_monitor")
4250+
42374251
def get_disable_continuous_control_plane_and_addon_monitor(self) -> bool:
42384252
"""Obtain the value of disable_continuous_control_plane_and_addon_monitor.
42394253
@@ -5406,12 +5420,18 @@ def set_up_health_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:
54065420
"""
54075421
self._ensure_mc(mc)
54085422

5409-
if self.context.get_enable_continuous_control_plane_and_addon_monitor():
5423+
enable_continuous = self.context.get_enable_continuous_control_plane_and_addon_monitor()
5424+
enable_on_demand = self.context.get_enable_on_demand_monitor()
5425+
5426+
if enable_continuous or enable_on_demand:
54105427
if mc.health_monitor_profile is None:
54115428
mc.health_monitor_profile = (
54125429
self.models.ManagedClusterHealthMonitorProfile() # pylint: disable=no-member
54135430
)
5414-
mc.health_monitor_profile.enable_continuous_control_plane_and_addon_monitor = True
5431+
if enable_continuous:
5432+
mc.health_monitor_profile.enable_continuous_control_plane_and_addon_monitor = True
5433+
if enable_on_demand:
5434+
mc.health_monitor_profile.enable_on_demand_monitor = True
54155435

54165436
return mc
54175437

@@ -8143,20 +8163,30 @@ def update_health_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:
81438163

81448164
enable = self.context.get_enable_continuous_control_plane_and_addon_monitor()
81458165
disable = self.context.get_disable_continuous_control_plane_and_addon_monitor()
8166+
enable_on_demand = self.context.get_enable_on_demand_monitor()
8167+
disable_on_demand = self.context.get_disable_on_demand_monitor()
81468168

8147-
if not enable and not disable:
8169+
if not enable and not disable and not enable_on_demand and not disable_on_demand:
81488170
return mc
81498171
if enable and disable:
81508172
raise MutuallyExclusiveArgumentError(
81518173
"Cannot specify --enable-continuous-control-plane-and-addon-monitor and "
81528174
"--disable-continuous-control-plane-and-addon-monitor at the same time."
81538175
)
8176+
if enable_on_demand and disable_on_demand:
8177+
raise MutuallyExclusiveArgumentError(
8178+
"Cannot specify --enable-on-demand-monitor and "
8179+
"--disable-on-demand-monitor at the same time."
8180+
)
81548181

81558182
if mc.health_monitor_profile is None:
81568183
mc.health_monitor_profile = (
81578184
self.models.ManagedClusterHealthMonitorProfile() # pylint: disable=no-member
81588185
)
8159-
mc.health_monitor_profile.enable_continuous_control_plane_and_addon_monitor = bool(enable)
8186+
if enable or disable:
8187+
mc.health_monitor_profile.enable_continuous_control_plane_and_addon_monitor = bool(enable)
8188+
if enable_on_demand or disable_on_demand:
8189+
mc.health_monitor_profile.enable_on_demand_monitor = bool(enable_on_demand)
81608190

81618191
return mc
81628192

0 commit comments

Comments
 (0)