Is there a tutorial that explains how the sandbox completes the 'source' with the sdk and executable code? - sandbox

New guy here. I walked through the 'Cassandra data analytics demo' in the sandbox and was up and running in no time (using the recommended hardware, Raspberry Pi and DHT11 sensor).
Now I want to take it to the next step. I installed an instance of Kaa (not the sandbox anymore) and followed the same tutorial which explained setting up the schemas and log appenders etc (https://www.youtube.com/watch?v=VHwJLHQjl50) and exported the sdk to the Raspberry Pi. The issue I'm running into is understanding exactly what all was done for me in the sandbox, for instance, all of these steps performed when I click "Source":
Assembling sources for 'Cassandra data analytics demo' project... SDK
profile id of project: 10 Getting SDK for requested project...
Successfuly got SDK. Processing project archive...
CCassandraDataAnalyticsDemo/ CCassandraDataAnalyticsDemo/src/
CCassandraDataAnalyticsDemo/src/dht11/
CCassandraDataAnalyticsDemo/CMakeLists.txt
CCassandraDataAnalyticsDemo/src/dht11/dht11.h
CCassandraDataAnalyticsDemo/src/dht11/dht11.c
CCassandraDataAnalyticsDemo/src/kaa_demo.c
CCassandraDataAnalyticsDemo/build.sh Compressing source project
archive... CCassandraDataAnalyticsDemo/
CCassandraDataAnalyticsDemo/libs/
CCassandraDataAnalyticsDemo/libs/kaa/
CCassandraDataAnalyticsDemo/libs/kaa/kaa-c-ep-sdk-wcknkllgn6TIg3OjUlumWqcZSCw.tar.gz
CCassandraDataAnalyticsDemo/src/
CCassandraDataAnalyticsDemo/src/dht11/
CCassandraDataAnalyticsDemo/src/dht11/dht11.c
CCassandraDataAnalyticsDemo/src/dht11/dht11.h
CCassandraDataAnalyticsDemo/src/kaa_demo.c
CCassandraDataAnalyticsDemo/CMakeLists.txt
CCassandraDataAnalyticsDemo/build.sh Source project archive
compressed. Succesfully prepared project data!
-------- CLICK OK TO START DOWNLOAD PROJECT SOURCES --------
Finished!
My question is, once I download the c-sdk from my instance of kaa (not the sandbox), moved it to the Raspberry Pi and built it, what do I need to do, or what glue code is required to get the Pi to start logging a sensor's data and reporting back to my instance?

There is no tutorial that explains how the sandbox completes the 'source' with the SDK and executable code.
Kaa Sandbox is a preconfigured virtual environment designed for the users who want to use their private instance of Kaa platform for educational, development, and proof-of-concept purposes.
The Sandbox also includes a selection of demo applications that illustrate various aspects of the platform functionality.
When you click "Source", you got sample project with generated SDK for specified platform and language. See your first Kaa application guide for details.
For example, if you want to run the 'Cassandra data analytics demo' without the Kaa Sandbox, you should do the next:
Create an application.
Add this log schema (you can use Upload from file at Add log schema window in Kaa Admin Console).
Add "sensor_per_row", "sensor_per_date" and "sensor_per_region" log appenders using configuration from corresponding sensor_per_*_cassandra_appender.json located here
(you can use Upload from file at Add log appender window in Kaa Admin Console).
Download "c" folder from here.
Create folders "libs/kaa" (project files structure as in downloaded Cassandra data analytics demo from the Kaa Sandbox).
Add SDK profile for your application.
Generate SDK for C target platform.
Save SDK into the libs/kaa folder.
Follow the installation steps for Cassandra data analytics demo from Sandbox to run client application (for now you don't need to download the source code by clicking the "Source" button).

Related

How can I debug on Azure Devops VSO

I have made a task for Azure Devops Server pipeline.
On the local Azure Dev-Ops server, I can upload extensions from the local machine wrapped in VSIX file and examine the agent on the machine itself. The agent has the deployed DLL's from the extension and I always change specific DLL that has Logger inside and it prints to console on the pipeline itself.
How can I check if my task is compatible with the cloud version?
And off course if it is, how can I debug it?
The only possible way I found to insert my task in VSO is through the Microsoft DevOps marketplace, but I cannot upload the whole extension once per each change in code.
Also, didn't find a way to upload personal tasks to the marketplace. The private version is not helping because I can see it from within the server just like my clients.
Any advice or debug experience on that platform is appreciated.
Please follow this devblogs, it described how you can work and debug extension directly inside your IDE without publishing it to the marketplace.
Since this blog is very detailed, just mention the key steps.
Based on debugging purposes, you need create a special manifest, for sample I specify it as vss-extension-debug.json:
{
...
"id": "dev-extension",
"name": "Dev-Extension",
"baseUri": "https://localhost:44362",
...
}
You can customized the id and name by yourself. The most important and magic is baseUri, this will tell the VSTS server to load the extension from localhost where we can run and debug it in IISExpress from Visual Studio.
Note: Since our server need extension served from a secure source, please ensure enable SSL mode to run IISExpress

Virtual assistant template and integrating skills

I have been trying the newly launched virtual assistant template (C#) of the bot framework, downloaded it from here https://github.com/microsoft/botframework-solutions/tree/master/templates/Virtual-Assistant-Template/csharp and deployed it using deployment scripts and the default setup works well.
As a next step, tried to add remote skill (few of the existing skills such as Calendar) using relevant script and it worked too.
Basic question we have is, would we need to download existing skill from here https://github.com/microsoft/botframework-solutions/tree/master/templates/Skill-Template/csharp and deploy it in our own Azure environment or can we just use already published skills such as thishttps://bftodoskill.azurewebsites.net/api/skill/manifest
If yes, that's perfect! however if not - will it make sense for the bot framework team to release skills as a service so that end users can simply consume already available and published skills in their virtual assistants?
Looks like they are in the process of working on the publish scripts for Skills:- https://github.com/microsoft/botframework-solutions/issues/1496.
However, you should be able to manually build the Skills by leveraging the source code located here (disclaimer: not tried myself): https://github.com/microsoft/botframework-solutions/tree/master/skills/src/csharp.
UPDATE: You can find the deployment scripts for a given Skill under the Deployment/Scripts folder in the root of the Skill's directory (e.g. /skills/src/csharp/calendarskill) in the repo. Instructions on how to run these scripts can be found at: https://github.com/microsoft/botframework-solutions/blob/master/docs/tutorials/assistantandskilldeploymentsteps.md.

MEASURING MANUAL/AUTOMATED FUNCTIONAL TESTS CODE COVERAGE

We are trying to generate code coverage on performing manual tests for application hosted in Azure app services.
I have a trail account in portal.azure.com with 'user' privilege.
Tried the below options:
A. Use VS tools in Azure console and local
B. Use OpenCover in Azure console
Both the above mentioned options using VS tools and Opencover has been used in the localhost (IIS server) to successfully generate code coverage on runnign manual tests.
A. Steps for code coverage using VS tools in Azure:
1. cd D:\Program Files (x86)\Microsoft Visual Studio 15.0\Team Tools\Performance Tools
2. vsinstr /coverage D:\home\site\wwwroot\bin\abc.dll
3. vsperfcmd /start:coverage /output:D:\home\LogFiles\Testing123.coverage
4. vsperfcmd -shutdown
Issue1: The generated code coverage file has error: Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see https://go.microsoft.com/fwlink/?LinkID=253731
However I'm able to generate code coverage on the same application which has been hosted in my local IIS server. The same 4 steps mentioned above is working. The issue is that the instrumented dll doesn't log the transactions performed on the hosted application.
Reference: https://gurunadhduvvuru.wordpress.com/2014/08/01/generating-functional-testing-code-coverage/
PS: We have tried starting the coverage process before and after publish the application.
B. Steps for code coverage using Open Cover in Azure
1. OpenCover.Console.exe -target:C:\Windows\System32\inetsrv\w3wp.exe -targetargs:"-debug -s 1" -targetdir:C:\inetpub\wwwroot\bin\ -filter:+[] -register:user -output:C:\Users\coverage2.xml
Issue 2: Access denied is displayed when the application is not running.
Issue 3: The generated coverage file is empty and doesn't has the same error mentioned in Issue 1, on executing the opencover command when the application is running.
Reference: https://automationrhapsody.com/code-coverage-manual-automated-tests-opencover-net-applications/
Any help on the reason for the generated coverage file to be empty ? or any reference to suffice my requirement would be much appreciated?
It appears that it is a limitation of Azure WebApp Sandbox, all Azure Web Apps run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine as well as providing an additional degree of security and privacy which would otherwise not be available.
You cannot install arbitrary software when running on Azure App Service. Generally, you cannot make any machine level changes (e.g. registry changes).
Reference: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox. If your requirement fits, try this on an Azure VM running IIS, where you have greater control on managing the VM.

How could I prohibit anonymous access to my NodeRed UI Dashboard on IBM Cloud(Bluemix)?

I'm working with node-red, on boilerplate IBM cloud. I know that there is a way, changing the value of enviroments variables(NODE_RED_USERNAME and NODE_RED_PASSWORD), to change username and password of the editor flow. But, what about UI dashboard? I mean using dashboard nodes. Forbid access to
https://noderedservicename.mybluemix.net/ui/
I know that on the code, changing the variable httpNodeAuth on the file settings.js I can do what I want. What is the way for doing that on IBM Cloud?
Thank you in advance!
You need to add the httpNodeAuth (not the httpAdminAuth as this is for controlling access to the Node-RED editor and can done with the environment variables discussed in the other answer.) to the app/bluemix-settings.js file.
Something like this:
...
httpStatic: path.join(__dirname,"public"),
httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
functionGlobalContext: { },
...
Details of how to generate the pass can be found here
There are a number of ways you can edit the file, some of which include linking the Node-RED deployment to a git repository or downloading the whole app, editing the file and pushing it back to Bluemix (when you first deploy Node-RED from the starter pack it gives you instructions on how to download the source to make changes and then push them back. You can get to these instructions by clicking on the "Getting started" link in your Node-RED Bluemix console page).
But the quickest/simplest/dirtiest way is probably to just SSH into the instance and change the file with something like vi. Details on how to ssh to an app instance can be found here. But the following should work:
cf ssh [app name]
Once you have edited the file you will need to tell bluemix to restart the app. You can do this from the web console or with the cf command line tool.
(The changes made by this method will not survive if the app is restaged, or bluemix decides to move your instance to another machine internally because it will rebuild the app from the pushed sources. The permanent solution is to download the source, edit and push back)
This link will help you but it's written in Japanese.
http://dotnsf.blog.jp/archives/1030376575.html
Summary
You can define the "user-defined" environment variables through the IBM Cloud dashboard.
It contains the variables to protect Node-RED GUI.
You have to be set as follows
NODE_RED_USERNAME : username
NODE_RED_PASSWORD : password

creating a performance tool for web based GUI

I want to create an automated performance metric gathering tool, to get various metrics for page load times for a flash based web application. I am doing the web automation using a batch script, and then I want to collect the various metrics using browsermob-proxy (http://opensource.webmetrics.com/browsermob-proxy/), it exports the metrics in a HAR file. I've never done this before so I was wondering if this approach is okay? What are the steps to using browswermob-proxy for windows (firefox). There is no information about windows in the documentation, just linux. I know I run the proxy from the /bin directory, then what do I need to do?
I had downloaded the copy from the browsermob zip from here..http://opensource.webmetrics.com/browsermob-proxy/ Unzip and refer the readme.md
The readme file in the browsemob zip, specifies the instructions to start the proxy server. Once the server is started, you would need to specify the server port and machine ip in your firefox proxy settings (from options->advanced->network>settings. Then trigger your urls on this browser.

Resources