Skip to content

Commit

Permalink
Merged PR 854886: Convert settings file to yaml
Browse files Browse the repository at this point in the history
This allows us to put comments in the config files. (Json does not allow this)
This also:
* Renames the `runtime` key to `agent`
* Tweaks the provisioning enum to make it a little easier to deal with
* Allows setting of config values via environment variables with `IOTEDGE_` prefix.
  • Loading branch information
myagley committed May 24, 2018
1 parent ce6c97a commit e38801c
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 257 deletions.
26 changes: 0 additions & 26 deletions edgelet/contrib/config/config.json

This file was deleted.

110 changes: 110 additions & 0 deletions edgelet/contrib/config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
###############################################################################
# IoT Edge Daemon configuration
###############################################################################
#
# This file configures the IoT Edge daemon.
# The daemon must be restarted to pick up any configuration changes.
#
# Note - this file is yaml. Learn more here: http://yaml.org/refcard.html
#
###############################################################################

###############################################################################
# Provisioning mode and settings
###############################################################################
#
# This configures the identity provisioning mode of the daemon.
#
# Supported modes:
# manual - using an iothub connection string
# dps - using dps for provisioning
#
###############################################################################

provisioning:
source: "manual"
device_connection_string: ""

# provisioning:
# source: "dps"
# global_endpoint: "global.azure-devices-provisioning.net"
# scope_id: "{scope_id}"

###############################################################################
# Edge Agent module spec
###############################################################################
#
# This configures the initial Edge Agent module.
# The daemon uses this Edge Agent definition to bootstrap the system.
# The Edge Agent can then update itself based on the Edge Agent module
# definition present in the deployment.
#
###############################################################################

agent:
name: "edgeAgent"
type: "docker"
env: {}
config:
image: "microsoft/azureiotedge-agent:1.0-preview"
create_options: ""
auth: {}

###############################################################################
# Edge Device Hostname
# This is injected into modules as IOTEDGE_GATEWAYHOSTNAME
###############################################################################

hostname: "localhost"

###############################################################################
# Connect settings
###############################################################################
#
# This configures the connection uri for a client of the workload/mgmt APIs
# The workload_uri is the API modules use to retrieve tokens and certificates.
# The management_uri is the API the Edge Agent uses to start/stop/manage
# modules.
#
# The following uri schemes are supported:
# http - connect over tcp
# unix - connect over unix domain socket
#
###############################################################################

connect:
workload_uri: "unix:///var/run/iotedge/workload.sock"
management_uri: "unix:///var/run/iotedge/mgmt.sock"

###############################################################################
# Listen settings
###############################################################################
#
# This configures the listen address for the daemon.
# The workload_uri is the API modules use to retrieve tokens and certificates.
# The management_uri is the API the Edge Agent uses to start/stop/manage
# modules.
#
# The following uri schemes are supported:
# http - listen over tcp
# unix - listen over unix domain socket
# fd - listen using systemd socket activation
#
# They can be different than the connect uris.
#
# For instance, when using the fd:// scheme for systemd,
# the listen address is fd://iotedge.workload,
# but the connect address is unix:///var/run/iotedge/workload.sock
#
###############################################################################

listen:
workload_uri: "fd://iotedge.workload"
management_uri: "fd://iotedge.mgmt"

###############################################################################
# Docker Engine URI
###############################################################################

docker_uri: "unix:///var/run/docker.sock"

2 changes: 1 addition & 1 deletion edgelet/contrib/debian/conffiles
Original file line number Diff line number Diff line change
@@ -1 +1 @@
etc/iotedge/config.json
etc/iotedge/config.yaml
2 changes: 1 addition & 1 deletion edgelet/contrib/debian/install
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
iotedge usr/bin
iotedged usr/bin
debian/iotedge.mgmt.socket lib/systemd/system
etc/iotedge/config.json
etc/iotedge/config.yaml
2 changes: 1 addition & 1 deletion edgelet/edgelet-docker/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use edgelet_utils::serde_clone;

use error::Result;

#[derive(Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct DockerConfig {
image: String,
Expand Down
24 changes: 24 additions & 0 deletions edgelet/iotedged/src/config/unix/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
provisioning:
source: "manual"
device_connection_string: "HostName=something.some.com;DeviceId=some;SharedAccessKey=some"

agent:
name: "edgeAgent"
type: "docker"
env": {}
config:
image: "microsoft/azureiotedge-agent:1.0-preview"
create_options: ""
auth: {}

hostname: "localhost"

connect:
workload_uri: "http://localhost:8081"
management_uri: "http://localhost:8080"

listen:
workload_uri: "http://0.0.0.0:8081"
management_uri: "http://0.0.0.0:8080"

docker_uri: "unix:///var/run/docker.sock"
24 changes: 24 additions & 0 deletions edgelet/iotedged/src/config/windows/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
provisioning:
source: "manual"
device_connection_string: "HostName=something.some.com;DeviceId=some;SharedAccessKey=some"

agent:
name: "edgeAgent"
type: "docker"
env": {}
config:
image: "microsoft/azureiotedge-agent:1.0-preview"
create_options: ""
auth: {}

hostname: "localhost"

connect:
workload_uri: "http://localhost:8081"
management_uri: "http://localhost:8080"

listen:
workload_uri: "http://0.0.0.0:8081"
management_uri: "http://0.0.0.0:8080"

docker_uri: "http://localhost:2375"
Loading

0 comments on commit e38801c

Please sign in to comment.