Skip to content

Commit

Permalink
Move NestedEdgeEnabled out of experimental features. (#4467) (#4537)
Browse files Browse the repository at this point in the history
### NOTE: After this PR is merged, Nested Edge would be enabled by default.
There are two main changes in this PR:
- Enable nested edge by default
- Move `NestedEdgeEnabled` settings out of `experimentalFeatures` section.

### Before:
To enable nested edge/broker you would need to have the following env vars in your deployment manifest:
```json
                    "edgeHub": {
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always",
                        "settings": {
                            "image": "edgerelease.azurecr.io/microsoft/azureiotedge-hub:1.2.0-rc3-linux-amd64",
                            "createOptions": "{\"HostConfig\": {\"PortBindings\": {\"1883/tcp\": [{\"HostPort\": \"1883\"}], \"8883/tcp\": [{\"HostPort\": \"8883\"}],\"443/tcp\": [{\"HostPort\": \"443\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}"
                        },
                        "env": {
                            "experimentalFeatures__nestedEdgeEnabled": {
                                "value": "true"
                            },
                            "experimentalFeatures__mqttBrokerEnabled": {
                                "value": "true"
                            },
                            "experimentalFeatures__enabled": {
                                "value": "true"
                            }
                        }
                    }
```

### After
With this change, the Nested Edge would be on by default. So if you want to run nested + broker, here is how the deployment manifest would look like:
```json
                    "edgeHub": {
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always",
                        "settings": {
                            "image": "edgerelease.azurecr.io/microsoft/azureiotedge-hub:1.2.0-rc3-linux-amd64",
                            "createOptions": "{\"HostConfig\": {\"PortBindings\": {\"1883/tcp\": [{\"HostPort\": \"1883\"}], \"8883/tcp\": [{\"HostPort\": \"8883\"}],\"443/tcp\": [{\"HostPort\": \"443\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}"
                        },
                        "env": {
                            "experimentalFeatures__mqttBrokerEnabled": {
                                "value": "true"
                            },
                            "experimentalFeatures__enabled": {
                                "value": "true"
                            }
                        }
                    }
```

if for some reason you want to disable nested edge, here's how to do that:
```json
                    "edgeHub": {
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always",
                        "settings": {
                            "image": "edgerelease.azurecr.io/microsoft/azureiotedge-hub:1.2.0-rc3-linux-amd64",
                            "createOptions": "{\"HostConfig\": {\"PortBindings\": {\"1883/tcp\": [{\"HostPort\": \"1883\"}], \"8883/tcp\": [{\"HostPort\": \"8883\"}],\"443/tcp\": [{\"HostPort\": \"443\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}"
                        },
                        "env": {
                            "NestedEdgeEnabled": {
                                "value": "false"
                            }
                        }
                    }
```
  • Loading branch information
vadim-kovalyov authored Mar 4, 2021
1 parent 0f44aef commit 7e0fc1f
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 158 deletions.
2 changes: 1 addition & 1 deletion e2e_deployment_files/long_haul_deployment.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"experimentalfeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"NestedEdgeEnabled": {
"value": "false"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"experimentalFeatures__mqttBrokerEnabled": {
"value": "true"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@
"type": "docker",
"status": "running",
"restartPolicy": "always",
"env": {
"experimentalfeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
}
},
"settings": {
"image": "<Container_Registry>/microsoft/azureiotedge-hub:<EdgeRuntime.BuildNumber>-linux-<Architecture>",
"createOptions": "{\"ExposedPorts\": {\"9600/tcp\": {}}, \"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}],\"9600/tcp\": [{\"HostPort\": \"9601\"}]}}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"experimentalFeatures__mqttBrokerEnabled": {
"value": "true"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"image": "$upstream:443/microsoft/azureiotedge-agent:<Build.BuildNumber>-linux-<Architecture>",
"createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}"
},
"https_proxy": {
"https_proxy": {
"value": "<proxyAddress>"
}
},
Expand All @@ -28,21 +28,15 @@
"createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}"
},
"env": {
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"DeviceScopeCacheRefreshDelaySecs": {
"value": 1
},
"RuntimeLogLevel": {
"value": "debug"
},
"https_proxy": {
"https_proxy": {
"value": "<proxyAddress>"
}
}
},
"status": "running",
"restartPolicy": "always"
Expand All @@ -64,7 +58,7 @@
"value": "-1"
}
}
}
}
}
}
},
Expand All @@ -79,18 +73,18 @@
},
"mqttBroker": {
"authorizations": [
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
}
]
}
]
}
}
Expand Down
27 changes: 12 additions & 15 deletions e2e_deployment_files/nestededge_middleLayerBaseDeployment_amqp.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"DeviceScopeCacheRefreshDelaySecs": {
"value": 0
},
"RuntimeLogLevel": {
"value": "debug"
}
}
},
"status": "running",
"restartPolicy": "always"
Expand Down Expand Up @@ -99,18 +96,18 @@
},
"mqttBroker": {
"authorizations": [
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
}
]
}
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"experimentalFeatures__mqttBrokerEnabled": {
"value": "true"
},
Expand All @@ -47,7 +44,7 @@
},
"RuntimeLogLevel": {
"value": "debug"
}
}
},
"status": "running",
"restartPolicy": "always"
Expand Down
34 changes: 14 additions & 20 deletions e2e_deployment_files/nestededge_topLayerBaseDeployment_amqp.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"image": "<Container_Registry>/microsoft/azureiotedge-agent:<Build.BuildNumber>-linux-<Architecture>",
"createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}"
},
"https_proxy": {
"https_proxy": {
"value": "<proxyAddress>"
}
},
Expand All @@ -35,21 +35,15 @@
"createOptions": "{\"HostConfig\": {\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}, \"PortBindings\": {\"8883/tcp\": [{\"HostPort\": \"8883\"}],\"5671/tcp\": [{\"HostPort\": \"5671\"}]}}}"
},
"env": {
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"DeviceScopeCacheRefreshDelaySecs": {
"value": 0
},
"RuntimeLogLevel": {
"value": "debug"
},
"https_proxy": {
"https_proxy": {
"value": "<proxyAddress>"
}
}
},
"status": "running",
"restartPolicy": "always"
Expand Down Expand Up @@ -114,18 +108,18 @@
},
"mqttBroker": {
"authorizations": [
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
}
]
}
]
}
}
Expand Down
31 changes: 14 additions & 17 deletions e2e_deployment_files/nestededge_topLayerBaseDeployment_mqtt.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"image": "<Container_Registry>/microsoft/azureiotedge-agent:<Build.BuildNumber>-linux-<Architecture>",
"createOptions": "{\"HostConfig\":{\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{\"max-size\":\"4m\",\"max-file\":\"7\"}}}}"
},
"https_proxy": {
"https_proxy": {
"value": "<proxyAddress>"
}
},
Expand All @@ -38,9 +38,6 @@
"experimentalFeatures__enabled": {
"value": "true"
},
"experimentalFeatures__nestedEdgeEnabled": {
"value": "true"
},
"experimentalFeatures__mqttBrokerEnabled": {
"value": "true"
},
Expand All @@ -50,9 +47,9 @@
"RuntimeLogLevel": {
"value": "debug"
},
"https_proxy": {
"https_proxy": {
"value": "<proxyAddress>"
}
}
},
"status": "running",
"restartPolicy": "always"
Expand Down Expand Up @@ -117,18 +114,18 @@
},
"mqttBroker": {
"authorizations": [
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
{
"identities": [
"{{iot:identity}}"
],
"allow": [
{
"operations": [
"mqtt:connect"
]
}
}
]
}
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public CloudConnectionProvider(
bool useServerHeartbeat,
Option<IWebProxy> proxy,
IMetadataStore metadataStore,
bool nestedEdgeEnabled = false)
bool nestedEdgeEnabled = true)
{
this.messageConverterProvider = Preconditions.CheckNotNull(messageConverterProvider, nameof(messageConverterProvider));
this.clientProvider = Preconditions.CheckNotNull(clientProvider, nameof(clientProvider));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ServiceProxy : IServiceProxy
readonly IDeviceScopeApiClientProvider securityScopesApiClientProvider;
readonly bool nestedEdgeEnabled;

public ServiceProxy(IDeviceScopeApiClientProvider securityScopesApiClientProvider, bool nestedEdgeEnabled = false)
public ServiceProxy(IDeviceScopeApiClientProvider securityScopesApiClientProvider, bool nestedEdgeEnabled = true)
{
this.securityScopesApiClientProvider = Preconditions.CheckNotNull(securityScopesApiClientProvider, nameof(securityScopesApiClientProvider));
this.nestedEdgeEnabled = nestedEdgeEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public DeviceScopeCertificateAuthenticator(
IAuthenticator underlyingAuthenticator,
IList<X509Certificate2> trustBundle,
bool syncServiceIdentityOnFailure,
bool nestedEdgeEnabled = false)
bool nestedEdgeEnabled = true)
: base(deviceScopeIdentitiesCache, underlyingAuthenticator, false, syncServiceIdentityOnFailure, nestedEdgeEnabled)
{
this.trustBundle = Preconditions.CheckNotNull(trustBundle, nameof(trustBundle));
Expand Down
Loading

0 comments on commit 7e0fc1f

Please sign in to comment.