Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
Devis Lucato 892a55e7e4 Generate telemetry using external scripts (#22)
Use external Javascript functions to generate the telemetry for simulated devices. The path of folder that contain the Javascript files can be configured, so it's possible to mount JS files from anywhere. Files are loaded at runtime. The name of the files is specified in the Device Type JSON files, which are managed in the same way, with a configurable path and loaded at runtime.
Javascript files are interpreted using Jint https://github.com/sebastienros/jint .
Documentation here: https://github.com/Azure/device-simulation-dotnet/wiki/Device-Types
2017-07-11 10:28:55 -07:00
Devis Lucato 360ec08524 Remove Akka and update to new template (#21)
Remove Akka and use .NET Thread Pool to manage multiple threads sending telemetry. The lack of Akka means some extra work that we'll need in order to distribute the simulation over multiple servers. For the time being, we assume that the simulation runs in one instance only. If Akka's move to .NET Core is ready we can move back to Akka, otherwise we need some partitioning logic to distribute the load over multiple machines.

Upgrade the project to the latest template, e.g. scripts and documentations. Minor fixes for cross-platform development (VS2017 and Rider).

Complete the /status endpoint to check if IoT Hub Manager is available. In order to run the simulation, IoT Hub Manager is required. Without this check, it was too difficult to debug whether the service could connect to IoT Hub Manager or not, particularly when using Docker Compose.

Added Docker Compose file, to bootstrap this service and IoT Hub Manager containers. Add script to publish to Docker Hub. Move Docker image version/tag to a version file, so that the version is not hard coded in multiple places.

Fix an issue with the logger using too much memory when serializing exceptions.

Improve handling of exceptions caused by unreachable external dependencies when using the HTTP client.
2017-07-07 13:49:03 -07:00
Devis Lucato 541e5cff8e Minor cleanups left over after .NET Core migration (#10)
* remove unused dependency
* minor changes, cleaning up
2017-06-22 16:59:18 -07:00
Devis Lucato 8a4e79cf00 Migrate to .NET Core (#9)
Upgrade source code, project files and scripts to use .NET Core. Mono is not required anymore, and also the Docker image will now use only .NET Core.
The configuration format has changed to be in line with ASP.NET Core configuration providers.
The simulation runner is temporarily disabled, because Akka.NET is not ready for .NET Core, and I'm in the middle of removing Akka from the project as well.
Due to the move from .NET Core, some internal APIs are different, for instance you might notice changes in the web service exception filter, in the Autofac dependency injection setup, in the use of Kestrel as a HTTP server.
Since the microservice is now built and packaged with the `dotnet` command, some paths have changed, and scripts have been updated accordingly. I tested the scripts in Windows and MacOS, hopefully catching all the edge cases. The scripts are now actually simpler, which is a nice and unexpected result of the migration.
2017-06-20 18:52:50 -07:00
Devis Lucato 2302587b1b Synchronize env vars and scripts with template (#8)
* Remove Akka HOCON from web service, use app.confg for settings - use HOCON only when using Akka
* Improve config parsing
* Add Moq to all test projects
* Add env var for IoTHubMan web service
* Update env vars management and correlated scripts
2017-06-07 18:01:19 -07:00
Devis Lucato f545d74e79 Start/stop simulation actors based on simulation status + Dockerize microservice (#6)
* implement simulation agent using Akka actors
* update Docker scripts to package the web service and the simulation agent
* some DI refactoring to align web service and simulation agent
* detect and manage content negotiation errors
* Change ERRORLEVEL code in Windows scripts
* Change windows scripts error redirection
* Fix compilation warnings and convert some *nix scripts to ISO
* Document the exceptions and apply filters on controllers (rather than globally)
2017-06-01 12:56:19 -07:00
Devis Lucato 16a851651f Add device types configuration and endpoint
This adds a new endpoint to list all the supported device types. Device types are configured via JSON files external to the assembly, so that users can add custom types without rebuilding the service. The files include a README describing the format of these files.
I was going to use HOCON for these files too, for a cleaner look, but I'm actually reconsidering that approach and the use of Newtonsoft greatly reduces the code required to parse these files (at least in .NET).
2017-05-30 19:50:03 -07:00
Devis Lucato 15c6855f62 Initialize project with files from template 2017-05-25 18:22:07 -07:00
Devis Lucato 33b3e53a15 Install Mono 5.x in the CI environment 2017-04-30 19:54:04 -07:00
Devis Lucato fe70b90f45 Update build script error logic 2017-04-30 19:38:34 -07:00
Devis Lucato da56943aae Initial commit 2017-04-30 19:08:53 -07:00