Skip to content

Commit

Permalink
Automated DCL import.
Browse files Browse the repository at this point in the history
  - b44e28361dd7b37c420903057566ac1ce9826f0b Automatic import from cloud_mmv2_dcl_20240919_1831_RC00 by DCL Team <[email protected]>

GitOrigin-RevId: b44e28361dd7b37c420903057566ac1ce9826f0b
  • Loading branch information
DCL Team authored and copybara-github committed Sep 20, 2024
1 parent ca02468 commit b15fd79
Show file tree
Hide file tree
Showing 54 changed files with 2,553 additions and 58 deletions.
2 changes: 2 additions & 0 deletions python/proto/assuredworkloads/alpha/workload.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ enum AssuredworkloadsAlphaWorkloadComplianceRegimeEnum {
AssuredworkloadsAlphaWorkloadComplianceRegimeEnumJP_REGIONS_AND_SUPPORT = 19;
AssuredworkloadsAlphaWorkloadComplianceRegimeEnumKSA_REGIONS_AND_SUPPORT_WITH_SOVEREIGNTY_CONTROLS = 20;
AssuredworkloadsAlphaWorkloadComplianceRegimeEnumREGIONAL_CONTROLS = 21;
AssuredworkloadsAlphaWorkloadComplianceRegimeEnumHEALTHCARE_AND_LIFE_SCIENCES_CONTROLS = 22;
AssuredworkloadsAlphaWorkloadComplianceRegimeEnumHEALTHCARE_AND_LIFE_SCIENCES_CONTROLS_WITH_US_SUPPORT = 23;
}

enum AssuredworkloadsAlphaWorkloadResourceSettingsResourceTypeEnum {
Expand Down
2 changes: 2 additions & 0 deletions python/proto/assuredworkloads/beta/workload.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ enum AssuredworkloadsBetaWorkloadComplianceRegimeEnum {
AssuredworkloadsBetaWorkloadComplianceRegimeEnumJP_REGIONS_AND_SUPPORT = 19;
AssuredworkloadsBetaWorkloadComplianceRegimeEnumKSA_REGIONS_AND_SUPPORT_WITH_SOVEREIGNTY_CONTROLS = 20;
AssuredworkloadsBetaWorkloadComplianceRegimeEnumREGIONAL_CONTROLS = 21;
AssuredworkloadsBetaWorkloadComplianceRegimeEnumHEALTHCARE_AND_LIFE_SCIENCES_CONTROLS = 22;
AssuredworkloadsBetaWorkloadComplianceRegimeEnumHEALTHCARE_AND_LIFE_SCIENCES_CONTROLS_WITH_US_SUPPORT = 23;
}

enum AssuredworkloadsBetaWorkloadResourceSettingsResourceTypeEnum {
Expand Down
2 changes: 2 additions & 0 deletions python/proto/assuredworkloads/workload.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ enum AssuredworkloadsWorkloadComplianceRegimeEnum {
AssuredworkloadsWorkloadComplianceRegimeEnumJP_REGIONS_AND_SUPPORT = 19;
AssuredworkloadsWorkloadComplianceRegimeEnumKSA_REGIONS_AND_SUPPORT_WITH_SOVEREIGNTY_CONTROLS = 20;
AssuredworkloadsWorkloadComplianceRegimeEnumREGIONAL_CONTROLS = 21;
AssuredworkloadsWorkloadComplianceRegimeEnumHEALTHCARE_AND_LIFE_SCIENCES_CONTROLS = 22;
AssuredworkloadsWorkloadComplianceRegimeEnumHEALTHCARE_AND_LIFE_SCIENCES_CONTROLS_WITH_US_SUPPORT = 23;
}

enum AssuredworkloadsWorkloadResourceSettingsResourceTypeEnum {
Expand Down
22 changes: 18 additions & 4 deletions python/proto/containeraws/alpha/node_pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ enum ContainerawsAlphaNodePoolStateEnum {
ContainerawsAlphaNodePoolStateEnumDEGRADED = 7;
}

enum ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnum {
ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnumNO_VALUE_DO_NOT_USE = 0;
ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnumnone = 1;
ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnumstatic = 2;
}

message ContainerawsAlphaNodePool {
string name = 1;
string version = 2;
Expand All @@ -71,10 +77,11 @@ message ContainerawsAlphaNodePool {
map<string, string> annotations = 12;
ContainerawsAlphaNodePoolMaxPodsConstraint max_pods_constraint = 13;
ContainerawsAlphaNodePoolManagement management = 14;
ContainerawsAlphaNodePoolUpdateSettings update_settings = 15;
string project = 16;
string location = 17;
string cluster = 18;
ContainerawsAlphaNodePoolKubeletConfig kubelet_config = 15;
ContainerawsAlphaNodePoolUpdateSettings update_settings = 16;
string project = 17;
string location = 18;
string cluster = 19;
}

message ContainerawsAlphaNodePoolConfig {
Expand Down Expand Up @@ -147,6 +154,13 @@ message ContainerawsAlphaNodePoolManagement {
bool auto_repair = 1;
}

message ContainerawsAlphaNodePoolKubeletConfig {
ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnum cpu_manager_policy = 1;
bool cpu_cfs_quota = 2;
string cpu_cfs_quota_period = 3;
int64 pod_pids_limit = 4;
}

message ContainerawsAlphaNodePoolUpdateSettings {
ContainerawsAlphaNodePoolUpdateSettingsSurgeSettings surge_settings = 1;
}
Expand Down
22 changes: 18 additions & 4 deletions python/proto/containeraws/beta/node_pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ enum ContainerawsBetaNodePoolStateEnum {
ContainerawsBetaNodePoolStateEnumDEGRADED = 7;
}

enum ContainerawsBetaNodePoolKubeletConfigCpuManagerPolicyEnum {
ContainerawsBetaNodePoolKubeletConfigCpuManagerPolicyEnumNO_VALUE_DO_NOT_USE = 0;
ContainerawsBetaNodePoolKubeletConfigCpuManagerPolicyEnumnone = 1;
ContainerawsBetaNodePoolKubeletConfigCpuManagerPolicyEnumstatic = 2;
}

message ContainerawsBetaNodePool {
string name = 1;
string version = 2;
Expand All @@ -71,10 +77,11 @@ message ContainerawsBetaNodePool {
map<string, string> annotations = 12;
ContainerawsBetaNodePoolMaxPodsConstraint max_pods_constraint = 13;
ContainerawsBetaNodePoolManagement management = 14;
ContainerawsBetaNodePoolUpdateSettings update_settings = 15;
string project = 16;
string location = 17;
string cluster = 18;
ContainerawsBetaNodePoolKubeletConfig kubelet_config = 15;
ContainerawsBetaNodePoolUpdateSettings update_settings = 16;
string project = 17;
string location = 18;
string cluster = 19;
}

message ContainerawsBetaNodePoolConfig {
Expand Down Expand Up @@ -147,6 +154,13 @@ message ContainerawsBetaNodePoolManagement {
bool auto_repair = 1;
}

message ContainerawsBetaNodePoolKubeletConfig {
ContainerawsBetaNodePoolKubeletConfigCpuManagerPolicyEnum cpu_manager_policy = 1;
bool cpu_cfs_quota = 2;
string cpu_cfs_quota_period = 3;
int64 pod_pids_limit = 4;
}

message ContainerawsBetaNodePoolUpdateSettings {
ContainerawsBetaNodePoolUpdateSettingsSurgeSettings surge_settings = 1;
}
Expand Down
22 changes: 18 additions & 4 deletions python/proto/containeraws/node_pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ enum ContainerawsNodePoolStateEnum {
ContainerawsNodePoolStateEnumDEGRADED = 7;
}

enum ContainerawsNodePoolKubeletConfigCpuManagerPolicyEnum {
ContainerawsNodePoolKubeletConfigCpuManagerPolicyEnumNO_VALUE_DO_NOT_USE = 0;
ContainerawsNodePoolKubeletConfigCpuManagerPolicyEnumnone = 1;
ContainerawsNodePoolKubeletConfigCpuManagerPolicyEnumstatic = 2;
}

message ContainerawsNodePool {
string name = 1;
string version = 2;
Expand All @@ -63,10 +69,11 @@ message ContainerawsNodePool {
map<string, string> annotations = 12;
ContainerawsNodePoolMaxPodsConstraint max_pods_constraint = 13;
ContainerawsNodePoolManagement management = 14;
ContainerawsNodePoolUpdateSettings update_settings = 15;
string project = 16;
string location = 17;
string cluster = 18;
ContainerawsNodePoolKubeletConfig kubelet_config = 15;
ContainerawsNodePoolUpdateSettings update_settings = 16;
string project = 17;
string location = 18;
string cluster = 19;
}

message ContainerawsNodePoolConfig {
Expand Down Expand Up @@ -128,6 +135,13 @@ message ContainerawsNodePoolManagement {
bool auto_repair = 1;
}

message ContainerawsNodePoolKubeletConfig {
ContainerawsNodePoolKubeletConfigCpuManagerPolicyEnum cpu_manager_policy = 1;
bool cpu_cfs_quota = 2;
string cpu_cfs_quota_period = 3;
int64 pod_pids_limit = 4;
}

message ContainerawsNodePoolUpdateSettings {
ContainerawsNodePoolUpdateSettingsSurgeSettings surge_settings = 1;
}
Expand Down
102 changes: 102 additions & 0 deletions python/services/containeraws/alpha/node_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(
annotations: dict = None,
max_pods_constraint: dict = None,
management: dict = None,
kubelet_config: dict = None,
update_settings: dict = None,
project: str = None,
location: str = None,
Expand All @@ -51,6 +52,7 @@ def __init__(
self.annotations = annotations
self.max_pods_constraint = max_pods_constraint
self.management = management
self.kubelet_config = kubelet_config
self.update_settings = update_settings
self.project = project
self.location = location
Expand Down Expand Up @@ -96,6 +98,12 @@ def apply(self):
)
else:
request.resource.ClearField("management")
if NodePoolKubeletConfig.to_proto(self.kubelet_config):
request.resource.kubelet_config.CopyFrom(
NodePoolKubeletConfig.to_proto(self.kubelet_config)
)
else:
request.resource.ClearField("kubelet_config")
if NodePoolUpdateSettings.to_proto(self.update_settings):
request.resource.update_settings.CopyFrom(
NodePoolUpdateSettings.to_proto(self.update_settings)
Expand Down Expand Up @@ -130,6 +138,7 @@ def apply(self):
response.max_pods_constraint
)
self.management = NodePoolManagement.from_proto(response.management)
self.kubelet_config = NodePoolKubeletConfig.from_proto(response.kubelet_config)
self.update_settings = NodePoolUpdateSettings.from_proto(
response.update_settings
)
Expand Down Expand Up @@ -177,6 +186,12 @@ def delete(self):
)
else:
request.resource.ClearField("management")
if NodePoolKubeletConfig.to_proto(self.kubelet_config):
request.resource.kubelet_config.CopyFrom(
NodePoolKubeletConfig.to_proto(self.kubelet_config)
)
else:
request.resource.ClearField("kubelet_config")
if NodePoolUpdateSettings.to_proto(self.update_settings):
request.resource.update_settings.CopyFrom(
NodePoolUpdateSettings.to_proto(self.update_settings)
Expand Down Expand Up @@ -239,6 +254,12 @@ def to_proto(self):
resource.management.CopyFrom(NodePoolManagement.to_proto(self.management))
else:
resource.ClearField("management")
if NodePoolKubeletConfig.to_proto(self.kubelet_config):
resource.kubelet_config.CopyFrom(
NodePoolKubeletConfig.to_proto(self.kubelet_config)
)
else:
resource.ClearField("kubelet_config")
if NodePoolUpdateSettings.to_proto(self.update_settings):
resource.update_settings.CopyFrom(
NodePoolUpdateSettings.to_proto(self.update_settings)
Expand Down Expand Up @@ -863,6 +884,67 @@ def from_proto(self, resources):
return [NodePoolManagement.from_proto(i) for i in resources]


class NodePoolKubeletConfig(object):

def __init__(
self,
cpu_manager_policy: str = None,
cpu_cfs_quota: bool = None,
cpu_cfs_quota_period: str = None,
pod_pids_limit: int = None,
):
self.cpu_manager_policy = cpu_manager_policy
self.cpu_cfs_quota = cpu_cfs_quota
self.cpu_cfs_quota_period = cpu_cfs_quota_period
self.pod_pids_limit = pod_pids_limit

@classmethod
def to_proto(self, resource):
if not resource:
return None

res = node_pool_pb2.ContainerawsAlphaNodePoolKubeletConfig()
if NodePoolKubeletConfigCpuManagerPolicyEnum.to_proto(
resource.cpu_manager_policy
):
res.cpu_manager_policy = NodePoolKubeletConfigCpuManagerPolicyEnum.to_proto(
resource.cpu_manager_policy
)
if Primitive.to_proto(resource.cpu_cfs_quota):
res.cpu_cfs_quota = Primitive.to_proto(resource.cpu_cfs_quota)
if Primitive.to_proto(resource.cpu_cfs_quota_period):
res.cpu_cfs_quota_period = Primitive.to_proto(resource.cpu_cfs_quota_period)
if Primitive.to_proto(resource.pod_pids_limit):
res.pod_pids_limit = Primitive.to_proto(resource.pod_pids_limit)
return res

@classmethod
def from_proto(self, resource):
if not resource:
return None

return NodePoolKubeletConfig(
cpu_manager_policy=NodePoolKubeletConfigCpuManagerPolicyEnum.from_proto(
resource.cpu_manager_policy
),
cpu_cfs_quota=Primitive.from_proto(resource.cpu_cfs_quota),
cpu_cfs_quota_period=Primitive.from_proto(resource.cpu_cfs_quota_period),
pod_pids_limit=Primitive.from_proto(resource.pod_pids_limit),
)


class NodePoolKubeletConfigArray(object):
@classmethod
def to_proto(self, resources):
if not resources:
return resources
return [NodePoolKubeletConfig.to_proto(i) for i in resources]

@classmethod
def from_proto(self, resources):
return [NodePoolKubeletConfig.from_proto(i) for i in resources]


class NodePoolUpdateSettings(object):

def __init__(self, surge_settings: dict = None):
Expand Down Expand Up @@ -1025,6 +1107,26 @@ def from_proto(self, resource):
]


class NodePoolKubeletConfigCpuManagerPolicyEnum(object):
@classmethod
def to_proto(self, resource):
if not resource:
return resource
return node_pool_pb2.ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnum.Value(
"ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnum%s" % resource
)

@classmethod
def from_proto(self, resource):
if not resource:
return resource
return node_pool_pb2.ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnum.Name(
resource
)[
len("ContainerawsAlphaNodePoolKubeletConfigCpuManagerPolicyEnum") :
]


class Primitive(object):
@classmethod
def to_proto(self, s):
Expand Down
Loading

0 comments on commit b15fd79

Please sign in to comment.