Skip to content

Commit

Permalink
Update Synse Server to be compatible with v1.0 of the Synse SDK (#175)
Browse files Browse the repository at this point in the history
* start to update internal grpc client for sdk1.0 changes

* update internal grpc client handling

* add capabilities route

* update models, update tests

* update plugins route to include metadata and health info

* update plugin registration flow. still needs to be cleaned up, tests need to be updated/added

* add support for service discovery via kubernetes service endpointswith labels

* update deployment configurations, fix bug in unix registration

* update tests for plugin flow changes

* update api docs

* use new synse_grpc package

* more doc updates, fix serialization bug

* user guide docs update

* update user guide docs

* fix bug where no returned reading would cause failure (#178)

* Change read scheme to allow multiple readings of the same type (#181)

* update read scheme to allow multiple readings of the same type from the same device (e.g. a single device might provide multiple voltage readings)

* update api docs

* Fix build args for old docker versions (#183)

* fix build args for old docker version

* update comment

* scan output should have type, not kind (#186)

* final updates
  • Loading branch information
edaniszewski committed Jul 2, 2018
1 parent 2b6da14 commit 1e03fb3
Show file tree
Hide file tree
Showing 70 changed files with 3,550 additions and 2,119 deletions.
112 changes: 73 additions & 39 deletions deploy/docker/config/devices/devices.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,105 @@
version: 1.0
locations:
r1vec:
rack: rack-1
board: vec
- name: r1vec
rack:
name: rack-1
board:
name: vec
devices:
# -- temperature devices --
- type: temperature
model: emul8-temp
- name: temperature
metadata:
model: emul8-temp
outputs:
- type: temperature
instances:
- id: "1"
- info: Synse Temperature Sensor 1
location: r1vec
info: Synse Temperature Sensor 1
- id: "2"
data:
id: 1
- info: Synse Temperature Sensor 2
location: r1vec
info: Synse Temperature Sensor 2
- id: "3"
data:
id: 2
- info: Synse Temperature Sensor 3
location: r1vec
info: Synse Temperature Sensor 3
- id: "4"
data:
id: 3
- info: Synse Temperature Sensor 4
location: r1vec
info: Synse Temperature Sensor 4
- id: "5"
data:
id: 4
- info: Synse Temperature Sensor 5
location: r1vec
info: Synse Temperature Sensor 5
data:
id: 5

# -- pressure devices --
- type: pressure
model: emul8-pressure
- name: pressure
metadata:
model: emul8-pressure
outputs:
- type: pressure
instances:
- id: "1"
- info: Synse Pressure Sensor 1
location: r1vec
info: Synse Pressure Sensor 1
- id: "2"
data:
id: 1
- info: Synse Pressure Sensor 2
location: r1vec
info: Synse Pressure Sensor 2
data:
id: 2

# -- led devices --
- type: led
model: emul8-led
- name: led
metadata:
model: emul8-led
outputs:
- type: led.color
- type: led.state
instances:
- id: "1"
- info: Synse LED
location: r1vec
info: Synse LED
- id: "2"
data:
id: 1
- info: Synse Backup LED
location: r1vec
info: Synse backup LED
data:
id: 2

# -- humidity devices --
- type: humidity
model: emul8-humidity
- name: humidity
metadata:
model: emul8-humidity
outputs:
- type: humidity
- type: temperature
instances:
- id: "1"
- info: Synse Humidity Sensor
location: r1vec
info: Synse Humidity Sensor
data:
id: 1

# -- fan devices --
- type: fan
model: emul8-fan
- name: fan
metadata:
model: emul8-fan
outputs:
- type: fan.speed
instances:
- id: "1"
- info: Synse Fan
location: r1vec
info: Synse Fan
data:
id: 1

# -- airflow devices --
- type: airflow
model: emul8-air
- name: airflow
metadata:
model: emul8-air
outputs:
- type: airflow
instances:
- id: "1"
- info: Synse Airflow Sensor
location: r1vec
info: Synse Airflow Sensor
data:
id: 1
1 change: 0 additions & 1 deletion deploy/docker/config/tcp/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version: 1.0
name: emulator
debug: true
network:
type: tcp
Expand Down
1 change: 0 additions & 1 deletion deploy/docker/config/unix/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version: 1.0
name: emulator
debug: true
network:
type: unix
Expand Down
10 changes: 6 additions & 4 deletions deploy/docker/deploy-tcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ services:
# Synse Server
synse-server:
container_name: synse-server
image: vaporio/synse-server:2.0.0
image: vaporio/synse-server:edge
ports:
- 5000:5000
# TCP-based plugins can be registered with Synse Server via
# environment variables, so we specify the plugin here.
environment:
SYNSE_PLUGIN_TCP_EMULATOR: emulator-plugin:5001
SYNSE_LOGGING: debug
SYNSE_PLUGIN_TCP: emulator-plugin:5001
links:
- emulator-plugin

# Emulator Plugin
emulator-plugin:
container_name: emulator-plugin
image: vaporio/emulator-plugin
image: vaporio/emulator-plugin:edge
ports:
- 5001:5001
command: "--debug"
volumes:
# mount in the plugin config (see the environment section on how to
# reference this non-default location)
Expand All @@ -37,4 +39,4 @@ services:
# sets the override location for the plugin configuration
PLUGIN_CONFIG: /tmp/config
# sets the override location for the device instance configuration
PLUGIN_DEVICE_PATH: /tmp/devices
PLUGIN_DEVICE_CONFIG: /tmp/devices
8 changes: 5 additions & 3 deletions deploy/docker/deploy-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ services:
# Synse Server
synse-server:
container_name: synse-server
image: vaporio/synse-server:2.0.0
image: vaporio/synse-server:edge
ports:
- 5000:5000
environment:
SYNSE_LOGGING: debug
# Unix-based plugins can be registered with Synse Server when Synse Server
# detects the socket file in a well-known path. Here, we mount a shared
# volume to that path (/tmp/synse/procs) so that Synse Server can access
Expand All @@ -25,13 +27,13 @@ services:
# Emulator Plugin
emulator-plugin:
container_name: emulator-plugin
image: vaporio/emulator-plugin
image: vaporio/emulator-plugin:edge
environment:
# sets the override location for the plugin configuration (which is
# mounted in as a volume, below)
PLUGIN_CONFIG: /tmp/config
# sets the override location for the device instance configuration
PLUGIN_DEVICE_PATH: /tmp/devices
PLUGIN_DEVICE_CONFIG: /tmp/devices
volumes:
# mount in the plugin config (see the environment section on how to
# reference this non-default location)
Expand Down
15 changes: 14 additions & 1 deletion dockerfile/release.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,24 @@
#
FROM vaporio/synse-server:base

# Set Image Metadata (mapping after dockerfile/slim.dockerfile).
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VCS_REF

LABEL org.label-schema.schema-version="1.0" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="vaporio/synse-server" \
org.label-schema.vcs-url="https://github.com/vapor-ware/synse-server" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vendor="Vapor IO" \
org.label-schema.version=$BUILD_VERSION

# Emulator installation script
COPY bin/install_emulator.sh tmp/install_emulator.sh

# Environment variables for built-in emulator configuration.
ENV PLUGIN_DEVICE_CONFIG="/synse/emulator/config" \
ENV PLUGIN_DEVICE_CONFIG="/synse/emulator/config/device" \
PLUGIN_CONFIG="/synse/emulator"

# The linux_amd64 emulator binary is built with libc, not muslc, it
Expand Down

0 comments on commit 1e03fb3

Please sign in to comment.