Skip to content

Commit ae4138c

Browse files
committed
Merge branch 'main' of https://github.com/Shekar2004/azure-cli-extensions into pgnanashekar/neon-code-removal
2 parents 4d7b511 + da27996 commit ae4138c

169 files changed

Lines changed: 25233 additions & 5953 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.

linter_exclusions.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ aks create:
124124
cluster_service_load_balancer_health_probe_mode:
125125
rule_exclusions:
126126
- option_length_too_long
127+
enable_service_account_image_pull:
128+
rule_exclusions:
129+
- option_length_too_long
130+
service_account_image_pull_default_managed_identity_id:
131+
rule_exclusions:
132+
- option_length_too_long
127133
aks update:
128134
parameters:
129135
aad_admin_group_object_ids:
@@ -207,6 +213,15 @@ aks update:
207213
disable_application_load_balancer:
208214
rule_exclusions:
209215
- option_length_too_long
216+
enable_service_account_image_pull:
217+
rule_exclusions:
218+
- option_length_too_long
219+
disable_service_account_image_pull:
220+
rule_exclusions:
221+
- option_length_too_long
222+
service_account_image_pull_default_managed_identity_id:
223+
rule_exclusions:
224+
- option_length_too_long
210225
aks agent:
211226
parameters:
212227
prompt:
@@ -401,6 +416,75 @@ codespace plan create:
401416
confidentialledger managedccfs update:
402417
rule_exclusions:
403418
- missing_command_test_coverage
419+
confluent organization environment:
420+
rule_exclusions:
421+
- require_wait_command_if_no_wait
422+
confluent organization environment cluster:
423+
rule_exclusions:
424+
- require_wait_command_if_no_wait
425+
confluent organization environment cluster connector:
426+
rule_exclusions:
427+
- require_wait_command_if_no_wait
428+
confluent organization environment cluster topic:
429+
rule_exclusions:
430+
- require_wait_command_if_no_wait
431+
confluent agreement default create:
432+
rule_exclusions:
433+
- missing_command_example
434+
confluent organization environment create:
435+
rule_exclusions:
436+
- missing_command_example
437+
parameters:
438+
stream_governance_config:
439+
rule_exclusions:
440+
- option_length_too_long
441+
confluent organization environment update:
442+
rule_exclusions:
443+
- missing_command_example
444+
parameters:
445+
stream_governance_config:
446+
rule_exclusions:
447+
- option_length_too_long
448+
confluent organization environment cluster create:
449+
rule_exclusions:
450+
- missing_command_example
451+
confluent organization environment cluster update:
452+
rule_exclusions:
453+
- missing_command_example
454+
confluent organization environment cluster connector create:
455+
rule_exclusions:
456+
- missing_command_example
457+
parameters:
458+
connector_service_type_info:
459+
rule_exclusions:
460+
- option_length_too_long
461+
confluent organization environment cluster connector update:
462+
rule_exclusions:
463+
- missing_command_example
464+
parameters:
465+
connector_service_type_info:
466+
rule_exclusions:
467+
- option_length_too_long
468+
confluent organization environment cluster topic create:
469+
rule_exclusions:
470+
- missing_command_example
471+
parameters:
472+
partitions_reassignments:
473+
rule_exclusions:
474+
- option_length_too_long
475+
confluent organization environment cluster topic update:
476+
rule_exclusions:
477+
- missing_command_example
478+
parameters:
479+
partitions_reassignments:
480+
rule_exclusions:
481+
- option_length_too_long
482+
confluent validation orgvalidate:
483+
rule_exclusions:
484+
- missing_command_example
485+
confluent validation orgvalidate-v2:
486+
rule_exclusions:
487+
- missing_command_example
404488
containerapp env create:
405489
parameters:
406490
infrastructure_subnet_resource_id:

src/aks-preview/HISTORY.rst

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

1212
Pending
1313
+++++++
14+
15+
19.0.0b28
16+
+++++++
1417
* Fix `match_condition` kwarg leaking to HTTP transport by overriding `put_mc` and `add_agentpool` to pass `if_match` / `if_none_match` directly to the vendored SDK. This change fixes the compatibility issue as azure-cli/acs module adopts TypeSpec emitted SDKs while azure-cli-extensions/aks-preview still uses the autorest emitted SDK.
1518
+ `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region.
19+
* `az aks create/update`: Add `--enable-service-account-image-pull`, `--disable-service-account-image-pull`, and `--service-account-image-pull-default-managed-identity-id` parameters to manage service account based image pull settings.
20+
* `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region.
21+
* Add managed GPU enablement option to node pool property in `az aks nodepool add` and `az aks nodepool update`.
22+
* `az aks namespace update`: Fix location should use existing namespace location.
1623

1724
19.0.0b27
1825
+++++++

src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
],
2323
"gpu, no quota": [
2424
"test_aks_nodepool_add_with_gpu_instance_profile",
25-
"test_aks_gpu_driver_type"
25+
"test_aks_gpu_driver_type",
26+
"test_aks_nodepool_add_with_enable_managed_gpu",
27+
"test_aks_nodepool_update_with_enable_managed_gpu"
2628
],
2729
"pod ip allocation mode static block, missing feature registration": [
2830
"test_aks_create_with_pod_ip_allocation_mode_static_block"

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
CONST_GPU_DRIVER_INSTALL = "Install"
7777
CONST_GPU_DRIVER_NONE = "None"
7878

79+
# gpu management mode
80+
CONST_GPU_MANAGEMENT_MODE_MANAGED = "Managed"
81+
CONST_GPU_MANAGEMENT_MODE_UNMANAGED = "Unmanaged"
82+
7983
# consts for ManagedCluster
8084
# load balancer sku
8185
CONST_LOAD_BALANCER_SKU_BASIC = "basic"

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,12 @@
519519
- name: --enable-image-integrity
520520
type: bool
521521
short-summary: Enable ImageIntegrity Service.
522+
- name: --enable-service-account-image-pull
523+
type: bool
524+
short-summary: Enable service account based image pull. For more information, see https://aka.ms/aks/identity-binding/acr-image-pull/docs.
525+
- name: --service-account-image-pull-default-managed-identity-id
526+
type: string
527+
short-summary: The default managed identity resource ID used for image pulls at the cluster level.
522528
- name: --dns-zone-resource-id
523529
type: string
524530
short-summary: The resource ID of the DNS zone resource to use with the App Routing addon.
@@ -1228,6 +1234,15 @@
12281234
- name: --disable-image-integrity
12291235
type: bool
12301236
short-summary: Disable ImageIntegrity Service.
1237+
- name: --enable-service-account-image-pull
1238+
type: bool
1239+
short-summary: Enable service account based image pull. For more information, see https://aka.ms/aks/identity-binding/acr-image-pull/docs.
1240+
- name: --disable-service-account-image-pull
1241+
type: bool
1242+
short-summary: Disable service account based image pull.
1243+
- name: --service-account-image-pull-default-managed-identity-id
1244+
type: string
1245+
short-summary: The default managed identity resource ID used for image pulls at the cluster level.
12311246
- name: --enable-apiserver-vnet-integration
12321247
type: bool
12331248
short-summary: Enable integration of user vnet with control plane apiserver pods.
@@ -2203,6 +2218,9 @@
22032218
- name: --enable-artifact-streaming
22042219
type: bool
22052220
short-summary: Enable artifact streaming for VirtualMachineScaleSets managed by a node pool, to speed up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.
2221+
- name: --enable-managed-gpu
2222+
type: bool
2223+
short-summary: Enable the Managed GPU experience, which installs additional components like DCGM metrics for monitoring on top of the GPU driver. For more details, visit aka.ms/aks/managed-gpu.
22062224
- name: --skip-gpu-driver-install
22072225
type: bool
22082226
short-summary: To skip GPU driver auto installation by AKS on a nodepool using GPU vm size if customers want to manage GPU driver installation by their own. If not specified, the default is false.
@@ -2419,6 +2437,9 @@
24192437
- name: --enable-artifact-streaming
24202438
type: bool
24212439
short-summary: Enable artifact streaming for VirtualMachineScaleSets managed by a node pool, to speed up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.
2440+
- name: --enable-managed-gpu
2441+
type: bool
2442+
short-summary: Enable the Managed GPU experience, which installs additional components like DCGM metrics for monitoring on top of the GPU driver. For more details, visit aka.ms/aks/managed-gpu.
24222443
- name: --os-sku
24232444
type: string
24242445
short-summary: The os-sku of the agent node pool.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,8 @@ def load_arguments(self, _):
899899
)
900900
c.argument("revision", validator=validate_azure_service_mesh_revision)
901901
c.argument("image_cleaner_interval_hours", type=int)
902+
c.argument("enable_service_account_image_pull", action="store_true", is_preview=True)
903+
c.argument("service_account_image_pull_default_managed_identity_id", is_preview=True)
902904
c.argument(
903905
"cluster_snapshot_id",
904906
validator=validate_cluster_snapshot_id,
@@ -1454,6 +1456,9 @@ def load_arguments(self, _):
14541456
)
14551457
c.argument("image_cleaner_interval_hours", type=int)
14561458
c.argument("disable_image_integrity", action="store_true", is_preview=True)
1459+
c.argument("enable_service_account_image_pull", action="store_true", is_preview=True)
1460+
c.argument("disable_service_account_image_pull", action="store_true", is_preview=True)
1461+
c.argument("service_account_image_pull_default_managed_identity_id", is_preview=True)
14571462
c.argument(
14581463
"enable_apiserver_vnet_integration", action="store_true", is_preview=True
14591464
)
@@ -2031,6 +2036,12 @@ def load_arguments(self, _):
20312036
validator=validate_artifact_streaming,
20322037
is_preview=True,
20332038
)
2039+
c.argument(
2040+
"enable_managed_gpu",
2041+
action="store_true",
2042+
is_preview=True,
2043+
help="Enable the Managed GPU experience.",
2044+
)
20342045
c.argument(
20352046
"node_public_ip_tags",
20362047
arg_type=tags_type,
@@ -2140,6 +2151,12 @@ def load_arguments(self, _):
21402151
validator=validate_artifact_streaming,
21412152
is_preview=True,
21422153
)
2154+
c.argument(
2155+
"enable_managed_gpu",
2156+
action="store_true",
2157+
is_preview=True,
2158+
help="Enable the Managed GPU experience.",
2159+
)
21432160
c.argument(
21442161
"os_sku",
21452162
arg_type=get_enum_type(node_os_skus_update),

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
CONST_DEFAULT_WINDOWS_VMS_VM_SIZE,
4545
CONST_MANAGED_CLUSTER_SKU_NAME_AUTOMATIC,
4646
CONST_SSH_ACCESS_LOCALUSER,
47+
CONST_GPU_DRIVER_INSTALL,
4748
CONST_GPU_DRIVER_NONE,
49+
CONST_GPU_MANAGEMENT_MODE_MANAGED,
50+
CONST_GPU_MANAGEMENT_MODE_UNMANAGED,
4851
CONST_NODEPOOL_MODE_MANAGEDSYSTEM,
4952
CONST_NODEPOOL_MODE_MACHINES,
5053
)
@@ -587,6 +590,27 @@ def get_enable_artifact_streaming(self) -> bool:
587590
enable_artifact_streaming = self.agentpool.artifact_streaming_profile.enabled
588591
return enable_artifact_streaming
589592

593+
def get_enable_managed_gpu(self) -> Union[bool, None]:
594+
"""Obtain the value of enable_managed_gpu.
595+
:return: bool
596+
"""
597+
598+
# read the original value passed by the command
599+
enable_managed_gpu = self.raw_param.get("enable_managed_gpu")
600+
601+
# In create mode, try to read the property value corresponding to the parameter from the `agentpool` object
602+
if self.decorator_mode == DecoratorMode.CREATE:
603+
if (
604+
self.agentpool and
605+
self.agentpool.gpu_profile is not None and
606+
self.agentpool.gpu_profile.nvidia is not None and
607+
self.agentpool.gpu_profile.nvidia.management_mode is not None
608+
):
609+
enable_managed_gpu = (
610+
self.agentpool.gpu_profile.nvidia.management_mode == CONST_GPU_MANAGEMENT_MODE_MANAGED
611+
)
612+
return enable_managed_gpu
613+
590614
def get_pod_ip_allocation_mode(self: bool = False) -> Union[str, None]:
591615
"""Get the value of pod_ip_allocation_mode.
592616
:return: str or None
@@ -1276,6 +1300,21 @@ def set_up_artifact_streaming(self, agentpool: AgentPool) -> AgentPool:
12761300
agentpool.artifact_streaming_profile.enabled = True
12771301
return agentpool
12781302

1303+
def set_up_managed_gpu(self, agentpool: AgentPool) -> AgentPool:
1304+
"""Set up managed GPU property for the AgentPool object."""
1305+
self._ensure_agentpool(agentpool)
1306+
1307+
enable_managed_gpu = self.context.get_enable_managed_gpu()
1308+
1309+
if enable_managed_gpu:
1310+
if agentpool.gpu_profile is None:
1311+
agentpool.gpu_profile = self.models.GPUProfile() # pylint: disable=no-member
1312+
if agentpool.gpu_profile.nvidia is None:
1313+
agentpool.gpu_profile.nvidia = self.models.NvidiaGPUProfile() # pylint: disable=no-member
1314+
agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_MANAGED
1315+
agentpool.gpu_profile.driver = CONST_GPU_DRIVER_INSTALL
1316+
return agentpool
1317+
12791318
def set_up_ssh_access(self, agentpool: AgentPool) -> AgentPool:
12801319
self._ensure_agentpool(agentpool)
12811320

@@ -1510,6 +1549,8 @@ def construct_agentpool_profile_preview(self) -> AgentPool:
15101549
agentpool = self.set_up_init_taints(agentpool)
15111550
# set up artifact streaming
15121551
agentpool = self.set_up_artifact_streaming(agentpool)
1552+
# set up managed gpu
1553+
agentpool = self.set_up_managed_gpu(agentpool)
15131554
# set up skip_gpu_driver_install
15141555
agentpool = self.set_up_skip_gpu_driver_install(agentpool)
15151556
# set up gpu profile
@@ -1704,6 +1745,29 @@ def update_artifact_streaming(self, agentpool: AgentPool) -> AgentPool:
17041745
agentpool.artifact_streaming_profile.enabled = True
17051746
return agentpool
17061747

1748+
def update_managed_gpu(self, agentpool: AgentPool) -> AgentPool:
1749+
"""Update managed GPU property for the AgentPool object.
1750+
:return: the AgentPool object
1751+
"""
1752+
self._ensure_agentpool(agentpool)
1753+
1754+
enable_managed_gpu = self.context.get_enable_managed_gpu()
1755+
if enable_managed_gpu is None:
1756+
return agentpool
1757+
1758+
if enable_managed_gpu:
1759+
if agentpool.gpu_profile is None:
1760+
agentpool.gpu_profile = self.models.GPUProfile() # pylint: disable=no-member
1761+
if agentpool.gpu_profile.nvidia is None:
1762+
agentpool.gpu_profile.nvidia = self.models.NvidiaGPUProfile() # pylint: disable=no-member
1763+
agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_MANAGED
1764+
agentpool.gpu_profile.driver = CONST_GPU_DRIVER_INSTALL
1765+
else:
1766+
if agentpool.gpu_profile and agentpool.gpu_profile.nvidia:
1767+
agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_UNMANAGED
1768+
1769+
return agentpool
1770+
17071771
def update_os_sku(self, agentpool: AgentPool) -> AgentPool:
17081772
self._ensure_agentpool(agentpool)
17091773

@@ -1828,6 +1892,9 @@ def update_agentpool_profile_preview(self, agentpools: List[AgentPool] = None) -
18281892
# update artifact streaming
18291893
agentpool = self.update_artifact_streaming(agentpool)
18301894

1895+
# update managed gpu
1896+
agentpool = self.update_managed_gpu(agentpool)
1897+
18311898
# update secure boot
18321899
agentpool = self.update_secure_boot(agentpool)
18331900

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,8 @@ def aks_create(
10761076
enable_image_cleaner=False,
10771077
image_cleaner_interval_hours=None,
10781078
enable_image_integrity=False,
1079+
enable_service_account_image_pull=False,
1080+
service_account_image_pull_default_managed_identity_id=None,
10791081
cluster_snapshot_id=None,
10801082
enable_apiserver_vnet_integration=False,
10811083
apiserver_subnet_id=None,
@@ -1321,6 +1323,9 @@ def aks_update(
13211323
image_cleaner_interval_hours=None,
13221324
enable_image_integrity=False,
13231325
disable_image_integrity=False,
1326+
enable_service_account_image_pull=False,
1327+
disable_service_account_image_pull=False,
1328+
service_account_image_pull_default_managed_identity_id=None,
13241329
enable_apiserver_vnet_integration=False,
13251330
apiserver_subnet_id=None,
13261331
enable_keda=False,
@@ -1919,6 +1924,7 @@ def aks_agentpool_add(
19191924
asg_ids=None,
19201925
node_public_ip_tags=None,
19211926
enable_artifact_streaming=False,
1927+
enable_managed_gpu=False,
19221928
skip_gpu_driver_install=False,
19231929
gpu_driver=None,
19241930
driver_type=None,
@@ -1993,6 +1999,7 @@ def aks_agentpool_update(
19931999
allowed_host_ports=None,
19942000
asg_ids=None,
19952001
enable_artifact_streaming=False,
2002+
enable_managed_gpu=False,
19962003
os_sku=None,
19972004
ssh_access=None,
19982005
yes=False,

0 commit comments

Comments
 (0)