Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from Azure:master #1920

Merged
merged 3 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ endif
SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH := dockerd --experimental=true --storage-driver=vfs \
--data-root=$(DOCKER_DATA_ROOT_FOR_MULTIARCH) --exec-root=/var/run/march/docker/ \
-H unix:///var/run/march/docker.sock -p /var/run/march/docker.pid

ifneq ($(DOCKER_CONFIG_FILE_FOR_MULTIARCH),)
SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH += --config-file=$(DOCKER_CONFIG_FILE_FOR_MULTIARCH)
endif

DOCKER_RUN += -v /var/run/march/docker.sock:/var/run/docker.sock
DOCKER_RUN += -v /var/run/march/docker.pid:/var/run/docker.pid
DOCKER_RUN += -v /var/run/march/docker:/var/run/docker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
{#
Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}

{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '44566528' %}
{% set ingress_lossless_xoff_size = '3614720' %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
{#
Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}

{% set default_cable = '5m' %}
{% set ingress_lossless_pool_size = '43794432' %}
{% set ingress_lossless_xoff_size = '4386816' %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
##
## Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
## Apache-2.0
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##

# name lanes alias index speed
Ethernet0 0,1 etp1a 1 50000
Ethernet2 2,3 etp1b 1 50000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES.
Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<root>
<platform_info type="4601">

Expand Down
18 changes: 12 additions & 6 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1224,47 +1224,53 @@
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "local"
},
"database": {
"auto_restart": "always_enabled",
"has_global_scope": "true",
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "always_enabled"
"state": "always_enabled",
"set_owner": "local"
},
"snmp": {
"auto_restart": "enabled",
"has_global_scope": "true",
"has_per_asic_scope": "false",
"has_timer": "true",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "kube"
},
"swss": {
"auto_restart": "enabled",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "local"
},
"syncd": {
"auto_restart": "enabled",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "local"
},
"lldp": {
"auto_restart": "enabled",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "kube"
}
},
"DHCP_RELAY": {
Expand Down
10 changes: 9 additions & 1 deletion src/sonic-yang-models/tests/yang_model_tests/tests/feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
"FEATURE_WITH_INVALID_STATE" : {
"desc": "Referring invalid feature state.",
"eStrKey": "Pattern",
"eStr": ["enabled|disabled|always_enabled"]
"eStr": ["enabled|disabled|always_enabled|always_disabled"]
},
"FEATURE_WITH_INVALID_OWNER" : {
"desc": "Referring invalid feature set_owner field.",
"eStrKey": "Pattern",
"eStr": ["kube|local"]
},
"FEATURE_WITH_NO_OWNER" : {
"desc": "Config feature table without set_owner"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,44 @@
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "local"
},
{
"name": "swss",
"state": "always_enabled",
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "local"
},
{
"name": "syncd",
"state": "always_enabled",
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "local"
},
{
"name": "snmp",
"state": "enabled",
"auto_restart": "enabled",
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "false"
"has_per_asic_scope": "false",
"set_owner": "kube"
},
{
"name": "lldp",
"state": "disabled",
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "kube"
}
]
}
Expand All @@ -57,6 +62,40 @@
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "true",
"set_owner": "local"
}
]
}
}
},
"FEATURE_WITH_INVALID_OWNER": {
"sonic-feature:sonic-feature": {
"sonic-feature:FEATURE": {
"FEATURE_LIST": [
{
"name": "lldp",
"state": "disabled",
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "invalid"
}
]
}
}
},
"FEATURE_WITH_NO_OWNER": {
"sonic-feature:sonic-feature": {
"sonic-feature:FEATURE": {
"FEATURE_LIST": [
{
"name": "lldp",
"state": "disabled",
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
}
]
Expand Down
30 changes: 24 additions & 6 deletions src/sonic-yang-models/yang-models/sonic-feature.yang
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ module sonic-feature{
namespace "http://github.com/Azure/sonic-feature";
prefix feature;

import sonic-types {
prefix stypes;
description "Feature Table yang Module for SONiC";

typedef feature-state {
description "configuration to set the feature running state";
type string {
pattern "enabled|disabled|always_enabled|always_disabled";
}
}

description "Feature Table yang Module for SONiC OS";
typedef feature-owner {
description "configuration to set if the container is controlled
by kubernetes or locally";
type string {
pattern "kube|local";
}
}

container sonic-feature {

Expand All @@ -30,12 +41,12 @@ module sonic-feature{

leaf state {
description "state of the feature";
type stypes:feature_state;
type feature-state;
default "enabled";
}

leaf auto_restart {
type stypes:feature_state;
type feature-state;
default "enabled";
}

Expand Down Expand Up @@ -63,9 +74,16 @@ module sonic-feature{
leaf high_mem_alert {
description "This configuration controls the trigger to generate
alert on high memory utilization";
type stypes:feature_state;
type feature-state;
default "disabled";
}

leaf set_owner {
description " This configuration set the feature owner is
kubernetes or local";
type feature-owner;
default "local";
}
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/sonic-yang-models/yang-templates/sonic-types.yang.j2
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ module sonic-types {
}
}

typedef feature_state {
type string {
pattern "enabled|disabled|always_enabled";
}
}
typedef meter_type {
type enumeration {
enum packets;
Expand Down